Search in sources :

Example 11 with PacketPlayOutCloseWindow

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

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

Example 12 with PacketPlayOutCloseWindow

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

the class v1_12_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_12_R1.inventory.CraftContainer) Container(net.minecraft.server.v1_12_R1.Container) EntityPlayer(net.minecraft.server.v1_12_R1.EntityPlayer) PacketPlayOutCloseWindow(net.minecraft.server.v1_12_R1.PacketPlayOutCloseWindow)

Example 13 with PacketPlayOutCloseWindow

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

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

Example 14 with PacketPlayOutCloseWindow

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

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

Example 15 with PacketPlayOutCloseWindow

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

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