aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java1
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java3
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java75
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java95
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java83
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java67
-rw-r--r--src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java6
7 files changed, 148 insertions, 182 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index e92d9ffae9..d853ea5f0a 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -546,7 +546,6 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler, IG
public boolean mIgnoreTcon = true;
public boolean mDisableIC2Cables = false;
public boolean mAchievements = true;
- public boolean mAE2Integration = true;
public boolean mArcSmeltIntoAnnealed = true;
public boolean mMagneticraftRecipes = false;
public boolean mImmersiveEngineeringRecipes = false;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
index f71ef2ee30..957d446a51 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
@@ -17,7 +17,6 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
import com.gtnewhorizons.modularui.common.widget.textfield.BaseTextFieldWidget;
-import gregtech.api.GregTech_API;
import gregtech.api.gui.modularui.GT_CoverUIBuildContext;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
@@ -85,7 +84,7 @@ public class GT_Cover_ItemMeter extends GT_CoverBehaviorBase<GT_Cover_ItemMeter.
if (mte instanceof GT_MetaTileEntity_DigitalChestBase dc) {
max = dc.getMaxItemCount();
used = dc.getProgresstime();
- } else if (GregTech_API.mAE2 && mte instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) {
+ } else if (mte instanceof GT_MetaTileEntity_Hatch_OutputBus_ME) {
if (((GT_MetaTileEntity_Hatch_OutputBus_ME) mte).isLastOutputFailed()) {
max = 64;
used = 64;
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java
index 6c4fcf40e2..83a5789430 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_CraftingInput_ME.java
@@ -67,7 +67,6 @@ import appeng.util.IWideReadableNumberConverter;
import appeng.util.Platform;
import appeng.util.ReadableNumberConverter;
import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.IConfigurationCircuitSupport;
@@ -485,9 +484,7 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_
}
aNBT.setTag("internalInventory", internalInventoryNBT);
if (customName != null) aNBT.setString("customName", customName);
- if (GregTech_API.mAE2) {
- getProxy().writeToNBT(aNBT);
- }
+ getProxy().writeToNBT(aNBT);
}
@Override
@@ -537,9 +534,7 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_
if (aNBT.hasKey("customName")) customName = aNBT.getString("customName");
- if (GregTech_API.mAE2) {
- getProxy().readFromNBT(aNBT);
- }
+ getProxy().readFromNBT(aNBT);
}
@Override
@@ -557,44 +552,42 @@ public class GT_MetaTileEntity_Hatch_CraftingInput_ME extends GT_MetaTileEntity_
@Override
public String[] getInfoData() {
- if (GregTech_API.mAE2) {
- var ret = new ArrayList<String>();
+ var ret = new ArrayList<String>();
+ ret.add(
+ "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online"
+ : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET);
+ ret.add("Internal Inventory: ");
+ var i = 0;
+ for (var slot : internalInventory) {
+ if (slot == null) continue;
+ IWideReadableNumberConverter nc = ReadableNumberConverter.INSTANCE;
+
+ i += 1;
ret.add(
- "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online"
- : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET);
- ret.add("Internal Inventory: ");
- var i = 0;
- for (var slot : internalInventory) {
- if (slot == null) continue;
- IWideReadableNumberConverter nc = ReadableNumberConverter.INSTANCE;
-
- i += 1;
+ "Slot " + i
+ + " "
+ + EnumChatFormatting.BLUE
+ + describePattern(slot.patternDetails)
+ + EnumChatFormatting.RESET);
+ for (var item : slot.itemInventory) {
+ if (item == null || item.stackSize == 0) continue;
+ ret.add(
+ item.getItem()
+ .getItemStackDisplayName(item) + ": "
+ + EnumChatFormatting.GOLD
+ + nc.toWideReadableForm(item.stackSize)
+ + EnumChatFormatting.RESET);
+ }
+ for (var fluid : slot.fluidInventory) {
+ if (fluid == null || fluid.amount == 0) continue;
ret.add(
- "Slot " + i
- + " "
- + EnumChatFormatting.BLUE
- + describePattern(slot.patternDetails)
+ fluid.getLocalizedName() + ": "
+ + EnumChatFormatting.AQUA
+ + nc.toWideReadableForm(fluid.amount)
+ EnumChatFormatting.RESET);
- for (var item : slot.itemInventory) {
- if (item == null || item.stackSize == 0) continue;
- ret.add(
- item.getItem()
- .getItemStackDisplayName(item) + ": "
- + EnumChatFormatting.GOLD
- + nc.toWideReadableForm(item.stackSize)
- + EnumChatFormatting.RESET);
- }
- for (var fluid : slot.fluidInventory) {
- if (fluid == null || fluid.amount == 0) continue;
- ret.add(
- fluid.getLocalizedName() + ": "
- + EnumChatFormatting.AQUA
- + nc.toWideReadableForm(fluid.amount)
- + EnumChatFormatting.RESET);
- }
}
- return ret.toArray(new String[0]);
- } else return new String[] {};
+ }
+ return ret.toArray(new String[0]);
}
@Override
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java
index 801bff1c4c..39fd457647 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_InputBus_ME.java
@@ -50,7 +50,6 @@ import appeng.me.GridAccessException;
import appeng.me.helpers.AENetworkProxy;
import appeng.me.helpers.IGridProxyable;
import appeng.util.item.AEItemStack;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.gui.modularui.GT_UITextures;
import gregtech.api.interfaces.IConfigurationCircuitSupport;
@@ -174,9 +173,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
aNBT.setIntArray("sizes", sizes);
aNBT.setBoolean("autoStock", autoPullItemList);
aNBT.setInteger("minAutoPullStackSize", minAutoPullStackSize);
- if (GregTech_API.mAE2) {
- getProxy().writeToNBT(aNBT);
- }
+ getProxy().writeToNBT(aNBT);
}
private void setAutoPullItemList(boolean pullItemList) {
@@ -208,9 +205,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
}
autoPullItemList = aNBT.getBoolean("autoStock");
minAutoPullStackSize = aNBT.getInteger("minAutoPullStackSize");
- if (GregTech_API.mAE2) {
- getProxy().readFromNBT(aNBT);
- }
+ getProxy().readFromNBT(aNBT);
}
@Override
@@ -220,11 +215,9 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
@Override
public String[] getInfoData() {
- if (GregTech_API.mAE2) {
- return new String[] {
- "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online"
- : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET };
- } else return new String[] {};
+ return new String[] {
+ "The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online"
+ : EnumChatFormatting.RED + "offline" + getAEDiagnostics()) + EnumChatFormatting.RESET };
}
@Override
@@ -337,7 +330,7 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
// Display slots
return null;
if (aIndex == getCircuitSlot() || aIndex == getManualSlot()) return mInventory[aIndex];
- if (GregTech_API.mAE2 && mInventory[aIndex] != null) {
+ if (mInventory[aIndex] != null) {
AENetworkProxy proxy = getProxy();
if (proxy == null) {
return null;
@@ -385,28 +378,26 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
}
private void refreshItemList() {
- if (GregTech_API.mAE2) {
- AENetworkProxy proxy = getProxy();
- try {
- IMEMonitor<IAEItemStack> sg = proxy.getStorage()
- .getItemInventory();
- Iterator<IAEItemStack> iterator = sg.getStorageList()
- .iterator();
- int index = 0;
- while (iterator.hasNext() && index < SLOT_COUNT) {
- IAEItemStack currItem = iterator.next();
- if (currItem.getStackSize() >= minAutoPullStackSize) {
- ItemStack itemstack = GT_Utility.copyAmount(1, currItem.getItemStack());
- this.mInventory[index] = itemstack;
- index++;
- }
- }
- for (int i = index; i < SLOT_COUNT; i++) {
- mInventory[i] = null;
+ AENetworkProxy proxy = getProxy();
+ try {
+ IMEMonitor<IAEItemStack> sg = proxy.getStorage()
+ .getItemInventory();
+ Iterator<IAEItemStack> iterator = sg.getStorageList()
+ .iterator();
+ int index = 0;
+ while (iterator.hasNext() && index < SLOT_COUNT) {
+ IAEItemStack currItem = iterator.next();
+ if (currItem.getStackSize() >= minAutoPullStackSize) {
+ ItemStack itemstack = GT_Utility.copyAmount(1, currItem.getItemStack());
+ this.mInventory[index] = itemstack;
+ index++;
}
+ }
+ for (int i = index; i < SLOT_COUNT; i++) {
+ mInventory[i] = null;
+ }
- } catch (final GridAccessException ignored) {}
- }
+ } catch (final GridAccessException ignored) {}
}
private void updateAllInformationSlots() {
@@ -417,33 +408,31 @@ public class GT_MetaTileEntity_Hatch_InputBus_ME extends GT_MetaTileEntity_Hatch
@Override
public void endRecipeProcessing() {
- if (GregTech_API.mAE2) {
- for (int i = 0; i < SLOT_COUNT; ++i) {
- if (savedStackSizes[i] != 0) {
- ItemStack oldStack = shadowInventory[i];
- if (oldStack == null || oldStack.stackSize < savedStackSizes[i]) {
- AENetworkProxy proxy = getProxy();
- try {
- IMEMonitor<IAEItemStack> sg = proxy.getStorage()
- .getItemInventory();
- IAEItemStack request = AEItemStack.create(mInventory[i]);
- request.setStackSize(savedStackSizes[i] - (oldStack == null ? 0 : oldStack.stackSize));
- sg.extractItems(request, Actionable.MODULATE, getRequestSource());
- proxy.getEnergy()
- .extractAEPower(request.getStackSize(), Actionable.MODULATE, PowerMultiplier.CONFIG);
- setInventorySlotContents(i + SLOT_COUNT, oldStack);
- } catch (final GridAccessException ignored) {}
- }
- savedStackSizes[i] = 0;
- shadowInventory[i] = null;
+ for (int i = 0; i < SLOT_COUNT; ++i) {
+ if (savedStackSizes[i] != 0) {
+ ItemStack oldStack = shadowInventory[i];
+ if (oldStack == null || oldStack.stackSize < savedStackSizes[i]) {
+ AENetworkProxy proxy = getProxy();
+ try {
+ IMEMonitor<IAEItemStack> sg = proxy.getStorage()
+ .getItemInventory();
+ IAEItemStack request = AEItemStack.create(mInventory[i]);
+ request.setStackSize(savedStackSizes[i] - (oldStack == null ? 0 : oldStack.stackSize));
+ sg.extractItems(request, Actionable.MODULATE, getRequestSource());
+ proxy.getEnergy()
+ .extractAEPower(request.getStackSize(), Actionable.MODULATE, PowerMultiplier.CONFIG);
+ setInventorySlotContents(i + SLOT_COUNT, oldStack);
+ } catch (final GridAccessException ignored) {}
}
+ savedStackSizes[i] = 0;
+ shadowInventory[i] = null;
}
}
processingRecipe = false;
}
public ItemStack updateInformationSlot(int aIndex, ItemStack aStack) {
- if (GregTech_API.mAE2 && aIndex >= 0 && aIndex < SLOT_COUNT) {
+ if (aIndex >= 0 && aIndex < SLOT_COUNT) {
if (aStack == null) {
super.setInventorySlotContents(aIndex + SLOT_COUNT, null);
} else {
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java
index 086cbf0b96..ff284015ea 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_OutputBus_ME.java
@@ -34,7 +34,6 @@ import appeng.util.IWideReadableNumberConverter;
import appeng.util.Platform;
import appeng.util.ReadableNumberConverter;
import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.ITexture;
@@ -49,9 +48,9 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
private BaseActionSource requestSource = null;
private @Nullable AENetworkProxy gridProxy = null;
- final IItemList<IAEItemStack> itemCache = GregTech_API.mAE2 ? AEApi.instance()
+ final IItemList<IAEItemStack> itemCache = AEApi.instance()
.storage()
- .createItemList() : null;
+ .createItemList();
long lastOutputTick = 0;
long tickCounter = 0;
boolean lastOutputFailed = false;
@@ -96,7 +95,6 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
@Override
public boolean storeAll(ItemStack aStack) {
- if (!GregTech_API.mAE2) return false;
aStack.stackSize = store(aStack);
return aStack.stackSize == 0;
}
@@ -210,57 +208,53 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- if (GregTech_API.mAE2) {
- NBTTagList items = new NBTTagList();
- for (IAEItemStack s : itemCache) {
- if (s.getStackSize() == 0) continue;
- NBTTagCompound tag = new NBTTagCompound();
- tag.setTag("itemStack", GT_Utility.saveItem(s.getItemStack()));
- tag.setLong("size", s.getStackSize());
- items.appendTag(tag);
- }
- aNBT.setTag("cachedItems", items);
- getProxy().writeToNBT(aNBT);
+ NBTTagList items = new NBTTagList();
+ for (IAEItemStack s : itemCache) {
+ if (s.getStackSize() == 0) continue;
+ NBTTagCompound tag = new NBTTagCompound();
+ tag.setTag("itemStack", GT_Utility.saveItem(s.getItemStack()));
+ tag.setLong("size", s.getStackSize());
+ items.appendTag(tag);
}
+ aNBT.setTag("cachedItems", items);
+ getProxy().writeToNBT(aNBT);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- if (GregTech_API.mAE2) {
- NBTBase t = aNBT.getTag("cachedStack"); // legacy
- if (t instanceof NBTTagCompound) itemCache.add(
- AEApi.instance()
+ NBTBase t = aNBT.getTag("cachedStack"); // legacy
+ if (t instanceof NBTTagCompound) itemCache.add(
+ AEApi.instance()
+ .storage()
+ .createItemStack(GT_Utility.loadItem((NBTTagCompound) t)));
+ t = aNBT.getTag("cachedItems");
+ if (t instanceof NBTTagList l) {
+ for (int i = 0; i < l.tagCount(); ++i) {
+ NBTTagCompound tag = l.getCompoundTagAt(i);
+ if (!tag.hasKey("itemStack")) { // legacy #868
+ itemCache.add(
+ AEApi.instance()
+ .storage()
+ .createItemStack(GT_Utility.loadItem(l.getCompoundTagAt(i))));
+ continue;
+ }
+ NBTTagCompound tagItemStack = tag.getCompoundTag("itemStack");
+ final IAEItemStack s = AEApi.instance()
.storage()
- .createItemStack(GT_Utility.loadItem((NBTTagCompound) t)));
- t = aNBT.getTag("cachedItems");
- if (t instanceof NBTTagList l) {
- for (int i = 0; i < l.tagCount(); ++i) {
- NBTTagCompound tag = l.getCompoundTagAt(i);
- if (!tag.hasKey("itemStack")) { // legacy #868
- itemCache.add(
- AEApi.instance()
- .storage()
- .createItemStack(GT_Utility.loadItem(l.getCompoundTagAt(i))));
- continue;
- }
- NBTTagCompound tagItemStack = tag.getCompoundTag("itemStack");
- final IAEItemStack s = AEApi.instance()
- .storage()
- .createItemStack(GT_Utility.loadItem(tagItemStack));
- if (s != null) {
- s.setStackSize(tag.getLong("size"));
- itemCache.add(s);
- } else {
- GT_Mod.GT_FML_LOGGER.warn(
- "An error occurred while loading contents of ME Output Bus. This item has been voided: "
- + tagItemStack);
- }
+ .createItemStack(GT_Utility.loadItem(tagItemStack));
+ if (s != null) {
+ s.setStackSize(tag.getLong("size"));
+ itemCache.add(s);
+ } else {
+ GT_Mod.GT_FML_LOGGER.warn(
+ "An error occurred while loading contents of ME Output Bus. This item has been voided: "
+ + tagItemStack);
}
}
- getProxy().readFromNBT(aNBT);
}
+ getProxy().readFromNBT(aNBT);
}
public boolean isLastOutputFailed() {
@@ -274,7 +268,6 @@ public class GT_MetaTileEntity_Hatch_OutputBus_ME extends GT_MetaTileEntity_Hatc
@Override
public String[] getInfoData() {
- if (!GregTech_API.mAE2) return new String[] {};
List<String> ss = new ArrayList<>();
ss.add(
"The bus is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online"
diff --git a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java
index 6deff3edcb..000af7c8de 100644
--- a/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java
+++ b/src/main/java/gregtech/common/tileentities/machines/GT_MetaTileEntity_Hatch_Output_ME.java
@@ -39,7 +39,6 @@ import appeng.me.helpers.IGridProxyable;
import appeng.util.IWideReadableNumberConverter;
import appeng.util.ReadableNumberConverter;
import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.ITexture;
@@ -53,9 +52,9 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
private BaseActionSource requestSource = null;
private @Nullable AENetworkProxy gridProxy = null;
- final IItemList<IAEFluidStack> fluidCache = GregTech_API.mAE2 ? AEApi.instance()
+ final IItemList<IAEFluidStack> fluidCache = AEApi.instance()
.storage()
- .createFluidList() : null;
+ .createFluidList();
long lastOutputTick = 0;
long tickCounter = 0;
boolean lastOutputFailed = false;
@@ -104,7 +103,6 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- if (!GregTech_API.mAE2) return 0;
if (doFill) {
return tryFillAE(aFluid);
} else {
@@ -234,47 +232,43 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
@Override
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
- if (GregTech_API.mAE2) {
- NBTTagList fluids = new NBTTagList();
- for (IAEFluidStack s : fluidCache) {
- if (s.getStackSize() == 0) continue;
- NBTTagCompound tag = new NBTTagCompound();
- NBTTagCompound tagFluidStack = new NBTTagCompound();
- s.getFluidStack()
- .writeToNBT(tagFluidStack);
- tag.setTag("fluidStack", tagFluidStack);
- tag.setLong("size", s.getStackSize());
- fluids.appendTag(tag);
- }
- aNBT.setTag("cachedFluids", fluids);
- getProxy().writeToNBT(aNBT);
+ NBTTagList fluids = new NBTTagList();
+ for (IAEFluidStack s : fluidCache) {
+ if (s.getStackSize() == 0) continue;
+ NBTTagCompound tag = new NBTTagCompound();
+ NBTTagCompound tagFluidStack = new NBTTagCompound();
+ s.getFluidStack()
+ .writeToNBT(tagFluidStack);
+ tag.setTag("fluidStack", tagFluidStack);
+ tag.setLong("size", s.getStackSize());
+ fluids.appendTag(tag);
}
+ aNBT.setTag("cachedFluids", fluids);
+ getProxy().writeToNBT(aNBT);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
- if (GregTech_API.mAE2) {
- NBTBase t = aNBT.getTag("cachedFluids");
- if (t instanceof NBTTagList l) {
- for (int i = 0; i < l.tagCount(); ++i) {
- NBTTagCompound tag = l.getCompoundTagAt(i);
- NBTTagCompound tagFluidStack = tag.getCompoundTag("fluidStack");
- final IAEFluidStack s = AEApi.instance()
- .storage()
- .createFluidStack(GT_Utility.loadFluid(tagFluidStack));
- if (s != null) {
- s.setStackSize(tag.getLong("size"));
- fluidCache.add(s);
- } else {
- GT_Mod.GT_FML_LOGGER.warn(
- "An error occurred while loading contents of ME Output Hatch. This fluid has been voided: "
- + tagFluidStack);
- }
+ NBTBase t = aNBT.getTag("cachedFluids");
+ if (t instanceof NBTTagList l) {
+ for (int i = 0; i < l.tagCount(); ++i) {
+ NBTTagCompound tag = l.getCompoundTagAt(i);
+ NBTTagCompound tagFluidStack = tag.getCompoundTag("fluidStack");
+ final IAEFluidStack s = AEApi.instance()
+ .storage()
+ .createFluidStack(GT_Utility.loadFluid(tagFluidStack));
+ if (s != null) {
+ s.setStackSize(tag.getLong("size"));
+ fluidCache.add(s);
+ } else {
+ GT_Mod.GT_FML_LOGGER.warn(
+ "An error occurred while loading contents of ME Output Hatch. This fluid has been voided: "
+ + tagFluidStack);
}
}
- getProxy().readFromNBT(aNBT);
}
+ getProxy().readFromNBT(aNBT);
}
public boolean isLastOutputFailed() {
@@ -288,7 +282,6 @@ public class GT_MetaTileEntity_Hatch_Output_ME extends GT_MetaTileEntity_Hatch_O
@Override
public String[] getInfoData() {
- if (!GregTech_API.mAE2) return new String[] {};
List<String> ss = new ArrayList<>();
ss.add(
"The hatch is " + ((getProxy() != null && getProxy().isActive()) ? EnumChatFormatting.GREEN + "online"
diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
index d8d4483cb9..5f3ed20c07 100644
--- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
+++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java
@@ -342,7 +342,7 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
mInventory[2] = null;
}
- if (GregTech_API.mAE2) notifyListeners(count - savedCount, stack);
+ notifyListeners(count - savedCount, stack);
if (count != savedCount) getBaseMetaTileEntity().markDirty();
}
}
@@ -468,14 +468,14 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti
@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
- if (GregTech_API.mAE2 && GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) return false;
+ if (GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) return false;
return aIndex == 1;
}
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
- if (GregTech_API.mAE2 && GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) return false;
+ if (GT_Values.disableDigitalChestsExternalAccess && hasActiveMEConnection()) return false;
if (aIndex != 0) return false;
if ((mInventory[0] != null && !GT_Utility.areStacksEqual(mInventory[0], aStack))) return false;
if (mDisableFilter) return true;