Java 类net.minecraft.entity.player.InventoryPlayer 实例源码

项目:rezolve    文件:RemoteShellEntity.java   
@Override
public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack) {

    Slot slot = containerToSend.getSlot(slotInd);
    boolean charge = true;

    if (slot != null) {
        if (slot.inventory instanceof InventoryPlayer) {
            // We don't charge for changes to the player's inventory.
            charge = false;
        }
    }

    System.out.println("Send slot contents for "+slotInd+":");
    if (stack == null)
        System.out.println(" - No contents");
    else
        System.out.println(" - "+stack.stackSize+" "+stack.getDisplayName());

    if (charge) {
        System.out.println("Charging a fee for data transfer...");
        this.chargeForAccess(1);
    }

}
项目:CustomWorldGen    文件:GuiContainerCreative.java   
public ContainerCreative(EntityPlayer player)
{
    InventoryPlayer inventoryplayer = player.inventory;

    for (int i = 0; i < 5; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(GuiContainerCreative.basicInventory, i * 9 + j, 9 + j * 18, 18 + i * 18));
        }
    }

    for (int k = 0; k < 9; ++k)
    {
        this.addSlotToContainer(new Slot(inventoryplayer, k, 9 + k * 18, 112));
    }

    this.scrollTo(0.0F);
}
项目:BaseClient    文件:ContainerHopper.java   
public ContainerHopper(InventoryPlayer playerInventory, IInventory hopperInventoryIn, EntityPlayer player)
{
    this.hopperInventory = hopperInventoryIn;
    hopperInventoryIn.openInventory(player);
    int i = 51;

    for (int j = 0; j < hopperInventoryIn.getSizeInventory(); ++j)
    {
        this.addSlotToContainer(new Slot(hopperInventoryIn, j, 44 + j * 18, 20));
    }

    for (int l = 0; l < 3; ++l)
    {
        for (int k = 0; k < 9; ++k)
        {
            this.addSlotToContainer(new Slot(playerInventory, k + l * 9 + 9, 8 + k * 18, l * 18 + i));
        }
    }

    for (int i1 = 0; i1 < 9; ++i1)
    {
        this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 58 + i));
    }
}
项目:DecompiledMinecraft    文件:ContainerHopper.java   
public ContainerHopper(InventoryPlayer playerInventory, IInventory hopperInventoryIn, EntityPlayer player)
{
    this.hopperInventory = hopperInventoryIn;
    hopperInventoryIn.openInventory(player);
    int i = 51;

    for (int j = 0; j < hopperInventoryIn.getSizeInventory(); ++j)
    {
        this.addSlotToContainer(new Slot(hopperInventoryIn, j, 44 + j * 18, 20));
    }

    for (int l = 0; l < 3; ++l)
    {
        for (int k = 0; k < 9; ++k)
        {
            this.addSlotToContainer(new Slot(playerInventory, k + l * 9 + 9, 8 + k * 18, l * 18 + i));
        }
    }

    for (int i1 = 0; i1 < 9; ++i1)
    {
        this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 58 + i));
    }
}
项目:CustomWorldGen    文件:ContainerMerchant.java   
public ContainerMerchant(InventoryPlayer playerInventory, IMerchant merchant, World worldIn)
{
    this.theMerchant = merchant;
    this.theWorld = worldIn;
    this.merchantInventory = new InventoryMerchant(playerInventory.player, merchant);
    this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53));
    this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53));
    this.addSlotToContainer(new SlotMerchantResult(playerInventory.player, merchant, this.merchantInventory, 2, 120, 53));

    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
        }
    }

    for (int k = 0; k < 9; ++k)
    {
        this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
    }
}
项目:Technical    文件:TileEntityAutoWorkBench.java   
public boolean canCraft() {
    if(currentEnergy <= 0) {
        FMLLog.log(Level.INFO, "Ba");
        currentEnergy = 0;
        return false;
    } else {
        FMLLog.log(Level.INFO, "Bb");
        InventoryCrafting inv = new InventoryCrafting(new ContainerAutoWorkBench(new InventoryPlayer(null), this), 3, 3);
        for(int i = 1; i < machineItemStacks.length - 1; i++) {
            inv.setInventorySlotContents(i - 1, machineItemStacks[i - 1]);
            FMLLog.log(Level.INFO, "Bc" + (i - 1));
        }
        ItemStack stack = AutoWorkBenchRecipes.smelting().getSmeltingResult(inv, worldObj, Tier.normal)[0];
        FMLLog.log(Level.INFO, "Bd" + (stack != null));
        return stack != null;
    }
}
项目:pnc-repressurized    文件:ContainerProgrammer.java   
public ContainerProgrammer(InventoryPlayer inventoryPlayer, TileEntityProgrammer te) {
    super(te);

    addSlotToContainer(new SlotItemHandler(te.getPrimaryInventory(), 0, 326, 15) {
        @Override
        public boolean isItemValid(@Nonnull ItemStack stack) {
            return isProgrammableItem(stack);
        }
    });

    // Add the player's inventory slots to the container
    for (int inventoryRowIndex = 0; inventoryRowIndex < 3; ++inventoryRowIndex) {
        for (int inventoryColumnIndex = 0; inventoryColumnIndex < 9; ++inventoryColumnIndex) {
            addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 95 + inventoryColumnIndex * 18, 174 + inventoryRowIndex * 18));
        }
    }

    // Add the player's action bar slots to the container
    for (int actionBarSlotIndex = 0; actionBarSlotIndex < 9; ++actionBarSlotIndex) {
        addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 95 + actionBarSlotIndex * 18, 232));
    }
}
项目:OpenFlexiTrack    文件:BlockSurveyFlag.java   
/**
 * Removes the given amount of items from the given player inventory. Scans through multiple inventory slots if needed.
 * 
 * @param inv - {@link net.minecraft.entity.player.InventoryPlayer Player inventory} to interact with.
 * @param item - {@link net.minecraft.item.Item Item type} to remove.
 * @param meta - Item metadata; set to {@code -1} to disregard item metadata.
 * @param qty - Number of items to remove.
 */
private static void removeItemsFromPlayer(InventoryPlayer inv, Item item, int meta, int qty){

    for(int i=0; i<inv.mainInventory.length; ++i){

        ItemStack stack = inv.mainInventory[i];
        if (stack == null) {
            continue;
        }

        if(stack.getItem().equals(item)){
            if(stack.getItemDamage() == meta || meta == -1){
                if(stack.stackSize <= qty){
                    qty -= stack.stackSize;
                    inv.removeStackFromSlot(i);
                }else{
                    stack.stackSize -= qty;
                    inv.setInventorySlotContents(i, stack);
                    return;
                }
            }
        }
    }
}
项目:Mods    文件:ContainerAmmoFurnace.java   
public ContainerAmmoFurnace(InventoryPlayer playerInventory, IInventory furnaceInventory) {
    this.tileFurnace = furnaceInventory;
    for (int i = 0; i < 9; i++)
        this.addSlotToContainer(new Slot(furnaceInventory, i, 9 + (i % 3) * 18, 17 + (i / 3) * 18));
    this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 9, 80, 53));
    for (int i = 0; i < 9; i++)
        this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, furnaceInventory, i + 10,
                116 + (i % 3) * 18, 17 + (i / 3) * 18));

    for (int i = 0; i < 3; ++i)
        for (int j = 0; j < 9; ++j)
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));

    for (int k = 0; k < 9; ++k)
        this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
}
项目:BaseClient    文件:ContainerBrewingStand.java   
public ContainerBrewingStand(InventoryPlayer playerInventory, IInventory tileBrewingStandIn)
{
    this.tileBrewingStand = tileBrewingStandIn;
    this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 46));
    this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 53));
    this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 2, 102, 46));
    this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(tileBrewingStandIn, 3, 79, 17));

    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
        }
    }

    for (int k = 0; k < 9; ++k)
    {
        this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
    }
}
项目:CustomWorldGen    文件:ContainerBrewingStand.java   
public ContainerBrewingStand(InventoryPlayer playerInventory, IInventory tileBrewingStandIn)
{
    this.tileBrewingStand = tileBrewingStandIn;
    this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 51));
    this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 58));
    this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 2, 102, 51));
    this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(tileBrewingStandIn, 3, 79, 17));
    this.addSlotToContainer(new ContainerBrewingStand.Fuel(tileBrewingStandIn, 4, 17, 17));

    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 9; ++j)
        {
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
        }
    }

    for (int k = 0; k < 9; ++k)
    {
        this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
    }
}
项目:Bewitchment    文件:ContainerApiary.java   
public ContainerApiary(InventoryPlayer playerInventory, IInventory inventory) {
    this.apiary = inventory;
    this.addSlotToContainer(new SlotBee(inventory, 0, 26, 34));

    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 6; j++) {
            this.addSlotToContainer(new SlotItem(inventory, j + i * 6 + 1, 62 + j * 18, 16 + i * 18));
        }
    }

    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 9; ++j) {
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
        }
    }

    for (int k = 0; k < 9; ++k) {
        this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
    }
}
项目:CustomWorldGen    文件:GuiEnchantment.java   
public GuiEnchantment(InventoryPlayer inventory, World worldIn, IWorldNameable nameable)
{
    super(new ContainerEnchantment(inventory, worldIn));
    this.playerInventory = inventory;
    this.container = (ContainerEnchantment)this.inventorySlots;
    this.nameable = nameable;
}
项目:WirelessCharger    文件:ContainerPersonalCharger.java   
public ContainerPersonalCharger(final EntityPlayer player, TileEntityBase tile) {

        tilePersonalCharger = (TilePersonalCharger) tile;
        InventoryPlayer inventory = player.inventory;
        addPlayerSlots(inventory);
        addUpgradeSlots(((TilePersonalCharger) tile).getUpgradeStackHandler());
    }
项目:Proyecto-DASI    文件:InventoryCommandsImplementation.java   
static void combineSlots(EntityPlayerMP player, int dst, int add)
{
    InventoryPlayer inv = player.inventory;
    ItemStack dstStack = inv.getStackInSlot(dst);
    ItemStack addStack = inv.getStackInSlot(add);

    if (addStack == null)
        return;    // Combination is a no-op.

    if (dstStack == null)   // Do a straight move - nothing to combine with.
    {
        inv.setInventorySlotContents(dst, addStack);
        inv.setInventorySlotContents(add, null);
        return;
    }

    // Check we can combine. This logic comes from InventoryPlayer.storeItemStack():
    boolean itemsMatch = dstStack.getItem() == addStack.getItem();
    boolean dstCanStack = dstStack.isStackable() && dstStack.stackSize < dstStack.getMaxStackSize() && dstStack.stackSize < inv.getInventoryStackLimit();
    boolean subTypesMatch = !dstStack.getHasSubtypes() || dstStack.getMetadata() == addStack.getMetadata();
    boolean tagsMatch = ItemStack.areItemStackTagsEqual(dstStack, addStack);
    if (itemsMatch && dstCanStack && subTypesMatch && tagsMatch)
    {
        // We can combine, so figure out how much we have room for:
        int limit = Math.min(dstStack.getMaxStackSize(), inv.getInventoryStackLimit());
        int room = limit - dstStack.stackSize;
        if (addStack.stackSize > room)
        {
            // Not room for all of it, so shift across as much as possible.
            addStack.stackSize -= room;
            dstStack.stackSize += room;
        }
        else
        {
            // Room for the whole lot, so empty out the add slot.
            dstStack.stackSize += addStack.stackSize;
            inv.setInventorySlotContents(add, null);
        }
    }
}
项目:DecompiledMinecraft    文件:GuiEnchantment.java   
public GuiEnchantment(InventoryPlayer inventory, World worldIn, IWorldNameable p_i45502_3_)
{
    super(new ContainerEnchantment(inventory, worldIn));
    this.playerInventory = inventory;
    this.container = (ContainerEnchantment)this.inventorySlots;
    this.field_175380_I = p_i45502_3_;
}
项目:Backmemed    文件:GuiBeacon.java   
public GuiBeacon(InventoryPlayer playerInventory, IInventory tileBeaconIn)
{
    super(new ContainerBeacon(playerInventory, tileBeaconIn));
    this.tileBeacon = tileBeaconIn;
    this.xSize = 230;
    this.ySize = 219;
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Updates which hotbar slot of the player is currently selected
 */
public void handleHeldItemChange(SPacketHeldItemChange packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (InventoryPlayer.isHotbar(packetIn.getHeldItemHotbarIndex()))
    {
        this.gameController.player.inventory.currentItem = packetIn.getHeldItemHotbarIndex();
    }
}
项目:Backmemed    文件:GuiHopper.java   
public GuiHopper(InventoryPlayer playerInv, IInventory hopperInv)
{
    super(new ContainerHopper(playerInv, hopperInv, Minecraft.getMinecraft().player));
    this.playerInventory = playerInv;
    this.hopperInventory = hopperInv;
    this.allowUserInput = false;
    this.ySize = 133;
}
项目:CustomWorldGen    文件:ContainerWorkbench.java   
public ContainerWorkbench(InventoryPlayer playerInventory, World worldIn, BlockPos posIn)
{
    this.worldObj = worldIn;
    this.pos = posIn;
    this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));

    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 3; ++j)
        {
            this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18));
        }
    }

    for (int k = 0; k < 3; ++k)
    {
        for (int i1 = 0; i1 < 9; ++i1)
        {
            this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18));
        }
    }

    for (int l = 0; l < 9; ++l)
    {
        this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142));
    }

    this.onCraftMatrixChanged(this.craftMatrix);
}
项目:Randores2    文件:CraftiniumConverterContainer.java   
public CraftiniumConverterContainer(InventoryPlayer playerInventory, World world, BlockPos converter) {
    this.world = world;
    this.converter = converter;
    this.player = playerInventory.player;

    this.input = new CraftiniumSlotConvertInput(this);

    this.delegate = new DelegatingItemStackHandler();
    PagedItemStackHandler handler = new PagedItemStackHandler(9, 0);
    this.handler = handler;
    this.delegate.setHandler(handler);

    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            this.addSlotToContainer(new CraftiniumSlotConvertOutput(this, this.delegate, j + i * 3, 30 + j * 18, 17 + i * 18)); //TODO proper offsets
        }
    }

    for (int k = 0; k < 3; ++k) {
        for (int i1 = 0; i1 < 9; ++i1) {
            this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18));
        }
    }

    for (int l = 0; l < 9; ++l) {
        this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142));
    }
}
项目:BaseClient    文件:ContainerWorkbench.java   
public ContainerWorkbench(InventoryPlayer playerInventory, World worldIn, BlockPos posIn)
{
    this.worldObj = worldIn;
    this.pos = posIn;
    this.addSlotToContainer(new SlotCrafting(playerInventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));

    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 3; ++j)
        {
            this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18));
        }
    }

    for (int k = 0; k < 3; ++k)
    {
        for (int i1 = 0; i1 < 9; ++i1)
        {
            this.addSlotToContainer(new Slot(playerInventory, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18));
        }
    }

    for (int l = 0; l < 9; ++l)
    {
        this.addSlotToContainer(new Slot(playerInventory, l, 8 + l * 18, 142));
    }

    this.onCraftMatrixChanged(this.craftMatrix);
}
项目:DecompiledMinecraft    文件:GuiHopper.java   
public GuiHopper(InventoryPlayer playerInv, IInventory hopperInv)
{
    super(new ContainerHopper(playerInv, hopperInv, Minecraft.getMinecraft().thePlayer));
    this.playerInventory = playerInv;
    this.hopperInventory = hopperInv;
    this.allowUserInput = false;
    this.ySize = 133;
}
项目:pnc-repressurized    文件:ContainerPneumaticBase.java   
@Nonnull
private ItemStack slotClickPhantom(Slot slot, int dragType, ClickType clickType, EntityPlayer player) {
    ItemStack stack = ItemStack.EMPTY;

    if (clickType == ClickType.CLONE && dragType == 2) {
        // middle-click: clear slot
        if (((IPhantomSlot) slot).canAdjust()) {
            slot.putStack(ItemStack.EMPTY);
        }
    } else if ((clickType == ClickType.PICKUP || clickType == ClickType.QUICK_MOVE) && (dragType == 0 || dragType == 1)) {
        // left or right-click...
        InventoryPlayer playerInv = player.inventory;
        slot.onSlotChanged();
        ItemStack stackSlot = slot.getStack();
        ItemStack stackHeld = playerInv.getItemStack();

        stack = stackSlot.copy();
        if (stackSlot.isEmpty()) {
            if (!stackHeld.isEmpty() && slot.isItemValid(stackHeld)) {
                fillPhantomSlot(slot, stackHeld, clickType, dragType);
            }
        } else if (stackHeld.isEmpty()) {
            adjustPhantomSlot(slot, clickType, dragType);
            slot.onTake(player, playerInv.getItemStack());
        } else if (slot.isItemValid(stackHeld)) {
            if (canStacksMerge(stackSlot, stackHeld)) {
                adjustPhantomSlot(slot, clickType, dragType);
            } else {
                fillPhantomSlot(slot, stackHeld, clickType, dragType);
            }
        }
    }
    return stack;
}
项目:CraftingParadiseMod    文件:ContainerWorldMachine.java   
public ContainerWorldMachine(EntityPlayer player, TileWorldMachine tile)
{
    this.tile = tile;

    InventoryPlayer ip = player.inventory;
    int playerInventoryX = 35;
    int playerInventoryY = 147;

    for(int x = 0; x < 9; x++)
        this.addSlotToContainer(new Slot(ip, x, playerInventoryX + x * 18 , playerInventoryY+58));

    for(int x = 0; x < 9; x++)
        for(int y = 0; y < 3; y++)
            this.addSlotToContainer(new Slot(ip, 9 + y * 9 + x, playerInventoryX + x * 18, playerInventoryY + y * 18));

    SlotWorldModule core = new SlotWorldModule(tile, 0, 21, 21, IWorldBuilderModule.ModuleType.CORE);
    SlotWorldModule mantle = new SlotWorldModule(tile, 1, 39, 21, IWorldBuilderModule.ModuleType.MANTLE, core);
    SlotWorldModule crust = new SlotWorldModule(tile, 2, 57, 21, IWorldBuilderModule.ModuleType.CRUST, core, mantle);
    SlotWorldModule land = new SlotWorldModule(tile, 3, 21, 39, IWorldBuilderModule.ModuleType.LANDSCAPE, core, mantle, crust);
    SlotWorldModule world = new SlotWorldModule(tile, 4, 39, 39, IWorldBuilderModule.ModuleType.WORLD, core, mantle, crust, land);
    SlotWorldModule atmosphere = new SlotWorldModule(tile, 5, 57, 39, IWorldBuilderModule.ModuleType.ATMOSPHERE, core, mantle, crust, land, world);

    this.addSlotToContainer(core);
    this.addSlotToContainer(mantle);
    this.addSlotToContainer(crust);
    this.addSlotToContainer(land);
    this.addSlotToContainer(world);
    this.addSlotToContainer(atmosphere);
}
项目:pnc-repressurized    文件:ContainerInventorySearcher.java   
public ContainerInventorySearcher(InventoryPlayer inventoryPlayer) {
    // Add the player's inventory slots to the container
    for (int inventoryRowIndex = 0; inventoryRowIndex < 3; ++inventoryRowIndex) {
        for (int inventoryColumnIndex = 0; inventoryColumnIndex < 9; ++inventoryColumnIndex) {
            addSlotToContainer(new Slot(inventoryPlayer, inventoryColumnIndex + inventoryRowIndex * 9 + 9, 8 + inventoryColumnIndex * 18, 48 + inventoryRowIndex * 18));
        }
    }

    // Add the player's action bar slots to the container
    for (int actionBarSlotIndex = 0; actionBarSlotIndex < 9; ++actionBarSlotIndex) {
        addSlotToContainer(new Slot(inventoryPlayer, actionBarSlotIndex, 8 + actionBarSlotIndex * 18, 106));
    }
}
项目:Mods    文件:GuiUpgradeStation.java   
public GuiUpgradeStation(InventoryPlayer playerInv, TileEntityUpgrades station, World worldIn,
        BlockPos blockPosition) {
    super(new ContainerUpgrades(Minecraft.getMinecraft().player, playerInv, station, worldIn, blockPosition));
    this.station = station;
    this.xSize = 230;
    this.ySize = 216;
    // this.itemsToRender=new ItemStack[9];
}
项目:ExPetrum    文件:ExPHandlerServer.java   
@SubscribeEvent
public void onContainerOpened(PlayerContainerEvent.Open event)
{
       if (!SettingsFlags.instance.enableCustomInventory)
       {
           return;
       }

    try
    {
        Container c = event.getContainer();
        for (int i = 0; i < c.inventorySlots.size(); ++i)
        {
            Slot s = c.inventorySlots.get(i);
            if (s.getClass().equals(Slot.class) && s.inventory instanceof InventoryPlayer && !(s instanceof ManagedSlot) && s.getSlotIndex() >= 9 && s.getSlotIndex() < 36)
            {
                ManagedSlot wrapper = new ManagedSlot(s);
                c.inventorySlots.remove(i);
                c.inventorySlots.add(i, wrapper);
            }
        }
    }
    catch (Exception ex)
    {
        ExPMisc.modLogger.log(LogLevel.Error, "ExPetrum was unable to initialize it's inventory system! This is most likely caused by another mod!", ex);
    }
}
项目:pnc-repressurized    文件:ContainerOmnidirectionalHopper.java   
public ContainerOmnidirectionalHopper(InventoryPlayer inventoryPlayer, TileEntityOmnidirectionalHopper te) {
    super(te);

    addUpgradeSlots(23, 29);

    for (int i = 0; i < TileEntityOmnidirectionalHopper.INVENTORY_SIZE; i++) {
        addSlotToContainer(new SlotItemHandler(te.getPrimaryInventory(), i, 68 + i * 18, 36));
    }

    addPlayerSlots(inventoryPlayer, 84);
}
项目:ArcaneMagic    文件:ContainerInfusionAltar.java   
public ContainerInfusionAltar(InventoryPlayer playerInventory, TileEntityInfusionAltar te)
{
    super();
    this.te = te;
    addOwnSlots();
    addPlayerSlots(playerInventory);
}
项目:Zombe-Modpack    文件:NetHandlerPlayServer.java   
/**
 * Updates which quickbar slot is selected
 */
public void processHeldItemChange(CPacketHeldItemChange packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());

    if (packetIn.getSlotId() >= 0 && packetIn.getSlotId() < InventoryPlayer.getHotbarSize())
    {
        this.playerEntity.inventory.currentItem = packetIn.getSlotId();
        this.playerEntity.markPlayerActive();
    }
    else
    {
        LOGGER.warn("{} tried to set an invalid carried item", new Object[] {this.playerEntity.getName()});
    }
}
项目:PurificatiMagicae    文件:ContainerMagibench.java   
private ContainerMagibench(TileMagibench tile, World world, MagibenchRegistry.Tier t, InventoryPlayer inv)
{
    super(inv, t.getWidth() * t.getHeight() + 1, 18, 107);
    this.world = world;
    this.tile = tile;
    this.tier = t;
    this.inv = inv;
    this.matrix = new Crafting();
    this.result = new InventoryCraftResult();
    addSlots();
    addPlayerSlots();
    onCraftMatrixChanged(matrix);
}
项目:ExSartagine    文件:ContainerPan.java   
public ContainerPan(InventoryPlayer playerInventory, TileEntityPan pan) {

    this.addSlotToContainer(new SlotPanInput(pan.getInventory(), 0, 56, 17));
       this.addSlotToContainer(new SlotPanOutput(playerInventory.player, pan.getInventory(), 1, 116, 35));

       for (int i = 0; i < 3; ++i)
           for (int j = 0; j < 9; ++j)
               this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));

       for (int k = 0; k < 9; ++k)
           this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Updates which hotbar slot of the player is currently selected
 */
public void handleHeldItemChange(S09PacketHeldItemChange packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (packetIn.getHeldItemHotbarIndex() >= 0 && packetIn.getHeldItemHotbarIndex() < InventoryPlayer.getHotbarSize())
    {
        this.gameController.thePlayer.inventory.currentItem = packetIn.getHeldItemHotbarIndex();
    }
}
项目:Bewitchment    文件:ContainerBase.java   
protected void addPlayerSlots(InventoryPlayer playerInventory, int x, int y) {
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 9; ++j) {
            addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, x + j * 18, y + i * 18));
        }
    }

    for (int i = 0; i < 9; ++i) {
        addSlotToContainer(new Slot(playerInventory, i, x + i * 18, y + 58));
    }
}
项目:FoodCraft-Reloaded    文件:ContainerPressureCooker.java   
public ContainerPressureCooker(InventoryPlayer playerInventory, TileEntity tileEntity) {
    this.inventoryPlayer = playerInventory;
    this.itemHandler = (IItemHandlerModifiable) tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
    for (int i = 0; i < 2; ++i)
        for (int j = 0; j < 3; ++j)
            addSlotToContainer(new SlotItemHandler(itemHandler, j + i * 2, 43 + j * 24, 15 + i * 34));
    addSlotToContainer(new SlotItemHandler(itemHandler, 6, 141 + 4, 28 + 4));
    for (int i = 0; i < 3; ++i)
        for (int j = 0; j < 9; ++j)
            this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));

    for (int k = 0; k < 9; ++k)
        this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142));
}
项目:BetterBeginningsReborn    文件:ContainerSimpleWorkbench.java   
public ContainerSimpleWorkbench(InventoryPlayer invPlayer, World world, BlockPos loc)
{
    worldObj = world;
    pos = loc;

    addSlotToContainer(new SlotCrafting(invPlayer.player, craftMatrix, craftResult, 0, 124, 35));
    int l;
    int i1;

    for (l = 0; l < 3; ++l)
    {
        for (i1 = 0; i1 < 3; ++i1)
        {
            addSlotToContainer(new Slot(craftMatrix, i1 + l * 3, 30 + i1 * 18, 17 + l * 18));
        }
    }

    for (l = 0; l < 3; ++l)
    {
        for (i1 = 0; i1 < 9; ++i1)
        {
            addSlotToContainer(new Slot(invPlayer, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
        }
    }

    for (l = 0; l < 9; ++l)
    {
        addSlotToContainer(new Slot(invPlayer, l, 8 + l * 18, 142));
    }

    onCraftMatrixChanged(craftMatrix);
}
项目:pnc-repressurized    文件:GuiKeroseneLamp.java   
public GuiKeroseneLamp(InventoryPlayer player, TileEntityKeroseneLamp te) {
    super(new ContainerKeroseneLamp(player, te), te, Textures.GUI_KEROSENE_LAMP);
}
项目:BaseClient    文件:LocalBlockIntercommunication.java   
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
{
    throw new UnsupportedOperationException();
}
项目:CustomWorldGen    文件:PlayerInvWrapper.java   
public PlayerInvWrapper(InventoryPlayer inv)
{
    super(new PlayerMainInvWrapper(inv), new PlayerArmorInvWrapper(inv), new PlayerOffhandInvWrapper(inv));
}