本文整理汇总了Java中net.minecraft.world.IInteractionObject类的典型用法代码示例。如果您正苦于以下问题:Java IInteractionObject类的具体用法?Java IInteractionObject怎么用?Java IInteractionObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IInteractionObject类属于net.minecraft.world包,在下文中一共展示了IInteractionObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
String s = guiOwner.getGuiID();
if ("minecraft:crafting_table".equals(s))
{
this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj));
}
else if ("minecraft:enchanting_table".equals(s))
{
this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, guiOwner));
}
else if ("minecraft:anvil".equals(s))
{
this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj));
}
}
示例2: displayGUIChest
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
/**
* Displays the GUI for interacting with a chest inventory. Args: chestInventory
*/
public void displayGUIChest(IInventory chestInventory) {
String s = chestInventory instanceof IInteractionObject ? ((IInteractionObject) chestInventory).getGuiID()
: "minecraft:container";
if ("minecraft:chest".equals(s)) {
this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
} else if ("minecraft:hopper".equals(s)) {
this.mc.displayGuiScreen(new GuiHopper(this.inventory, chestInventory));
} else if ("minecraft:furnace".equals(s)) {
this.mc.displayGuiScreen(new GuiFurnace(this.inventory, chestInventory));
} else if ("minecraft:brewing_stand".equals(s)) {
this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, chestInventory));
} else if ("minecraft:beacon".equals(s)) {
this.mc.displayGuiScreen(new GuiBeacon(this.inventory, chestInventory));
} else if (!"minecraft:dispenser".equals(s) && !"minecraft:dropper".equals(s)) {
this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
} else {
this.mc.displayGuiScreen(new GuiDispenser(this.inventory, chestInventory));
}
}
示例3: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
String s = guiOwner.getGuiID();
if ("minecraft:crafting_table".equals(s))
{
this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.world));
}
else if ("minecraft:enchanting_table".equals(s))
{
this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.world, guiOwner));
}
else if ("minecraft:anvil".equals(s))
{
this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.world));
}
}
示例4: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
if (guiOwner instanceof ILootContainer && ((ILootContainer)guiOwner).getLootTable() != null && this.isSpectator())
{
this.addChatMessage((new TextComponentTranslation("container.spectatorCantOpen", new Object[0])).setStyle((new Style()).setColor(TextFormatting.RED)));
}
else
{
this.getNextWindowId();
this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, guiOwner.getGuiID(), guiOwner.getDisplayName()));
this.openContainer = guiOwner.createContainer(this.inventory, this);
this.openContainer.windowId = this.currentWindowId;
this.openContainer.addListener(this);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.openContainer));
}
}
示例5: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
this.getNextWindowId();
this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, guiOwner.getGuiID(), guiOwner.getDisplayName()));
this.openContainer = guiOwner.createContainer(this.inventory, this);
this.openContainer.windowId = this.currentWindowId;
this.openContainer.onCraftGuiOpened(this);
}
示例6: displayGUIChest
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
/**
* Displays the GUI for interacting with a chest inventory. Args: chestInventory
*/
public void displayGUIChest(IInventory chestInventory)
{
if (this.openContainer != this.inventoryContainer)
{
this.closeScreen();
}
if (chestInventory instanceof ILockableContainer)
{
ILockableContainer ilockablecontainer = (ILockableContainer)chestInventory;
if (ilockablecontainer.isLocked() && !this.canOpen(ilockablecontainer.getLockCode()) && !this.isSpectator())
{
this.playerNetServerHandler.sendPacket(new S02PacketChat(new ChatComponentTranslation("container.isLocked", new Object[] {chestInventory.getDisplayName()}), (byte)2));
this.playerNetServerHandler.sendPacket(new S29PacketSoundEffect("random.door_close", this.posX, this.posY, this.posZ, 1.0F, 1.0F));
return;
}
}
this.getNextWindowId();
if (chestInventory instanceof IInteractionObject)
{
this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, ((IInteractionObject)chestInventory).getGuiID(), chestInventory.getDisplayName(), chestInventory.getSizeInventory()));
this.openContainer = ((IInteractionObject)chestInventory).createContainer(this.inventory, this);
}
else
{
this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:container", chestInventory.getDisplayName(), chestInventory.getSizeInventory()));
this.openContainer = new ContainerChest(this.inventory, chestInventory, this);
}
this.openContainer.windowId = this.currentWindowId;
this.openContainer.onCraftGuiOpened(this);
}
示例7: displayGUIChest
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
/**
* Displays the GUI for interacting with a chest inventory. Args: chestInventory
*/
public void displayGUIChest(IInventory chestInventory)
{
String s = chestInventory instanceof IInteractionObject ? ((IInteractionObject)chestInventory).getGuiID() : "minecraft:container";
if ("minecraft:chest".equals(s))
{
this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
}
else if ("minecraft:hopper".equals(s))
{
this.mc.displayGuiScreen(new GuiHopper(this.inventory, chestInventory));
}
else if ("minecraft:furnace".equals(s))
{
this.mc.displayGuiScreen(new GuiFurnace(this.inventory, chestInventory));
}
else if ("minecraft:brewing_stand".equals(s))
{
this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, chestInventory));
}
else if ("minecraft:beacon".equals(s))
{
this.mc.displayGuiScreen(new GuiBeacon(this.inventory, chestInventory));
}
else if (!"minecraft:dispenser".equals(s) && !"minecraft:dropper".equals(s))
{
this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
}
else
{
this.mc.displayGuiScreen(new GuiDispenser(this.inventory, chestInventory));
}
}
示例8: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner) {
String s = guiOwner.getGuiID();
if ("minecraft:crafting_table".equals(s)) {
this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj));
} else if ("minecraft:enchanting_table".equals(s)) {
this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, guiOwner));
} else if ("minecraft:anvil".equals(s)) {
this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj));
}
}
示例9: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
@Override
public void displayGui(IInteractionObject guiOwner) {
if (m_realPlayer == null) {
super.displayGui(guiOwner);
} else {
syncToRealPlayer();
m_realPlayer.displayGui(guiOwner);
syncPublicFieldsFromReal();
}
}
示例10: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
@Override
public void displayGui(IInteractionObject guiOwner) {
if (m_realPlayer == null) {
super.displayGui(guiOwner);
} else {
m_realPlayer.displayGui(guiOwner);
}
}
示例11: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
if (guiOwner instanceof ILootContainer && ((ILootContainer)guiOwner).getLootTable() != null && this.isSpectator())
{
this.addChatComponentMessage((new TextComponentTranslation("container.spectatorCantOpen", new Object[0])).setStyle((new Style()).setColor(TextFormatting.RED)), true);
}
else
{
this.getNextWindowId();
this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, guiOwner.getGuiID(), guiOwner.getDisplayName()));
this.openContainer = guiOwner.createContainer(this.inventory, this);
this.openContainer.windowId = this.currentWindowId;
this.openContainer.addListener(this);
}
}
示例12: displayGUIChest
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
/**
* Displays the GUI for interacting with a chest inventory.
*/
public void displayGUIChest(IInventory chestInventory)
{
String s = chestInventory instanceof IInteractionObject ? ((IInteractionObject)chestInventory).getGuiID() : "minecraft:container";
if ("minecraft:chest".equals(s))
{
this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
}
else if ("minecraft:hopper".equals(s))
{
this.mc.displayGuiScreen(new GuiHopper(this.inventory, chestInventory));
}
else if ("minecraft:furnace".equals(s))
{
this.mc.displayGuiScreen(new GuiFurnace(this.inventory, chestInventory));
}
else if ("minecraft:brewing_stand".equals(s))
{
this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, chestInventory));
}
else if ("minecraft:beacon".equals(s))
{
this.mc.displayGuiScreen(new GuiBeacon(this.inventory, chestInventory));
}
else if (!"minecraft:dispenser".equals(s) && !"minecraft:dropper".equals(s))
{
this.mc.displayGuiScreen(new GuiChest(this.inventory, chestInventory));
}
else
{
this.mc.displayGuiScreen(new GuiDispenser(this.inventory, chestInventory));
}
}
示例13: displayGuiHook
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public static void displayGuiHook(EntityPlayerSP player, IInteractionObject iiobject)
{
if (debug) System.out.println("displayGui: " + iiobject.getGuiID());
MeddleClient.IDisplayGui handler = MeddleClient.guiHandlers.get(iiobject.getGuiID());
if (handler != null) handler.onOpenGui(player, iiobject.getGuiID(), iiobject.getDisplayName(), 0);
}
示例14: displayGui
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
}
示例15: displayGUIChest
import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
/**
* Displays the GUI for interacting with a chest inventory.
*/
public void displayGUIChest(IInventory chestInventory)
{
if (chestInventory instanceof ILootContainer && ((ILootContainer)chestInventory).getLootTable() != null && this.isSpectator())
{
this.addChatComponentMessage((new TextComponentTranslation("container.spectatorCantOpen", new Object[0])).setStyle((new Style()).setColor(TextFormatting.RED)), true);
}
else
{
if (this.openContainer != this.inventoryContainer)
{
this.closeScreen();
}
if (chestInventory instanceof ILockableContainer)
{
ILockableContainer ilockablecontainer = (ILockableContainer)chestInventory;
if (ilockablecontainer.isLocked() && !this.canOpen(ilockablecontainer.getLockCode()) && !this.isSpectator())
{
this.connection.sendPacket(new SPacketChat(new TextComponentTranslation("container.isLocked", new Object[] {chestInventory.getDisplayName()}), (byte)2));
this.connection.sendPacket(new SPacketSoundEffect(SoundEvents.BLOCK_CHEST_LOCKED, SoundCategory.BLOCKS, this.posX, this.posY, this.posZ, 1.0F, 1.0F));
return;
}
}
this.getNextWindowId();
if (chestInventory instanceof IInteractionObject)
{
this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, ((IInteractionObject)chestInventory).getGuiID(), chestInventory.getDisplayName(), chestInventory.getSizeInventory()));
this.openContainer = ((IInteractionObject)chestInventory).createContainer(this.inventory, this);
}
else
{
this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, "minecraft:container", chestInventory.getDisplayName(), chestInventory.getSizeInventory()));
this.openContainer = new ContainerChest(this.inventory, chestInventory, this);
}
this.openContainer.windowId = this.currentWindowId;
this.openContainer.addListener(this);
}
}