Send items again after updating inventory title

This commit is contained in:
NichtStudioCode 2021-09-11 19:43:59 +02:00
parent 5ae4dda739
commit e765daa00f
7 changed files with 7 additions and 0 deletions

@ -48,6 +48,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
Container container = entityPlayer.activeContainer;
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), createNMSComponent(title)));
entityPlayer.updateInventory(container);
}
private static Containers<?> getNotchInventoryType(Inventory inventory) {

@ -47,6 +47,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
Container container = entityPlayer.activeContainer;
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), createNMSComponent(title)));
entityPlayer.updateInventory(container);
}
public static IChatBaseComponent createNMSComponent(BaseComponent[] components) {

@ -48,6 +48,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
Container container = entityPlayer.activeContainer;
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), createNMSComponent(title)));
entityPlayer.updateInventory(container);
}
public static IChatBaseComponent createNMSComponent(BaseComponent[] components) {

@ -48,6 +48,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
Container container = entityPlayer.activeContainer;
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), createNMSComponent(title)));
entityPlayer.updateInventory(container);
}
public static IChatBaseComponent createNMSComponent(BaseComponent[] components) {

@ -48,6 +48,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
Container container = entityPlayer.activeContainer;
entityPlayer.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, container.getType(), createNMSComponent(title)));
entityPlayer.updateInventory(container);
}
public static IChatBaseComponent createNMSComponent(BaseComponent[] components) {

@ -56,6 +56,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle();
AbstractContainerMenu menu = serverPlayer.containerMenu;
serverPlayer.connection.send(new ClientboundOpenScreenPacket(menu.containerId, menu.getType(), createNMSComponent(title)));
serverPlayer.initMenu(menu);
}
public static Component createNMSComponent(BaseComponent[] components) {

@ -56,6 +56,7 @@ public class InventoryUtilsImpl implements InventoryUtils {
ServerPlayer serverPlayer = ((CraftPlayer) player).getHandle();
AbstractContainerMenu menu = serverPlayer.containerMenu;
serverPlayer.connection.send(new ClientboundOpenScreenPacket(menu.containerId, menu.getType(), createNMSComponent(title)));
serverPlayer.initMenu(menu);
}
public static Component createNMSComponent(BaseComponent[] components) {