Skip to content

Commit 284ba48

Browse files
committed
fixed enchanting crash on damaged items and serious crafting bug
1 parent 96973e2 commit 284ba48

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/MiNET/MiNET/Enchantment.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ public static void SendEnchantments(Player player, Item itemToEnchant)
101101
{
102102
if (itemToEnchant.ExtraData != null)
103103
{
104-
SendEmptyEnchantments(player);
105-
return;
104+
if (itemToEnchant.ExtraData.Contains("ench"))
105+
{
106+
SendEmptyEnchantments(player);
107+
return;
108+
}
106109
}
107110

108111
var rnd = new Random();

src/MiNET/MiNET/ItemStackInventoryManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ protected virtual uint ProcessCraftAction(CraftAction action)
482482
protected virtual void ProcessCraftAuto(CraftAutoAction action)
483483
{
484484
RecipeManager.resultMap.TryGetValue((int)action.RecipeNetworkId, out Item item);
485-
_player.Inventory.UiInventory.Slots[50] = new Item(item.Id, item.Metadata, item.Count * action.craftCount);
485+
_player.Inventory.UiInventory.Slots[50] = ItemFactory.GetItem(item.Id, item.Metadata, item.Count * action.craftCount);
486486
}
487487

488488
protected virtual void ProcessCraftCreativeAction(CraftCreativeAction action)

0 commit comments

Comments
 (0)