fix detector
This commit is contained in:
@@ -47,6 +47,21 @@ public class BlockDetector extends BlockMachine
|
|||||||
return new TileDetector();
|
return new TileDetector();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int isProvidingWeakPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side)
|
||||||
|
{
|
||||||
|
return ((TileDetector) world.getTileEntity(pos)).isPowered() ? 15 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int isProvidingStrongPower(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing side)
|
||||||
|
{
|
||||||
|
return ((TileDetector) world.getTileEntity(pos)).isPowered() ? 15 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canProvidePower()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
|
@@ -101,7 +101,8 @@ public class TileDetector extends TileMachine implements IInventory, ISidedInven
|
|||||||
|
|
||||||
if (powered != lastPowered)
|
if (powered != lastPowered)
|
||||||
{
|
{
|
||||||
worldObj.notifyBlockOfStateChange(pos, StorageCraftBlocks.DETECTOR); // @TODO: redstone update
|
worldObj.markBlockForUpdate(pos);
|
||||||
|
worldObj.notifyNeighborsOfStateChange(pos, StorageCraftBlocks.DETECTOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,8 +196,10 @@ public class TileDetector extends TileMachine implements IInventory, ISidedInven
|
|||||||
|
|
||||||
powered = buf.readBoolean();
|
powered = buf.readBoolean();
|
||||||
|
|
||||||
if (powered != lastPowered) {
|
if (powered != lastPowered)
|
||||||
|
{
|
||||||
worldObj.markBlockForUpdate(pos);
|
worldObj.markBlockForUpdate(pos);
|
||||||
|
worldObj.notifyNeighborsOfStateChange(pos, StorageCraftBlocks.DETECTOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user