1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-25 19:07:39 +00:00

Handle tile entity changes

This commit is contained in:
Bartek Bok
2017-05-03 11:14:39 +02:00
parent 58e6e9ea46
commit 5284b145f8
3 changed files with 59 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ public abstract class BlockGeneric extends Block implements
public final void dropBlockAsItemWithChance( World world, BlockPos pos, IBlockState state, float chance, int fortune )
{
}
@Override
public final List<ItemStack> getDrops( IBlockAccess world, BlockPos pos, IBlockState state, int fortune )
{
@@ -107,7 +107,7 @@ public abstract class BlockGeneric extends Block implements
{
Block.spawnAsEntity( world, pos, stack );
}
@Override
public final void breakBlock( World world, BlockPos pos, IBlockState newState )
{
@@ -162,6 +162,17 @@ public abstract class BlockGeneric extends Block implements
}
}
@Override
public final void onNeighborChange( IBlockAccess world, BlockPos pos, BlockPos neighbour )
{
TileEntity tile = world.getTileEntity( pos );
if( tile instanceof TileGeneric )
{
TileGeneric generic = (TileGeneric)tile;
generic.onNeighbourTileEntityChange( neighbour );
}
}
@Override
public final boolean isSideSolid( IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side )
{

View File

@@ -95,6 +95,10 @@ public abstract class TileGeneric extends TileEntity
{
}
public void onNeighbourTileEntityChange( BlockPos neighbour )
{
}
public boolean isSolidOnSide( int side )
{
return true;