Add Super Stock Replenisher (#278)

Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Co-authored-by: lordIcocain <62835225+lordIcocain@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-06-22 17:49:44 +02:00
1 parent 35136c31ee
commit 0499adcc6f
19 files changed
+1039 -6

No files matched your search

@@ -51,6 +51,7 @@ import appeng.api.parts.IPart;
import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEStack;
import appeng.api.util.DimensionalCoord;
import appeng.api.util.WorldCoord;
import appeng.container.AEBaseContainer;
@@ -60,6 +61,7 @@ import appeng.tile.networking.TileCableBus;
import appeng.tile.networking.TileWireless;
import appeng.util.Platform;
import appeng.util.item.AEFluidStack;
import appeng.util.item.AEItemStack;
import baubles.api.BaublesApi;
import codechicken.nei.recipe.StackInfo;
import cpw.mods.fml.common.Loader;
@@ -413,6 +415,36 @@ public final class Util {
}
}
public static void writeAEStackMapToBuf(Map<Integer, IAEStack<?>> list, ByteBuf buf) throws IOException {
buf.writeInt(list.size());
for (Map.Entry<Integer, IAEStack<?>> as : list.entrySet()) {
buf.writeInt(as.getKey());
if (as.getValue() == null) buf.writeBoolean(false);
else {
buf.writeBoolean(true);
as.getValue().writeToPacket(buf);
}
}
}
public static void readAEStackMapFromBuf(Map<Integer, IAEStack<?>> list, ByteBuf buf) throws IOException {
int size = buf.readInt();
for (int i = 0; i < size; i++) {
int id = buf.readInt();
boolean isNull = buf.readBoolean();
if (!isNull) list.put(id, null);
else {
IAEStack<?> as;
if (id > 99) {
as = AEItemStack.loadItemStackFromPacket(buf);
} else {
as = AEFluidStack.loadFluidStackFromPacket(buf);
}
list.put(id, as);
}
}
}
public static class GuiHelper {
public enum GuiType {