本文整理汇总了Java中net.minecraft.inventory.AnimalChest类的典型用法代码示例。如果您正苦于以下问题:Java AnimalChest类的具体用法?Java AnimalChest怎么用?Java AnimalChest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnimalChest类属于net.minecraft.inventory包,在下文中一共展示了AnimalChest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initHorseChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void initHorseChest()
{
AnimalChest animalchest = this.horseChest;
this.horseChest = new AnimalChest("HorseChest", this.getChestSize());
this.horseChest.setCustomName(this.getName());
if (animalchest != null)
{
animalchest.func_110132_b(this);
int i = Math.min(animalchest.getSizeInventory(), this.horseChest.getSizeInventory());
for (int j = 0; j < i; ++j)
{
ItemStack itemstack = animalchest.getStackInSlot(j);
if (itemstack != null)
{
this.horseChest.setInventorySlotContents(j, itemstack.copy());
}
}
}
this.horseChest.func_110134_a(this);
this.updateHorseSlots();
}
示例2: initHorseChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void initHorseChest()
{
AnimalChest animalchest = this.horseChest;
this.horseChest = new AnimalChest("HorseChest", this.getChestSize());
this.horseChest.setCustomName(this.getName());
if (animalchest != null)
{
animalchest.removeInventoryChangeListener(this);
int i = Math.min(animalchest.getSizeInventory(), this.horseChest.getSizeInventory());
for (int j = 0; j < i; ++j)
{
ItemStack itemstack = animalchest.getStackInSlot(j);
if (itemstack != null)
{
this.horseChest.setInventorySlotContents(j, itemstack.copy());
}
}
}
this.horseChest.addInventoryChangeListener(this);
this.updateHorseSlots();
this.itemHandler = new net.minecraftforge.items.wrapper.InvWrapper(this.horseChest);
}
示例3: chestInit
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void chestInit()
{
//Compare To: @EntityHorse
AnimalChest animalchest = this.turtleChest;
this.turtleChest = new AnimalChest("TurtleChest", this.getChestSize());
this.turtleChest.setCustomName(this.getName());
if (animalchest != null)
{
animalchest.func_110132_b(this);
int i = Math.min(animalchest.getSizeInventory(), this.turtleChest.getSizeInventory());
for (int j = 0; j < i; ++j)
{
ItemStack itemstack = animalchest.getStackInSlot(j);
if (itemstack != null)
{
this.turtleChest.setInventorySlotContents(j, itemstack.copy());
}
}
}
this.turtleChest.func_110134_a(this);
this.updateWatcheables();
}
示例4: dropItemsInChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void dropItemsInChest(Entity p_110240_1_, AnimalChest p_110240_2_)
{
//Compare To: @EntityHorse
if (p_110240_2_ != null && !this.worldObj.isRemote)
{
for (int i = 0; i < p_110240_2_.getSizeInventory(); ++i)
{
ItemStack itemstack = p_110240_2_.getStackInSlot(i);
if (itemstack != null)
{
this.entityDropItem(itemstack, 0.0F);
}
}
}
}
示例5: func_110226_cD
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void func_110226_cD() {
AnimalChest animalchest = this.horseChest;
this.horseChest = new AnimalChest("HorseChest", this.func_110225_cC());
this.horseChest.func_110133_a(this.getCommandSenderName());
if (animalchest != null) {
animalchest.func_110132_b(this);
int i = Math.min(animalchest.getSizeInventory(), this.horseChest.getSizeInventory());
for (int j = 0; j < i; ++j) {
ItemStack itemstack = animalchest.getStackInSlot(j);
if (itemstack != null) {
this.horseChest.setInventorySlotContents(j, itemstack.copy());
}
}
animalchest = null;
}
this.horseChest.func_110134_a(this);
this.func_110232_cE();
}
示例6: func_110226_cD
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void func_110226_cD() {
AnimalChest var1 = this.field_110296_bG;
this.field_110296_bG = new AnimalChest("HorseChest", this.func_110225_cC());
this.field_110296_bG.func_110133_a(this.func_70023_ak());
if(var1 != null) {
var1.func_110132_b(this);
int var2 = Math.min(var1.func_70302_i_(), this.field_110296_bG.func_70302_i_());
for(int var3 = 0; var3 < var2; ++var3) {
ItemStack var4 = var1.func_70301_a(var3);
if(var4 != null) {
this.field_110296_bG.func_70299_a(var3, var4.func_77946_l());
}
}
var1 = null;
}
this.field_110296_bG.func_110134_a(this);
this.func_110232_cE();
}
示例7: createCamelChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void createCamelChest()
{
AnimalChest animalchest = this.camelChest;
this.camelChest = new AnimalChest("CamelChest", 17);
this.camelChest.func_110133_a(this.getCommandSenderName());
if (animalchest != null)
{
animalchest.func_110132_b((IInvBasic) this);
int i = Math.min(animalchest.getSizeInventory(), this.camelChest.getSizeInventory());
for (int j = 0; j < i; ++j)
{
ItemStack itemstack = animalchest.getStackInSlot(j);
if (itemstack != null)
{
this.camelChest.setInventorySlotContents(j, itemstack.copy());
}
}
animalchest = null;
}
this.camelChest.func_110134_a((IInvBasic) this);
}
示例8: ContainerMechInventory
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
public ContainerMechInventory(InventoryPlayer inventory, AnimalChest mechChest, EntityMech mech)
{
this.field_111243_a = mechChest;
this.theMech = mech;
byte b0 = 3;
mechChest.openChest();
int i = (b0 - 4) * 18;
this.addSlotToContainer(new ContainerMechInventorySlotChip(this, mechChest, 0, 8, 18, theMech));
int j;
int k;
for (j = 0; j < 3; ++j)
{
for (k = 0; k < 9; ++k)
{
this.addSlotToContainer(new Slot(inventory, k + j * 9 + 9, 8 + k * 18, 102 + j * 18 + i));
}
}
for (j = 0; j < 9; ++j)
{
this.addSlotToContainer(new Slot(inventory, j, 8 + j * 18, 160 + i));
}
}
示例9: dropItemsInChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void dropItemsInChest(Entity entityIn, AnimalChest animalChestIn)
{
if (animalChestIn != null && !this.worldObj.isRemote)
{
for (int i = 0; i < animalChestIn.getSizeInventory(); ++i)
{
ItemStack itemstack = animalChestIn.getStackInSlot(i);
if (itemstack != null)
{
this.entityDropItem(itemstack, 0.0F);
}
}
}
}
示例10: handleOpenWindow
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
/**
* Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table,
* Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse
*/
public void handleOpenWindow(S2DPacketOpenWindow packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
EntityPlayerSP entityplayersp = this.gameController.thePlayer;
if ("minecraft:container".equals(packetIn.getGuiId()))
{
entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
else if ("minecraft:villager".equals(packetIn.getGuiId()))
{
entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
else if ("EntityHorse".equals(packetIn.getGuiId()))
{
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityHorse)
{
entityplayersp.displayGUIHorse((EntityHorse)entity, new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
}
else if (!packetIn.hasSlots())
{
entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
else
{
ContainerLocalMenu containerlocalmenu = new ContainerLocalMenu(packetIn.getGuiId(), packetIn.getWindowTitle(), packetIn.getSlotCount());
entityplayersp.displayGUIChest(containerlocalmenu);
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
}
示例11: handleOpenWindow
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
/**
* Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace,
* Dispenser, Enchanting table, Brewing stand, Villager merchant, Beacon, Anvil,
* Hopper, Dropper, Horse
*/
public void handleOpenWindow(S2DPacketOpenWindow packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
EntityPlayerSP entityplayersp = this.gameController.thePlayer;
if ("minecraft:container".equals(packetIn.getGuiId())) {
entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
} else if ("minecraft:villager".equals(packetIn.getGuiId())) {
entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
} else if ("EntityHorse".equals(packetIn.getGuiId())) {
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityHorse) {
entityplayersp.displayGUIHorse((EntityHorse) entity,
new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
} else if (!packetIn.hasSlots()) {
entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
} else {
ContainerLocalMenu containerlocalmenu = new ContainerLocalMenu(packetIn.getGuiId(),
packetIn.getWindowTitle(), packetIn.getSlotCount());
entityplayersp.displayGUIChest(containerlocalmenu);
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
}
示例12: handleOpenWindow
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
/**
* Displays a GUI by ID. In order starting from id 0: Chest, Workbench, Furnace, Dispenser, Enchanting table,
* Brewing stand, Villager merchant, Beacon, Anvil, Hopper, Dropper, Horse
*/
public void handleOpenWindow(SPacketOpenWindow packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
EntityPlayerSP entityplayersp = this.gameController.thePlayer;
if ("minecraft:container".equals(packetIn.getGuiId()))
{
entityplayersp.displayGUIChest(new InventoryBasic(packetIn.getWindowTitle(), packetIn.getSlotCount()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
else if ("minecraft:villager".equals(packetIn.getGuiId()))
{
entityplayersp.displayVillagerTradeGui(new NpcMerchant(entityplayersp, packetIn.getWindowTitle()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
else if ("EntityHorse".equals(packetIn.getGuiId()))
{
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityHorse)
{
entityplayersp.openGuiHorseInventory((EntityHorse)entity, new AnimalChest(packetIn.getWindowTitle(), packetIn.getSlotCount()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
}
else if (!packetIn.hasSlots())
{
entityplayersp.displayGui(new LocalBlockIntercommunication(packetIn.getGuiId(), packetIn.getWindowTitle()));
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
else
{
IInventory iinventory = new ContainerLocalMenu(packetIn.getGuiId(), packetIn.getWindowTitle(), packetIn.getSlotCount());
entityplayersp.displayGUIChest(iinventory);
entityplayersp.openContainer.windowId = packetIn.getWindowId();
}
}
示例13: func_110226_cD
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void func_110226_cD()
{
AnimalChest var1 = this.horseChest;
this.horseChest = new AnimalChest("HorseChest", this.func_110225_cC());
this.horseChest.func_110133_a(this.getCommandSenderName());
if (var1 != null)
{
var1.func_110132_b(this);
int var2 = Math.min(var1.getSizeInventory(), this.horseChest.getSizeInventory());
for (int var3 = 0; var3 < var2; ++var3)
{
ItemStack var4 = var1.getStackInSlot(var3);
if (var4 != null)
{
this.horseChest.setInventorySlotContents(var3, var4.copy());
}
}
var1 = null;
}
this.horseChest.func_110134_a(this);
this.func_110232_cE();
}
示例14: dropItemsInChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void dropItemsInChest(Entity par1Entity, AnimalChest par2AnimalChest)
{
if (par2AnimalChest != null && !this.worldObj.isClient)
{
for (int var3 = 0; var3 < par2AnimalChest.getSizeInventory(); ++var3)
{
ItemStack var4 = par2AnimalChest.getStackInSlot(var3);
if (var4 != null)
{
this.entityDropItem(var4, 0.0F);
}
}
}
}
示例15: dropItemsInChest
import net.minecraft.inventory.AnimalChest; //导入依赖的package包/类
private void dropItemsInChest(Entity par1Entity, AnimalChest par2AnimalChest) {
if (par2AnimalChest != null && !this.worldObj.isRemote) {
for (int i = 0; i < par2AnimalChest.getSizeInventory(); ++i) {
ItemStack itemstack = par2AnimalChest.getStackInSlot(i);
if (itemstack != null) {
this.entityDropItem(itemstack, 0.0F);
}
}
}
}