public void handleTileInfoPacketType(PacketBase payload, byte b) { if (b == TileFluidPackets.UPDATE_RENDER) { myRenderFluid = payload.getFluidStack(); BlockHelper.callBlockUpdate(world(), pos()); } }
@Override public void onNeighborChange() { if (stuffed != isStuffed()) { stuffed = isStuffed(); BlockHelper.callBlockUpdate(baseTile.getWorld(), baseTile.getPos()); } super.onNeighborChange(); }
@Override public void checkSignal() { boolean wasPowered = isPowered; isPowered = rsMode.isDisabled() || rsMode.getState() == getPowerState(); if (wasPowered != isPowered) { BlockHelper.callBlockUpdate(baseTile.getWorld(), baseTile.getPos()); } }
@Override public void onNeighborChange() { super.onNeighborChange(); TileEntity adjacentTileEntity = BlockHelper.getAdjacentTileEntity(baseTile, side); clearCache(); boolean wasValidInput = isValidInput; isValidInput = isValidTile(adjacentTileEntity); if (isValidInput) { cacheTile(adjacentTileEntity); } boolean wasPowered = isPowered; isPowered = rsMode.isDisabled() || rsMode.getState() == getPowerState(); if (wasPowered != isPowered || isValidInput != wasValidInput) { BlockHelper.callBlockUpdate(baseTile.getWorld(), baseTile.getPos()); } }
@Override public void readPortableData(EntityPlayer player, NBTTagCompound tag) { readFromNBT(tag); baseTile.world().notifyNeighborsOfStateChange(baseTile.getPos(), baseTile.getBlockType(), false); onNeighborChange(); GridStructural grid = structureUnit.getGrid(); if (grid != null) { grid.resetRelays(); } onNeighborChange(); BlockHelper.callBlockUpdate(baseTile.getWorld(), baseTile.getPos()); }
@Override public void handlePacket(EntityPlayer player, boolean isServer) { FluidStack fluid = getFluidStack(); int n = getVarInt(); World world = player.world; for (int i = 0; i < n; i++) { int x = getVarInt(); int y = getVarInt(); int z = getVarInt(); BlockPos pos = new BlockPos(x, y, z); if (!world.isBlockLoaded(pos)) { continue; } TileEntity tile = world.getTileEntity(pos); if (tile instanceof IDuctHolder) { DuctUnitFluid duct = ((IDuctHolder) tile).getDuct(DuctToken.FLUID); if (duct != null) { duct.myRenderFluid = fluid; duct.updateLighting(); BlockHelper.callBlockUpdate(world, new BlockPos(x, y, z)); } } } }
@Override public void handleInfoPacket(PacketBase payload, boolean isServer, EntityPlayer player) { super.handleInfoPacket(payload, isServer, player); byte prevType = type; byte prevColor = color; type = payload.getByte(); threshold = payload.getByte(); invert = payload.getByte(); color = payload.getByte(); if (isServer) { baseTile.world().notifyNeighborsOfStateChange(baseTile.getPos(), baseTile.getBlockType(), false); onNeighborChange(); GridStructural grid = structureUnit.getGrid(); if ((type != prevType || color != prevColor) && grid != null) { grid.resetRelays(); } } BlockHelper.callBlockUpdate(baseTile.getWorld(), baseTile.getPos()); }
world().scheduleBlockUpdate(pos(), block, world().rand.nextInt(30) + 10, 0); BlockHelper.callBlockUpdate(world(), pos());