use of net.minecraft.network.play.server.SSetSlotPacket in project BluePower by Qmunity.
the class ContainerProjectTable method updateCrafting.
protected static void updateCrafting(int id, World world, PlayerEntity playerEntity, CraftingInventory craftingInventory, CraftResultInventory craftResultInventory) {
if (!world.isClientSide) {
ServerPlayerEntity serverplayerentity = (ServerPlayerEntity) playerEntity;
ItemStack itemstack = ItemStack.EMPTY;
Optional<ICraftingRecipe> optional = world.getServer().getRecipeManager().getRecipeFor(IRecipeType.CRAFTING, craftingInventory, world);
if (optional.isPresent()) {
ICraftingRecipe icraftingrecipe = optional.get();
if (craftResultInventory.setRecipeUsed(world, serverplayerentity, icraftingrecipe)) {
itemstack = icraftingrecipe.assemble(craftingInventory);
}
}
craftResultInventory.setItem(0, itemstack);
serverplayerentity.connection.send(new SSetSlotPacket(id, 0, itemstack));
}
}
Aggregations