Fixed Crash with valve and redstone
Also due to an F up i redownloaded some files to correct me trying to remove the unkown liquid. I forgot i used that to prevent null errors, and since i'll changing over system soon there is no point in correcting it.
This commit is contained in:
parent
87308ec86b
commit
ca66742d6b
1 changed files with 0 additions and 27 deletions
|
@ -31,12 +31,6 @@ public class BlockReleaseValve extends BlockMachine
|
||||||
return new TileEntityReleaseValve();
|
return new TileEntityReleaseValve();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World par1World, int x, int y, int z)
|
|
||||||
{
|
|
||||||
this.checkForPower(par1World, x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
|
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
|
@ -83,7 +77,6 @@ public class BlockReleaseValve extends BlockMachine
|
||||||
public void onNeighborBlockChange(World par1World, int x, int y, int z, int side)
|
public void onNeighborBlockChange(World par1World, int x, int y, int z, int side)
|
||||||
{
|
{
|
||||||
super.onNeighborBlockChange(par1World, x, y, z, side);
|
super.onNeighborBlockChange(par1World, x, y, z, side);
|
||||||
this.checkForPower(par1World, x, y, z);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,24 +85,4 @@ public class BlockReleaseValve extends BlockMachine
|
||||||
{
|
{
|
||||||
return new ItemStack(FluidMech.blockReleaseValve, 1, 0);
|
return new ItemStack(FluidMech.blockReleaseValve, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkForPower(World world, int x, int y, int z)
|
|
||||||
{
|
|
||||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if (tileEntity instanceof TileEntityReleaseValve)
|
|
||||||
{
|
|
||||||
boolean powered = ((TileEntityReleaseValve) tileEntity).isPowered;
|
|
||||||
boolean beingPowered = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockGettingPowered(x, y, z);
|
|
||||||
if (powered && !beingPowered)
|
|
||||||
{
|
|
||||||
((IRedstoneReceptor) world.getBlockTileEntity(x, y, z)).onPowerOff();
|
|
||||||
}
|
|
||||||
else if (!powered && beingPowered)
|
|
||||||
{
|
|
||||||
((IRedstoneReceptor) world.getBlockTileEntity(x, y, z)).onPowerOn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue