Search in sources :

Example 11 with ProcessorTileEntity

use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.

the class VariableScreenModule method getData.

@Override
public ModuleDataVariable getData(IScreenDataHelper h, World worldObj, long millis) {
    World world = DimensionManager.getWorld(dim);
    if (world == null) {
        return null;
    }
    if (!WorldTools.chunkLoaded(world, coordinate)) {
        return null;
    }
    Block block = world.getBlockState(coordinate).getBlock();
    if (block != ModBlocks.processorBlock) {
        return null;
    }
    if (varIdx < 0 || varIdx >= ProcessorTileEntity.MAXVARS) {
        return null;
    }
    TileEntity te = world.getTileEntity(coordinate);
    if (te instanceof ProcessorTileEntity) {
        ProcessorTileEntity processor = (ProcessorTileEntity) te;
        Parameter parameter = processor.getParameter(varIdx);
        return new ModuleDataVariable(parameter);
    }
    return null;
}
Also used : ProcessorTileEntity(mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) ProcessorTileEntity(mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity) Block(net.minecraft.block.Block) Parameter(mcjty.rftoolscontrol.api.parameters.Parameter) ModuleDataVariable(mcjty.rftoolscontrol.rftoolssupport.ModuleDataVariable) World(net.minecraft.world.World)

Example 12 with ProcessorTileEntity

use of mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity in project RFToolsControl by McJty.

the class CraftingStationTileEntity method getCraftableItems.

public ItemStackList getCraftableItems() {
    ItemStackList items = ItemStackList.create();
    for (BlockPos p : processorList) {
        TileEntity te = getWorld().getTileEntity(p);
        if (te instanceof ProcessorTileEntity) {
            ProcessorTileEntity processor = (ProcessorTileEntity) te;
            processor.getCraftableItems(items);
        }
    }
    return items;
}
Also used : ProcessorTileEntity(mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity) GenericTileEntity(mcjty.lib.entity.GenericTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) ProcessorTileEntity(mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity) ItemStackList(mcjty.lib.varia.ItemStackList) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

ProcessorTileEntity (mcjty.rftoolscontrol.blocks.processor.ProcessorTileEntity)12 TileEntity (net.minecraft.tileentity.TileEntity)11 GenericTileEntity (mcjty.lib.entity.GenericTileEntity)5 Block (net.minecraft.block.Block)5 ItemStack (net.minecraft.item.ItemStack)5 ItemStackList (mcjty.lib.varia.ItemStackList)4 BlockPos (net.minecraft.util.math.BlockPos)4 World (net.minecraft.world.World)3 TextComponentString (net.minecraft.util.text.TextComponentString)2 Parameter (mcjty.rftoolscontrol.api.parameters.Parameter)1 Tuple (mcjty.rftoolscontrol.api.parameters.Tuple)1 CraftingCardItem (mcjty.rftoolscontrol.items.craftingcard.CraftingCardItem)1 PacketGraphicsReady (mcjty.rftoolscontrol.network.PacketGraphicsReady)1 ModuleDataLog (mcjty.rftoolscontrol.rftoolssupport.ModuleDataLog)1 ModuleDataVariable (mcjty.rftoolscontrol.rftoolssupport.ModuleDataVariable)1 ModuleDataVectorArt (mcjty.rftoolscontrol.rftoolssupport.ModuleDataVectorArt)1