net.minecraft.inventory.Slot.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中net.minecraft.inventory.Slot.<init>()方法的一些代码示例,展示了Slot.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Slot.<init>()方法的具体详情如下:
包路径:net.minecraft.inventory.Slot
类名称:Slot
方法名:<init>

Slot.<init>介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

  1. public ContainerFlowerBag(InventoryPlayer playerInv, InventoryFlowerBag flowerBagInv) {
  2. int i;
  3. int j;
  4. this.flowerBagInv = flowerBagInv;
  5. for(i = 0; i < 2; ++i)
  6. for(j = 0; j < 8; ++j) {
  7. int k = j + i * 8;
  8. addSlotToContainer(new SlotItemHandler(flowerBagInv, k, 17 + j * 18, 26 + i * 18));
  9. }
  10. for(i = 0; i < 3; ++i)
  11. for(j = 0; j < 9; ++j)
  12. addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
  13. for(i = 0; i < 9; ++i) {
  14. if(playerInv.getStackInSlot(i) == flowerBagInv.bag)
  15. addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
  16. else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
  17. }
  18. }

代码示例来源:origin: SlimeKnights/TinkersConstruct

  1. this.addSlotToContainer(input1 = new Slot(craftMatrix, 0, 48, 26));
  2. this.addSlotToContainer(input2 = new Slot(craftMatrix, 1, 48, 44));

代码示例来源:origin: SlimeKnights/TinkersConstruct

  1. this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18));

代码示例来源:origin: Vazkii/Botania

  1. public ContainerBaubleBox(EntityPlayer player, InventoryBaubleBox boxInv) {
  2. int i;
  3. int j;
  4. IInventory playerInv = player.inventory;
  5. baubleBoxInv = boxInv;
  6. baubles = BaublesApi.getBaublesHandler(player);
  7. addSlotToContainer(new SlotBauble(player, baubles, 0, 8, 8 + 0 * 18));
  8. addSlotToContainer(new SlotBauble(player, baubles, 1, 8, 8 + 1 * 18));
  9. addSlotToContainer(new SlotBauble(player, baubles, 2, 8, 8 + 2 * 18));
  10. addSlotToContainer(new SlotBauble(player, baubles, 3, 8, 8 + 3 * 18));
  11. addSlotToContainer(new SlotBauble(player, baubles, 4, 27, 8 + 0 * 18));
  12. addSlotToContainer(new SlotBauble(player, baubles, 5, 27, 8 + 1 * 18));
  13. addSlotToContainer(new SlotBauble(player, baubles, 6, 27, 8 + 2 * 18));
  14. for(i = 0; i < 4; ++i)
  15. for(j = 0; j < 6; ++j) {
  16. int k = j + i * 6;
  17. addSlotToContainer(new SlotItemHandler(baubleBoxInv, k, 62 + j * 18, 8 + i * 18));
  18. }
  19. for(i = 0; i < 3; ++i)
  20. for(j = 0; j < 9; ++j)
  21. addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
  22. for(i = 0; i < 9; ++i) {
  23. if(playerInv.getStackInSlot(i) == baubleBoxInv.box)
  24. addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
  25. else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
  26. }
  27. }

代码示例来源:origin: CoFH/ThermalExpansion

  1. public ContainerItemCollector(InventoryPlayer inventory, TileEntity tile) {
  2. super(inventory, tile);
  3. myTile = (TileItemCollector) tile;
  4. for (int i = 0; i < 3; i++) {
  5. for (int j = 0; j < 3; j++) {
  6. addSlotToContainer(new Slot(myTile, j + i * 3, 62 + j * 18, 17 + i * 18));
  7. }
  8. }
  9. }

代码示例来源:origin: ExtraCells/ExtraCells2

  1. protected void bindPlayerInventory(IInventory inventoryPlayer) {
  2. for (int i = 0; i < 3; ++i) {
  3. for (int j = 0; j < 9; ++j) {
  4. this.addSlotToContainer(new Slot(inventoryPlayer,
  5. j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
  6. }
  7. }
  8. for (int i = 0; i < 9; ++i) {
  9. this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18,
  10. 142));
  11. }
  12. }

代码示例来源:origin: ExtraCells/ExtraCells2

  1. protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
  2. for (int i = 0; i < 3; i++) {
  3. for (int j = 0; j < 9; j++) {
  4. addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
  5. 8 + j * 18, i * 18 + 84));
  6. }
  7. }
  8. for (int i = 0; i < 9; i++) {
  9. addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
  10. }
  11. }

代码示例来源:origin: ExtraCells/ExtraCells2

  1. protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
  2. for (int i = 0; i < 3; i++) {
  3. for (int j = 0; j < 9; j++) {
  4. addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
  5. 8 + j * 18, i * 18 + 84));
  6. }
  7. }
  8. for (int i = 0; i < 9; i++) {
  9. addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
  10. }
  11. }

代码示例来源:origin: Nividica/ThaumicEnergistics

  1. protected void bindPlayerInventory(InventoryPlayer player, int offsetX, int offsetY) {
  2. for (int i = 0; i < 3; i++) {
  3. for (int j = 0; j < 9; j++) {
  4. this.addSlotToContainer(new Slot(player, 9 * i + j + 9, offsetX + 8 + 18 * j, offsetY + 2 + 18 * i));
  5. }
  6. }
  7. for (int i = 0; i < 9; i++) {
  8. this.addSlotToContainer(new Slot(player, i, offsetX + 8 + 18 * i, offsetY + 60));
  9. }
  10. }

代码示例来源:origin: CoFH/ThermalDynamics

  1. @Override
  2. protected void addPlayerInventory(InventoryPlayer inventory) {
  3. for (int i = 0; i < 3; i++) {
  4. for (int j = 0; j < 9; j++) {
  5. addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 53 + i * 18));
  6. }
  7. }
  8. for (int i = 0; i < 9; i++) {
  9. addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 111));
  10. }
  11. }

代码示例来源:origin: CoFH/ThermalDynamics

  1. protected void addPlayerInventory(InventoryPlayer inventory) {
  2. for (int i = 0; i < 3; i++) {
  3. for (int j = 0; j < 9; j++) {
  4. addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 123 + i * 18));
  5. }
  6. }
  7. for (int i = 0; i < 9; i++) {
  8. addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 181));
  9. }
  10. }

代码示例来源:origin: SonarSonic/Calculator

  1. public ContainerHungerProcessor(InventoryPlayer inventory, TileEntityHungerProcessor entity) {
  2. super(entity);
  3. this.entity = entity;
  4. addSlotToContainer(new Slot(entity, 0, 55, 34));
  5. addSlotToContainer(new Slot(entity, 1, 104, 35));
  6. addInventory(inventory, 8, 84);
  7. }

代码示例来源:origin: SonarSonic/Calculator

  1. public ContainerHealthProcessor(InventoryPlayer inventory, TileEntityHealthProcessor entity) {
  2. super(entity);
  3. this.entity = entity;
  4. addSlotToContainer(new Slot(entity, 0, 55, 34));
  5. addSlotToContainer(new Slot(entity, 1, 104, 35));
  6. addInventory(inventory, 8, 84);
  7. }

代码示例来源:origin: CoFH/CoFHCore

  1. protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
  2. int xOffset = getPlayerInventoryHorizontalOffset();
  3. int yOffset = getPlayerInventoryVerticalOffset();
  4. for (int i = 0; i < 3; i++) {
  5. for (int j = 0; j < 9; j++) {
  6. addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, xOffset + j * 18, yOffset + i * 18));
  7. }
  8. }
  9. for (int i = 0; i < 9; i++) {
  10. addSlotToContainer(new Slot(inventoryPlayer, i, xOffset + i * 18, yOffset + 58));
  11. }
  12. }

代码示例来源:origin: Ellpeck/ActuallyAdditions

  1. public ContainerCanolaPress(InventoryPlayer inventory, TileEntityBase tile){
  2. this.press = (TileEntityCanolaPress)tile;
  3. this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.press.inv, 0, 81, 10));
  4. for(int i = 0; i < 3; i++){
  5. for(int j = 0; j < 9; j++){
  6. this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
  7. }
  8. }
  9. for(int i = 0; i < 9; i++){
  10. this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
  11. }
  12. }

代码示例来源:origin: WayofTime/BloodMagic

  1. public ContainerTeleposer(InventoryPlayer inventoryPlayer, IInventory tileTeleposer) {
  2. this.tileTeleposer = tileTeleposer;
  3. this.addSlotToContainer(new SlotTeleposer(tileTeleposer, 0, 80, 33));
  4. for (int i = 0; i < 3; i++) {
  5. for (int j = 0; j < 9; j++) {
  6. addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 57 + i * 18));
  7. }
  8. }
  9. for (int i = 0; i < 9; i++) {
  10. addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 115));
  11. }
  12. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. protected void addMachineSlots(@Nonnull InventoryPlayer playerInv) {
  3. if (((TileBuffer) getInv().getOwner()).hasInventory()) {
  4. Point point = new Point(((TileBuffer) getInv().getOwner()).hasPower() ? 96 : 62, 15);
  5. for (int i = 0; i < 9; i++) {
  6. addSlotToContainer(new Slot(this.getInv(), i, point.x + ((i % 3) * 18), point.y + ((i / 3) * 18)));
  7. }
  8. }
  9. }

代码示例来源:origin: ForestryMC/ForestryMC

  1. @Override
  2. protected void addHotbarSlot(InventoryPlayer playerInventory, int slot, int x, int y) {
  3. ItemStack stackInSlot = playerInventory.getStackInSlot(slot);
  4. if (inventory.isParentItemInventory(stackInSlot)) {
  5. addSlotToContainer(new SlotLocked(playerInventory, slot, x, y));
  6. } else {
  7. addSlotToContainer(new Slot(playerInventory, slot, x, y));
  8. }
  9. }

代码示例来源:origin: PrinceOfAmber/Cyclic

  1. protected void bindPlayerHotbar(InventoryPlayer inventoryPlayer) {
  2. for (int i = 0; i < 9; i++) {
  3. addSlotToContainer(new Slot(inventoryPlayer, i, getScreenSize().playerOffsetX() + i * Const.SQ, getScreenSize().playerOffsetY() + Const.PAD / 2 + 3 * Const.SQ));
  4. }
  5. }
  6. }

代码示例来源:origin: vadis365/TheErebus

  1. public ContainerUmberFurnace(InventoryPlayer inventory, TileEntityUmberFurnace tile) {
  2. furnace = tile;
  3. addSlotToContainer(new SlotFluidContainer(tile, 0, 31, 35));
  4. addSlotToContainer(new SlotSmelt(tile, 1, 56, 17));
  5. addSlotToContainer(new SlotFuel(tile, 2, 56, 53));
  6. addSlotToContainer(new SlotFurnaceOutput(inventory.player, tile, 3, 116, 35));
  7. for (int i = 0; i < 3; ++i)
  8. for (int j = 0; j < 9; ++j)
  9. addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
  10. for (int i = 0; i < 9; ++i)
  11. addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
  12. }

相关文章