本文整理汇总了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));
}
}
示例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));
}
}
示例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));
}
}
示例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();
}
示例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();
}
示例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();
}