java类net.minecraft.entity.player.InventoryPlayer的实例源码

NetHandlerPlayServer.java 文件源码 项目:Zombe-Modpack 阅读 21 收藏 0 点赞 0 评论 0
/**
 * 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()});
    }
}
ContainerMagibench.java 文件源码 项目:PurificatiMagicae 阅读 16 收藏 0 点赞 0 评论 0
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);
}
ContainerPan.java 文件源码 项目:ExSartagine 阅读 18 收藏 0 点赞 0 评论 0
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));
}
NetHandlerPlayClient.java 文件源码 项目:DecompiledMinecraft 阅读 22 收藏 0 点赞 0 评论 0
/**
 * 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();
    }
}
ContainerBase.java 文件源码 项目:Bewitchment 阅读 39 收藏 0 点赞 0 评论 0
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));
    }
}
ContainerPressureCooker.java 文件源码 项目:FoodCraft-Reloaded 阅读 19 收藏 0 点赞 0 评论 0
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));
}
ContainerSimpleWorkbench.java 文件源码 项目:BetterBeginningsReborn 阅读 20 收藏 0 点赞 0 评论 0
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);
}
GuiKeroseneLamp.java 文件源码 项目:pnc-repressurized 阅读 17 收藏 0 点赞 0 评论 0
public GuiKeroseneLamp(InventoryPlayer player, TileEntityKeroseneLamp te) {
    super(new ContainerKeroseneLamp(player, te), te, Textures.GUI_KEROSENE_LAMP);
}
LocalBlockIntercommunication.java 文件源码 项目:BaseClient 阅读 17 收藏 0 点赞 0 评论 0
public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn)
{
    throw new UnsupportedOperationException();
}
PlayerInvWrapper.java 文件源码 项目:CustomWorldGen 阅读 98 收藏 0 点赞 0 评论 0
public PlayerInvWrapper(InventoryPlayer inv)
{
    super(new PlayerMainInvWrapper(inv), new PlayerArmorInvWrapper(inv), new PlayerOffhandInvWrapper(inv));
}


问题


面经


文章

微信
公众号

扫码关注公众号