Search in sources :

Example 1 with PacketGraphicsReady

use of mcjty.rftoolscontrol.network.PacketGraphicsReady in project RFToolsControl by McJty.

the class CommandHandler method registerCommands.

public static void registerCommands() {
    McJtyLib.registerCommand(RFToolsControl.MODID, CMD_TESTRECIPE, (player, arguments) -> {
        ItemStack heldItem = player.getHeldItem(EnumHand.MAIN_HAND);
        if (heldItem.isEmpty()) {
            return false;
        }
        if (heldItem.getItem() instanceof CraftingCardItem) {
            CraftingCardItem.testRecipe(player.getEntityWorld(), heldItem);
        }
        return true;
    });
    McJtyLib.registerCommand(RFToolsControl.MODID, CMD_GETGRAPHICS, (player, arguments) -> {
        TileEntity te = player.getEntityWorld().getTileEntity(arguments.getBlockPos());
        if (te instanceof ProcessorTileEntity) {
            ProcessorTileEntity processor = (ProcessorTileEntity) te;
            RFToolsCtrlMessages.INSTANCE.sendTo(new PacketGraphicsReady(processor), (EntityPlayerMP) player);
        }
        return true;
    });
}
Also used : ProcessorTileEntity(mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) ProcessorTileEntity(mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity) PacketGraphicsReady(mcjty.rftoolscontrol.network.PacketGraphicsReady) ItemStack(net.minecraft.item.ItemStack) CraftingCardItem(mcjty.rftoolscontrol.items.craftingcard.CraftingCardItem)

Aggregations

ProcessorTileEntity (mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity)1 CraftingCardItem (mcjty.rftoolscontrol.items.craftingcard.CraftingCardItem)1 PacketGraphicsReady (mcjty.rftoolscontrol.network.PacketGraphicsReady)1 ItemStack (net.minecraft.item.ItemStack)1 TileEntity (net.minecraft.tileentity.TileEntity)1