mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-08-26 07:22:56 +02: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();
|
ItemStack stack = item.clone();
|
||||||
stack.setAmount(dontBreakStacks ? ess.getSettings().getDefaultStackSize() : item.getType().getMaxStackSize());
|
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());
|
item.setAmount(item.getAmount() - item.getType().getMaxStackSize());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Just store it
|
// Just store it
|
||||||
EnchantmentFix.setItem(cinventory, firstFree, item);
|
if (cinventory instanceof FakeInventory)
|
||||||
|
{
|
||||||
|
cinventory.setItem(firstFree, item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EnchantmentFix.setItem(cinventory, firstFree, item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user