Search in sources :

Example 1 with ItemLogisticsFrame

use of pneumaticCraft.common.item.ItemLogisticsFrame in project PneumaticCraft by MineMaarten.

the class ContainerLogistics method getLogistics.

public static SemiBlockLogistics getLogistics(EntityPlayer player, ItemStack itemRequester) {
    if (itemRequester != null && itemRequester.getItem() instanceof ItemLogisticsFrame) {
        SemiBlockLogistics logistics = (SemiBlockLogistics) SemiBlockManager.getSemiBlockForKey(((ItemLogisticsFrame) itemRequester.getItem()).semiBlockId);
        logistics.initialize(player.worldObj, new ChunkPosition(0, 0, 0));
        logistics.onPlaced(player, itemRequester);
        return logistics;
    } else {
        return null;
    }
}
Also used : SemiBlockLogistics(pneumaticCraft.common.semiblock.SemiBlockLogistics) ItemLogisticsFrame(pneumaticCraft.common.item.ItemLogisticsFrame) ChunkPosition(net.minecraft.world.ChunkPosition)

Example 2 with ItemLogisticsFrame

use of pneumaticCraft.common.item.ItemLogisticsFrame in project PneumaticCraft by MineMaarten.

the class SemiBlockLogistics method playerIsHoldingLogisticItems.

@SideOnly(Side.CLIENT)
private boolean playerIsHoldingLogisticItems() {
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    ItemStack stack = player.getCurrentEquippedItem();
    return stack != null && (stack.getItem() == Itemss.logisticsConfigurator || stack.getItem() instanceof ItemLogisticsFrame);
}
Also used : ItemLogisticsFrame(pneumaticCraft.common.item.ItemLogisticsFrame) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

ItemLogisticsFrame (pneumaticCraft.common.item.ItemLogisticsFrame)2 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ItemStack (net.minecraft.item.ItemStack)1 ChunkPosition (net.minecraft.world.ChunkPosition)1 SemiBlockLogistics (pneumaticCraft.common.semiblock.SemiBlockLogistics)1