Search in sources :

Example 6 with PacketPlayOutSetSlot

use of net.minecraft.server.v1_11_R1.PacketPlayOutSetSlot in project PublicCrafters by BananaPuncher714.

the class CustomContainerWorkbench method setCraftResult.

public void setCraftResult() {
    CraftingManager.getInstance().lastCraftView = getBukkitView();
    ItemStack craftResult = CraftingManager.getInstance().craft(craftInventory, world);
    resultInventory.setItem(0, craftResult);
    if (listeners.isEmpty()) {
        return;
    }
    if ((craftResult != null) && (craftResult.getItem() == Items.FILLED_MAP)) {
        return;
    }
    for (Object listener : listeners) {
        EntityPlayer player = (EntityPlayer) listener;
        player.playerConnection.sendPacket(new PacketPlayOutSetSlot(player.activeContainer.windowId, 0, craftResult));
    }
}
Also used : EntityPlayer(net.minecraft.server.v1_9_R2.EntityPlayer) PacketPlayOutSetSlot(net.minecraft.server.v1_9_R2.PacketPlayOutSetSlot) ItemStack(net.minecraft.server.v1_9_R2.ItemStack)

Example 7 with PacketPlayOutSetSlot

use of net.minecraft.server.v1_11_R1.PacketPlayOutSetSlot in project PublicCrafters by BananaPuncher714.

the class CustomContainerWorkbench method setCraftResult.

public void setCraftResult() {
    CraftingManager.getInstance().lastCraftView = getBukkitView();
    ItemStack craftResult = CraftingManager.getInstance().craft(craftInventory, world);
    resultInventory.setItem(0, craftResult);
    if (listeners.isEmpty()) {
        return;
    }
    if ((craftResult != null) && (craftResult.getItem() == Items.FILLED_MAP)) {
        return;
    }
    for (Object listener : listeners) {
        EntityPlayer player = (EntityPlayer) listener;
        player.playerConnection.sendPacket(new PacketPlayOutSetSlot(player.activeContainer.windowId, 0, craftResult));
    }
}
Also used : EntityPlayer(net.minecraft.server.v1_10_R1.EntityPlayer) PacketPlayOutSetSlot(net.minecraft.server.v1_10_R1.PacketPlayOutSetSlot) ItemStack(net.minecraft.server.v1_10_R1.ItemStack)

Aggregations

EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)1 ItemStack (net.minecraft.server.v1_10_R1.ItemStack)1 PacketPlayOutSetSlot (net.minecraft.server.v1_10_R1.PacketPlayOutSetSlot)1 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)1 ItemStack (net.minecraft.server.v1_11_R1.ItemStack)1 PacketPlayOutSetSlot (net.minecraft.server.v1_11_R1.PacketPlayOutSetSlot)1 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)1 IRecipe (net.minecraft.server.v1_12_R1.IRecipe)1 ItemStack (net.minecraft.server.v1_12_R1.ItemStack)1 PacketPlayOutSetSlot (net.minecraft.server.v1_12_R1.PacketPlayOutSetSlot)1 EntityPlayer (net.minecraft.server.v1_13_R1.EntityPlayer)1 IRecipe (net.minecraft.server.v1_13_R1.IRecipe)1 ItemStack (net.minecraft.server.v1_13_R1.ItemStack)1 PacketPlayOutSetSlot (net.minecraft.server.v1_13_R1.PacketPlayOutSetSlot)1 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)1 IRecipe (net.minecraft.server.v1_13_R2.IRecipe)1 ItemStack (net.minecraft.server.v1_13_R2.ItemStack)1 PacketPlayOutSetSlot (net.minecraft.server.v1_13_R2.PacketPlayOutSetSlot)1 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)1 ItemStack (net.minecraft.server.v1_8_R3.ItemStack)1