Fix renaming pet not opening proper window

This commit is contained in:
libraryaddict 2015-10-23 09:26:21 +13:00
parent 53aa1b655b
commit aedf04b3e3

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import net.minecraft.server.v1_8_R3.Blocks;
import net.minecraft.server.v1_8_R3.ChatMessage;
import net.minecraft.server.v1_8_R3.EntityPlayer; import net.minecraft.server.v1_8_R3.EntityPlayer;
import net.minecraft.server.v1_8_R3.IChatBaseComponent; import net.minecraft.server.v1_8_R3.IChatBaseComponent;
import net.minecraft.server.v1_8_R3.Items; import net.minecraft.server.v1_8_R3.Items;
@ -167,7 +169,7 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
PetTagPage petTagPage = new PetTagPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Repairing", getPlayer(), pet, petPurchase); PetTagPage petTagPage = new PetTagPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Repairing", getPlayer(), pet, petPurchase);
EntityPlayer entityPlayer = ((CraftPlayer) getPlayer()).getHandle(); EntityPlayer entityPlayer = ((CraftPlayer) getPlayer()).getHandle();
int containerCounter = entityPlayer.nextContainerCounter(); int containerCounter = entityPlayer.nextContainerCounter();
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(containerCounter, "minecraft:anvil", IChatBaseComponent.ChatSerializer.a("Repairing"), 8)); entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(containerCounter, "minecraft:anvil", new ChatMessage(Blocks.ANVIL.a() + ".name", new Object[0])));
entityPlayer.activeContainer = new AnvilContainer(entityPlayer.inventory, petTagPage.getInventory()); entityPlayer.activeContainer = new AnvilContainer(entityPlayer.inventory, petTagPage.getInventory());
entityPlayer.activeContainer.windowId = containerCounter; entityPlayer.activeContainer.windowId = containerCounter;
entityPlayer.activeContainer.addSlotListener(entityPlayer); entityPlayer.activeContainer.addSlotListener(entityPlayer);