本文整理汇总了Java中net.minecraft.inventory.SlotFurnaceFuel类的典型用法代码示例。如果您正苦于以下问题:Java SlotFurnaceFuel类的具体用法?Java SlotFurnaceFuel怎么用?Java SlotFurnaceFuel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SlotFurnaceFuel类属于net.minecraft.inventory包,在下文中一共展示了SlotFurnaceFuel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isStackValidForSlot
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
private boolean isStackValidForSlot(int index, @Nonnull ItemStack stack)
{
if (!slotChecksEnabled)
return true;
if (type.isOutputSlot(index))
{
return false;
} else if (type.isInputSlot(index))
{
return true;
} else
{
return TileEntityFurnace.isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack);
}
}
示例2: isItemValidForSlot
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
* guis use Slot.isItemValid
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
if (index == 2)
{
return false;
}
else if (index != 1)
{
return true;
}
else
{
ItemStack itemstack = (ItemStack)this.furnaceItemStacks.get(1);
return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && itemstack.getItem() != Items.BUCKET;
}
}
示例3: ContainerAmmoFurnace
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
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));
}
示例4: isItemValidForSlot
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. For
* guis use Slot.isItemValid
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
if (index == 2)
{
return false;
}
else if (index != 1)
{
return true;
}
else
{
ItemStack itemstack = this.furnaceItemStacks[1];
return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && (itemstack == null || itemstack.getItem() != Items.BUCKET);
}
}
示例5: ContainerAlloyFurnace
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public ContainerAlloyFurnace(InventoryPlayer p_i45794_1_, IInventory furnaceInventory) {
this.tileFurnace = furnaceInventory;
this.addSlotToContainer(new Slot(furnaceInventory, 0, 35, 17));
this.addSlotToContainer(new Slot(furnaceInventory, 1, 53, 17));
this.addSlotToContainer(new SlotFurnaceFuel(furnaceInventory, 2, 44, 53));
this.addSlotToContainer(new SlotFurnaceOutput(p_i45794_1_.player, furnaceInventory, 3, 116, 35));
int i;
for (i = 0; i < 3; ++i) {
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(p_i45794_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(p_i45794_1_, i, 8 + i * 18, 142));
}
}
示例6: addSlots
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
private void addSlots() {
this.addSlotToContainer(new Slot(tileFurnace, 0, 56, 17));
this.addSlotToContainer(new SlotFurnaceFuel(tileFurnace, 1, 56, 53));
this.addSlotToContainer(new SlotFurnaceOutput(playerInventory.player, tileFurnace, 2, 116, 35));
// Adds the player inventory to furnace's gui.
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(playerInventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
}
}
// Adds the player hotbar slots to the gui.
for (int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(playerInventory, i, 8 + i * 18, 142)); // 198
}
}
示例7: ContainerFurnace
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public ContainerFurnace(InventoryPlayer inventory, IInventory te)
{
this.furnace = te;
this.addSlotToContainer(new Slot(te, 0, 56, 17));
this.addSlotToContainer(new SlotFurnaceFuel(te, 1, 56, 53));
this.addSlotToContainer(new SlotFurnaceOutput(inventory.player, te, 2, 116, 35));
int i;
for(i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for(i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142));
}
}
示例8: isItemValidForSlot
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
/**
* Returns true if automation is allowed to insert the given stack (ignoring
* stack size) into the given slot.
*/
@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
if (index > 9)
return false;
else if (index != 9)
return true;
else {
ItemStack itemstack = this.furnaceItemStacks.get(9);
return isItemFuel(stack)
|| SlotFurnaceFuel.isBucket(stack) && (itemstack.isEmpty() || itemstack.getItem() != Items.BUCKET);
}
}
示例9: ContainerRefinery
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public ContainerRefinery(InventoryPlayer playerInv, TileEntityRefinery te) {
this.te = te;
sync = new FluidSynchronizer(() -> te.getTankIn().getFluid(), () -> te.getTankOut1().getFluid(), () -> te.getTankOut2().getFluid(), () -> te.getTankOut3().getFluid());
addSlotToContainer(new SlotFurnaceFuel(te, 0, 49, 63));
addSlotToContainer(new SlotFurnaceFuel(te, 1, 30, 27));
addSlotToContainer(new SlotFurnaceFuel(te, 2, 30, 45));
addSlotToContainer(new SlotFurnaceFuel(te, 3, 30, 63));
addPlayerSlots(playerInv, 8, 94);
}
示例10: ContainerFurnaceGenerator
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public ContainerFurnaceGenerator(InventoryPlayer inv, TileFurnaceGenerator generator){
this.generator = generator;
addSlotToContainer(new SlotItemHandler(generator, 0, 80, 34){
@Override
public boolean isItemValid(ItemStack stack) {
return SlotFurnaceFuel.isBucket(stack) || TileEntityFurnace.isItemFuel(stack);
}
}); // Nice and centered :P
for(int i = 0; i<3; ++i) for(int j = 0; j<9; ++j) addSlotToContainer(new Slot(inv, j+i*9+9, 8+j*18, 84+i*18));
for(int i = 0; i<9; ++i) addSlotToContainer(new Slot(inv, i, 8+i*18, 142));
}
示例11: ContainerFractionalDistiller
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public ContainerFractionalDistiller(InventoryPlayer inventoryPlayer, TileEntityFractionalDistillation fractionaldistiller) {
this.fractionaldistiller = fractionaldistiller;
lastValue = new int[this.fractionaldistiller.getFieldCount()];
addSlotToContainer(new SlotFurnaceFuel(fractionaldistiller, 0, 80, 108));
addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 1, 126, 90));
if (fractionaldistiller.hasSlot(2)) {
addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 2, 126, 66));
isSlot3Active = true;
}
if (fractionaldistiller.hasSlot(3)) {
addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 3, 126, 48));
isSlot3Active = true;
}
if (fractionaldistiller.hasSlot(4)) {
addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 4, 126, 30));
isSlot4Active = true;
}
if (fractionaldistiller.hasSlot(5)) {
addSlotToContainer(new SlotFractionalDistllerBucket(fractionaldistiller, 5, 126, 12));
isSlot5Active = true;
}
//
// for (int i = 0; i < 1; i++) {
// for (int j = 0; j < 1; j++) {
// addSlotToContainer(new Slot(fractionaldistiller, j + i * 9, 8 + j * 18, 18 + i * 18));
// }
// }
// commonly used vanilla code that adds the player's inventory
bindPlayerInventory(inventoryPlayer);
}
示例12: ContainerDistiller
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public ContainerDistiller(InventoryPlayer inventoryPlayer, TileEntityDistiller distiller) {
this.distiller = distiller;
lastFuelStorage = -1;
lastRemainBurnTime = -1;
for (int i = 0; i < 1; i++) {
for (int j = 0; j < 1; j++) {
addSlotToContainer(new SlotFurnaceFuel(distiller, j + i * 9, 8 + j * 18, 18 + i * 18));
}
}
// commonly used vanilla code that adds the player's inventory
bindPlayerInventory(inventoryPlayer);
}
示例13: CSteamFurnace
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
public CSteamFurnace(InventoryPlayer playerInv, IInventory furnaceInv) {
this.furnaceInv = furnaceInv;
this.addSlotToContainer(new SlotFurnaceFuel(furnaceInv, 0, 80, 41));
this.addSlotToContainer(new SLimitedSlot(new Item[] { Items.bucket, Items.water_bucket }, 1, furnaceInv, 1, 26, 61));
int i, j;
for (i = 0; i < 3; ++i) {
for (j = 0; j < 9; ++j) {
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
}
}
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
}
}
示例14: isItemValidForSlot
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
if (slot == 2)
return false;
else if (slot != 1)
return true;
else {
final ItemStack itemStack = slots.get(1);
return isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack) && (itemStack == ItemStack.EMPTY || itemStack.getItem() != Items.BUCKET);
}
}
示例15: isItemValidForSlot
import net.minecraft.inventory.SlotFurnaceFuel; //导入依赖的package包/类
/**
* Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
*/
public boolean isItemValidForSlot(int index, ItemStack stack)
{
return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotFurnaceFuel.isBucket(stack));
}