本文整理汇总了Java中net.minecraft.server.TileEntityBrewingStand类的典型用法代码示例。如果您正苦于以下问题:Java TileEntityBrewingStand类的具体用法?Java TileEntityBrewingStand怎么用?Java TileEntityBrewingStand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileEntityBrewingStand类属于net.minecraft.server包,在下文中一共展示了TileEntityBrewingStand类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getType
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
public InventoryType getType() {
// Thanks to Droppers extending Dispensers, order is important.
if (inventory instanceof InventoryCrafting) {
return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
} else if (inventory instanceof PlayerInventory) {
return InventoryType.PLAYER;
} else if (inventory instanceof TileEntityDropper) {
return InventoryType.DROPPER;
} else if (inventory instanceof TileEntityDispenser) {
return InventoryType.DISPENSER;
} else if (inventory instanceof TileEntityFurnace) {
return InventoryType.FURNACE;
} else if (inventory instanceof ContainerEnchantTableInventory) {
return InventoryType.ENCHANTING;
} else if (inventory instanceof TileEntityBrewingStand) {
return InventoryType.BREWING;
} else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
} else if (inventory instanceof InventoryEnderChest) {
return InventoryType.ENDER_CHEST;
} else if (inventory instanceof InventoryMerchant) {
return InventoryType.MERCHANT;
} else if (inventory instanceof TileEntityBeacon) {
return InventoryType.BEACON;
} else if (inventory instanceof ContainerAnvilInventory) {
return InventoryType.ANVIL;
} else if (inventory instanceof IHopper) {
return InventoryType.HOPPER;
} else {
return InventoryType.CHEST;
}
}
示例2: getType
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
public InventoryType getType() {
// Thanks to Droppers extending Dispensers, order is important.
if (inventory instanceof InventoryCrafting) {
return inventory.getSize() >= 9 ? InventoryType.WORKBENCH : InventoryType.CRAFTING;
} else if (inventory instanceof PlayerInventory) {
return InventoryType.PLAYER;
} else if (inventory instanceof TileEntityDropper) {
return InventoryType.DROPPER;
} else if (inventory instanceof TileEntityDispenser) {
return InventoryType.DISPENSER;
} else if (inventory instanceof TileEntityFurnace) {
return InventoryType.FURNACE;
} else if (this instanceof CraftInventoryEnchanting) {
return InventoryType.ENCHANTING;
} else if (inventory instanceof TileEntityBrewingStand) {
return InventoryType.BREWING;
} else if (inventory instanceof CraftInventoryCustom.MinecraftInventory) {
return ((CraftInventoryCustom.MinecraftInventory) inventory).getType();
} else if (inventory instanceof InventoryEnderChest) {
return InventoryType.ENDER_CHEST;
} else if (inventory instanceof InventoryMerchant) {
return InventoryType.MERCHANT;
} else if (inventory instanceof TileEntityBeacon) {
return InventoryType.BEACON;
} else if (this instanceof CraftInventoryAnvil) {
return InventoryType.ANVIL;
} else if (inventory instanceof IHopper) {
return InventoryType.HOPPER;
} else {
return InventoryType.CHEST;
}
}
示例3: openInventory
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
public InventoryView openInventory(Inventory inventory) {
if(!(getHandle() instanceof EntityPlayer)) return null;
EntityPlayer player = (EntityPlayer) getHandle();
InventoryType type = inventory.getType();
Container formerContainer = getHandle().activeContainer;
// TODO: Should we check that it really IS a CraftInventory first?
CraftInventory craftinv = (CraftInventory) inventory;
switch(type) {
case PLAYER:
case CHEST:
case ENDER_CHEST:
getHandle().openContainer(craftinv.getInventory());
break;
case DISPENSER:
if (craftinv.getInventory() instanceof TileEntityDispenser) {
getHandle().openDispenser((TileEntityDispenser) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 3);
}
break;
case FURNACE:
if (craftinv.getInventory() instanceof TileEntityFurnace) {
getHandle().openFurnace((TileEntityFurnace) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 2);
}
break;
case WORKBENCH:
openCustomInventory(inventory, player, 1);
break;
case BREWING:
if (craftinv.getInventory() instanceof TileEntityBrewingStand) {
getHandle().openBrewingStand((TileEntityBrewingStand) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 5);
}
break;
case ENCHANTING:
openCustomInventory(inventory, player, 4);
break;
case HOPPER:
if (craftinv.getInventory() instanceof TileEntityHopper) {
getHandle().openHopper((TileEntityHopper) craftinv.getInventory());
} else if (craftinv.getInventory() instanceof EntityMinecartHopper) {
getHandle().openMinecartHopper((EntityMinecartHopper) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 9);
}
break;
case CREATIVE:
case CRAFTING:
throw new IllegalArgumentException("Can't open a " + type + " inventory!");
}
if (getHandle().activeContainer == formerContainer) {
return null;
}
getHandle().activeContainer.checkReachable = false;
return getHandle().activeContainer.getBukkitView();
}
示例4: CraftBrewingStand
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
public CraftBrewingStand(Block block) {
super(block);
brewingStand = (TileEntityBrewingStand) ((CraftWorld) block.getWorld()).getTileEntityAt(getX(), getY(), getZ());
}
示例5: getTileEntity
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
@Override
public TileEntityBrewingStand getTileEntity() {
return brewingStand;
}
示例6: setBlockState
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
@Override
public void setBlockState(BlockState blockState) {
Validate.notNull(blockState, "blockState must not be null");
TileEntity te = ((CraftBlockState) blockState).getTileEntity();
Validate.notNull(te, "Invalid blockState");
boolean valid;
switch (material) {
case SIGN:
case SIGN_POST:
case WALL_SIGN:
valid = te instanceof TileEntitySign;
break;
case CHEST:
case TRAPPED_CHEST:
valid = te instanceof TileEntityChest;
break;
case BURNING_FURNACE:
case FURNACE:
valid = te instanceof TileEntityFurnace;
break;
case DISPENSER:
valid = te instanceof TileEntityDispenser;
break;
case DROPPER:
valid = te instanceof TileEntityDropper;
break;
case HOPPER:
valid = te instanceof TileEntityHopper;
break;
case MOB_SPAWNER:
valid = te instanceof TileEntityMobSpawner;
break;
case NOTE_BLOCK:
valid = te instanceof TileEntityNote;
break;
case JUKEBOX:
valid = te instanceof BlockJukeBox.TileEntityRecordPlayer;
break;
case BREWING_STAND:
valid = te instanceof TileEntityBrewingStand;
break;
case SKULL:
valid = te instanceof TileEntitySkull;
break;
case COMMAND:
valid = te instanceof TileEntityCommand;
break;
case BEACON:
valid = te instanceof TileEntityBeacon;
break;
case BANNER:
case WALL_BANNER:
case STANDING_BANNER:
valid = te instanceof TileEntityBanner;
break;
default:
valid = false;
break;
}
Validate.isTrue(valid, "Invalid blockState for " + material);
blockEntityTag = new NBTTagCompound();
te.b(blockEntityTag);
}
示例7: setBlockState
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
@Override
public void setBlockState(BlockState blockState) {
Validate.notNull(blockState, "blockState must not be null");
TileEntity te = ((CraftBlockState) blockState).getTileEntity();
Validate.notNull(te, "Invalid blockState");
boolean valid;
switch (material) {
case SIGN:
case SIGN_POST:
case WALL_SIGN:
valid = te instanceof TileEntitySign;
break;
case CHEST:
case TRAPPED_CHEST:
valid = te instanceof TileEntityChest;
break;
case BURNING_FURNACE:
case FURNACE:
valid = te instanceof TileEntityFurnace;
break;
case DISPENSER:
valid = te instanceof TileEntityDispenser;
break;
case DROPPER:
valid = te instanceof TileEntityDropper;
break;
case END_GATEWAY:
valid = te instanceof TileEntityEndGateway;
break;
case HOPPER:
valid = te instanceof TileEntityHopper;
break;
case MOB_SPAWNER:
valid = te instanceof TileEntityMobSpawner;
break;
case NOTE_BLOCK:
valid = te instanceof TileEntityNote;
break;
case JUKEBOX:
valid = te instanceof BlockJukeBox.TileEntityRecordPlayer;
break;
case BREWING_STAND:
valid = te instanceof TileEntityBrewingStand;
break;
case SKULL:
valid = te instanceof TileEntitySkull;
break;
case COMMAND:
case COMMAND_REPEATING:
case COMMAND_CHAIN:
valid = te instanceof TileEntityCommand;
break;
case BEACON:
valid = te instanceof TileEntityBeacon;
break;
case SHIELD:
case BANNER:
case WALL_BANNER:
case STANDING_BANNER:
valid = te instanceof TileEntityBanner;
break;
case FLOWER_POT_ITEM:
valid = te instanceof TileEntityFlowerPot;
break;
default:
valid = false;
break;
}
Validate.isTrue(valid, "Invalid blockState for " + material);
blockEntityTag = new NBTTagCompound();
te.save(blockEntityTag);
}
示例8: openInventory
import net.minecraft.server.TileEntityBrewingStand; //导入依赖的package包/类
public InventoryView openInventory(Inventory inventory) {
if(!(getHandle() instanceof EntityPlayer)) return null;
EntityPlayer player = (EntityPlayer) getHandle();
InventoryType type = inventory.getType();
Container formerContainer = getHandle().activeContainer;
// TODO: Should we check that it really IS a CraftInventory first?
CraftInventory craftinv = (CraftInventory) inventory;
switch(type) {
case PLAYER:
case CHEST:
case ENDER_CHEST:
getHandle().openContainer(craftinv.getInventory());
break;
case DISPENSER:
if (craftinv.getInventory() instanceof TileEntityDispenser) {
getHandle().openDispenser((TileEntityDispenser) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 3);
}
break;
case FURNACE:
if (craftinv.getInventory() instanceof TileEntityFurnace) {
getHandle().openFurnace((TileEntityFurnace) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 2);
}
break;
case WORKBENCH:
openCustomInventory(inventory, player, 1);
break;
case BREWING:
if (craftinv.getInventory() instanceof TileEntityBrewingStand) {
getHandle().openBrewingStand((TileEntityBrewingStand) craftinv.getInventory());
} else {
openCustomInventory(inventory, player, 5);
}
break;
case ENCHANTING:
openCustomInventory(inventory, player, 4);
break;
case HOPPER:
if (craftinv.getInventory() instanceof TileEntityHopper) {
getHandle().openHopper((TileEntityHopper) craftinv.getInventory());
} else if (craftinv.getInventory() instanceof EntityMinecartHopper) {
getHandle().openMinecartHopper((EntityMinecartHopper) craftinv.getInventory());
}
break;
case CREATIVE:
case CRAFTING:
throw new IllegalArgumentException("Can't open a " + type + " inventory!");
}
if (getHandle().activeContainer == formerContainer) {
return null;
}
getHandle().activeContainer.checkReachable = false;
return getHandle().activeContainer.getBukkitView();
}