mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-16 20:22:55 +00:00
fix disenchant bugs from setdurability etc
This commit is contained in:
parent
706afb70d4
commit
c862675999
|
|
@ -154,7 +154,7 @@ public class ItemMeta
|
|||
/// <param name="enchants">The enchantments to set.</param>
|
||||
public void setEnchants(Dictionary<EnchantmentType, int>? enchants)
|
||||
{
|
||||
enchants = enchants != null ? new Dictionary<EnchantmentType, int>(enchants) : null;
|
||||
_enchants = enchants != null ? new Dictionary<EnchantmentType, int>(enchants) : null;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -828,16 +828,14 @@ int __cdecl NativeGetItemMeta(int entityId, int slot, char *outBuf, int bufSize)
|
|||
return 0;
|
||||
|
||||
CompoundTag *tag = item->getTag();
|
||||
if (!tag || !tag->contains(L"display"))
|
||||
return 0;
|
||||
|
||||
CompoundTag *display = tag->getCompound(L"display");
|
||||
bool hasName = display->contains(L"Name");
|
||||
bool hasLore = display->contains(L"Lore");
|
||||
|
||||
bool hasEnchantments = item->isEnchanted();
|
||||
|
||||
if (!hasName && !hasLore)
|
||||
CompoundTag *display = (tag && tag->contains(L"display")) ? tag->getCompound(L"display") : nullptr;
|
||||
bool hasName = display && display->contains(L"Name");
|
||||
bool hasLore = display && display->contains(L"Lore");
|
||||
|
||||
if (!hasName && !hasLore && !hasEnchantments)
|
||||
return 0;
|
||||
|
||||
int offset = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue