use of net.minecraft.server.level.EntityPlayer in project WildChests by BG-Software-LLC.
the class NMSInventory_v1_17_R1 method openPage.
@Override
public void openPage(Player player, com.bgsoftware.wildchests.objects.inventory.CraftWildInventory inventory) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
String title = inventory.getTitle();
Container container = createContainer(entityPlayer.nextContainerCounter(), entityPlayer.getInventory(), inventory);
container.setTitle(new ChatComponentText(title));
// Cursor item is not updated, so we need to update it manually
org.bukkit.inventory.ItemStack cursorItem = player.getItemOnCursor();
entityPlayer.b.sendPacket(new PacketPlayOutOpenWindow(container.j, container.getType(), container.getTitle()));
entityPlayer.bV = container;
entityPlayer.initMenu(container);
player.setItemOnCursor(cursorItem);
}
use of net.minecraft.server.level.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_18_R1 method animate.
@Override
public void animate(Player player) {
EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
broadcastPacket(player, new PacketPlayOutAnimation(NMSPlayer, ThreadLocalRandom.current().nextInt(2) == 1 ? 0 : 3));
}
Aggregations