Search in sources :

Example 1 with SPacketRemoveDisabledRendering

use of com.lowdragmc.multiblocked.network.s2c.SPacketRemoveDisabledRendering in project Multiblocked by Low-Drag-MC.

the class MultiblockState method onBlockStateChanged.

public void onBlockStateChanged(BlockPos pos) {
    if (pos.equals(controllerPos)) {
        if (this.getMatchContext().containsKey("renderMask")) {
            MultiblockedNetworking.sendToAll(new SPacketRemoveDisabledRendering(controllerPos));
        }
        if (lastController != null) {
            lastController.onStructureInvalid();
        }
        MultiblockWorldSavedData mbds = MultiblockWorldSavedData.getOrCreate(world);
        mbds.removeMapping(this);
        mbds.removeLoading(controllerPos);
    } else if (error != UNLOAD_ERROR) {
        ControllerTileEntity controller = getController();
        if (controller != null && !controller.checkPattern()) {
            controller.onStructureInvalid();
            MultiblockWorldSavedData.getOrCreate(world).removeMapping(this);
        }
    }
}
Also used : MultiblockWorldSavedData(com.lowdragmc.multiblocked.persistence.MultiblockWorldSavedData) SPacketRemoveDisabledRendering(com.lowdragmc.multiblocked.network.s2c.SPacketRemoveDisabledRendering) ControllerTileEntity(com.lowdragmc.multiblocked.api.tile.ControllerTileEntity)

Aggregations

ControllerTileEntity (com.lowdragmc.multiblocked.api.tile.ControllerTileEntity)1 SPacketRemoveDisabledRendering (com.lowdragmc.multiblocked.network.s2c.SPacketRemoveDisabledRendering)1 MultiblockWorldSavedData (com.lowdragmc.multiblocked.persistence.MultiblockWorldSavedData)1