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


Java IMerchant.getDisplayName方法代码示例

本文整理汇总了Java中net.minecraft.entity.IMerchant.getDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Java IMerchant.getDisplayName方法的具体用法?Java IMerchant.getDisplayName怎么用?Java IMerchant.getDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.IMerchant的用法示例。


在下文中一共展示了IMerchant.getDisplayName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: displayVillagerTradeGui

import net.minecraft.entity.IMerchant; //导入方法依赖的package包/类
public void displayVillagerTradeGui(IMerchant villager)
{
    this.getNextWindowId();
    this.openContainer = new ContainerMerchant(this.inventory, villager, this.worldObj);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.onCraftGuiOpened(this);
    IInventory iinventory = ((ContainerMerchant)this.openContainer).getMerchantInventory();
    IChatComponent ichatcomponent = villager.getDisplayName();
    this.playerNetServerHandler.sendPacket(new S2DPacketOpenWindow(this.currentWindowId, "minecraft:villager", ichatcomponent, iinventory.getSizeInventory()));
    MerchantRecipeList merchantrecipelist = villager.getRecipes(this);

    if (merchantrecipelist != null)
    {
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.currentWindowId);
        merchantrecipelist.writeToBuf(packetbuffer);
        this.playerNetServerHandler.sendPacket(new S3FPacketCustomPayload("MC|TrList", packetbuffer));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:EntityPlayerMP.java

示例2: displayVillagerTradeGui

import net.minecraft.entity.IMerchant; //导入方法依赖的package包/类
public void displayVillagerTradeGui(IMerchant villager)
{
    this.getNextWindowId();
    this.openContainer = new ContainerMerchant(this.inventory, villager, this.world);
    this.openContainer.windowId = this.currentWindowId;
    this.openContainer.addListener(this);
    IInventory iinventory = ((ContainerMerchant)this.openContainer).getMerchantInventory();
    ITextComponent itextcomponent = villager.getDisplayName();
    this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, "minecraft:villager", itextcomponent, iinventory.getSizeInventory()));
    MerchantRecipeList merchantrecipelist = villager.getRecipes(this);

    if (merchantrecipelist != null)
    {
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.currentWindowId);
        merchantrecipelist.writeToBuf(packetbuffer);
        this.connection.sendPacket(new SPacketCustomPayload("MC|TrList", packetbuffer));
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:20,代码来源:EntityPlayerMP.java

示例3: displayVillagerTradeGui

import net.minecraft.entity.IMerchant; //导入方法依赖的package包/类
public void displayVillagerTradeGui(IMerchant villager)
{
    this.getNextWindowId();
    this.openContainer = new ContainerMerchant(this.inventory, villager, this.worldObj);
    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));
    IInventory iinventory = ((ContainerMerchant)this.openContainer).getMerchantInventory();
    ITextComponent itextcomponent = villager.getDisplayName();
    this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, "minecraft:villager", itextcomponent, iinventory.getSizeInventory()));
    MerchantRecipeList merchantrecipelist = villager.getRecipes(this);

    if (merchantrecipelist != null)
    {
        PacketBuffer packetbuffer = new PacketBuffer(Unpooled.buffer());
        packetbuffer.writeInt(this.currentWindowId);
        merchantrecipelist.writeToBuf(packetbuffer);
        this.connection.sendPacket(new SPacketCustomPayload("MC|TrList", packetbuffer));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:EntityPlayerMP.java

示例4: GuiMerchant

import net.minecraft.entity.IMerchant; //导入方法依赖的package包/类
public GuiMerchant(InventoryPlayer p_i45500_1_, IMerchant p_i45500_2_, World worldIn)
{
    super(new ContainerMerchant(p_i45500_1_, p_i45500_2_, worldIn));
    this.merchant = p_i45500_2_;
    this.chatComponent = p_i45500_2_.getDisplayName();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:GuiMerchant.java

示例5: GuiTrading

import net.minecraft.entity.IMerchant; //导入方法依赖的package包/类
public GuiTrading(InventoryPlayer inventoryPlayer, IMerchant merchant, World worldIn) {
    super(new ContainerTrading(inventoryPlayer, merchant, worldIn));
    this.merchant = merchant;
    this.chatComponent = merchant.getDisplayName();
}
 
开发者ID:CountGrimhart,项目名称:Count-Armours,代码行数:6,代码来源:GuiTrading.java

示例6: GuiNPCMerchant

import net.minecraft.entity.IMerchant; //导入方法依赖的package包/类
public GuiNPCMerchant(InventoryPlayer player, IMerchant merchant, World world){
	super(new ContainerNPCMerchant(player, merchant, world));
	this.merchant = (NPCShop) merchant;
	this.chatComponent = merchant.getDisplayName();
}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:6,代码来源:GuiNPCMerchant.java


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