Search in sources :

Example 6 with PacketPlayOutCloseWindow

use of net.minecraft.server.v1_16_R3.PacketPlayOutCloseWindow in project TheAPI by TheDevTec.

the class v1_8_R1 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : CraftContainer(org.bukkit.craftbukkit.v1_8_R1.inventory.CraftContainer) IContainer(net.minecraft.server.v1_8_R1.IContainer) Container(net.minecraft.server.v1_8_R1.Container) EntityPlayer(net.minecraft.server.v1_8_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_8_R1.PacketPlayOutCloseWindow)

Example 7 with PacketPlayOutCloseWindow

use of net.minecraft.server.v1_16_R3.PacketPlayOutCloseWindow in project TheAPI by TheDevTec.

the class v1_16_R1 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : Container(net.minecraft.server.v1_16_R1.Container) CraftContainer(org.bukkit.craftbukkit.v1_16_R1.inventory.CraftContainer) EntityPlayer(net.minecraft.server.v1_16_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_16_R1.PacketPlayOutCloseWindow)

Example 8 with PacketPlayOutCloseWindow

use of net.minecraft.server.v1_16_R3.PacketPlayOutCloseWindow in project TheAPI by TheDevTec.

the class v1_8_R2 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : IContainer(net.minecraft.server.v1_8_R2.IContainer) CraftContainer(org.bukkit.craftbukkit.v1_8_R2.inventory.CraftContainer) Container(net.minecraft.server.v1_8_R2.Container) EntityPlayer(net.minecraft.server.v1_8_R2.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_8_R2.PacketPlayOutCloseWindow)

Example 9 with PacketPlayOutCloseWindow

use of net.minecraft.server.v1_16_R3.PacketPlayOutCloseWindow in project TheAPI by TheDevTec.

the class v1_11_R1 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : Container(net.minecraft.server.v1_11_R1.Container) CraftContainer(org.bukkit.craftbukkit.v1_11_R1.inventory.CraftContainer) EntityPlayer(net.minecraft.server.v1_11_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_11_R1.PacketPlayOutCloseWindow)

Example 10 with PacketPlayOutCloseWindow

use of net.minecraft.server.v1_16_R3.PacketPlayOutCloseWindow in project TheAPI by TheDevTec.

the class v1_16_R2 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket)
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(BukkitLoader.getNmsProvider().getContainerId(container)));
    EntityPlayer nmsPlayer = (EntityPlayer) getPlayer(player);
    nmsPlayer.activeContainer = nmsPlayer.defaultContainer;
    ((Container) container).transferTo(nmsPlayer.activeContainer, (CraftPlayer) player);
}
Also used : Container(net.minecraft.server.v1_16_R2.Container) CraftContainer(org.bukkit.craftbukkit.v1_16_R2.inventory.CraftContainer) EntityPlayer(net.minecraft.server.v1_16_R2.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_16_R2.PacketPlayOutCloseWindow)

Aggregations

Container (net.minecraft.server.v1_10_R1.Container)1 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)1 PacketPlayOutCloseWindow (net.minecraft.server.v1_10_R1.PacketPlayOutCloseWindow)1 Container (net.minecraft.server.v1_11_R1.Container)1 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)1 PacketPlayOutCloseWindow (net.minecraft.server.v1_11_R1.PacketPlayOutCloseWindow)1 Container (net.minecraft.server.v1_12_R1.Container)1 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)1 PacketPlayOutCloseWindow (net.minecraft.server.v1_12_R1.PacketPlayOutCloseWindow)1 Container (net.minecraft.server.v1_13_R1.Container)1 EntityPlayer (net.minecraft.server.v1_13_R1.EntityPlayer)1 PacketPlayOutCloseWindow (net.minecraft.server.v1_13_R1.PacketPlayOutCloseWindow)1 Container (net.minecraft.server.v1_13_R2.Container)1 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)1 PacketPlayOutCloseWindow (net.minecraft.server.v1_13_R2.PacketPlayOutCloseWindow)1 Container (net.minecraft.server.v1_14_R1.Container)1 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)1 PacketPlayOutCloseWindow (net.minecraft.server.v1_14_R1.PacketPlayOutCloseWindow)1 Container (net.minecraft.server.v1_15_R1.Container)1 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)1