当前位置: 首页>>代码示例>>Java>>正文


Java IInteractionObject类代码示例

本文整理汇总了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));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntityPlayerSP.java

示例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));
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:24,代码来源:EntityPlayerSP.java

示例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));
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:18,代码来源:EntityPlayerSP.java

示例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));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:EntityPlayerMP.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:EntityPlayerMP.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:39,代码来源:EntityPlayerMP.java

示例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));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:37,代码来源:EntityPlayerSP.java

示例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));
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:EntityPlayerSP.java

示例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();
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:EntityPlayerMPProxy.java

示例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);
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:9,代码来源:EntityPlayerProxy.java

示例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);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:16,代码来源:EntityPlayerMP.java

示例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));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:37,代码来源:EntityPlayerSP.java

示例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);
}
 
开发者ID:FyberOptic,项目名称:MeddleAPI,代码行数:8,代码来源:MeddleClientHooks.java

示例14: displayGui

import net.minecraft.world.IInteractionObject; //导入依赖的package包/类
public void displayGui(IInteractionObject guiOwner)
{
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:4,代码来源:EntityPlayer.java

示例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);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:46,代码来源:EntityPlayerMP.java


注:本文中的net.minecraft.world.IInteractionObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。