本文整理了Java中net.minecraft.inventory.Slot.<init>()
方法的一些代码示例,展示了Slot.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Slot.<init>()
方法的具体详情如下:
包路径:net.minecraft.inventory.Slot
类名称:Slot
方法名:<init>
暂无
代码示例来源:origin: Vazkii/Botania
public ContainerFlowerBag(InventoryPlayer playerInv, InventoryFlowerBag flowerBagInv) {
int i;
int j;
this.flowerBagInv = flowerBagInv;
for(i = 0; i < 2; ++i)
for(j = 0; j < 8; ++j) {
int k = j + i * 8;
addSlotToContainer(new SlotItemHandler(flowerBagInv, k, 17 + j * 18, 26 + i * 18));
}
for(i = 0; i < 3; ++i)
for(j = 0; j < 9; ++j)
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for(i = 0; i < 9; ++i) {
if(playerInv.getStackInSlot(i) == flowerBagInv.bag)
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
}
}
代码示例来源:origin: SlimeKnights/TinkersConstruct
this.addSlotToContainer(input1 = new Slot(craftMatrix, 0, 48, 26));
this.addSlotToContainer(input2 = new Slot(craftMatrix, 1, 48, 44));
代码示例来源:origin: SlimeKnights/TinkersConstruct
this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 3, 30 + j * 18, 17 + i * 18));
代码示例来源:origin: Vazkii/Botania
public ContainerBaubleBox(EntityPlayer player, InventoryBaubleBox boxInv) {
int i;
int j;
IInventory playerInv = player.inventory;
baubleBoxInv = boxInv;
baubles = BaublesApi.getBaublesHandler(player);
addSlotToContainer(new SlotBauble(player, baubles, 0, 8, 8 + 0 * 18));
addSlotToContainer(new SlotBauble(player, baubles, 1, 8, 8 + 1 * 18));
addSlotToContainer(new SlotBauble(player, baubles, 2, 8, 8 + 2 * 18));
addSlotToContainer(new SlotBauble(player, baubles, 3, 8, 8 + 3 * 18));
addSlotToContainer(new SlotBauble(player, baubles, 4, 27, 8 + 0 * 18));
addSlotToContainer(new SlotBauble(player, baubles, 5, 27, 8 + 1 * 18));
addSlotToContainer(new SlotBauble(player, baubles, 6, 27, 8 + 2 * 18));
for(i = 0; i < 4; ++i)
for(j = 0; j < 6; ++j) {
int k = j + i * 6;
addSlotToContainer(new SlotItemHandler(baubleBoxInv, k, 62 + j * 18, 8 + i * 18));
}
for(i = 0; i < 3; ++i)
for(j = 0; j < 9; ++j)
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for(i = 0; i < 9; ++i) {
if(playerInv.getStackInSlot(i) == baubleBoxInv.box)
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
}
}
代码示例来源:origin: CoFH/ThermalExpansion
public ContainerItemCollector(InventoryPlayer inventory, TileEntity tile) {
super(inventory, tile);
myTile = (TileItemCollector) tile;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
addSlotToContainer(new Slot(myTile, j + i * 3, 62 + j * 18, 17 + i * 18));
}
}
}
代码示例来源:origin: ExtraCells/ExtraCells2
protected void bindPlayerInventory(IInventory inventoryPlayer) {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(inventoryPlayer,
j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (int i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18,
142));
}
}
代码示例来源:origin: ExtraCells/ExtraCells2
protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
8 + j * 18, i * 18 + 84));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
}
}
代码示例来源:origin: ExtraCells/ExtraCells2
protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9,
8 + j * 18, i * 18 + 84));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
}
}
代码示例来源:origin: Nividica/ThaumicEnergistics
protected void bindPlayerInventory(InventoryPlayer player, int offsetX, int offsetY) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(player, 9 * i + j + 9, offsetX + 8 + 18 * j, offsetY + 2 + 18 * i));
}
}
for (int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(player, i, offsetX + 8 + 18 * i, offsetY + 60));
}
}
代码示例来源:origin: CoFH/ThermalDynamics
@Override
protected void addPlayerInventory(InventoryPlayer inventory) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 53 + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 111));
}
}
代码示例来源:origin: CoFH/ThermalDynamics
protected void addPlayerInventory(InventoryPlayer inventory) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 123 + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 181));
}
}
代码示例来源:origin: SonarSonic/Calculator
public ContainerHungerProcessor(InventoryPlayer inventory, TileEntityHungerProcessor entity) {
super(entity);
this.entity = entity;
addSlotToContainer(new Slot(entity, 0, 55, 34));
addSlotToContainer(new Slot(entity, 1, 104, 35));
addInventory(inventory, 8, 84);
}
代码示例来源:origin: SonarSonic/Calculator
public ContainerHealthProcessor(InventoryPlayer inventory, TileEntityHealthProcessor entity) {
super(entity);
this.entity = entity;
addSlotToContainer(new Slot(entity, 0, 55, 34));
addSlotToContainer(new Slot(entity, 1, 104, 35));
addInventory(inventory, 8, 84);
}
代码示例来源:origin: CoFH/CoFHCore
protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) {
int xOffset = getPlayerInventoryHorizontalOffset();
int yOffset = getPlayerInventoryVerticalOffset();
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, xOffset + j * 18, yOffset + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventoryPlayer, i, xOffset + i * 18, yOffset + 58));
}
}
代码示例来源:origin: Ellpeck/ActuallyAdditions
public ContainerCanolaPress(InventoryPlayer inventory, TileEntityBase tile){
this.press = (TileEntityCanolaPress)tile;
this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.press.inv, 0, 81, 10));
for(int i = 0; i < 3; i++){
for(int j = 0; j < 9; j++){
this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18));
}
}
for(int i = 0; i < 9; i++){
this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155));
}
}
代码示例来源:origin: WayofTime/BloodMagic
public ContainerTeleposer(InventoryPlayer inventoryPlayer, IInventory tileTeleposer) {
this.tileTeleposer = tileTeleposer;
this.addSlotToContainer(new SlotTeleposer(tileTeleposer, 0, 80, 33));
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 57 + i * 18));
}
}
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 115));
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
protected void addMachineSlots(@Nonnull InventoryPlayer playerInv) {
if (((TileBuffer) getInv().getOwner()).hasInventory()) {
Point point = new Point(((TileBuffer) getInv().getOwner()).hasPower() ? 96 : 62, 15);
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(this.getInv(), i, point.x + ((i % 3) * 18), point.y + ((i / 3) * 18)));
}
}
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
protected void addHotbarSlot(InventoryPlayer playerInventory, int slot, int x, int y) {
ItemStack stackInSlot = playerInventory.getStackInSlot(slot);
if (inventory.isParentItemInventory(stackInSlot)) {
addSlotToContainer(new SlotLocked(playerInventory, slot, x, y));
} else {
addSlotToContainer(new Slot(playerInventory, slot, x, y));
}
}
代码示例来源:origin: PrinceOfAmber/Cyclic
protected void bindPlayerHotbar(InventoryPlayer inventoryPlayer) {
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(inventoryPlayer, i, getScreenSize().playerOffsetX() + i * Const.SQ, getScreenSize().playerOffsetY() + Const.PAD / 2 + 3 * Const.SQ));
}
}
}
代码示例来源:origin: vadis365/TheErebus
public ContainerUmberFurnace(InventoryPlayer inventory, TileEntityUmberFurnace tile) {
furnace = tile;
addSlotToContainer(new SlotFluidContainer(tile, 0, 31, 35));
addSlotToContainer(new SlotSmelt(tile, 1, 56, 17));
addSlotToContainer(new SlotFuel(tile, 2, 56, 53));
addSlotToContainer(new SlotFurnaceOutput(inventory.player, tile, 3, 116, 35));
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 9; ++j)
addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for (int i = 0; i < 9; ++i)
addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
内容来源于网络,如有侵权,请联系作者删除!