mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-18 08:35:44 +01:00
Fix broken trade/buy signs because of a wrong cast
This commit is contained in:
parent
aceda4c680
commit
6603d0997e
@ -151,13 +151,27 @@ public final class InventoryWorkaround
|
||||
{
|
||||
ItemStack stack = item.clone();
|
||||
stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
|
||||
EnchantmentFix.setItem(cinventory, firstFree, stack);
|
||||
if (cinventory instanceof FakeInventory)
|
||||
{
|
||||
cinventory.setItem(firstFree, stack);
|
||||
}
|
||||
else
|
||||
{
|
||||
EnchantmentFix.setItem(cinventory, firstFree, stack);
|
||||
}
|
||||
item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just store it
|
||||
EnchantmentFix.setItem(cinventory, firstFree, item);
|
||||
if (cinventory instanceof FakeInventory)
|
||||
{
|
||||
cinventory.setItem(firstFree, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
EnchantmentFix.setItem(cinventory, firstFree, item);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user