Fixed redstone event

This commit is contained in:
Goodbird committed 2024-01-22 19:50:40 +03:00
1 parent 54f4ed5c16
commit b42ab94251
1 file changed
+6 -1
@@ -207,10 +207,15 @@ public class BlockScripted extends BlockContainer {
public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) {
TileScripted tile = (TileScripted) world.getTileEntity(x, y, z);
EventHooks.onScriptBlockNeighborChanged(tile, tileX, tileY, tileZ);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
TileScripted tile = (TileScripted) world.getTileEntity(x, y, z);
int power = 0;
for (EnumFacing enumfacing : EnumFacing.values()) {
int p = world.isBlockProvidingPowerTo(x + enumfacing.getFrontOffsetX(),
int p = world.getIndirectPowerLevelTo(x + enumfacing.getFrontOffsetX(),
y + enumfacing.getFrontOffsetZ(), z + enumfacing.getFrontOffsetZ(), enumfacing.ordinal());
if (p > power)
power = p;