Utils ported
This commit is contained in:
@@ -22,7 +22,7 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.CopyMode;
|
||||
@@ -118,9 +118,9 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
|
||||
this.copyMode.setState(this.container.getCopyMode() == CopyMode.CLEAR_ON_REMOVE);
|
||||
|
||||
boolean hasFuzzy = false;
|
||||
final ItemTransferable inv = this.container.getCellUpgradeInventory();
|
||||
for (int x = 0; x < inv.getSlots(); x++) {
|
||||
final ItemStack is = inv.getStackInSlot(x);
|
||||
final FixedItemInv inv = this.container.getCellUpgradeInventory();
|
||||
for (int x = 0; x < inv.getSlotCount(); x++) {
|
||||
final ItemStack is = inv.getInvStack(x);
|
||||
if (!is.isEmpty() && is.getItem() instanceof IUpgradeModule) {
|
||||
if (((IUpgradeModule) is.getItem()).getType(is) == Upgrades.FUZZY) {
|
||||
hasFuzzy = true;
|
||||
|
||||
@@ -223,7 +223,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
for (int x = 0; x < current.getInventory().getSlots(); x++) {
|
||||
final String which = Integer.toString(x);
|
||||
if (invData.contains(which)) {
|
||||
current.getInventory().setStackInSlot(x, ItemStack.read(invData.getCompound(which)));
|
||||
current.getInventory().setStackInSlot(x, ItemStack.fromTag(invData.getCompound(which)));
|
||||
}
|
||||
}
|
||||
} catch (final NumberFormatException ignored) {
|
||||
@@ -319,7 +319,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
|
||||
for (int i = 0; i < outTag.size(); i++) {
|
||||
|
||||
final ItemStack parsedItemStack = ItemStack.read(outTag.getCompound(i));
|
||||
final ItemStack parsedItemStack = ItemStack.fromTag(outTag.getCompound(i));
|
||||
if (!parsedItemStack.isEmpty()) {
|
||||
final String displayName = Platform.getItemDisplayName(AEApi.instance().storage()
|
||||
.getStorageChannel(IItemStorageChannel.class).createStack(parsedItemStack)).getString()
|
||||
|
||||
Reference in New Issue
Block a user