Search in sources :

Example 1 with PacketPlayOutCloseWindow

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

the class v1_10_R1 method closeGUI.

@Override
public void closeGUI(Player player, Object container, boolean closePacket) {
    if (closePacket) {
        BukkitLoader.getPacketHandler().send(player, new PacketPlayOutCloseWindow(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_10_R1.inventory.CraftContainer) Container(net.minecraft.server.v1_10_R1.Container) EntityPlayer(net.minecraft.server.v1_10_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_10_R1.PacketPlayOutCloseWindow)

Example 2 with PacketPlayOutCloseWindow

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

the class v1_9_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_9_R1.inventory.CraftContainer) Container(net.minecraft.server.v1_9_R1.Container) EntityPlayer(net.minecraft.server.v1_9_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_9_R1.PacketPlayOutCloseWindow)

Example 3 with PacketPlayOutCloseWindow

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

the class v1_14_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_14_R1.inventory.CraftContainer) Container(net.minecraft.server.v1_14_R1.Container) EntityPlayer(net.minecraft.server.v1_14_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_14_R1.PacketPlayOutCloseWindow)

Example 4 with PacketPlayOutCloseWindow

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

the class v1_15_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_15_R1.inventory.CraftContainer) Container(net.minecraft.server.v1_15_R1.Container) EntityPlayer(net.minecraft.server.v1_15_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_15_R1.PacketPlayOutCloseWindow)

Example 5 with PacketPlayOutCloseWindow

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

the class v1_7_R4 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_7_R4.IContainer) CraftContainer(org.bukkit.craftbukkit.v1_7_R4.inventory.CraftContainer) Container(net.minecraft.server.v1_7_R4.Container) EntityPlayer(net.minecraft.server.v1_7_R4.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_7_R4.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