Search in sources :

Example 1 with EndergenicTileEntity

use of mcjty.rftools.blocks.endergen.EndergenicTileEntity in project RFTools by McJty.

the class ClientCommandHandler method registerCommands.

public static void registerCommands() {
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_RETURN_DESTINATION_INFO, (player, arguments) -> {
        MatterTransmitterBlock.setDestinationInfo(arguments.getInt(), arguments.getString());
        return true;
    });
    if (SecurityConfiguration.enabled) {
        McJtyLib.registerClientCommand(RFTools.MODID, CMD_RETURN_SECURITY_NAME, (player, arguments) -> {
            SecurityCardItem.channelNameFromServer = arguments.getString();
            return true;
        });
    }
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_RETURN_SCAN_DIRTY, (player, arguments) -> {
        ScanDataManagerClient.getScansClient().getOrCreateScan(arguments.getInt()).setDirtyCounter(arguments.getInt());
        return true;
    });
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_RETURN_ENERGY_CONSUMPTION, (player, arguments) -> {
        GuiLocator.energyConsumption = arguments.getInt();
        return true;
    });
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_RETURN_STORAGE_INFO, (player, arguments) -> {
        ModularStorageBlock.cntReceived = arguments.getInt();
        ModularStorageBlock.nameModuleReceived = arguments.getString();
        return true;
    });
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_FLASH_ENDERGENIC, (player, arguments) -> {
        BlockPos pos = arguments.getBlockPos();
        TileEntity te = RFTools.proxy.getClientWorld().getTileEntity(pos);
        if (te instanceof EndergenicTileEntity) {
            EndergenicTileEntity tileEntity = (EndergenicTileEntity) te;
            tileEntity.syncCountersFromServer(arguments.getInt(), arguments.getInt());
        }
        return true;
    });
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_POSITION_TO_CLIENT, (player, arguments) -> {
        BlockPos tePos = arguments.getBlockPos();
        BlockPos scanPos = arguments.getBlockPos();
        TileEntity te = RFTools.proxy.getClientWorld().getTileEntity(tePos);
        if (te instanceof BuilderTileEntity) {
            BuilderTileEntity.setScanLocationClient(tePos, scanPos);
        }
        return true;
    });
    McJtyLib.registerClientCommand(RFTools.MODID, CMD_RETURN_COUNTER_INFO, (player, arguments) -> {
        CounterBlock.cntReceived = arguments.getInt();
        return true;
    });
}
Also used : BuilderTileEntity(mcjty.rftools.blocks.builder.BuilderTileEntity) EndergenicTileEntity(mcjty.rftools.blocks.endergen.EndergenicTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) BlockPos(net.minecraft.util.math.BlockPos) EndergenicTileEntity(mcjty.rftools.blocks.endergen.EndergenicTileEntity) BuilderTileEntity(mcjty.rftools.blocks.builder.BuilderTileEntity)

Example 2 with EndergenicTileEntity

use of mcjty.rftools.blocks.endergen.EndergenicTileEntity in project RFTools by McJty.

the class ForgeEventHandlers method onPostWorldTick.

@SubscribeEvent
public void onPostWorldTick(TickEvent.WorldTickEvent event) {
    if (!event.world.isRemote) {
        for (EndergenicTileEntity endergenic : EndergenicTileEntity.todoEndergenics) {
            endergenic.checkStateServer();
        }
        EndergenicTileEntity.todoEndergenics.clear();
        EndergenicTileEntity.endergenicsAdded.clear();
    }
}
Also used : EndergenicTileEntity(mcjty.rftools.blocks.endergen.EndergenicTileEntity) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

EndergenicTileEntity (mcjty.rftools.blocks.endergen.EndergenicTileEntity)2 BuilderTileEntity (mcjty.rftools.blocks.builder.BuilderTileEntity)1 TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.math.BlockPos)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1