Fixed data export to item stack not happening if there was no save before extracting the item.
This commit is contained in:
@@ -58,11 +58,19 @@ public class DeviceItemStackHandler extends ItemStackHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ItemStack getStackInSlot(final int slot) {
|
||||
final ItemStack stack = super.getStackInSlot(slot);
|
||||
busElement.exportDeviceDataToItemStack(slot, stack);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ItemStack extractItem(final int slot, final int amount, final boolean simulate) {
|
||||
if (!simulate && amount > 0) {
|
||||
busElement.exportDeviceDataToItemStack(slot, getStackInSlot(slot));
|
||||
busElement.exportDeviceDataToItemStack(slot, super.getStackInSlot(slot));
|
||||
}
|
||||
|
||||
return super.extractItem(slot, amount, simulate);
|
||||
|
||||
Reference in New Issue
Block a user