Utils ported
This commit is contained in:
@@ -405,7 +405,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
final ItemStack t = d.getStack().copy();
|
||||
|
||||
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
||||
int maxSize = t.getMaxStackSize();
|
||||
int maxSize = t.getMaxCount();
|
||||
if (maxSize > d.getSlotStackLimit()) {
|
||||
maxSize = d.getSlotStackLimit();
|
||||
}
|
||||
@@ -449,7 +449,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
final ItemStack t = d.getStack().copy();
|
||||
|
||||
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
||||
int maxSize = t.getMaxStackSize();
|
||||
int maxSize = t.getMaxCount();
|
||||
if (maxSize > d.getSlotStackLimit()) {
|
||||
maxSize = d.getSlotStackLimit();
|
||||
}
|
||||
@@ -478,7 +478,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int maxSize = tis.getMaxStackSize();
|
||||
int maxSize = tis.getMaxCount();
|
||||
if (maxSize > d.getSlotStackLimit()) {
|
||||
maxSize = d.getSlotStackLimit();
|
||||
}
|
||||
@@ -580,7 +580,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
if (hand.isEmpty()) {
|
||||
is.setCount(Math.max(1, is.getCount() - 1));
|
||||
} else if (hand.isItemEqual(is)) {
|
||||
is.setCount(Math.min(is.getMaxStackSize(), is.getCount() + 1));
|
||||
is.setCount(Math.min(is.getMaxCount(), is.getCount() + 1));
|
||||
} else {
|
||||
is = hand.copy();
|
||||
is.setCount(1);
|
||||
@@ -632,7 +632,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
IAEItemStack ais = slotItem.copy();
|
||||
ItemStack myItem = ais.createItemStack();
|
||||
|
||||
ais.setStackSize(myItem.getMaxStackSize());
|
||||
ais.setStackSize(myItem.getMaxCount());
|
||||
|
||||
final InventoryAdaptor adp = InventoryAdaptor.getAdaptor(player);
|
||||
myItem.setCount((int) ais.getStackSize());
|
||||
@@ -691,7 +691,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
final ItemStack item = player.inventory.getItemStack();
|
||||
|
||||
if (!item.isEmpty()) {
|
||||
if (item.getCount() >= item.getMaxStackSize()) {
|
||||
if (item.getCount() >= item.getMaxCount()) {
|
||||
liftQty = 0;
|
||||
}
|
||||
if (!Platform.itemComparisons().isSameItem(slotItem.getDefinition(), item)) {
|
||||
@@ -726,7 +726,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
if (player.inventory.getItemStack().isEmpty()) {
|
||||
if (slotItem != null) {
|
||||
IAEItemStack ais = slotItem.copy();
|
||||
ais.setStackSize(ais.getDefinition().getMaxStackSize());
|
||||
ais.setStackSize(ais.getDefinition().getMaxCount());
|
||||
ais = Platform.poweredExtraction(this.getPowerSource(), this.getCellInventory(), ais,
|
||||
this.getActionSource());
|
||||
if (ais != null) {
|
||||
@@ -758,7 +758,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
if (player.inventory.getItemStack().isEmpty()) {
|
||||
if (slotItem != null) {
|
||||
IAEItemStack ais = slotItem.copy();
|
||||
final long maxSize = ais.getDefinition().getMaxStackSize();
|
||||
final long maxSize = ais.getDefinition().getMaxCount();
|
||||
ais.setStackSize(maxSize);
|
||||
ais = this.getCellInventory().extractItems(ais, Actionable.SIMULATE, this.getActionSource());
|
||||
|
||||
@@ -796,7 +796,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
case CREATIVE_DUPLICATE:
|
||||
if (player.abilities.isCreativeMode && slotItem != null) {
|
||||
final ItemStack is = slotItem.createItemStack();
|
||||
is.setCount(is.getMaxStackSize());
|
||||
is.setCount(is.getMaxCount());
|
||||
player.inventory.setItemStack(is);
|
||||
this.updateHeld(player);
|
||||
}
|
||||
@@ -813,7 +813,7 @@ public abstract class AEBaseContainer extends Container {
|
||||
IAEItemStack ais = slotItem.copy();
|
||||
ItemStack myItem = ais.createItemStack();
|
||||
|
||||
ais.setStackSize(myItem.getMaxStackSize());
|
||||
ais.setStackSize(myItem.getMaxCount());
|
||||
|
||||
final InventoryAdaptor adp = InventoryAdaptor.getAdaptor(player);
|
||||
myItem.setCount((int) ais.getStackSize());
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.INBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.wrapper.PlayerInvWrapper;
|
||||
@@ -237,8 +237,8 @@ public class PatternTermContainer extends MEMonitorableContainer
|
||||
// encode the slot.
|
||||
final CompoundTag encodedValue = new CompoundTag();
|
||||
|
||||
final ListNBT tagIn = new ListNBT();
|
||||
final ListNBT tagOut = new ListNBT();
|
||||
final ListTag tagIn = new ListTag();
|
||||
final ListTag tagOut = new ListTag();
|
||||
|
||||
for (final ItemStack i : in) {
|
||||
tagIn.add(this.createItemTag(i));
|
||||
|
||||
@@ -127,12 +127,12 @@ public class AppEngSlot extends Slot {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return this.itemHandler.getSlotLimit(this.index);
|
||||
return this.itemHandler.getMaxAmount(this.index, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemStackLimit(@Nonnull ItemStack stack) {
|
||||
return Math.min(this.getSlotStackLimit(), stack.getMaxStackSize());
|
||||
return Math.min(this.getSlotStackLimit(), stack.getMaxCount());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -108,11 +108,11 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
|
||||
if (action == InventoryAction.CRAFT_SHIFT) // craft into player inventory...
|
||||
{
|
||||
ia = InventoryAdaptor.getAdaptor(who);
|
||||
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxStackSize() / (double) howManyPerCraft);
|
||||
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxCount() / (double) howManyPerCraft);
|
||||
} else if (action == InventoryAction.CRAFT_STACK) // craft into hand, full stack
|
||||
{
|
||||
ia = new AdaptorFixedInv(new WrapperCursorItemHandler(who.inventory));
|
||||
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxStackSize() / (double) howManyPerCraft);
|
||||
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxCount() / (double) howManyPerCraft);
|
||||
} else
|
||||
// pick up what was crafted...
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user