From 19e99fe18b9800eeb2c6d3bc0858059721c26929 Mon Sep 17 00:00:00 2001 From: querns <33518699+querns@users.noreply.github.com> Date: Thu, 17 Oct 2024 02:01:02 -0500 Subject: [PATCH 01/38] Refactors shift tooltips on MetaBaseItem a bit (#3333) Co-authored-by: Martin Robertz Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com> --- .../java/gregtech/api/interfaces/IItemBehaviour.java | 5 +++-- src/main/java/gregtech/api/items/MetaBaseItem.java | 11 +++++++++-- .../items/behaviors/BehaviourSprayColorInfinite.java | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java index 3526fc716bb..7a4286f638d 100644 --- a/src/main/java/gregtech/api/interfaces/IItemBehaviour.java +++ b/src/main/java/gregtech/api/interfaces/IItemBehaviour.java @@ -1,6 +1,7 @@ package gregtech.api.interfaces; import java.util.List; +import java.util.Optional; import net.minecraft.dispenser.IBlockSource; import net.minecraft.entity.Entity; @@ -61,8 +62,8 @@ boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aW List getAdditionalToolTips(E aItem, List aList, ItemStack aStack); - default List getAdditionalToolTipsWhileSneaking(E aItem, List aList, ItemStack aStack) { - return aList; + default Optional> getAdditionalToolTipsWhileSneaking(E aItem, List aList, ItemStack aStack) { + return Optional.empty(); } void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand); diff --git a/src/main/java/gregtech/api/items/MetaBaseItem.java b/src/main/java/gregtech/api/items/MetaBaseItem.java index 7369d5d1b26..c6751adb96d 100644 --- a/src/main/java/gregtech/api/items/MetaBaseItem.java +++ b/src/main/java/gregtech/api/items/MetaBaseItem.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; @@ -269,8 +270,14 @@ public final void addInformation(ItemStack aStack, EntityPlayer aPlayer, List> behaviours = mItemBehaviors.get((short) getDamage(aStack)); if (behaviours != null) { for (IItemBehaviour behavior : behaviours) { - aList = !KeyboardUtil.isShiftKeyDown() ? behavior.getAdditionalToolTips(this, aList, aStack) - : behavior.getAdditionalToolTipsWhileSneaking(this, aList, aStack); + final Optional> shiftTooltips = KeyboardUtil.isShiftKeyDown() + ? behavior.getAdditionalToolTipsWhileSneaking(this, aList, aStack) + : Optional.empty(); + if (shiftTooltips.isPresent()) { + aList = shiftTooltips.get(); + } else { + aList = behavior.getAdditionalToolTips(this, aList, aStack); + } } } diff --git a/src/main/java/gregtech/common/items/behaviors/BehaviourSprayColorInfinite.java b/src/main/java/gregtech/common/items/behaviors/BehaviourSprayColorInfinite.java index 7a625afc41f..924d160f2dd 100644 --- a/src/main/java/gregtech/common/items/behaviors/BehaviourSprayColorInfinite.java +++ b/src/main/java/gregtech/common/items/behaviors/BehaviourSprayColorInfinite.java @@ -4,6 +4,7 @@ import static net.minecraft.util.MovingObjectPosition.MovingObjectType.BLOCK; import java.util.List; +import java.util.Optional; import java.util.function.Consumer; import net.minecraft.entity.player.EntityPlayer; @@ -114,8 +115,10 @@ public List getAdditionalToolTips(final MetaBaseItem aItem, final List getAdditionalToolTipsWhileSneaking(final MetaBaseItem aItem, final List aList, + public Optional> getAdditionalToolTipsWhileSneaking(final MetaBaseItem aItem, final List aList, final ItemStack aStack) { + aList.add(StatCollector.translateToLocal("gt.behaviour.paintspray.infinite.tooltip.infinite")); + aList.add(mTooltipChain); aList.add(" "); aList.add(StatCollector.translateToLocal("gt.behaviour.paintspray.infinite.tooltip.switch")); aList.add(StatCollector.translateToLocal("gt.behaviour.paintspray.infinite.tooltip.gui")); @@ -123,7 +126,8 @@ public List getAdditionalToolTipsWhileSneaking(final MetaBaseItem aItem, aList.add(StatCollector.translateToLocal("gt.behaviour.paintspray.infinite.tooltip.lock")); aList.add(" "); aList.add(AuthorQuerns); - return aList; + + return Optional.of(aList); } // endregion From 55a4816242fc945ae367360bb4002cbb4294816d Mon Sep 17 00:00:00 2001 From: Dream Master Date: Thu, 17 Oct 2024 11:13:15 +0200 Subject: [PATCH 02/38] update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 1e1348fd2a5..38873c19c43 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -58,7 +58,7 @@ dependencies { compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.54:dev") - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta7:api') { transitive = false } + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta8:api') { transitive = false } compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.3:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.39:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.18:dev") { transitive = false } From 7ad32098ac5d941f32fff792fc9a11af1097b310 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Thu, 17 Oct 2024 06:24:12 -0400 Subject: [PATCH 03/38] Fix several issues with ender tank covers (#3377) Co-authored-by: Martin Robertz Co-authored-by: Ethryan <3237986+Ethryan@users.noreply.github.com> --- .../enderStorage/EnderFluidContainer.java | 22 +++ .../mechanics/enderStorage/EnderLinkTag.java | 21 ++ .../mechanics/enderStorage/EnderLinkTank.java | 45 ++++- .../enderStorage/EnderWorldSavedData.java | 181 +++++++++++++----- .../thing/cover/CoverEnderFluidLink.java | 85 +++++--- 5 files changed, 278 insertions(+), 76 deletions(-) diff --git a/src/main/java/tectech/mechanics/enderStorage/EnderFluidContainer.java b/src/main/java/tectech/mechanics/enderStorage/EnderFluidContainer.java index f77a5a1b519..9995ec5da07 100644 --- a/src/main/java/tectech/mechanics/enderStorage/EnderFluidContainer.java +++ b/src/main/java/tectech/mechanics/enderStorage/EnderFluidContainer.java @@ -131,4 +131,26 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE } if (fluidStack != null) fluidStack.tag = tag; } + + public NBTTagCompound save() { + NBTTagCompound data = new NBTTagCompound(); + + if (fluidStack != null) { + fluidStack.writeToNBT(data); + } + + return data; + } + + public static EnderFluidContainer load(NBTTagCompound data) { + EnderFluidContainer container = new EnderFluidContainer(); + + if (!"".equals(data.getString("FluidName"))) { + container.fluidStack = FluidStack.loadFluidStackFromNBT(data); + } else { + container.fluidStack = null; + } + + return container; + } } diff --git a/src/main/java/tectech/mechanics/enderStorage/EnderLinkTag.java b/src/main/java/tectech/mechanics/enderStorage/EnderLinkTag.java index 516b7fd637a..78b3c47c10d 100644 --- a/src/main/java/tectech/mechanics/enderStorage/EnderLinkTag.java +++ b/src/main/java/tectech/mechanics/enderStorage/EnderLinkTag.java @@ -3,6 +3,8 @@ import java.io.Serializable; import java.util.UUID; +import net.minecraft.nbt.NBTTagCompound; + import com.google.common.base.Objects; public class EnderLinkTag implements Serializable { @@ -36,4 +38,23 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hashCode(frequency, player); } + + public NBTTagCompound save() { + NBTTagCompound data = new NBTTagCompound(); + + data.setString("Freq", frequency); + if (player != null) { + data.setLong("ID1", player.getLeastSignificantBits()); + data.setLong("ID2", player.getMostSignificantBits()); + } + + return data; + } + + public static EnderLinkTag load(NBTTagCompound data) { + String freq = data.getString("Freq"); + UUID player = data.hasKey("ID1") ? new UUID(data.getLong("ID2"), data.getLong("ID1")) : null; + + return new EnderLinkTag(freq, player); + } } diff --git a/src/main/java/tectech/mechanics/enderStorage/EnderLinkTank.java b/src/main/java/tectech/mechanics/enderStorage/EnderLinkTank.java index 1b14c1371ac..fe363b2058f 100644 --- a/src/main/java/tectech/mechanics/enderStorage/EnderLinkTank.java +++ b/src/main/java/tectech/mechanics/enderStorage/EnderLinkTank.java @@ -2,11 +2,14 @@ import java.io.Serializable; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fluids.IFluidHandler; import com.google.common.base.Objects; +import com.gtnewhorizon.gtnhlib.util.CoordinatePacker; public class EnderLinkTank implements Serializable { @@ -24,12 +27,24 @@ public EnderLinkTank(IFluidHandler fluidHandler) { D = tile.getWorldObj().provider.dimensionId; } + private EnderLinkTank(int x, int y, int z, int d) { + X = x; + Y = y; + Z = z; + D = d; + } + public IFluidHandler getFluidHandler() { - IFluidHandler fluidHandler = null; - TileEntity tile = DimensionManager.getWorld(D) - .getTileEntity(X, Y, Z); - if (tile instanceof IFluidHandler) fluidHandler = (IFluidHandler) tile; - return fluidHandler; + World world = DimensionManager.getWorld(D); + + if (world == null) return null; + + TileEntity tile = world.getTileEntity(X, Y, Z); + if (tile instanceof IFluidHandler fluidHandler) { + return fluidHandler; + } else { + return null; + } } @Override @@ -44,4 +59,24 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hashCode(X, Y, Z, D); } + + public NBTTagCompound save() { + NBTTagCompound data = new NBTTagCompound(); + + data.setLong("coords", CoordinatePacker.pack(X, Y, Z)); + data.setInteger("dim", D); + + return data; + } + + public static EnderLinkTank load(NBTTagCompound data) { + long coords = data.getLong("coords"); + int dim = data.getInteger("dim"); + + return new EnderLinkTank( + CoordinatePacker.unpackX(coords), + CoordinatePacker.unpackY(coords), + CoordinatePacker.unpackZ(coords), + dim); + } } diff --git a/src/main/java/tectech/mechanics/enderStorage/EnderWorldSavedData.java b/src/main/java/tectech/mechanics/enderStorage/EnderWorldSavedData.java index 515812548ea..62625ed4358 100644 --- a/src/main/java/tectech/mechanics/enderStorage/EnderWorldSavedData.java +++ b/src/main/java/tectech/mechanics/enderStorage/EnderWorldSavedData.java @@ -1,15 +1,18 @@ package tectech.mechanics.enderStorage; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; +import java.io.ObjectStreamClass; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Objects; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; import net.minecraft.world.WorldSavedData; import net.minecraft.world.storage.MapStorage; import net.minecraftforge.common.DimensionManager; @@ -26,7 +29,7 @@ public class EnderWorldSavedData extends WorldSavedData { private static final String DATA_NAME = Reference.MODID + "_EnderWorldSavedData"; private static final String ENDER_LIQUID_TAG_LINK = DATA_NAME + "_EnderLiquidTagLink"; private static final String ENDER_LIQUID_TANK_LINK = DATA_NAME + "_EnderLiquidTankLink"; - private static final EnderLinkTag DEFAULT_LINK_TAG = new EnderLinkTag("", null); + private static final String ENDER_LIQUID_TAG_VERSION = DATA_NAME + "_Version"; private Map EnderLiquidTagLink = new HashMap<>(); private Map EnderLiquidTankLink = new HashMap<>(); @@ -42,54 +45,91 @@ public EnderWorldSavedData(String s) { @SuppressWarnings("unchecked") @Override public void readFromNBT(NBTTagCompound nbtTagCompound) { - try { - byte[] ba = nbtTagCompound.getByteArray(ENDER_LIQUID_TAG_LINK); - InputStream is = new ByteArrayInputStream(ba); - ObjectInputStream ois = new ObjectInputStream(is); - Object data = ois.readObject(); - EnderLiquidTagLink = (Map) data; - } catch (IOException | ClassNotFoundException e) { - System.out.println("ENDER_LIQUID_TAG_LINK LOAD FAILED"); - e.printStackTrace(); - } + int version = nbtTagCompound.getInteger(ENDER_LIQUID_TAG_VERSION); + + switch (version) { + case 0: { + try { + byte[] bytes = nbtTagCompound.getByteArray(ENDER_LIQUID_TAG_LINK); + + try (InputStream is = new ByteArrayInputStream(bytes); + ObjectInputStream objectStream = new MigratingObjectInputStream(is);) { + EnderLiquidTagLink = (Map) objectStream.readObject(); + } + } catch (IOException | ClassNotFoundException e) { + System.out.println("ENDER_LIQUID_TAG_LINK LOAD FAILED"); + e.printStackTrace(); + } + + try { + byte[] bytes = nbtTagCompound.getByteArray(ENDER_LIQUID_TANK_LINK); + try (InputStream is = new ByteArrayInputStream(bytes); + ObjectInputStream objectStream = new MigratingObjectInputStream(is);) { + EnderLiquidTankLink = (Map) objectStream.readObject(); + } + } catch (IOException | ClassNotFoundException e) { + System.out.println("ENDER_LIQUID_TANK_LINK LOAD FAILED"); + e.printStackTrace(); + } + break; + } + case 1: { + List tags = ((NBTTagList) nbtTagCompound.getTag(ENDER_LIQUID_TAG_LINK)).tagList; + + EnderLiquidTagLink = new HashMap<>(); + + for (NBTTagCompound tagLink : tags) { + EnderLinkTag tag = EnderLinkTag.load((NBTTagCompound) tagLink.getTag("k")); + EnderFluidContainer container = EnderFluidContainer.load((NBTTagCompound) tagLink.getTag("v")); + EnderLiquidTagLink.put(tag, container); + } + + List tanks = ((NBTTagList) nbtTagCompound.getTag(ENDER_LIQUID_TANK_LINK)).tagList; - try { - byte[] ba = nbtTagCompound.getByteArray(ENDER_LIQUID_TANK_LINK); - InputStream is = new ByteArrayInputStream(ba); - ObjectInputStream ois = new ObjectInputStream(is); - Object data = ois.readObject(); - EnderLiquidTankLink = (Map) data; - } catch (IOException | ClassNotFoundException e) { - System.out.println("ENDER_LIQUID_TANK_LINK LOAD FAILED"); - e.printStackTrace(); + EnderLiquidTankLink = new HashMap<>(); + + for (NBTTagCompound tankLink : tanks) { + EnderLinkTank tank = EnderLinkTank.load((NBTTagCompound) tankLink.getTag("k")); + EnderLinkTag tag = EnderLinkTag.load((NBTTagCompound) tankLink.getTag("v")); + EnderLiquidTankLink.put(tank, tag); + } + + break; + } } } @Override public void writeToNBT(NBTTagCompound nbtTagCompound) { - try { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(EnderLiquidTagLink); - oos.flush(); - byte[] data = bos.toByteArray(); - nbtTagCompound.setByteArray(ENDER_LIQUID_TAG_LINK, data); - } catch (IOException e) { - System.out.println("ENDER_LIQUID_TAG_LINK SAVE FAILED"); - e.printStackTrace(); - } + nbtTagCompound.setInteger(ENDER_LIQUID_TAG_VERSION, 1); - try { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(EnderLiquidTankLink); - oos.flush(); - byte[] data = bos.toByteArray(); - nbtTagCompound.setByteArray(ENDER_LIQUID_TANK_LINK, data); - } catch (IOException e) { - System.out.println("ENDER_LIQUID_TANK_LINK SAVE FAILED"); - e.printStackTrace(); - } + HashSet usedTags = new HashSet<>(); + + NBTTagList tanks = new NBTTagList(); + + EnderLiquidTankLink.forEach((tank, tag) -> { + if (tank.getFluidHandler() != null) { + usedTags.add(tag); + NBTTagCompound entry = new NBTTagCompound(); + entry.setTag("k", tank.save()); + entry.setTag("v", tag.save()); + tanks.appendTag(entry); + } + }); + + nbtTagCompound.setTag(ENDER_LIQUID_TANK_LINK, tanks); + NBTTagList tags = new NBTTagList(); + + EnderLiquidTagLink.forEach((tag, container) -> { + if (usedTags.contains(tag)) { + NBTTagCompound entry = new NBTTagCompound(); + entry.setTag("k", tag.save()); + entry.setTag("v", container.save()); + tags.appendTag(entry); + } + }); + + nbtTagCompound.setTag(ENDER_LIQUID_TAG_LINK, tags); } private static void loadInstance() { @@ -123,16 +163,38 @@ public static EnderFluidContainer getEnderFluidContainer(EnderLinkTag tag) { public static EnderLinkTag getEnderLinkTag(IFluidHandler handler) { EnderLinkTank tank = new EnderLinkTank(handler); - if (!getEnderLiquidTankLink().containsKey(tank)) { - getEnderLiquidTankLink().put(tank, DEFAULT_LINK_TAG); + EnderLinkTag tag = getEnderLiquidTankLink().get(tank); + + if (tag != null && Objects.equals(tag.getFrequency(), "")) { + tag = null; } - return getEnderLiquidTankLink().get(tank); + + return tag; } public static void bindEnderLinkTag(IFluidHandler handler, EnderLinkTag tag) { EnderLinkTank tank = new EnderLinkTank(handler); - getEnderLiquidTankLink().remove(tank); - getEnderLiquidTankLink().put(tank, tag); + + if (!tag.equals(getEnderLiquidTankLink().get(tank))) { + unbindTank(handler); + + getEnderLiquidTankLink().remove(tank); + getEnderLiquidTankLink().put(tank, tag); + } + } + + public static void unbindTank(IFluidHandler handler) { + EnderLinkTank tank = new EnderLinkTank(handler); + EnderLinkTag oldTag = getEnderLiquidTankLink().remove(tank); + + if (oldTag != null) { + boolean isReferenced = getEnderLiquidTankLink().values() + .contains(oldTag); + + if (!isReferenced) { + getEnderLiquidLink().remove(oldTag); + } + } } @SubscribeEvent @@ -141,4 +203,25 @@ public void onWorldUnload(WorldEvent.Unload event) { INSTANCE = null; } } + + private static class MigratingObjectInputStream extends ObjectInputStream { + + public MigratingObjectInputStream(InputStream in) throws IOException { + super(in); + } + + @Override + protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException { + ObjectStreamClass resultClassDescriptor = super.readClassDescriptor(); + + String className = resultClassDescriptor.getName(); + + if (className.startsWith("com.github.technus.")) { + resultClassDescriptor = ObjectStreamClass + .lookup(Class.forName(className.replace("com.github.technus.", ""))); + } + + return resultClassDescriptor; + } + } } diff --git a/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java b/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java index bae4e26b6c2..9e63c852219 100644 --- a/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java +++ b/src/main/java/tectech/thing/cover/CoverEnderFluidLink.java @@ -1,5 +1,6 @@ package tectech.thing.cover; +import java.util.Objects; import java.util.UUID; import net.minecraft.entity.player.EntityPlayer; @@ -45,30 +46,49 @@ private void transferFluid(IFluidHandler source, ForgeDirection side, IFluidHand } } - private boolean testBit(int aCoverVariable, int bitMask) { + private static boolean testBit(int aCoverVariable, int bitMask) { return (aCoverVariable & bitMask) != 0; } - private int toggleBit(int aCoverVariable, int bitMask) { + private static int toggleBit(int aCoverVariable, int bitMask) { return (aCoverVariable ^ bitMask); } @Override public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { - if ((aTileEntity instanceof IFluidHandler fluidHandlerSelf)) { - IFluidHandler fluidHandlerEnder = EnderWorldSavedData - .getEnderFluidContainer(EnderWorldSavedData.getEnderLinkTag((IFluidHandler) aTileEntity)); - - if (testBit(aCoverVariable, IMPORT_EXPORT_MASK)) { - transferFluid(fluidHandlerEnder, ForgeDirection.UNKNOWN, fluidHandlerSelf, side, L_PER_TICK); - } else { - transferFluid(fluidHandlerSelf, side, fluidHandlerEnder, ForgeDirection.UNKNOWN, L_PER_TICK); + if ((aTileEntity instanceof IFluidHandler teTank)) { + EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag((IFluidHandler) aTileEntity); + + if (tag != null) { + IFluidHandler enderTank = EnderWorldSavedData.getEnderFluidContainer(tag); + + if (testBit(aCoverVariable, IMPORT_EXPORT_MASK)) { + transferFluid(enderTank, ForgeDirection.UNKNOWN, teTank, side, L_PER_TICK); + } else { + transferFluid(teTank, side, enderTank, ForgeDirection.UNKNOWN, L_PER_TICK); + } } } return aCoverVariable; } + @Override + public void onBaseTEDestroyed(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + if (aTileEntity instanceof IFluidHandler fluidHandlerSelf) { + EnderWorldSavedData.unbindTank(fluidHandlerSelf); + } + } + + @Override + public boolean onCoverRemoval(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + boolean aForced) { + if (aTileEntity instanceof IFluidHandler fluidHandlerSelf) { + EnderWorldSavedData.unbindTank(fluidHandlerSelf); + } + return true; + } + @Override public String getDescription(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { return ""; @@ -143,23 +163,23 @@ protected void addUIWidgets(ModularWindow.Builder builder) { builder.widget(frequencyField.setGetter(() -> { ICoverable te = getUIBuildContext().getTile(); if (!frequencyField.isClient() && te instanceof IFluidHandler) { - return EnderWorldSavedData.getEnderLinkTag((IFluidHandler) te) - .getFrequency(); + EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag((IFluidHandler) te); + + return tag == null ? "" : tag.getFrequency(); } return ""; }) .setSetter(val -> { - ICoverable te = getUIBuildContext().getTile(); - if (!frequencyField.isClient() && te instanceof IFluidHandler) { - UUID uuid; + if (!frequencyField.isClient() && getUIBuildContext().getTile() instanceof IFluidHandler tank) { + UUID uuid = null; + if (testBit(convert(getCoverData()), PUBLIC_PRIVATE_MASK)) { uuid = getUUID(); - if (!(te instanceof IGregTechTileEntity)) return; - if (!uuid.equals(((IGregTechTileEntity) te).getOwnerUuid())) return; - } else { - uuid = null; + if (!(tank instanceof IGregTechTileEntity gte)) return; + if (!uuid.equals(gte.getOwnerUuid())) return; } - EnderWorldSavedData.bindEnderLinkTag((IFluidHandler) te, new EnderLinkTag(val, uuid)); + + EnderWorldSavedData.bindEnderLinkTag(tank, new EnderLinkTag(val, uuid)); } }) .setTextColor(Color.WHITE.dark(1)) @@ -213,9 +233,30 @@ protected void addUIWidgets(ModularWindow.Builder builder) { private int getNewCoverVariable(int id, int coverVariable) { switch (id) { - case PUBLIC_BUTTON_ID: - case PRIVATE_BUTTON_ID: + case PUBLIC_BUTTON_ID: { + if (getUIBuildContext().getTile() instanceof IGregTechTileEntity gte) { + EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag(gte); + + if (tag != null) { + EnderWorldSavedData.bindEnderLinkTag(gte, new EnderLinkTag(tag.getFrequency(), null)); + } + } + + return toggleBit(coverVariable, PUBLIC_PRIVATE_MASK); + } + case PRIVATE_BUTTON_ID: { + if (getUIBuildContext().getTile() instanceof IGregTechTileEntity gte) { + EnderLinkTag tag = EnderWorldSavedData.getEnderLinkTag(gte); + + UUID player = getUUID(); + + if ((gte.getOwnerUuid() == null || Objects.equals(player, gte.getOwnerUuid())) && tag != null) { + EnderWorldSavedData.bindEnderLinkTag(gte, new EnderLinkTag(tag.getFrequency(), player)); + } + } + return toggleBit(coverVariable, PUBLIC_PRIVATE_MASK); + } case IMPORT_BUTTON_ID: case EXPORT_BUTTON_ID: return toggleBit(coverVariable, IMPORT_EXPORT_MASK); From 994490cac9fd9ff71fcea7f2b9e97e420e04ac26 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:44:06 +0200 Subject: [PATCH 04/38] Bind all tooltip separators to the config (#3376) Co-authored-by: boubou19 --- .../api/util/MultiblockTooltipBuilder.java | 74 ++++++++++--------- src/main/java/gregtech/common/GTProxy.java | 6 ++ .../java/gregtech/common/config/Client.java | 4 + .../gregtech/loaders/preload/GTPreLoad.java | 1 + .../metaTileEntity/multi/MTEEyeOfHarmony.java | 20 ++--- .../metaTileEntity/multi/MTEForgeOfGods.java | 10 +-- .../godforge_modules/MTEExoticModule.java | 4 +- .../godforge_modules/MTEMoltenModule.java | 2 +- .../godforge_modules/MTEPlasmaModule.java | 2 +- .../godforge_modules/MTESmeltingModule.java | 2 +- 10 files changed, 72 insertions(+), 53 deletions(-) diff --git a/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java index 5b858a426a9..007a73d588e 100644 --- a/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java +++ b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java @@ -133,14 +133,7 @@ public MultiblockTooltipBuilder addInfoAll(String... infoStrings) { * @return Instance this method was called on. */ public MultiblockTooltipBuilder addSeparator() { - switch (GTMod.gregtechproxy.separatorStyle) { - case 0 -> iLines.add(" "); - case 1 -> iLines.add(EnumChatFormatting.GRAY + StringUtils.getRepetitionOf('-', 41)); - default -> iLines.add( - EnumChatFormatting.GRAY.toString() + EnumChatFormatting.STRIKETHROUGH - + StringUtils.getRepetitionOf('-', 41)); - } - return this; + return addSeparator(EnumChatFormatting.GRAY, 41); } /** @@ -148,11 +141,12 @@ public MultiblockTooltipBuilder addSeparator() { * * @return Instance this method was called on. */ - public MultiblockTooltipBuilder addLineSeparator(EnumChatFormatting color, int length) { - if (GTMod.gregtechproxy.separatorStyle == 1) { - iLines.add(color + StringUtils.getRepetitionOf('-', length)); - } else { - iLines.add(color.toString() + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); + public MultiblockTooltipBuilder addSeparator(EnumChatFormatting color, int length) { + switch (GTMod.gregtechproxy.separatorStyle) { + case 0 -> iLines.add(" "); + case 1 -> iLines.add(color + StringUtils.getRepetitionOf('-', length)); + default -> iLines + .add(color.toString() + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); } return this; } @@ -681,11 +675,25 @@ public MultiblockTooltipBuilder addStructureInfo(String info) { * * @return Instance this method was called on. */ - public MultiblockTooltipBuilder addStructureInfoLineSeparator(EnumChatFormatting color, int length) { - if (GTMod.gregtechproxy.separatorStyle == 1) { - sLines.add(color + StringUtils.getRepetitionOf('-', length)); + public MultiblockTooltipBuilder addStructureInfoSeparator(EnumChatFormatting color, int length, + boolean useFinisherConfig) { + if (useFinisherConfig) { + switch (GTMod.gregtechproxy.tooltipFinisherStyle) { + case 0 -> {} + case 1 -> sLines.add(TAB + " "); + case 2 -> sLines.add(TAB + color + StringUtils.getRepetitionOf('-', length)); + default -> sLines.add( + TAB + color.toString() + + EnumChatFormatting.STRIKETHROUGH + + StringUtils.getRepetitionOf('-', length)); + } } else { - sLines.add(color.toString() + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); + switch (GTMod.gregtechproxy.separatorStyle) { + case 0 -> sLines.add(TAB + " "); + case 1 -> sLines.add(TAB + color + StringUtils.getRepetitionOf('-', length)); + default -> sLines + .add(TAB + color + EnumChatFormatting.STRIKETHROUGH + StringUtils.getRepetitionOf('-', length)); + } } return this; } @@ -696,14 +704,7 @@ public MultiblockTooltipBuilder addStructureInfoLineSeparator(EnumChatFormatting * @return Instance this method was called on. */ public MultiblockTooltipBuilder addStructureInfoSeparator() { - switch (GTMod.gregtechproxy.separatorStyle) { - case 0 -> sLines.add(" "); - case 1 -> sLines.add(EnumChatFormatting.GRAY + StringUtils.getRepetitionOf('-', 30)); - default -> sLines.add( - EnumChatFormatting.GRAY.toString() + EnumChatFormatting.STRIKETHROUGH - + StringUtils.getRepetitionOf('-', 30)); - } - return this; + return addStructureInfoSeparator(EnumChatFormatting.GRAY, 30, false); } /** @@ -754,8 +755,7 @@ public MultiblockTooltipBuilder addStructureHint(String name, int... dots) { * @param authors Formatted names of the creators of this multiblock machine - if any */ public MultiblockTooltipBuilder toolTipFinisher(@Nullable String... authors) { - iLines.add(" "); - return toolTipFinisher0(authors); + return toolTipFinisher(EnumChatFormatting.GRAY, 41, authors); } /** @@ -766,15 +766,23 @@ public MultiblockTooltipBuilder toolTipFinisher(@Nullable String... authors) { *

* Ends the building process. * - * @param authors Formatted names of the creators of this multiblock machine - if any + * @param separatorColor Color of the separator line + * @param separatorLength Length of the separator line + * @param authors Formatted names of the creators of this multiblock machine - if any */ + public MultiblockTooltipBuilder toolTipFinisher(EnumChatFormatting separatorColor, int separatorLength, @Nullable String... authors) { - this.addLineSeparator(separatorColor, separatorLength); - return toolTipFinisher0(authors); - } - private MultiblockTooltipBuilder toolTipFinisher0(@Nullable String... authors) { + switch (GTMod.gregtechproxy.tooltipFinisherStyle) { + case 0 -> {} + case 1 -> iLines.add(" "); + case 2 -> iLines.add(separatorColor + StringUtils.getRepetitionOf('-', separatorLength)); + default -> iLines.add( + separatorColor.toString() + EnumChatFormatting.STRIKETHROUGH + + StringUtils.getRepetitionOf('-', separatorLength)); + } + iLines.add( TT_hold + " " + EnumChatFormatting.BOLD @@ -807,7 +815,7 @@ private MultiblockTooltipBuilder toolTipFinisher0(@Nullable String... authors) { iLines.add(sb.toString()); } hLines.add(TT_structurehint); - sLines.add(" "); + this.addStructureInfoSeparator(EnumChatFormatting.GRAY, 30, true); sLines.add(EnumChatFormatting.WHITE + TT_StructureComplex); sLines.add( EnumChatFormatting.WHITE + TT_SeeStructure1 diff --git a/src/main/java/gregtech/common/GTProxy.java b/src/main/java/gregtech/common/GTProxy.java index 1515256ec1a..643811234da 100644 --- a/src/main/java/gregtech/common/GTProxy.java +++ b/src/main/java/gregtech/common/GTProxy.java @@ -691,6 +691,12 @@ public enum OreDropSystem { */ public int separatorStyle = 2; + /** + * Which style should tooltip finisher separator lines have? 0: no line, 1: empty line, 2: dashed line, 3+: + * continuous line + */ + public int tooltipFinisherStyle = 1; + /** * Whether to show seconds or ticks on NEI */ diff --git a/src/main/java/gregtech/common/config/Client.java b/src/main/java/gregtech/common/config/Client.java index f51c154466f..fdbd0fe6e0a 100644 --- a/src/main/java/gregtech/common/config/Client.java +++ b/src/main/java/gregtech/common/config/Client.java @@ -107,6 +107,10 @@ public static class Interface { @Config.Comment("Which style should tooltip separator lines have? 0: empty line, 1: dashed line, 2+: continuous line.") @Config.DefaultInt(2) public int separatorStyle; + + @Config.Comment("Which style should tooltip finisher separator lines have? 0: no line, 1: empty line, 2: dashed line, 3+: continuous line.") + @Config.DefaultInt(1) + public int tooltipFinisherStyle; } @Config.LangKey("GT5U.gui.config.client.preference") diff --git a/src/main/java/gregtech/loaders/preload/GTPreLoad.java b/src/main/java/gregtech/loaders/preload/GTPreLoad.java index 12c32941534..7fcea477c58 100644 --- a/src/main/java/gregtech/loaders/preload/GTPreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GTPreLoad.java @@ -588,6 +588,7 @@ public static void loadClientConfig() { GTMod.gregtechproxy.mTooltipShiftVerbosity = Client.iface.tooltipShiftVerbosity; GTMod.gregtechproxy.mTitleTabStyle = Client.iface.titleTabStyle; GTMod.gregtechproxy.separatorStyle = Client.iface.separatorStyle; + GTMod.gregtechproxy.tooltipFinisherStyle = Client.iface.tooltipFinisherStyle; GTMod.gregtechproxy.mNEIRecipeSecondMode = Client.nei.NEIRecipeSecondMode; GTMod.gregtechproxy.mNEIRecipeOwner = Client.nei.NEIRecipeOwner; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index bb798b9b2c7..403208a3937 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -976,7 +976,7 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo("engineering. Certified Time Lord regulation compliant. This multi uses too much EU") .addInfo("to be handled with conventional means. All EU requirements are handled directly by") .addInfo("your wireless EU network.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo("This multiblock will constantly consume hydrogen and helium when it is not running a") .addInfo("recipe once per second. It will store this internally, you can see the totals by") .addInfo("using a scanner. This multi also has three tiered blocks with " + RED + 9 + GRAY + " tiers") @@ -1030,24 +1030,24 @@ public MultiblockTooltipBuilder createTooltip() { + "%" + GRAY + " per tier (additive).") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo("Going over a recipe requirement on hydrogen or helium has a penalty on yield and recipe chance.") .addInfo("All stored hydrogen and helium is consumed during a craft. The associated formulas are:") .addInfo(GREEN + "Overflow ratio = (Stored fluid / Recipe requirement) - 1") .addInfo(GREEN + "Adjustment value = 1 - exp(-(30 * Overflow ratio)^2)") .addInfo("The Adjustment value is then subtracted from the total yield and recipe chance.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo("It should be noted that base recipe chance is determined per recipe and yield always starts") .addInfo("at 1 and subtracts depending on penalties. All fluid/item outputs are multiplied by the") .addInfo("yield. Failure fluid is exempt.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo("This multiblock can only output to ME output buses/hatches.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo("This multiblock can be overclocked by placing a programmed circuit into the input bus.") .addInfo( "E.g. A circuit of 2 will provide 2 OCs, 16x EU input and 0.25x the time. EU output is unaffected.") .addInfo("All outputs are equal. All item and fluid output chances & amounts per recipe are unaffected.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo( "If a recipe fails the EOH will output " + GREEN + "Success chance * " @@ -1060,14 +1060,14 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo( MaterialsUEVplus.SpaceTime.getLocalizedNameForItem("%material") + " instead of fluid/item outputs and output as much EU as a successful recipe.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo( "This multiblock can perform parallel processing by placing Astral Array Fabricators into the input bus.") .addInfo( "They are stored internally and can be retrieved via right-clicking the controller with a wire cutter.") .addInfo( "The maximum amount of stored Astral Arrays is " + formatNumbers(ASTRAL_ARRAY_LIMIT) - + ". The amount of parallel is calculated via these formulas:") + + ". Parallel amount is calculated via these formulas:") .addInfo( GREEN + "Parallel exponent = floor(log(" + formatNumbers(PARALLEL_FOR_FIRST_ASTRAL_ARRAY) @@ -1095,7 +1095,7 @@ public MultiblockTooltipBuilder createTooltip() { + GRAY + ".") .addInfo("The success or failure of each parallel is determined independently.") - .addLineSeparator(EnumChatFormatting.GOLD, 87) + .addSeparator(EnumChatFormatting.GOLD, 87) .addInfo("Animations can be disabled by using a screwdriver on the multiblock.") .addInfo("Planet block can be inserted directly by right-clicking the controller with planet block.") .beginStructureBlock(33, 33, 33, false) @@ -1113,7 +1113,7 @@ public MultiblockTooltipBuilder createTooltip() { EnumChatFormatting.GOLD + "48" + EnumChatFormatting.GRAY + " Stabilisation Field Generator.") .addStructureInfo( EnumChatFormatting.GOLD + "138" + EnumChatFormatting.GRAY + " Spacetime Compression Field Generator.") - .addStructureInfo("") + .addStructureInfoSeparator() .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 2 + EnumChatFormatting.GRAY + " input hatches.") .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " ME output hatch.") .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " input bus.") diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java index 30173ef91f6..5824b99beda 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java @@ -3065,7 +3065,7 @@ public MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); tt.addMachineType("Stellar Forge") .addInfo(EnumChatFormatting.ITALIC + "Also known as Godforge or Gorge for short.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 73) .addInfo("A massive structure harnessing the thermal, gravitational and") .addInfo("kinetic energy of a stabilised neutron star for material processing.") .addInfo( @@ -3075,7 +3075,7 @@ public MultiblockTooltipBuilder createTooltip() { + "which utilize the star to energize materials") .addInfo("to varying degrees, ranging from regular smelting to matter degeneration.") .addInfo("EU requirements for all modules are handled via wireless energy directly.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 73) .addInfo( "This multiblock has an " + EnumChatFormatting.GOLD + "extensive upgrade tree " @@ -3093,7 +3093,7 @@ public MultiblockTooltipBuilder createTooltip() { + EnumChatFormatting.GRAY + "These upgrades can be unlocked by reaching") .addInfo("certain milestones and/or spending materials.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 73) .addInfo( EnumChatFormatting.GREEN + "Clicking on the logo in the controller gui opens an extensive information window,") @@ -3196,11 +3196,11 @@ public MultiblockTooltipBuilder createTooltip() { + " Graviton Flow Modulator") .addStructureInfo( EnumChatFormatting.GOLD + "36" + EnumChatFormatting.GRAY + " Stellar Energy Siphon Casing") - .addStructureInfo("") + .addStructureInfoSeparator() .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " Input Hatch") .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " Output Bus (ME)") .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " Input Bus") - .toolTipFinisher(EnumChatFormatting.AQUA, 74); + .toolTipFinisher(EnumChatFormatting.AQUA, 73); return tt; } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java index ea75f67cbaf..dcf4389e2eb 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java @@ -646,7 +646,7 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo("This is a module of the Godforge.") .addInfo("Must be part of a Godforge to function.") .addInfo("Used for ultra high temperature matter degeneration.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 75) .addInfo("The fourth and final module of the Godforge, this module breaks apart the very") .addInfo("building blocks of matter, producing exotic mixtures in the process. Quark-Gluon Plasma") .addInfo("can be manufactured right away, but production of Magnetic Monopole Matter (Magmatter)") @@ -668,7 +668,7 @@ public MultiblockTooltipBuilder createTooltip() { .addStructureInfo(EnumChatFormatting.GOLD + "1" + EnumChatFormatting.GRAY + " Stellar Energy Siphon Casing") .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " Output Hatch") .addStructureInfo("Requires " + EnumChatFormatting.GOLD + 1 + EnumChatFormatting.GRAY + " Output Bus") - .toolTipFinisher(EnumChatFormatting.AQUA, 74); + .toolTipFinisher(EnumChatFormatting.AQUA, 75); return tt; } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java index 933983178a8..63f8879805c 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java @@ -153,7 +153,7 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo("This is a module of the Godforge.") .addInfo("Must be part of a Godforge to function.") .addInfo("Used for high temperature material liquefaction.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 74) .addInfo("The second module of the Godforge, this module melts materials directly into") .addInfo("their liquid form. If an output material does not have a liquid form, it will be output") .addInfo("as a regular solid instead.") diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java index 81698496396..faebecff471 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java @@ -224,7 +224,7 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo("This is a module of the Godforge.") .addInfo("Must be part of a Godforge to function.") .addInfo("Used for extreme temperature matter ionization.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 74) .addInfo("The third module of the Godforge, this module infuses materials with extreme amounts") .addInfo("of heat, ionizing and turning them into plasma directly. Not all plasmas can be produced") .addInfo("right away, some of them require certain upgrades to be unlocked.") diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java index dbf1e621d55..779280b1fe6 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java @@ -233,7 +233,7 @@ public MultiblockTooltipBuilder createTooltip() { .addInfo("This is a module of the Godforge.") .addInfo("Must be part of a Godforge to function.") .addInfo("Used for basic smelting operations at various temperatures.") - .addLineSeparator(EnumChatFormatting.AQUA, 74) + .addSeparator(EnumChatFormatting.AQUA, 74) .addInfo("As the first of the Godforge modules, this module performs the most basic") .addInfo("thermal processing, namely smelting materials identically to a furnace or blast furnace.") .addInfo("The desired method of processing can be selected in the gui.") From b3639bcb0949526ebad496bc9eeedbc2008ffcfb Mon Sep 17 00:00:00 2001 From: Spacebuilder2020 Date: Thu, 17 Oct 2024 04:51:00 -0600 Subject: [PATCH 05/38] Fix a rare overflow case when a fuel is so large that it breaks the super efficiency check. (#3332) Co-authored-by: boubou19 --- .../tileentities/machines/multi/MTELargeBoiler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java index 6f8f2076a6b..fdda78122bb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeBoiler.java @@ -276,9 +276,9 @@ public CheckRecipeResult checkProcessing() { if (tFluid != null && tRecipe.mSpecialValue > 1) { tFluid.amount = 1000; if (depleteInput(tFluid)) { + this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease() * 4; this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(tRecipe.mSpecialValue / 2)); this.mEUt = adjustEUtForConfig(getEUt()); - this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease() * 4; return CheckRecipeResultRegistry.SUCCESSFUL; } } @@ -288,10 +288,10 @@ public CheckRecipeResult checkProcessing() { if (tFluid != null) { tFluid.amount = 1000; if (depleteInput(tFluid)) { + this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); this.mMaxProgresstime = adjustBurnTimeForConfig( Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2))); this.mEUt = adjustEUtForConfig(getEUt()); - this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); return CheckRecipeResultRegistry.SUCCESSFUL; } } @@ -308,9 +308,9 @@ public CheckRecipeResult checkProcessing() { this.excessFuel += GTModHandler.getFuelValue(tInput) % 80; this.mMaxProgresstime += this.excessFuel / 80; this.excessFuel %= 80; + this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); this.mMaxProgresstime = adjustBurnTimeForConfig(runtimeBoost(this.mMaxProgresstime)); this.mEUt = adjustEUtForConfig(getEUt()); - this.mEfficiencyIncrease = this.mMaxProgresstime * getEfficiencyIncrease(); this.mOutputItems = new ItemStack[] { GTUtility.getContainerItem(tInput, true) }; tInput.stackSize -= 1; updateSlots(); @@ -482,7 +482,7 @@ private int adjustBurnTimeForConfig(int rawBurnTime) { // Checks if the fuel is eligible for a super efficiency increase and if so, we want to immediately apply the // adjustment! // We also want to check that the fuel - if (rawBurnTime * getEfficiencyIncrease() <= 5000 && mEfficiency < getCorrectedMaxEfficiency(mInventory[1])) { + if (mEfficiencyIncrease <= 5000 && mEfficiency < getCorrectedMaxEfficiency(mInventory[1])) { return rawBurnTime; } int adjustedEUt = Math.max(25, getEUt() - (isSuperheated() ? 75 : 25) * integratedCircuitConfig); From 37c33c050e5c6039f410c6b7360fb146b9aae7a2 Mon Sep 17 00:00:00 2001 From: Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> Date: Thu, 17 Oct 2024 05:03:06 -0600 Subject: [PATCH 06/38] Reworked cleanroom structure check. (#3312) Co-authored-by: Martin Robertz --- .../api/util/MultiblockTooltipBuilder.java | 13 + .../gregtech/common/config/MachineStats.java | 29 + .../machines/multi/MTECleanroom.java | 858 ++++++++++++------ .../gregtech/loaders/preload/GTPreLoad.java | 4 - .../resources/assets/gregtech/lang/en_US.lang | 1 + 5 files changed, 615 insertions(+), 290 deletions(-) diff --git a/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java index 007a73d588e..6c4b248aad2 100644 --- a/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java +++ b/src/main/java/gregtech/api/util/MultiblockTooltipBuilder.java @@ -131,6 +131,7 @@ public MultiblockTooltipBuilder addInfoAll(String... infoStrings) { * Add a separator line * * @return Instance this method was called on. + * @see #addStructureSeparator() */ public MultiblockTooltipBuilder addSeparator() { return addSeparator(EnumChatFormatting.GRAY, 41); @@ -720,6 +721,18 @@ public MultiblockTooltipBuilder addSubChannelUsage(String channel, String purpos return this; } + /** + * Add a separator line like this, to the structural hint:
+ * ----------------------------------------- + * + * @return Instance this method was called on. + * @see #addSeparator() + */ + public MultiblockTooltipBuilder addStructureSeparator() { + sLines.add(TAB + "-----------------------------------------"); + return this; + } + /** * Use this method to add non-standard structural hint. This info will appear before the standard structural hint. * diff --git a/src/main/java/gregtech/common/config/MachineStats.java b/src/main/java/gregtech/common/config/MachineStats.java index 2e7dfc7abf5..ce679052b88 100644 --- a/src/main/java/gregtech/common/config/MachineStats.java +++ b/src/main/java/gregtech/common/config/MachineStats.java @@ -30,6 +30,9 @@ public class MachineStats { @Config.Comment("Teleporter section") public static Teleporter teleporter = new Teleporter(); + @Config.Comment("Cleanroom section") + public static Cleanroom cleanroom = new Cleanroom(); + @Config.LangKey("GT5U.gui.config.machine_stats.bronze_solar_boiler") public static class BronzeSolarBoiler { @@ -166,4 +169,30 @@ public static class Teleporter { @Config.RequiresMcRestart public int powerMultiplier; } + + @Config.LangKey("GT5U.gui.config.machine_stats.cleanroom") + public static class Cleanroom { + + @Config.Comment("Minimum number of plascrete blocks in a valid cleanroom.") + @Config.RangeInt(min = 0) + @Config.DefaultInt(20) + @Config.RequiresMcRestart + public int minCasingCount; + + @Config.Comment("Maximum percentage of plascrete blocks which can be replaced by other valid blocks: glass, doors, hatches, etc.") + @Config.RangeInt(min = 0, max = 100) + @Config.DefaultInt(30) + @Config.RequiresMcRestart + public int maxReplacementPercentage; + + @Config.Comment("List of other blocks allowed as a part of the cleanroom. Format: or :.") + @Config.DefaultStringList({ "BW_GlasBlocks", // All Bart glass (including HV tier) + "tile.openblocks.elevator", "tile.openblocks.elevator_rotating", // OpenBlocks elevators + "tile.blockTravelAnchor", // EnderIO travel anchors + "tile.blockCosmeticOpaque:2", // TC Warded glass (usually HV tier) + "tile.extrautils:etherealglass" // ExtraUtils ineffable glass and variants + }) + @Config.RequiresMcRestart + public String[] allowedBlocks; + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java index bf5b6dbb108..47cb6b410a0 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTECleanroom.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import static bartworks.API.GlassTier.getGlassTier; import static gregtech.api.enums.GTValues.debugCleanroom; import static gregtech.api.enums.Textures.BlockIcons.BLOCK_PLASCRETE; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM; @@ -7,9 +8,9 @@ import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE_GLOW; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_GLOW; -import java.util.HashMap; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; -import java.util.Map; import java.util.Set; import javax.annotation.Nonnull; @@ -17,16 +18,14 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import net.minecraftforge.common.config.ConfigCategory; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; import gregtech.api.GregTechAPI; -import gregtech.api.enums.GTValues; import gregtech.api.enums.TierEU; import gregtech.api.interfaces.ICleanroom; import gregtech.api.interfaces.ICleanroomReceiver; @@ -35,6 +34,8 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.MTEBasicHull; +import gregtech.api.metatileentity.implementations.MTEHatchEnergy; +import gregtech.api.metatileentity.implementations.MTEHatchMaintenance; import gregtech.api.metatileentity.implementations.MTETooltipMultiBlockBase; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; @@ -42,10 +43,40 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTLog; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.config.MachineStats; public class MTECleanroom extends MTETooltipMultiBlockBase implements IConstructable, ISecondaryDescribable, ICleanroom { + /** + * Maximum width (horizontal size) of the cleanroom. Includes walls. + */ + public static final int MAX_WIDTH = 15; + + /** + * Maximum height of the cleanroom. Includes floor and ceiling. + */ + public static final int MAX_HEIGHT = 15; + + /** + * List of other blocks allowed in the cleanroom. + * Format of entries is either just the block's unlocalized name, or :. The former matches + * all blocks of that name regardless of meta value. Read from config file. + */ + public static final HashSet ALLOWED_BLOCKS = new HashSet<>(); + + // Plascrete blocks. + protected static Block CASING_BLOCK; + protected static final int CASING_META = 2; + // To color hatches. + protected static final int CASING_INDEX = 210; + // Filter casings. + protected static Block FILTER_BLOCK; + protected static final int FILTER_META = 11; + // Minimum valid tier of glass. All glasses of at least this tier are always allowed; + // lower tier glasses can be added separately in ALLOWED_BLOCKS. + protected static final int MIN_GLASS_TIER = 4; // EV + private final Set cleanroomReceivers = new HashSet<>(); private int mHeight = -1; @@ -87,30 +118,62 @@ public void pollute() { protected MultiblockTooltipBuilder createTooltip() { final MultiblockTooltipBuilder tt = new MultiblockTooltipBuilder(); tt.addMachineType("Cleanroom") - .addInfo("Consumes 40 EU/t when first turned on") - .addInfo("and 4 EU/t once at 100% efficiency") - .addInfo("If you use an LV energy hatch, it will actually accept 2A instead of just 1A.") - .addInfo( - "MV+ energy hatches just accept 1A as usual. For HV+ the cleanroom will overclock and gain efficiency faster.") - .addInfo("Time required to reach full efficiency is proportional to") - .addInfo("the height of empty space within") - .addInfo("Machines that cause pollution aren't allowed to be put in.") - .beginVariableStructureBlock(3, 15, 4, 15, 3, 15, true) - .addController("Top center") - .addCasingInfoRange("Plascrete", 20, 1007, false) + .addInfo("Consumes 40 EU/t when first turned on, and 4 EU/t once at 100% efficiency.") + .addInfo("Can accept 2A from an LV energy hatch.") + .addInfo("Will overclock and gain efficiency faster starting from HV.") + .addSeparator() + .addInfo(EnumChatFormatting.RED + "Warning:") + .addInfo("Below 100% efficiency machines inside have a chance to void outputs!") + .addInfo("Each maintenance issue reduces maximum efficiency by 10%.") + .addInfo("Generating any pollution inside causes the cleanroom to shut down.") + .beginVariableStructureBlock(3, MAX_WIDTH, 4, MAX_HEIGHT, 3, MAX_WIDTH, true) + .addController("Top center.") + .addStructureInfo(" If width or length is even, it can be in either of the two middle positions.") + .addOtherStructurePart("Filter Machine Casing", "Top layer, except for edges.") + .addOtherStructurePart( + "Plascrete Blocks", + "Edges of top layer, all walls and floor. Minimum " + EnumChatFormatting.GOLD + + MachineStats.cleanroom.minCasingCount + + EnumChatFormatting.GRAY + + ".") + .addEnergyHatch("Any Plascrete Block. Exactly one.") + .addMaintenanceHatch("Any Plascrete Block. Exactly one.") + .addStructureInfo("") + .addStructureInfo( + "Up to " + EnumChatFormatting.GOLD + + MachineStats.cleanroom.maxReplacementPercentage + + "%" + + EnumChatFormatting.GRAY + + " of plascrete blocks can be replaced by other valid blocks.") + .addStructureInfo("Try some of the following:") + .addStructureInfo( + "- Any " + EnumChatFormatting.DARK_GRAY + "EV+" + EnumChatFormatting.GRAY + " tier glass.") + .addStructureInfo("- Machine hulls or diodes for item and power transfer.") + .addStructureInfo( + "- Reinforced Doors (" + EnumChatFormatting.ITALIC + + "IC2" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + "). Keep closed, no gaps allowed or efficiency will drop!") .addStructureInfo( - GTValues.cleanroomGlass - + "% of the Plascrete can be replaced with Reinforced Glass (not counting the top layer)") + "- Elevators (" + EnumChatFormatting.ITALIC + + "OpenBlocks" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + ") or Travel Anchors (" + + EnumChatFormatting.ITALIC + + "EnderIO" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + ").") .addStructureInfo( - "Other material can be used in place of Plascrete, even in higher percentages. See config for detail") - .addOtherStructurePart("Filter Machine Casing", "Top besides controller and edges") - .addEnergyHatch("Any casing except top layer. Exactly one.") - .addMaintenanceHatch("Any casing except top layer") - .addStructureInfo("0-2x Reinforced Door (keep closed or efficiency will reduce)") - .addStructureInfo("Up to 1 Elevator, Rotating Elevator, and Travel Anchor each") - .addStructureInfo("Up to 10 Machine Hulls for Item & Energy transfer through walls") - .addStructureInfo("You can also use Diodes for more power") - .addStructureInfo("Diodes also count towards 10 Machine Hulls count limit") + "See " + EnumChatFormatting.DARK_GRAY + + "config/GregTech/MachineStats.cfg" + + EnumChatFormatting.GRAY + + " for more valid blocks.") + .addStructureInfo( + EnumChatFormatting.YELLOW + + "All non-plascrete blocks now share the same limit. Feel free to mix and match!") .toolTipFinisher(); return tt; } @@ -150,234 +213,458 @@ public boolean isFacingValid(ForgeDirection facing) { return (facing.flag & (ForgeDirection.UP.flag | ForgeDirection.DOWN.flag)) == 0; } - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int x = 1; - int z = 1; - int y = 1; - int mDoorCount = 0; - int mHullCount = 0; - int mPlascreteCount = 0; - final HashMap otherBlocks = new HashMap<>(); - boolean doorState = false; - this.mUpdate = 100; - cleanroomReceivers.forEach(r -> r.setCleanroom(null)); - cleanroomReceivers.clear(); + /* + * Structure check + */ + + // Extent in all directions. Specifically the offset from the controller to each wall. + // Min values will always be negative, Max values positive. + protected int dxMin = 0, dxMax = 0, dzMin = 0, dzMax = 0, dyMin = 0; + // Total number of plascrete blocks in the structure. + protected int casingCount; + // Total number of other blocks in the structure. Does NOT count filter casings or the controller. + protected int otherCount; + // Whether the cleanroom contains a door that is "open", efficiency is constantly reduced. + protected boolean isDoorOpen; + + private enum CleanroomBlockType { + CASING, // Plascrete block. + FILTER, // Filter casing. + GLASS, // Any EV+ tiered glass. + OTHER, // Another allowed replacement block. + DOOR, // Reinforced door (IC2). + HATCH_ENERGY, // Energy hatch. + HATCH_MAINTENANCE, // Maintenance hatch. + HATCH_DIODE, // Diode or machine hull. + INVALID // Invalid block. + } - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Checking machine"); - } - for (int i = 1; i < 8; i++) { - final Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); - final int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); - if (tBlock != GregTechAPI.sBlockCasings3 || tMeta != 11) { - if (tBlock == GregTechAPI.sBlockReinforced || tMeta == 2) { - x = i; - break; - } else { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Unable to detect room X edge?"); - } - return false; + // Specify which blocks are allowed where. This skips checks for other blocks. + private static final int MASK_CASING = 1; + private static final int MASK_FILTER = 1 << 1; + private static final int MASK_GLASS = 1 << 2; + private static final int MASK_OTHER = 1 << 3; + private static final int MASK_DOOR = 1 << 4; + private static final int MASK_HATCH = 1 << 5; + + // Ceiling blocks NOT including edges. + private static final int MASK_CEILING_INTERNAL = MASK_FILTER; + // Edges of the ceiling layer. Includes corners of the top layer. + private static final int MASK_CEILING_EDGE = MASK_CASING | MASK_GLASS | MASK_OTHER | MASK_HATCH; + // Blocks in the wall, not including vertical edges. + private static final int MASK_WALL_INTERNAL = MASK_CASING | MASK_GLASS | MASK_OTHER | MASK_DOOR | MASK_HATCH; + // Vertical edges of walls, not including any corners. + private static final int MASK_WALL_EDGE = MASK_CASING | MASK_GLASS | MASK_OTHER | MASK_HATCH; + // Floor, not including edges or corners. + private static final int MASK_FLOOR_INTERNAL = MASK_CASING | MASK_GLASS | MASK_OTHER | MASK_HATCH; + // Bottom horizontal edges and corners. + private static final int MASK_FLOOR_EDGE = MASK_CASING | MASK_GLASS | MASK_OTHER | MASK_HATCH; + + /** + * Determines the type of the block at a specified offset from the controller. Only types specified by allowedMask + * are checked, for efficiency. If a block is not one of the allowed types, CleanroomBlockType.INVALID is returned. + */ + private CleanroomBlockType getBlockType(IGregTechTileEntity aBaseMetaTileEntity, int dx, int dy, int dz, + int allowedMask) { + Block block = aBaseMetaTileEntity.getBlockOffset(dx, dy, dz); + int meta = aBaseMetaTileEntity.getMetaIDOffset(dx, dy, dz); + + if ((allowedMask & MASK_CASING) != 0 && block == CASING_BLOCK && meta == CASING_META) + return CleanroomBlockType.CASING; + + if ((allowedMask & MASK_FILTER) != 0 && block == FILTER_BLOCK && meta == FILTER_META) + return CleanroomBlockType.FILTER; + + if ((allowedMask & MASK_GLASS) != 0 && getGlassTier(block, meta) >= MIN_GLASS_TIER) + return CleanroomBlockType.GLASS; + + if ((allowedMask & MASK_OTHER) != 0 && (ALLOWED_BLOCKS.contains(block.getUnlocalizedName()) + || ALLOWED_BLOCKS.contains(block.getUnlocalizedName() + ":" + meta))) return CleanroomBlockType.OTHER; + + if ((allowedMask & MASK_DOOR) != 0 + // This allows doors on the edges, although their open/closed status will not be calculated correctly. + // The intent is that the wall check calling this method will not allow doors on edges. + && block instanceof ic2.core.block.BlockIC2Door) { + + if (!isDoorOpen) { // No need to check again if there is already an open door somewhere else. + int doorOrientation = getDoorOrientation(aBaseMetaTileEntity, dx, dy, dz); + if (doorOrientation < 0) { + // Somehow an invalid door block. + if (debugCleanroom) + GTLog.out.println("Cleanroom: Invalid block at offset (" + dx + ", " + dy + ", " + dz + ")."); + return CleanroomBlockType.INVALID; } - } - } - for (int i = 1; i < 8; i++) { - final Block tBlock = aBaseMetaTileEntity.getBlockOffset(0, 0, i); - final int tMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, i); - if (tBlock != GregTechAPI.sBlockCasings3 || tMeta != 11) { - if (tBlock == GregTechAPI.sBlockReinforced || tMeta == 2) { - z = i; - break; + if (doorOrientation % 2 == 0) { + // Door on the W or E side (aligned with Z axis). + if (dx != dxMin && dx != dxMax) + // Door is in the N or S wall, definitely open. + isDoorOpen = true; + // Otherwise check adjacent blocks for other doors. + else if (dz > dzMin + && aBaseMetaTileEntity.getBlockOffset(dx, dy, dz - 1) instanceof ic2.core.block.BlockIC2Door + && doorOrientation != getDoorOrientation(aBaseMetaTileEntity, dx, dy, dz - 1)) + isDoorOpen = true; + else if (dz < dzMax + && aBaseMetaTileEntity.getBlockOffset(dx, dy, dz + 1) instanceof ic2.core.block.BlockIC2Door + && doorOrientation != getDoorOrientation(aBaseMetaTileEntity, dx, dy, dz + 1)) + isDoorOpen = true; } else { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Unable to detect room Z edge?"); - } - return false; + // Door on the N or S side (aligned with X axis). + if (dz != dzMin && dz != dzMax) + // Door is in the N or S wall, definitely open. + isDoorOpen = true; + // Check adjacent blocks for other doors. + else if (dx > dxMin + && aBaseMetaTileEntity.getBlockOffset(dx - 1, dy, dz) instanceof ic2.core.block.BlockIC2Door + && doorOrientation != getDoorOrientation(aBaseMetaTileEntity, dx - 1, dy, dz)) + isDoorOpen = true; + else if (dx < dxMax + && aBaseMetaTileEntity.getBlockOffset(dx + 1, dy, dz) instanceof ic2.core.block.BlockIC2Door + && doorOrientation != getDoorOrientation(aBaseMetaTileEntity, dx + 1, dy, dz)) + isDoorOpen = true; + } + + if (debugCleanroom && isDoorOpen) { + GTLog.out.println("Cleanroom: Open door at offset (" + dx + ", " + dy + ", " + dz + ")."); } } + return CleanroomBlockType.DOOR; } - // detect rectangular area of filters - for (int i = -x + 1; i < x; i++) { - for (int j = -z + 1; j < z; j++) { - if (i == 0 && j == 0) continue; - final Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, j); - final int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, j); - if (tBlock != GregTechAPI.sBlockCasings3 && tMeta != 11) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: This is not a filter."); - } - return false; - } + + if ((allowedMask & MASK_HATCH) != 0) { + IGregTechTileEntity te = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dx, dy, dz); + if (te != null) { + IMetaTileEntity mte = te.getMetaTileEntity(); + if (mte instanceof MTEHatchMaintenance) return CleanroomBlockType.HATCH_MAINTENANCE; + else if (mte instanceof MTEHatchEnergy) return CleanroomBlockType.HATCH_ENERGY; + // Both hulls and diodes are instanceof MTEBasicHull. + else if (mte instanceof MTEBasicHull) return CleanroomBlockType.HATCH_DIODE; + else return CleanroomBlockType.INVALID; } } - for (int i = -1; i > -16; i--) { - final Block tBlock = aBaseMetaTileEntity.getBlockOffset(x, i, z); - final int tMeta = aBaseMetaTileEntity.getMetaIDOffset(x, i, z); - if (tBlock != GregTechAPI.sBlockReinforced || tMeta != 2) { - y = i + 1; + return CleanroomBlockType.INVALID; + } + + /** + * Add a block to the cleanroom which is at the specified offset. This properly increases the count of + * casings/non-casings, and if the block is a hatch, also adds it to the appropriate list. + * + * @param allowedMask specifies which types of blocks should be allowed at this position. Any other type of block is + * considered invalid. + * @return True on success (block was correctly added), false on failure (invalid block type). + */ + @SuppressWarnings("BooleanMethodIsAlwaysInverted") + protected boolean addStructureBlock(IGregTechTileEntity aBaseMetaTileEntity, int dx, int dy, int dz, + int allowedMask) { + switch (getBlockType(aBaseMetaTileEntity, dx, dy, dz, allowedMask)) { + case CASING: + ++casingCount; + return true; + + case FILTER: + return true; + + case GLASS: + case OTHER: + case DOOR: + case HATCH_DIODE: + ++otherCount; + return true; + + case HATCH_ENERGY: + addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(dx, dy, dz), CASING_INDEX); + ++otherCount; + return true; + + case HATCH_MAINTENANCE: + addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(dx, dy, dz), CASING_INDEX); + ++otherCount; + return true; + + case INVALID: + if (debugCleanroom) + GTLog.out.println("Cleanroom: Invalid block at offset (" + dx + ", " + dy + ", " + dz + ")."); + return false; + + default: + throw new IllegalArgumentException( + "Cleanroom error: unknown block type at at offset (" + dx + ", " + dy + ", " + dz + ")."); + } + } + + /** + * Find the horizontal size of the cleanroom. Populates values dxMin, dxMax, dzMin, and dzMax. + * + * @return True on success, false on failure (which means an invalid structure). + */ + protected boolean checkSize(IGregTechTileEntity aBaseMetaTileEntity) { + // Footprint must be a rectangle. If the width is odd, the controller must be in the middle. + // If the width is even, controller must be one of the two middle blocks. + + // X direction + + for (dxMin = -1; dxMin >= -MAX_WIDTH / 2; --dxMin) { + if (getBlockType(aBaseMetaTileEntity, dxMin, 0, 0, MASK_CEILING_INTERNAL) == CleanroomBlockType.INVALID) { break; } } - if (y > -2) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Room not tall enough?"); - } + if (dxMin < -MAX_WIDTH / 2) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Too large (x-axis)."); return false; } - for (int dX = -x; dX <= x; dX++) { - for (int dZ = -z; dZ <= z; dZ++) { - for (int dY = 0; dY >= y; dY--) { - if (dX == -x || dX == x || dY == 0 || dY == y || dZ == -z || dZ == z) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(dX, dY, dZ); - int tMeta = aBaseMetaTileEntity.getMetaIDOffset(dX, dY, dZ); - if (dY == 0) { // TOP - if (dX == -x || dX == x || dZ == -z || dZ == z) { // Top Border - if (tBlock != GregTechAPI.sBlockReinforced || tMeta != 2) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Non reinforced block on top edge? tMeta != 2"); - } - return false; - } - mPlascreteCount++; - } else if (dX != 0 || dZ != 0) { // Top Inner exclude center - if (tBlock != GregTechAPI.sBlockCasings3 || tMeta != 11) { - if (debugCleanroom) { - GTLog.out.println( - "Cleanroom: Non reinforced block on top face interior? tMeta != 11"); - } - return false; - } - } - } else if (tBlock == GregTechAPI.sBlockReinforced && tMeta == 2) { - mPlascreteCount++; - } else { - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity - .getIGregTechTileEntityOffset(dX, dY, dZ); - if ((!this.addMaintenanceToMachineList(tTileEntity, 210)) - && (!this.addEnergyInputToMachineList(tTileEntity, 210))) { - if (tBlock instanceof ic2.core.block.BlockIC2Door) { - if ((tMeta & 8) == 0) { - // let's not fiddle with bits anymore. - if (Math.abs(dZ) < z) // on side parallel to z axis - doorState = tMeta == 1 || tMeta == 3 || tMeta == 4 || tMeta == 6; - else if (Math.abs(dX) < x) // on side parallel to x axis - doorState = tMeta == 0 || tMeta == 2 || tMeta == 5 || tMeta == 7; - // corners ignored - } - mDoorCount++; - } else { - if (tTileEntity != null) { - final IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Missing block? Not a aMetaTileEntity"); - } - return false; - } - if (aMetaTileEntity instanceof MTEBasicHull) { - mHullCount++; - } else { - if (debugCleanroom) { - GTLog.out.println( - "Cleanroom: Incorrect GT block? " + tBlock.getUnlocalizedName()); - } - return false; - } - } else { - String key = tBlock.getUnlocalizedName() + ":" + tMeta; - if (config.containsKey(key)) { // check with meta first - otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); - } else { - key = tBlock.getUnlocalizedName(); - if (config.containsKey(key)) { - otherBlocks.compute(key, (k, v) -> v == null ? 1 : v + 1); - } else { - if (debugCleanroom) { - GTLog.out.println( - "Cleanroom: not allowed block " + tBlock.getUnlocalizedName()); - } - return false; - } - } - } - } - } - } - } - } + + for (dxMax = 1; dxMax <= MAX_WIDTH / 2; ++dxMax) { + if (getBlockType(aBaseMetaTileEntity, dxMax, 0, 0, MASK_CEILING_INTERNAL) == CleanroomBlockType.INVALID) { + break; } } - if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1 - || mDoorCount > 4 - || mHullCount > 10) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Incorrect number of doors, hulls, or hatches."); + if (dxMax > MAX_WIDTH / 2) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Too large (x-axis)."); + return false; + } + + if (Math.abs(dxMin + dxMax) > 1) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Controller not centered (x-axis)."); + return false; + } + + // Z direction + + for (dzMin = -1; dzMin >= -MAX_WIDTH / 2; --dzMin) { + if (getBlockType(aBaseMetaTileEntity, 0, 0, dzMin, MASK_CEILING_INTERNAL) == CleanroomBlockType.INVALID) { + break; } + } + if (dzMin < -MAX_WIDTH / 2) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Too large (z-axis)."); return false; } - if (mPlascreteCount < 20) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Could not find 20 Plascrete."); + + for (dzMax = 1; dzMax <= MAX_WIDTH / 2; ++dzMax) { + if (getBlockType(aBaseMetaTileEntity, 0, 0, dzMax, MASK_CEILING_INTERNAL) == CleanroomBlockType.INVALID) { + break; } + } + if (dzMax > MAX_WIDTH / 2) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Too large (z-axis)."); return false; } - int otherBlockCount = 0; - for (int v : otherBlocks.values()) { - otherBlockCount += v; + + if (Math.abs(dzMin + dzMax) > 1) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Controller not centered (z-axis)."); + return false; } - int maxAllowedRatio = 0; - for (Map.Entry e : otherBlocks.entrySet()) { - final ConfigEntry ce = config.get(e.getKey()); - maxAllowedRatio += Math.max(maxAllowedRatio, ce.percentage); - if (ce.allowedCount > 0) { // count has priority - if (e.getValue() > ce.allowedCount) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Absolute count too high for a block."); - } - return false; + + if (debugCleanroom) GTLog.out.println( + "Cleanroom: dxMin = " + dxMin + ", dxMax = " + dxMax + ", dzMin = " + dzMin + ", dzMax = " + dzMax + "."); + return true; + } + + /** + * Checks whether the ceiling layer of the cleanroom is complete. Assumes that + * {@link #checkSize(IGregTechTileEntity)} has already been run. + * + * @return True on success, false on failure. + */ + @SuppressWarnings("BooleanMethodIsAlwaysInverted") + protected boolean checkCeiling(IGregTechTileEntity aBaseMetaTileEntity) { + // Edges must be plascrete, everything else must be filters (except for the controller). + for (int dx = dxMin; dx <= dxMax; ++dx) { + for (int dz = dzMin; dz <= dzMax; ++dz) { + if (dx == 0 && dz == 0) { + // Controller. + continue; + } else if (dx == dxMin || dx == dxMax || dz == dzMin || dz == dzMax) { + // Edge. + if (!addStructureBlock(aBaseMetaTileEntity, dx, 0, dz, MASK_CEILING_EDGE)) return false; + } else { + // Internal block. + if (!addStructureBlock(aBaseMetaTileEntity, dx, 0, dz, MASK_CEILING_INTERNAL)) return false; } - } else if ((e.getValue() * 100) / (mPlascreteCount + otherBlockCount) > ce.percentage) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Relative count too high for a block."); + } + } + + return true; + } + + /** + * Checks the floor of the cleanroom. Note that if this fails, it is not necessarily because the structure is + * invalid, maybe the floor just isn't where we thought it was, and we're looking at a wall. + * + * @param dy Vertical offset of the floor from the controller. + * @return True on success, false on failure. + */ + protected boolean checkFloor(IGregTechTileEntity aBaseMetaTileEntity, int dy) { + // Save maintenance and energy hatches, if the check fails, we don't want to add them. + + // We always add all hatches, even if we find more than one. This allows for better error reporting: if there + // are two energy hatches in the floor layer, we add both, and report the floor as complete. This way, the + // structure check fails due to multiple hatches, and not due to missing floor. + int addedCasings = 0; + int addedOther = 0; + ArrayList energy = new ArrayList<>(); + ArrayList maintenance = new ArrayList<>(); + + for (int dx = dxMin + 1; dx <= dxMax - 1; ++dx) { + for (int dz = dzMin + 1; dz <= dzMax - 1; ++dz) { + switch (getBlockType(aBaseMetaTileEntity, dx, dy, dz, MASK_FLOOR_INTERNAL)) { + case CASING: + ++addedCasings; + break; + + case GLASS: + case OTHER: + case HATCH_DIODE: + case FILTER: + case DOOR: // Filters and doors should not be valid in the floor, but are included for completeness. + ++addedOther; + break; + + case HATCH_ENERGY: + energy.add(aBaseMetaTileEntity.getIGregTechTileEntityOffset(dx, dy, dz)); + ++addedOther; + break; + + case HATCH_MAINTENANCE: + maintenance.add(aBaseMetaTileEntity.getIGregTechTileEntityOffset(dx, dy, dz)); + ++addedOther; + break; + + case INVALID: + // Do not log an error, we might not be at the correct floor level yet. + return false; + + default: + throw new IllegalArgumentException( + "Cleanroom error: unknown block type at at offset (" + dx + ", " + dy + ", " + dz + ")."); } - return false; } } - if ((otherBlockCount * 100) / (mPlascreteCount + otherBlockCount) > maxAllowedRatio) { - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Relative count of all non-plascrete blocks too high."); + + // If we get here, the entire floor is valid. Add hatches to the machine. + casingCount += addedCasings; + otherCount += addedOther; + for (var te : energy) addEnergyInputToMachineList(te, CASING_INDEX); + for (var te : maintenance) addMaintenanceToMachineList(te, CASING_INDEX); + return true; + } + + /** + * Checks the walls of the cleanroom at a specified vertical offset. + * + * @param dy Vertical offset of the floor from the controller. + * @return True on success, false on failure. + */ + protected boolean checkWall(IGregTechTileEntity aBaseMetaTileEntity, int dy) { + for (int dx = dxMin + 1; dx <= dxMax - 1; ++dx) { + if (!addStructureBlock(aBaseMetaTileEntity, dx, dy, dzMin, MASK_WALL_INTERNAL)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dx, dy, dzMax, MASK_WALL_INTERNAL)) return false; + } + for (int dz = dzMin + 1; dz <= dzMax - 1; ++dz) { + if (!addStructureBlock(aBaseMetaTileEntity, dxMin, dy, dz, MASK_WALL_INTERNAL)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dxMax, dy, dz, MASK_WALL_INTERNAL)) return false; + } + + if (!addStructureBlock(aBaseMetaTileEntity, dxMin, dy, dzMin, MASK_WALL_EDGE)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dxMin, dy, dzMax, MASK_WALL_EDGE)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dxMax, dy, dzMin, MASK_WALL_EDGE)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dxMax, dy, dzMax, MASK_WALL_EDGE)) return false; + + return true; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mUpdate = 100; + cleanroomReceivers.forEach(r -> r.setCleanroom(null)); + cleanroomReceivers.clear(); + + casingCount = 0; + otherCount = 0; + isDoorOpen = false; + + if (debugCleanroom) GTLog.out.println("Cleanroom: Starting structure check."); + + // Optimization: a vast majority of the time, the size of the CR won't change. Try checking it using the old + // size, and only if that fails, try to find a new size. + if (dyMin == 0 || !checkCeiling(aBaseMetaTileEntity)) { + if (!checkSize(aBaseMetaTileEntity)) return false; + if (!checkCeiling(aBaseMetaTileEntity)) return false; + } + + // Check downward until we find a valid floor. + // We check specifically internal blocks for a valid floor. This means that in most cases this check + // immediately falls through, as the first block we check is already invalid (e.g., air or machine). + for (dyMin = -1; dyMin >= -(MAX_HEIGHT - 1); --dyMin) { + if (dyMin < -2 && checkFloor(aBaseMetaTileEntity, dyMin)) { + // Found a valid floor. Add its edges and finish. + for (int dx = dxMin; dx <= dxMax; ++dx) { + if (!addStructureBlock(aBaseMetaTileEntity, dx, dyMin, dzMin, MASK_FLOOR_EDGE)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dx, dyMin, dzMax, MASK_FLOOR_EDGE)) return false; + } + for (int dz = dzMin + 1; dz <= dzMax - 1; ++dz) { + if (!addStructureBlock(aBaseMetaTileEntity, dxMin, dyMin, dz, MASK_FLOOR_EDGE)) return false; + if (!addStructureBlock(aBaseMetaTileEntity, dxMax, dyMin, dz, MASK_FLOOR_EDGE)) return false; + } + break; + } else { + // Not floor yet, check for a wall. + if (!checkWall(aBaseMetaTileEntity, dyMin)) return false; } + } + if (dyMin < -(MAX_HEIGHT - 1)) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Too tall."); + return false; + } + mHeight = -dyMin + 1; + + if (debugCleanroom) GTLog.out.println( + "Cleanroom: Structure complete. Found " + casingCount + " casings, " + otherCount + " other blocks."); + + // Validate structure. + + if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Incorrect number of hatches."); return false; } - setCleanroomReceivers(x, y, z, aBaseMetaTileEntity); + if (casingCount < MachineStats.cleanroom.minCasingCount) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Not enough plascrete blocks."); + return false; + } - if (doorState) { + if ((otherCount * 100) / (casingCount + otherCount) > MachineStats.cleanroom.maxReplacementPercentage) { + if (debugCleanroom) GTLog.out.println("Cleanroom: Too many non-plascrete blocks."); + return false; + } + + if (isDoorOpen) { this.mEfficiency = Math.max(0, this.mEfficiency - 200); } + for (final ForgeDirection tSide : ForgeDirection.VALID_DIRECTIONS) { final byte t = (byte) Math.max(1, (byte) (15 / (10000f / this.mEfficiency))); aBaseMetaTileEntity.setInternalOutputRedstoneSignal(tSide, t); } - this.mHeight = -y; - if (debugCleanroom) { - GTLog.out.println("Cleanroom: Check successful."); - } - return true; - } - private void setCleanroomReceivers(int x, int y, int z, IGregTechTileEntity aBaseMetaTileEntity) { - for (int dX = -x + 1; dX <= x - 1; dX++) { - for (int dZ = -z + 1; dZ <= z - 1; dZ++) for (int dY = -1; dY >= y + 1; dY--) { - TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityOffset(dX, dY, dZ); - if (tTileEntity instanceof ICleanroomReceiver receiver) { - receiver.setCleanroom(this); - cleanroomReceivers.add(receiver); + // Re-add machines inside the cleanroom. + + for (int dy = dyMin + 1; dy < 0; ++dy) { + for (int dx = dxMin + 1; dx <= dxMax - 1; ++dx) { + for (int dz = dzMin + 1; dz <= dzMax - 1; dz++) { + TileEntity te = aBaseMetaTileEntity.getTileEntityOffset(dx, dy, dz); + if (te instanceof ICleanroomReceiver receiver) { + receiver.setCleanroom(this); + cleanroomReceivers.add(receiver); + } } } } + + if (debugCleanroom) GTLog.out.println("Cleanroom: Check successful."); + + return true; } @Override @@ -427,8 +714,8 @@ public boolean explodesOnComponentBreak(ItemStack aStack) { } @Override - public void construct(ItemStack itemStack, boolean b) { - int i = Math.min(itemStack.stackSize, 7); + public void construct(ItemStack stackSize, boolean hintsOnly) { + int i = Math.min(stackSize.stackSize, 7); IGregTechTileEntity baseEntity = this.getBaseMetaTileEntity(); World world = baseEntity.getWorld(); int x = baseEntity.getXCoord(); @@ -438,88 +725,87 @@ public void construct(ItemStack itemStack, boolean b) { for (int X = x - i; X <= x + i; X++) for (int Y = y; Y >= y - yoff; Y--) for (int Z = z - i; Z <= z + i; Z++) { if (X == x && Y == y && Z == z) continue; if (X == x - i || X == x + i || Z == z - i || Z == z + i || Y == y - yoff) { - if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTechAPI.sBlockReinforced, 2); - else world.setBlock(X, Y, Z, GregTechAPI.sBlockReinforced, 2, 2); + if (hintsOnly) StructureLibAPI.hintParticle(world, X, Y, Z, CASING_BLOCK, CASING_META); + else world.setBlock(X, Y, Z, CASING_BLOCK, CASING_META, 2); } else if (Y == y) { - if (b) StructureLibAPI.hintParticle(world, X, Y, Z, GregTechAPI.sBlockCasings3, 11); - else world.setBlock(X, Y, Z, GregTechAPI.sBlockCasings3, 11, 2); + if (hintsOnly) StructureLibAPI.hintParticle(world, X, Y, Z, FILTER_BLOCK, FILTER_META); + else world.setBlock(X, Y, Z, FILTER_BLOCK, FILTER_META, 2); } } } - private static class ConfigEntry { - - final int percentage; - final int allowedCount; + @Override + public void onConfigLoad() { + ALLOWED_BLOCKS.clear(); + Collections.addAll(ALLOWED_BLOCKS, MachineStats.cleanroom.allowedBlocks); - ConfigEntry(int percentage, int count) { - this.percentage = percentage; - this.allowedCount = count; - } + CASING_BLOCK = GregTechAPI.sBlockReinforced; + FILTER_BLOCK = GregTechAPI.sBlockCasings3; } - private static final HashMap config = new HashMap<>(); - private static final String category = "cleanroom_allowed_blocks"; - - private static void setDefaultConfigValues(Configuration cfg) { - cfg.get("cleanroom_allowed_blocks.manaGlass", "Name", "tile.manaGlass"); - cfg.get("cleanroom_allowed_blocks.manaGlass", "Percentage", 50); - cfg.get("cleanroom_allowed_blocks.elfGlass", "Name", "tile.elfGlass"); - cfg.get("cleanroom_allowed_blocks.elfGlass", "Percentage", 50); - cfg.get("cleanroom_allowed_blocks.reinforced_glass", "Name", "blockAlloyGlass"); - cfg.get("cleanroom_allowed_blocks.reinforced_glass", "Percentage", 5); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Name", "BW_GlasBlocks"); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Percentage", 50); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass_0", "Meta", 0); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass", "Name", "BW_GlasBlocks"); - cfg.get("cleanroom_allowed_blocks.bw_reinforced_glass", "Percentage", 100); - cfg.get("cleanroom_allowed_blocks.elevator", "Name", "tile.openblocks.elevator"); - cfg.get("cleanroom_allowed_blocks.elevator", "Count", 1); - cfg.get("cleanroom_allowed_blocks.travel_anchor", "Name", "tile.blockTravelAnchor"); - cfg.get("cleanroom_allowed_blocks.travel_anchor", "Count", 1); - cfg.get("cleanroom_allowed_blocks.warded_glass", "Name", "tile.blockCosmeticOpaque"); - cfg.get("cleanroom_allowed_blocks.warded_glass", "Meta", 2); - cfg.get("cleanroom_allowed_blocks.warded_glass", "Percentage", 50); - cfg.save(); + /** + * Doors are funny. So the meta value of the bottom part of the door determines where in the block the door is, when + * in the "closed" (inactive) position. + * 0 = lower x coordinate (west). + * 1 = lower z coordinate (north). + * 2 = upper x coordinate (east). + * 3 = upper z coordinate (south). + * If the door is opened, a 4 is added to this value. + *

+ * The meta of the top part of the door determines which way the door opens. + * 8 = opens counterclockwise. + * 9 = opens clockwise. + *

+ * Therefore, to find out where in the block the door currently is, we need to know both the top and the + * bottom part, as a door that is "closed" on the north side can "open" to either the west or east side. + * In both cases the meta of the bottom part will be the same (5). + *

+ * This method takes the coordinates of a door block (it is already assumed that this is a door), and returns the + * direction where the door is. Return value is the same as a default closed door: 0 = west, 1 = north, 2 = east, 3 + * = north. + */ + protected int getDoorOrientation(IGregTechTileEntity aBaseMetaTileEntity, int dx, int dy, int dz) { + int meta = aBaseMetaTileEntity.getMetaIDOffset(dx, dy, dz); + if (meta < 4) { + // Closed door, easy. + return meta; + } else if (meta < 8) { + // Bottom part of an open door. + if (aBaseMetaTileEntity.getBlockOffset(dx, dy + 1, dz) instanceof ic2.core.block.BlockIC2Door) { + return getDoorOrientation(meta, aBaseMetaTileEntity.getMetaIDOffset(dx, dy + 1, dz)); + } else { + // Bottom part of a door without the top part? Cheater! + return -1; + } + } else if (meta < 10) { + // Top part of a door. + if (aBaseMetaTileEntity.getBlockOffset(dx, dy - 1, dz) instanceof ic2.core.block.BlockIC2Door) { + return getDoorOrientation(aBaseMetaTileEntity.getMetaIDOffset(dx, dy - 1, dz), meta); + } else { + // Top part of a door without the bottom part? Cheater! + return -1; + } + } else { + // Invalid meta value? + return -1; + } } - public static void loadConfig(Configuration cfg) { - if (!cfg.hasCategory(category)) setDefaultConfigValues(cfg); - for (ConfigCategory cc : cfg.getCategory(category) - .getChildren()) { - final String name = cc.get("Name") - .getString(); - if (cc.containsKey("Count")) { - if (cc.containsKey("Meta")) config.put( - name + ":" - + cc.get("Meta") - .getInt(), - new ConfigEntry( - 0, - cc.get("Count") - .getInt())); - else config.put( - name, - new ConfigEntry( - 0, - cc.get("Count") - .getInt())); - } else if (cc.containsKey("Percentage")) { - if (cc.containsKey("Meta")) config.put( - name + ":" - + cc.get("Meta") - .getInt(), - new ConfigEntry( - cc.get("Percentage") - .getInt(), - 0)); - else config.put( - name, - new ConfigEntry( - cc.get("Percentage") - .getInt(), - 0)); + protected int getDoorOrientation(int bottomMeta, int topMeta) { + if (bottomMeta < 4) { + // Closed door, easy. + return bottomMeta; + } else if (bottomMeta < 8) { + // Open door. + if (topMeta == 8) { + // Opens CCW, add one. + return (bottomMeta + 1) % 4; + } else if (topMeta == 9) { + // Opens CW, subtract one. + return (bottomMeta - 1) % 4; } } + // Invalid combination? + return -1; } } diff --git a/src/main/java/gregtech/loaders/preload/GTPreLoad.java b/src/main/java/gregtech/loaders/preload/GTPreLoad.java index 7fcea477c58..bef36a2bdb4 100644 --- a/src/main/java/gregtech/loaders/preload/GTPreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GTPreLoad.java @@ -46,7 +46,6 @@ import gregtech.common.config.OPStuff; import gregtech.common.config.Worldgen; import gregtech.common.tileentities.machines.long_distance.MTELongDistancePipelineBase; -import gregtech.common.tileentities.machines.multi.MTECleanroom; public class GTPreLoad { @@ -487,9 +486,6 @@ public static void loadConfig() { GT_FML_LOGGER.error("The Length of the Gas Turbine Pollution Array Config must be the same as the Default"); } - // cleanroom file - if (GTMod.gregtechproxy.mEnableCleanroom) MTECleanroom.loadConfig(GTConfig.cleanroomFile); - // underground fluids file GTMod.gregtechproxy.mUndergroundOil.getConfig(GTConfig.undergroundFluidsFile, "undergroundfluid"); diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index 53a2282b088..edd3a8a0cc4 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -606,6 +606,7 @@ GT5U.gui.config.machine_stats.machines=Machines GT5U.gui.config.machine_stats.microwave_energy_transmitter=Microwave Energy Transmitter GT5U.gui.config.machine_stats.mass_fabricator=Mass Fabricator GT5U.gui.config.machine_stats.teleporter=Teleporter +GT5U.gui.config.machine_stats.cleanroom=Cleanroom GT5U.gui.config.worldgen=Worldgen GT5U.gui.config.worldgen.end_asteroids=End Asteroids GT5U.gui.config.worldgen.general=General From dc23a7a10700aff9cb9675e1b989928886217121 Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:10:35 +0800 Subject: [PATCH 07/38] Fix AAL (#3380) Co-authored-by: Martin Robertz --- src/main/java/ggfab/mte/MTEAdvAssLine.java | 11 +++++------ .../java/gregtech/api/util/OverclockCalculator.java | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/ggfab/mte/MTEAdvAssLine.java b/src/main/java/ggfab/mte/MTEAdvAssLine.java index c3cf42146f0..18ab96b6800 100644 --- a/src/main/java/ggfab/mte/MTEAdvAssLine.java +++ b/src/main/java/ggfab/mte/MTEAdvAssLine.java @@ -200,9 +200,6 @@ public class MTEAdvAssLine extends MTEExtendedPowerMultiBlockBase private int currentInputLength; private String lastStopReason = ""; private int currentRecipeParallel = 1; - // Batch mode will increase parallel per slice to try to get as close as possible to this amount of ticks - // per slice, but will never go over this amount. - private static final int BATCH_MODE_DESIRED_TICKS_PER_SLICE = 128; public MTEAdvAssLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -583,6 +580,8 @@ && hasAllFluids(currentRecipe, this.currentRecipeParallel) } } + endRecipeProcessing(); + boolean foundWorking = false; int working = 0; for (Slice slice : slices) { @@ -606,10 +605,9 @@ && hasAllFluids(currentRecipe, this.currentRecipeParallel) } } } else { - if (!super.onRunningTick(aStack)) return false; + return super.onRunningTick(aStack); } - endRecipeProcessing(); return true; } @@ -770,7 +768,8 @@ public CheckRecipeResult checkProcessing() { .setEUt(inputVoltage); if (!mExoticEnergyHatches.isEmpty()) { - normalOCCalculator.setCurrentParallel((int) (1 / normalOCCalculator.calculateDurationUnderOneTick())) + normalOCCalculator + .setCurrentParallel((int) Math.max(1 / normalOCCalculator.calculateDurationUnderOneTick(), 1)) .calculate(); int normalOverclockCount = normalOCCalculator.getPerformedOverclocks(); diff --git a/src/main/java/gregtech/api/util/OverclockCalculator.java b/src/main/java/gregtech/api/util/OverclockCalculator.java index e6e775b397d..28175c7b8c0 100644 --- a/src/main/java/gregtech/api/util/OverclockCalculator.java +++ b/src/main/java/gregtech/api/util/OverclockCalculator.java @@ -86,7 +86,7 @@ public class OverclockCalculator { /** * How many overclocks have been performed */ - private int overclockCount; + private int overclockCount = 0; /** * Should we actually try to calculate overclocking */ From 2c3b1f168e9b9e6ab55e63e13164877953d7720a Mon Sep 17 00:00:00 2001 From: Noc <95299389+Nockyx@users.noreply.github.com> Date: Thu, 17 Oct 2024 08:22:19 -0300 Subject: [PATCH 08/38] Deep earth heating pump Slight Rework and Balance Attempt (#3379) Co-authored-by: Martin Robertz Co-authored-by: boubou19 --- .../common/configs/Configuration.java | 4 - .../common/loaders/recipes/Assembler.java | 14 +++ .../common/loaders/recipes/AssemblyLine.java | 17 ---- .../multis/MTEDeepEarthHeatingPump.java | 95 ++++++++----------- 4 files changed, 54 insertions(+), 76 deletions(-) diff --git a/src/main/java/bartworks/common/configs/Configuration.java b/src/main/java/bartworks/common/configs/Configuration.java index 813c825dce0..50d144dc326 100644 --- a/src/main/java/bartworks/common/configs/Configuration.java +++ b/src/main/java/bartworks/common/configs/Configuration.java @@ -72,10 +72,6 @@ public static class Multiblocks { @Config.DefaultInt(20_000_000) public int energyPerCell; - @Config.Comment("This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") - @Config.DefaultBoolean(false) - public boolean DEHPDirectSteam; - @Config.Ignore() public static int megaMachinesMax = 256; diff --git a/src/main/java/bartworks/common/loaders/recipes/Assembler.java b/src/main/java/bartworks/common/loaders/recipes/Assembler.java index e1575fb3d92..b96c6653b21 100644 --- a/src/main/java/bartworks/common/loaders/recipes/Assembler.java +++ b/src/main/java/bartworks/common/loaders/recipes/Assembler.java @@ -10,6 +10,7 @@ import bartworks.common.loaders.ItemRegistry; import bartworks.system.material.WerkstoffLoader; +import goodgenerator.items.GGMaterial; import gregtech.api.GregTechAPI; import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; @@ -98,6 +99,19 @@ public void run() { .eut(TierEU.RECIPE_HV) .addTo(assemblerRecipes); + GTValues.RA.stdBuilder() // DEHP + .itemInputs( + ItemList.OilDrill4.get(1), + GTOreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 8), + GGMaterial.incoloy903.get(OrePrefixes.gearGt, 32), + GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Polytetrafluoroethylene, 16), + ItemList.Field_Generator_IV.get(1)) + .itemOutputs(ItemRegistry.dehp) + .fluidInputs(Materials.HSSE.getMolten(32 * 144)) + .duration(60 * SECONDS) + .eut(TierEU.RECIPE_IV) + .addTo(assemblerRecipes); + GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.wireFine, Materials.AnnealedCopper, 64L), diff --git a/src/main/java/bartworks/common/loaders/recipes/AssemblyLine.java b/src/main/java/bartworks/common/loaders/recipes/AssemblyLine.java index eed4b4286ae..2613a8c3b5a 100644 --- a/src/main/java/bartworks/common/loaders/recipes/AssemblyLine.java +++ b/src/main/java/bartworks/common/loaders/recipes/AssemblyLine.java @@ -1,6 +1,5 @@ package bartworks.common.loaders.recipes; -import static gregtech.api.util.GTRecipeBuilder.HOURS; import static gregtech.api.util.GTRecipeBuilder.MINUTES; import static gregtech.api.util.GTRecipeBuilder.SECONDS; import static gregtech.api.util.GTRecipeConstants.AssemblyLine; @@ -27,22 +26,6 @@ public void run() { Fluid solderIndalloy = FluidRegistry.getFluid("molten.indalloy140") != null ? FluidRegistry.getFluid("molten.indalloy140") : FluidRegistry.getFluid("molten.solderingalloy"); - GTValues.RA.stdBuilder() - .metadata(RESEARCH_ITEM, ItemList.Pump_HV.get(1L)) - .metadata(RESEARCH_TIME, 1 * HOURS) - .itemInputs( - ItemList.Pump_HV.get(16), - GTOreDictUnificator.get(OrePrefixes.pipeLarge, Materials.Ultimate, 32L), - GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - GTOreDictUnificator.get(OrePrefixes.gearGt, Materials.HSSE, 16L), - ItemList.Field_Generator_LuV.get(8)) - .fluidInputs( - new FluidStack(solderIndalloy, 32 * 144), - Materials.Polytetrafluoroethylene.getMolten(32 * 144)) - .itemOutputs(ItemRegistry.dehp) - .eut(TierEU.RECIPE_LuV) - .duration(4 * MINUTES + 10 * SECONDS) - .addTo(AssemblyLine); GTValues.RA.stdBuilder() .metadata(RESEARCH_ITEM, ItemList.OreDrill4.get(1L)) diff --git a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java index 68988e52fa5..8f329e2348f 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTEDeepEarthHeatingPump.java @@ -13,6 +13,7 @@ package bartworks.common.tileentities.multis; +import static bartworks.util.BWTooltipReference.MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS; import static gregtech.api.enums.GTValues.VN; import java.lang.reflect.Field; @@ -25,7 +26,6 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -import bartworks.common.configs.Configuration; import gregtech.api.enums.GTValues; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -96,25 +96,19 @@ protected MultiblockTooltipBuilder createTooltip() { .getDisplayName(); tt.addMachineType("Geothermal Heat Pump") .addInfo("Consumes " + GTValues.V[this.mTier + 2] + "EU/t") - .addInfo("Has 4 Modes, use the Screwdriver to change them:"); - if (Configuration.multiblocks.DEHPDirectSteam) { - tt.addInfo("0 Idle, 1 Steam, 2 Superheated Steam (requires Distilled Water), 3 Retract") - .addInfo("Explodes when it runs out of Water/Distilled Water") - .addInfo( - "Converts " + (long) (this.mTier * 1200 * 20) - + "L/s Water(minus 10% per Maintenance Problem) to Steam") - .addInfo( - "Converts " + (long) (this.mTier * 600 * 20) - + "L/s Distilled Water(minus 10% per Maintenance Problem) to SuperheatedSteam"); - - } else { - tt.addInfo("0 Idle, 1 & 2 Coolant Heating Mode (no Difference between them), 3 Retract") - .addInfo("Explodes when it runs out of Coolant") - .addInfo( - "Heats up " + (long) (this.mTier * 24 * (double) MTEDeepEarthHeatingPump.nulearHeatMod) * 20 - + "L/s Coolant(minus 10% per Maintenance Problem)"); - } - tt.beginStructureBlock(3, 7, 3, false) + .addInfo("Has 3 Modes, use the Screwdriver to change them:"); + + tt.addInfo("Direct Steam, Coolant Heating, Retract") + .addInfo( + "Direct Steam Mode: Consumes Distilled Water to produce " + (long) (this.mTier * 25600 * 20) + + "L/s of Superheated Steam") + .addInfo( + "Coolant Heating Mode: Converts " + (long) (this.mTier * 96 * 2 * 20) + "L/s Coolant to Hot Coolant") + .addInfo("Each maintenance issue lowers output efficiency by 10%") + .addInfo("Explodes when it runs out of Distilled Water/Coolant"); + + tt.addSeparator() + .beginStructureBlock(3, 7, 3, false) .addController("Front bottom") .addOtherStructurePart(casings, "form the 3x1x3 Base") .addOtherStructurePart(casings, "1x3x1 pillar above the center of the base (2 minimum total)") @@ -126,7 +120,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addInputBus("Mining Pipes, optional, any base casing") .addInputHatch("Any base casing") .addOutputHatch("Any base casing") - .toolTipFinisher(); + .toolTipFinisher(MULTIBLOCK_ADDED_BY_BARTIMAEUSNEK_VIA_BARTWORKS); return tt; } @@ -199,15 +193,21 @@ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, f if (this.getBaseMetaTileEntity() .getWorld().isRemote) return; ++this.mMode; - if (this.mMode >= 4) this.mMode = 0; - GTUtility.sendChatToPlayer(aPlayer, "Mode: " + this.mMode); + if (this.mMode >= 3) this.mMode = 0; + if (this.mMode == 0) { + GTUtility.sendChatToPlayer(aPlayer, "Mode: Direct Steam"); + } else if (this.mMode == 1) { + GTUtility.sendChatToPlayer(aPlayer, "Mode: Coolant Heating"); + } else if (this.mMode == 2) { + GTUtility.sendChatToPlayer(aPlayer, "Mode: Retract"); + } super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); } @Override protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead) { - if (this.mMode == 3) { + if (this.mMode == 2) { this.isPickingPipes = true; this.workState = 2; return true; @@ -219,38 +219,23 @@ protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int if (this.waitForPipes()) { return false; } - if (this.mMode == 0) { - this.mMode = 1; - } - if (Configuration.multiblocks.DEHPDirectSteam) { - if (this.mMode == 1) { - long steamProduced = this.mTier * 600 * 2L * this.mEfficiency / 10000L; - long waterConsume = (steamProduced + 160) / 160; - - if (this.getWaterFromHatches(false) - waterConsume > 0) { - this.consumeFluid(FluidRegistry.WATER, waterConsume); - this.addOutput(GTModHandler.getSteam(steamProduced)); - } else { - this.explodeMultiblock(); - return false; - } - } else if (this.mMode == 2) { - long steamProduced = this.mTier * 300 * 2L * this.mEfficiency / 10000L; - long waterConsume = (steamProduced + 160) / 160; - if (this.getWaterFromHatches(true) - waterConsume > 0) { - this.consumeFluid( - GTModHandler.getDistilledWater(1) - .getFluid(), - waterConsume); - this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); - } else { - this.explodeMultiblock(); - return false; - } + if (this.mMode == 0) { + long steamProduced = this.mTier * 25600L * this.mEfficiency / 10000L; + long waterConsume = (steamProduced + 160) / 160; + + if (this.getWaterFromHatches(true) - waterConsume > 0) { + this.consumeFluid( + GTModHandler.getDistilledWater(1) + .getFluid(), + waterConsume); + this.addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", (int) steamProduced)); + } else { + this.explodeMultiblock(); + return false; } - } else if (this.mMode == 1 || this.mMode == 2) { - long coolantConverted = (long) (this.mTier * 24 + } else if (this.mMode == 1) { + long coolantConverted = (long) (this.mTier * 96L * (double) MTEDeepEarthHeatingPump.nulearHeatMod * this.mEfficiency / 10000L); @@ -312,7 +297,7 @@ private boolean consumeFluid(Fluid fluid, long ammount) { @Override protected void setElectricityStats() { try { - this.mEUt = this.isPickingPipes ? 60 : Math.toIntExact(GTValues.V[this.getMinTier()]); + this.mEUt = this.isPickingPipes ? -60 : -1 * Math.toIntExact(GTValues.V[this.getMinTier()]); } catch (ArithmeticException e) { e.printStackTrace(); this.mEUt = Integer.MAX_VALUE - 7; From 68add57f6b088ffaaca552ef1539b4ca1fe92c78 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Thu, 17 Oct 2024 23:07:34 +0100 Subject: [PATCH 09/38] One last ra2 fix (#3385) --- src/main/java/gtnhlanth/loader/RecipeLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/gtnhlanth/loader/RecipeLoader.java b/src/main/java/gtnhlanth/loader/RecipeLoader.java index 025816c54e8..2ad74da12b5 100644 --- a/src/main/java/gtnhlanth/loader/RecipeLoader.java +++ b/src/main/java/gtnhlanth/loader/RecipeLoader.java @@ -13,6 +13,7 @@ import static gregtech.api.recipe.RecipeMaps.distillationTowerRecipes; import static gregtech.api.recipe.RecipeMaps.electroMagneticSeparatorRecipes; import static gregtech.api.recipe.RecipeMaps.electrolyzerRecipes; +import static gregtech.api.recipe.RecipeMaps.fluidHeaterRecipes; import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; import static gregtech.api.recipe.RecipeMaps.hammerRecipes; import static gregtech.api.recipe.RecipeMaps.laserEngraverRecipes; @@ -3383,7 +3384,7 @@ public static void addRandomChemCrafting() { .fluidOutputs(Materials.Acetone.getFluid(150)) .duration(6 * SECONDS) .eut(TierEU.RECIPE_MV) - .addTo(vacuumFreezerRecipes); + .addTo(fluidHeaterRecipes); // PTMEG Manipulation From 4fe5921fc93391bbe60c212cae8d6e08c9a25729 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Fri, 18 Oct 2024 00:14:43 +0200 Subject: [PATCH 10/38] Fix bacterial vat fluid render (#3384) Co-authored-by: boubou19 --- .../client/renderer/RendererGlassBlock.java | 19 +++++++++---------- .../renderer/RendererSwitchingColorFluid.java | 2 ++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/bartworks/client/renderer/RendererGlassBlock.java b/src/main/java/bartworks/client/renderer/RendererGlassBlock.java index 1af553ff59e..6a288751e70 100644 --- a/src/main/java/bartworks/client/renderer/RendererGlassBlock.java +++ b/src/main/java/bartworks/client/renderer/RendererGlassBlock.java @@ -79,22 +79,21 @@ public void renderInventoryBlock(Block block, int metadata, int modelId, RenderB // spotless:off @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { boolean flag = false; if (block instanceof BWBlocksGlass) { + final short[] color = ((BWBlocksGlass) block).getColor(world.getBlockMetadata(x, y, z)); flag |= renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses, x, y, z); - flag |= renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, - ((BWBlocksGlass) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, - ((BWBlocksGlass) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, - ((BWBlocksGlass) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + flag |= renderer.renderStandardBlockWithColorMultiplier(block, + x, y, z, + color[0] / 255f, color[1] / 255f, color[2] / 255f); } if (block instanceof BWBlocksGlass2) { + final short[] color = ((BWBlocksGlass2) block).getColor(world.getBlockMetadata(x, y, z)); flag |= renderer.renderStandardBlock(ItemRegistry.bw_fake_glasses2, x, y, z); - flag |= renderer.renderStandardBlockWithColorMultiplier(block, x, y, z, - ((BWBlocksGlass2) block).getColor(world.getBlockMetadata(x, y, z))[0] / 255f, - ((BWBlocksGlass2) block).getColor(world.getBlockMetadata(x, y, z))[1] / 255f, - ((BWBlocksGlass2) block).getColor(world.getBlockMetadata(x, y, z))[2] / 255f); + flag |= renderer.renderStandardBlockWithColorMultiplier(block, + x, y, z, + color[0] / 255f, color[1] / 255f, color[2] / 255f); } return flag; } diff --git a/src/main/java/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/bartworks/client/renderer/RendererSwitchingColorFluid.java index ba565cc2aa1..ae48a109d08 100644 --- a/src/main/java/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -31,6 +31,7 @@ import bartworks.common.tileentities.multis.MTEBioVat; import bartworks.util.Coords; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -49,6 +50,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler public static void register() { instance = new RendererSwitchingColorFluid(); + RenderingRegistry.registerBlockHandler(instance); } private float getFluidHeightAverage(float[] flow) { From 17b051afabc0f5b1455b022425d2c449b1699bec Mon Sep 17 00:00:00 2001 From: Dream Master Date: Fri, 18 Oct 2024 09:36:57 +0200 Subject: [PATCH 11/38] update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 38873c19c43..861fe9d8859 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -38,11 +38,11 @@ dependencies { api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") api("com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev") api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev") - api("com.github.GTNewHorizons:GTNHLib:0.5.14:dev") + api("com.github.GTNewHorizons:GTNHLib:0.5.15:dev") api("com.github.GTNewHorizons:ModularUI:1.2.11:dev") api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") - api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-468-GTNH:dev") + api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-469-GTNH:dev") api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.39-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") From 12def84bf51a942a8c7e28b7e0b72e41f8383259 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:12:09 +0200 Subject: [PATCH 12/38] remove Tessellator field from RenderQuantumStuff (#3386) --- src/main/java/tectech/thing/block/RenderQuantumStuff.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/tectech/thing/block/RenderQuantumStuff.java b/src/main/java/tectech/thing/block/RenderQuantumStuff.java index 98a0562b3ea..6d5a4f5462f 100644 --- a/src/main/java/tectech/thing/block/RenderQuantumStuff.java +++ b/src/main/java/tectech/thing/block/RenderQuantumStuff.java @@ -17,14 +17,13 @@ */ public final class RenderQuantumStuff implements ISimpleBlockRenderingHandler { - private static final Tessellator tes = Tessellator.instance; - @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { GL11.glTranslatef(-0.5F, -0.5F, -0.5F); GL11.glPushMatrix(); // Get icons from custom register (useful for renderers and fluids) IIcon side = BlockQuantumStuff.stuff; + Tessellator tes = Tessellator.instance; tes.startDrawingQuads(); tes.setNormal(0.0F, -1.0F, 0.0F); renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, side); @@ -58,6 +57,7 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b RenderBlocks renderer) { // renderer.renderStandardBlock(block, x, y, z); GL11.glPushMatrix(); + Tessellator tes = Tessellator.instance; tes.setNormal(0F, 1F, 0F); tes.setBrightness(15728880); IIcon side = BlockQuantumStuff.stuff; @@ -88,7 +88,8 @@ private void tesAbuse(int x, int y, int z, float sx, float sy, float sz, float r pos.rotateAroundX(rotX); pos.rotateAroundY(rotY); pos.rotateAroundZ(rotZ); - tes.addVertexWithUV(pos.xCoord + x + .5f, pos.yCoord + y + .5f, pos.zCoord + z + .5f, sideU, sideV); + Tessellator.instance + .addVertexWithUV(pos.xCoord + x + .5f, pos.yCoord + y + .5f, pos.zCoord + z + .5f, sideU, sideV); } @Override From 795f1b6ada6c4fd9fcdd72775f39e0658d1d807d Mon Sep 17 00:00:00 2001 From: Ruling-0 <47913168+Ruling-0@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:27:21 -0500 Subject: [PATCH 13/38] Fix and Buff Solidifier Min Casing Check and Improve Tooltip (#3383) --- .../machines/multi/MTEMultiSolidifier.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java index 80de2e93be9..256e2885bb4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEMultiSolidifier.java @@ -192,10 +192,11 @@ protected MultiblockTooltipBuilder createTooltip() { .addInfo(EnumChatFormatting.BLUE + "Pretty Ⱄⱁⰾⰻⰴ, isn't it") .beginVariableStructureBlock(17, 33, 5, 5, 5, 5, true) .addController("Front Center bottom") - .addCasingInfoMin("Solidifier Casing", 146, false) - .addCasingInfoMin("Radiator Casing", 18, false) - .addCasingInfoMin("Heat Proof Casing", 4, false) - .addCasingInfoMin("Solid Steel Casing", 4, false) + .addCasingInfoRange("Solidifier Casing", 91, 211, false) + .addCasingInfoRange("Solidifier Radiator", 13, 73, false) + .addCasingInfoRange("Heat Proof Machine Casing", 4, 16, false) + .addCasingInfoRange("Clean Stainless Steel Machine Casing", 4, 16, false) + .addCasingInfoRange("Glass", 21, 117, true) .addInputBus("Any Casing", 1) .addOutputBus("Any Casing", 1) .addInputHatch("Any Casing", 1) @@ -260,14 +261,14 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a if (!checkPiece(MS_END, -4 - 2 * width, 4, 0) || !checkPiece(MS_END, 4 + 2 * width, 4, 0)) { return false; } - if (glassTier >= VoltageIndex.UMV) return true; + for (MTEHatchEnergy mEnergyHatch : this.mEnergyHatches) { - if (mEnergyHatch.mTier > glassTier) { + if (glassTier < VoltageIndex.UMV & mEnergyHatch.mTier > glassTier) { return false; } } - return casingAmount >= (100 + width * 23); + return casingAmount >= (91 + width * 20) && mMaintenanceHatches.size() == 1; } @Override From c9727addbf5275c5847408ee26030126ace2ad9b Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Sat, 19 Oct 2024 11:57:51 +0100 Subject: [PATCH 14/38] fix Isophthalate typo (#3387) --- src/main/java/gregtech/loaders/materials/MaterialsInit1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/loaders/materials/MaterialsInit1.java b/src/main/java/gregtech/loaders/materials/MaterialsInit1.java index 1ddd6f29070..e76d4eda206 100644 --- a/src/main/java/gregtech/loaders/materials/MaterialsInit1.java +++ b/src/main/java/gregtech/loaders/materials/MaterialsInit1.java @@ -850,7 +850,7 @@ public static void load() { Materials.PhthalicAcid = new MaterialBuilder(595, TextureSet.SET_FLUID , "Phthalic Acid").setName("phtalicacid").addCell().addFluid().setRGB(54, 133, 71).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 8), new MaterialStack(Hydrogen, 6), new MaterialStack(Oxygen, 4)).constructMaterial(); Materials.Dichlorobenzidine = new MaterialBuilder(596, TextureSet.SET_FLUID , "3,3-Dichlorobenzidine").addCell().addFluid().setRGB(161, 222, 166).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 12),new MaterialStack(Hydrogen, 10), new MaterialStack(Nitrogen, 2), new MaterialStack(Chlorine, 2)).constructMaterial(); Materials.Diaminobenzidin = new MaterialBuilder(597, TextureSet.SET_FLUID , "3,3-Diaminobenzidine").addCell().addFluid().setRGB(51, 125, 89).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 12),new MaterialStack(Hydrogen, 14),new MaterialStack(Nitrogen, 4)).constructMaterial(); - Materials.Diphenylisophthalate = new MaterialBuilder(598, TextureSet.SET_FLUID , "Diphenyl Isophtalate").addCell().addFluid().setRGB(36, 110, 87).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 20),new MaterialStack(Hydrogen, 14),new MaterialStack(Oxygen, 4)).constructMaterial(); + Materials.Diphenylisophthalate = new MaterialBuilder(598, TextureSet.SET_FLUID , "Diphenyl Isophthalate").addCell().addFluid().setRGB(36, 110, 87).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 20),new MaterialStack(Hydrogen, 14),new MaterialStack(Oxygen, 4)).constructMaterial(); Materials.Polybenzimidazole = new Materials(599, TextureSet.SET_DULL ,3.0F, 64, 1, 1|2 |64|128 , 45, 45, 45, 0, "Polybenzimidazole" , "Polybenzimidazole" , 0, 0, 1450, 0, false, false, 1, 1, 1, Dyes.dyeBlack , 0, Arrays.asList(new MaterialStack(Carbon, 20), new MaterialStack(Nitrogen, 4), new MaterialStack(Hydrogen, 12)), Arrays.asList(new TCAspects.TC_AspectStack(TCAspects.ORDO, 2),new TCAspects.TC_AspectStack(TCAspects.VOLATUS, 1))); Materials.MTBEMixture = new MaterialBuilder(983, TextureSet.SET_FLUID , "MTBE Reaction Mixture (Butene)").addCell().addGas().setRGB(255, 255, 255).setColor(Dyes.dyeWhite).setMaterialList(new MaterialStack(Carbon, 5), new MaterialStack(Hydrogen, 12), new MaterialStack(Oxygen, 1)).constructMaterial(); From 5d0499bf2f9fbc4dd292e542ed546826d0375681 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:05:23 -0400 Subject: [PATCH 15/38] Fix DOB comb (#3388) --- src/main/java/gregtech/api/util/GTForestryCompat.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/api/util/GTForestryCompat.java b/src/main/java/gregtech/api/util/GTForestryCompat.java index 58045596c4f..a593410f81a 100644 --- a/src/main/java/gregtech/api/util/GTForestryCompat.java +++ b/src/main/java/gregtech/api/util/GTForestryCompat.java @@ -19,6 +19,8 @@ import gregtech.api.enums.Materials; import gregtech.api.enums.Mods; import gregtech.api.recipe.RecipeMaps; +import gregtech.common.items.CombType; +import gregtech.loaders.misc.GTBees; public class GTForestryCompat { @@ -134,7 +136,9 @@ public static void populateFakeNeiRecipes() { } public static void transferCentrifugeRecipes() { + // Dumb exceptions ItemStack irradiatedComb = GTModHandler.getModItem(Mods.Forestry.ID, "beeCombs", 1, 9); + ItemStack DOBComb = GTBees.combs.getStackForType(CombType.DOB); try { for (ICentrifugeRecipe tRecipe : RecipeManagers.centrifugeManager.recipes()) { @@ -142,7 +146,7 @@ public static void transferCentrifugeRecipes() { // Don't transfer GT recipes to centrifuge, those recipes are made already by ItemComb if (input.getUnlocalizedName() - .contains("gt.comb")) continue; + .contains("gt.comb") && !input.isItemEqual(DOBComb)) continue; if (irradiatedComb != null && input.isItemEqual(irradiatedComb)) continue; Map outputs = tRecipe.getAllProducts(); ItemStack[] tOutputs = new ItemStack[outputs.size()]; From 6df737c50905c6457206b59fb7fa13cc0736902f Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 20 Oct 2024 11:32:57 +0200 Subject: [PATCH 16/38] update --- dependencies.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 861fe9d8859..0ad015a05b3 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -43,7 +43,7 @@ dependencies { api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-469-GTNH:dev") - api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.39-gtnh:dev") + api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.40-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") @@ -80,7 +80,7 @@ dependencies { compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } - implementation("com.github.GTNewHorizons:Hodgepodge:2.5.71:dev") + implementation("com.github.GTNewHorizons:Hodgepodge:2.5.72:dev") compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.13-GTNH:dev') { transitive = false } compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384") From 2782e2235993d9d2973806528f647e082b6ecf7e Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Sun, 20 Oct 2024 18:10:43 +0800 Subject: [PATCH 17/38] Fix mega oil cracker hatch adder (#3391) Co-authored-by: Martin Robertz --- .../multis/mega/MTEMegaOilCracker.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java index 951903cc560..783d968535f 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaOilCracker.java @@ -100,12 +100,18 @@ public class MTEMegaOilCracker extends MegaMultiBlockBase imp .addElement('p', ofBlock(GregTechAPI.sBlockCasings4, 1)) .addElement( 'l', - InputHatch.withAdder(MTEMegaOilCracker::addLeftHatchToMachineList) - .newAny(CASING_INDEX, 2)) + buildHatchAdder(MTEMegaOilCracker.class) + .atLeast(InputHatch.withAdder(MTEMegaOilCracker::addLeftHatchToMachineList)) + .dot(2) + .casingIndex(CASING_INDEX) + .buildAndChain(GregTechAPI.sBlockCasings4, 1)) .addElement( 'r', - OutputHatch.withAdder(MTEMegaOilCracker::addRightHatchToMachineList) - .newAny(CASING_INDEX, 3)) + buildHatchAdder(MTEMegaOilCracker.class) + .atLeast(OutputHatch.withAdder(MTEMegaOilCracker::addRightHatchToMachineList)) + .dot(3) + .casingIndex(CASING_INDEX) + .buildAndChain(GregTechAPI.sBlockCasings4, 1)) .addElement( 'm', buildHatchAdder(MTEMegaOilCracker.class).atLeast(Energy.or(ExoticEnergy), Maintenance, InputBus) @@ -114,8 +120,11 @@ public class MTEMegaOilCracker extends MegaMultiBlockBase imp .buildAndChain(GregTechAPI.sBlockCasings4, 1)) .addElement( 'M', - InputHatch.withAdder(MTEMegaOilCracker::addMiddleInputToMachineList) - .newAny(CASING_INDEX, 4)) + buildHatchAdder(MTEMegaOilCracker.class) + .atLeast(InputHatch.withAdder(MTEMegaOilCracker::addMiddleInputToMachineList)) + .dot(4) + .casingIndex(CASING_INDEX) + .buildAndChain(GregTechAPI.sBlockCasings4, 1)) .addElement( 'g', withChannel( @@ -279,24 +288,22 @@ private boolean addLeftHatchToMachineList(IGregTechTileEntity aTileEntity, int a if (aMetaTileEntity == null) { return false; } - if (aMetaTileEntity instanceof MTEHatchInput) { + if (aMetaTileEntity instanceof MTEHatchInput tHatch) { if (this.mInputOnSide == 1) { return false; } this.mInputOnSide = 0; this.mOutputOnSide = 1; - MTEHatchInput tHatch = (MTEHatchInput) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); tHatch.mRecipeMap = this.getRecipeMap(); return this.mInputHatches.add(tHatch); } - if (aMetaTileEntity instanceof MTEHatchOutput) { + if (aMetaTileEntity instanceof MTEHatchOutput tHatch) { if (this.mOutputOnSide == 1) { return false; } this.mInputOnSide = 1; this.mOutputOnSide = 0; - MTEHatchOutput tHatch = (MTEHatchOutput) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); return this.mOutputHatches.add(tHatch); } @@ -311,24 +318,22 @@ private boolean addRightHatchToMachineList(IGregTechTileEntity aTileEntity, int if (aMetaTileEntity == null) { return false; } - if (aMetaTileEntity instanceof MTEHatchInput) { + if (aMetaTileEntity instanceof MTEHatchInput tHatch) { if (this.mInputOnSide == 0) { return false; } this.mInputOnSide = 1; this.mOutputOnSide = 0; - MTEHatchInput tHatch = (MTEHatchInput) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); tHatch.mRecipeMap = this.getRecipeMap(); return this.mInputHatches.add(tHatch); } - if (aMetaTileEntity instanceof MTEHatchOutput) { + if (aMetaTileEntity instanceof MTEHatchOutput tHatch) { if (this.mOutputOnSide == 0) { return false; } this.mInputOnSide = 0; this.mOutputOnSide = 1; - MTEHatchOutput tHatch = (MTEHatchOutput) aMetaTileEntity; tHatch.updateTexture(aBaseCasingIndex); return this.mOutputHatches.add(tHatch); } From c9dd559aa1cc5d1a3659fb11e48bcb4bc22d7214 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 20 Oct 2024 12:11:55 +0200 Subject: [PATCH 18/38] update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 0ad015a05b3..84c14fbf6a8 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -80,7 +80,7 @@ dependencies { compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } - implementation("com.github.GTNewHorizons:Hodgepodge:2.5.72:dev") + implementation("com.github.GTNewHorizons:Hodgepodge:2.5.73:dev") compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.13-GTNH:dev') { transitive = false } compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384") From 25f01262c6de6a25078ca97822de2b068b23c212 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Sun, 20 Oct 2024 09:08:15 -0400 Subject: [PATCH 19/38] Blackhole render enhancement (#3390) Co-authored-by: Martin Robertz --- .../common/render/BlackholeRenderer.java | 18 ++++++++++--- .../compressor/MTEBlackHoleCompressor.java | 16 ++++++++++-- .../render/TileEntityBlackhole.java | 25 +++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/main/java/gregtech/common/render/BlackholeRenderer.java b/src/main/java/gregtech/common/render/BlackholeRenderer.java index 26938447083..78432fbc6dd 100644 --- a/src/main/java/gregtech/common/render/BlackholeRenderer.java +++ b/src/main/java/gregtech/common/render/BlackholeRenderer.java @@ -7,6 +7,7 @@ import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.AdvancedModelLoader; @@ -118,10 +119,21 @@ private void init() { } private void renderBlackHole(TileEntityBlackhole tile, double x, double y, double z, float timer) { - blackholeProgram.use(); bindTexture(blackholeTexture); GL20.glUniform1f(u_Stability, tile.getStability()); + + float startTime = tile.getStartTime(); + float scaleF = timer - startTime; + // If this is false we're shrinking, so subtract from 40 to translate to reversed scaling + if (!tile.getScaling()) { + scaleF = 40 - scaleF; + } + scaleF = MathHelper.clamp_float(scaleF / 40, 0, 1) * modelScale; + // Smootherstep function to make it scale nicer + scaleF = scaleF * scaleF * scaleF * (scaleF * (6.0f * scaleF - 15.0f) + 10.0f); + GL20.glUniform1f(u_Scale, scaleF); + modelMatrixStack.clear(); float xLocal = ((float) x + .5f); @@ -206,7 +218,7 @@ public void renderTileEntityAt(TileEntity tile, double x, double y, double z, fl y, z, tile.getWorldObj() - .getWorldTime() + timeSinceLastTick); + .getTotalWorldTime() + timeSinceLastTick); } renderBlackHole( @@ -215,7 +227,7 @@ public void renderTileEntityAt(TileEntity tile, double x, double y, double z, fl y, z, tile.getWorldObj() - .getWorldTime() + timeSinceLastTick); + .getTotalWorldTime() + timeSinceLastTick); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java index 7b444c6573e..2d84f032afc 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/compressor/MTEBlackHoleCompressor.java @@ -496,8 +496,8 @@ private void searchAndDecrementCatalysts() { blackHoleStatus = 1; blackHoleStability = 100; catalyzingCostModifier = 1; - rendererTileEntity = null; - destroyRenderBlock(); + if (rendererTileEntity != null) rendererTileEntity.startScaleChange(false); + collapseTimer = 40; return; } } @@ -574,6 +574,10 @@ public boolean onRunningTick(ItemStack aStack) { return super.onRunningTick(aStack); } + // Asynchronous timer to destroy render block after collapse animation is done playing. + // This might not sync perfectly to the renderer but this is very low stakes + private int collapseTimer = -1; + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); @@ -581,6 +585,13 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { playBlackHoleSounds(); } + if (collapseTimer != -1) { + if (collapseTimer == 0) { + destroyRenderBlock(); + } + collapseTimer--; + } + // Run stability checks once per second if a black hole is open if (blackHoleStatus == 1 || aTick % 20 != 0) return; @@ -719,6 +730,7 @@ private void createRenderBlock() { rendererTileEntity = (TileEntityBlackhole) base.getWorld() .getTileEntity(base.getXCoord() + x, base.getYCoord() + y, base.getZCoord() + z); + rendererTileEntity.startScaleChange(true); rendererTileEntity.setStability(blackHoleStability / 100F); } diff --git a/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java b/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java index f15aa45eee6..2f7114e4055 100644 --- a/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java +++ b/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java @@ -10,12 +10,17 @@ public class TileEntityBlackhole extends TileEntity { // Should run from 0 to 1, >.5 starts showing changes private float stability = 1; + // true = growing, false = shrinking + private boolean scaling = true; + private long startTime = 0; private float laserR = 0.318f, laserG = 0.157f, laserB = 0.533f; private boolean laserRender = false; private static final String NBT_TAG = "BLACKHOLE"; private static final String STABILITY_NBT_TAG = NBT_TAG + "STABILITY"; + private static final String START_TIME_NBT_TAG = NBT_TAG + "START_TIME"; + private static final String SCALING_NBT_TAG = NBT_TAG + "SCALING"; private static final String COLOR_RED_NBT_TAG = NBT_TAG + "COLOR_RED"; private static final String COLOR_GREEN_NBT_TAG = NBT_TAG + "COLOR_GREEN"; private static final String COLOR_BLUE_NBT_TAG = NBT_TAG + "COLOR_BLUE"; @@ -53,6 +58,22 @@ public boolean getLaserRender() { return laserRender; } + public void startScaleChange(boolean scaling) { + if (!worldObj.isRemote) { + this.startTime = worldObj.getTotalWorldTime(); + this.scaling = scaling; + updateToClient(); + } + } + + public long getStartTime() { + return startTime; + } + + public boolean getScaling() { + return scaling; + } + public void setStability(float stability) { // Can probably be simplified, maps stability > .5 as 1, and stability <.5 from 0 to 1 if (!worldObj.isRemote) { @@ -68,6 +89,8 @@ public float getStability() { public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setFloat(STABILITY_NBT_TAG, stability); + compound.setBoolean(SCALING_NBT_TAG, scaling); + compound.setLong(START_TIME_NBT_TAG, startTime); compound.setFloat(COLOR_RED_NBT_TAG, laserR); compound.setFloat(COLOR_GREEN_NBT_TAG, laserG); compound.setFloat(COLOR_BLUE_NBT_TAG, laserB); @@ -77,6 +100,8 @@ public void writeToNBT(NBTTagCompound compound) { @Override public void readFromNBT(NBTTagCompound compound) { stability = compound.getFloat(STABILITY_NBT_TAG); + scaling = compound.getBoolean(SCALING_NBT_TAG); + startTime = compound.getLong(START_TIME_NBT_TAG); laserR = compound.getFloat(COLOR_RED_NBT_TAG); laserG = compound.getFloat(COLOR_GREEN_NBT_TAG); laserB = compound.getFloat(COLOR_BLUE_NBT_TAG); From 202d4104fdb195a2bafb7b47af845fd92f64bfed Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 20 Oct 2024 15:58:58 +0200 Subject: [PATCH 20/38] update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 84c14fbf6a8..f1b12498821 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -89,7 +89,7 @@ dependencies { // https://www.curseforge.com/minecraft/mc-mods/advancedsolarpanels compileOnlyApi rfg.deobf('curse.maven:advsolar-362768:2885953') compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.26-GTNH:dev') {transitive = false} - compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.6:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:BloodMagic:1.6.7:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.0:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.7.0-GTNH:dev") { transitive = false } compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612") From f391ffd120f63214106c07b9445d0dfaed6742cb Mon Sep 17 00:00:00 2001 From: Daniel Mendes <70096037+Steelux8@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:59:15 +0100 Subject: [PATCH 21/38] Fix Production of SC Steam on the EHE (#3394) --- .../blocks/tileEntity/MTEExtremeHeatExchanger.java | 4 +--- src/main/java/goodgenerator/loader/RecipeLoader2.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java index 9a251daf360..493ce3850f0 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java @@ -300,9 +300,7 @@ public boolean onRunningTick(ItemStack aStack) { public double getUnitSteamPower(String steam) { return switch (steam) { case "steam" -> 0.5; - case "ic2superheatedsteam" -> 1; - case "supercriticalsteam" -> 100; - case "densesupercriticalsteam" -> 1; + case "ic2superheatedsteam", "supercriticalsteam", "densesupercriticalsteam" -> 1; default -> -1; }; } diff --git a/src/main/java/goodgenerator/loader/RecipeLoader2.java b/src/main/java/goodgenerator/loader/RecipeLoader2.java index f3ba0468820..154a9b0a22c 100644 --- a/src/main/java/goodgenerator/loader/RecipeLoader2.java +++ b/src/main/java/goodgenerator/loader/RecipeLoader2.java @@ -1076,7 +1076,7 @@ public static void RecipeLoad() { FluidRegistry.getFluidStack("ic2coolant", 16000), FluidRegistry.getFluidStack("ic2distilledwater", 20000), FluidRegistry.getFluidStack("ic2superheatedsteam", 3200000), - FluidRegistry.getFluidStack("supercriticalsteam", 32000), + FluidRegistry.getFluidStack("supercriticalsteam", 3200000), 8000); MyRecipeAdder.instance.addExtremeHeatExchangerRecipe( @@ -1084,7 +1084,7 @@ public static void RecipeLoad() { FluidRegistry.getFluidStack("molten.solarsaltcold", 3200), FluidRegistry.getFluidStack("ic2distilledwater", 20000), FluidRegistry.getFluidStack("ic2superheatedsteam", 3200000), - FluidRegistry.getFluidStack("supercriticalsteam", 32000), + FluidRegistry.getFluidStack("supercriticalsteam", 3200000), 1600); GTValues.RA.stdBuilder() From 3576172f4d3491c64ad76d2e85f7bb6a97cfd8cd Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 21 Oct 2024 16:57:02 +0200 Subject: [PATCH 22/38] update --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index f1b12498821..ce6c7523497 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -43,7 +43,7 @@ dependencies { api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-469-GTNH:dev") - api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.40-gtnh:dev") + api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.41-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") From a58d9b7ef8651f579f7c82cd986c94f75b984670 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:11:59 -0400 Subject: [PATCH 23/38] Change extractor structure (#3393) Co-authored-by: chochem <40274384+chochem@users.noreply.github.com> --- .../multi/MTEIndustrialExtractor.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java index 40a87eecd72..a82e5555474 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIndustrialExtractor.java @@ -36,6 +36,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase; +import gregtech.api.multitileentity.multiblock.casing.Glasses; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; @@ -53,18 +54,18 @@ public class MTEIndustrialExtractor extends MTEExtendedPowerMultiBlockBasebuilder() .addShape( STRUCTURE_PIECE_MAIN, - (new String[][] { { " A ", " BBB ", "AB~BA", " BBB " }, { " A ", " BBB ", "AB BA", " BBB " }, - { " A ", " BBB ", "AB BA", " BBB " }, { " A ", " BBB ", "ABBBA", " BBB " }, - { " A ", " A ", "AAAAA", " " } })) + (new String[][] { { "CCCCC", "C C", "C C", "C C", "CC~CC" }, + { "CCCCC", " BBB ", " AAA ", " BBB ", "CCCCC" }, { "CCCCC", " BBB ", " ABA ", " BBB ", "CCCCC" }, + { "CCCCC", " BBB ", " AAA ", " BBB ", "CCCCC" }, { "CCCCC", "C C", "C C", "C C", "CCCCC" } })) .addElement( - 'B', + 'C', buildHatchAdder(MTEIndustrialExtractor.class).atLeast(InputBus, OutputBus, Maintenance, Energy) .casingIndex(((BlockCasings4) GregTechAPI.sBlockCasings4).getTextureIndex(1)) .dot(1) .buildAndChain( onElementPass(MTEIndustrialExtractor::onCasingAdded, ofBlock(GregTechAPI.sBlockCasings4, 1)))) .addElement( - 'A', + 'B', ofBlocksTiered( MTEIndustrialExtractor::getItemPipeTierFromMeta, ImmutableList.of( @@ -79,6 +80,7 @@ public class MTEIndustrialExtractor extends MTEExtendedPowerMultiBlockBase= 22; + if (!checkPiece(STRUCTURE_PIECE_MAIN, 2, 4, 0)) return false; + return mCasingAmount >= 45; } @Override @@ -212,7 +215,8 @@ protected ProcessingLogic createProcessingLogic() { } public int getMaxParallelRecipes() { - return 8 * itemPipeTier; + // Max call to prevent seeing -16 parallels in waila for unformed multi + return Math.max(8 * itemPipeTier, 0); } @Override From 42946c9ac1fdb250d8648a1128285a2409e4265c Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:07:05 +0800 Subject: [PATCH 24/38] Make some machine drops stackable with new ones (#3392) Co-authored-by: Martin Robertz --- .../tileentities/multis/MTECircuitAssemblyLine.java | 3 +-- .../tileentities/automation/MTEItemDistributor.java | 9 ++++++++- .../tileentities/machines/MTEHatchOutputBusME.java | 5 +++-- .../common/tileentities/machines/MTEHatchOutputME.java | 5 +++-- .../common/tileentities/machines/basic/MTEMiner.java | 2 +- .../common/tileentities/machines/basic/MTEPump.java | 4 ++-- .../common/tileentities/storage/MTEQuantumChest.java | 8 +++++--- .../machines/basic/MTEAtmosphericReconditioner.java | 4 ++-- .../multi/processing/MTEIndustrialMacerator.java | 2 +- .../processing/advanced/MTEAdvDistillationTower.java | 2 +- .../common/tileentities/storage/MTEEnergyBuffer.java | 6 ++++-- .../thing/metaTileEntity/multi/MTEEyeOfHarmony.java | 2 +- 12 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java index 324d041efc9..54810bcf6d9 100644 --- a/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java +++ b/src/main/java/bartworks/common/tileentities/multis/MTECircuitAssemblyLine.java @@ -263,8 +263,7 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public void setItemNBT(NBTTagCompound aNBT) { if (isImprinted()) aNBT.setTag(IMPRINT_KEY, this.type); - aNBT.setInteger(RUNNING_MODE_KEY, mode); - super.saveNBTData(aNBT); + super.setItemNBT(aNBT); } @Override diff --git a/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java b/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java index 36f1e1be58e..4dbd8237ca3 100644 --- a/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java +++ b/src/main/java/gregtech/common/tileentities/automation/MTEItemDistributor.java @@ -187,7 +187,14 @@ public void saveNBTData(NBTTagCompound aNBT) { @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); - aNBT.setByteArray("mItemsPerSide", itemsPerSide); + boolean hasSettings = false; + for (byte i : itemsPerSide) { + if (i != 0) { + hasSettings = true; + break; + } + } + if (hasSettings) aNBT.setByteArray("mItemsPerSide", itemsPerSide); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java index 9e396b8b275..1f6905926a7 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java @@ -50,7 +50,8 @@ public class MTEHatchOutputBusME extends MTEHatchOutputBus implements IPowerChannelState { - private long baseCapacity = 1_600; + private static final long DEFAULT_CAPACITY = 1_600; + private long baseCapacity = DEFAULT_CAPACITY; private BaseActionSource requestSource = null; private @Nullable AENetworkProxy gridProxy = null; @@ -268,7 +269,7 @@ public void addAdditionalTooltipInformation(ItemStack stack, List toolti @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); - aNBT.setLong("baseCapacity", baseCapacity); + if (baseCapacity != DEFAULT_CAPACITY) aNBT.setLong("baseCapacity", baseCapacity); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java index 7ebe9929c3f..40980c5f148 100644 --- a/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java +++ b/src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java @@ -58,7 +58,8 @@ public class MTEHatchOutputME extends MTEHatchOutput implements IPowerChannelState { - private long baseCapacity = 128_000; + private static final long DEFAULT_CAPACITY = 128_000; + private long baseCapacity = DEFAULT_CAPACITY; private BaseActionSource requestSource = null; private @Nullable AENetworkProxy gridProxy = null; @@ -302,7 +303,7 @@ public void addAdditionalTooltipInformation(ItemStack stack, List toolti @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); - aNBT.setLong("baseCapacity", baseCapacity); + if (baseCapacity != DEFAULT_CAPACITY) aNBT.setLong("baseCapacity", baseCapacity); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java index 7707564b939..d799955c19b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEMiner.java @@ -343,7 +343,7 @@ public long maxEUStore() { @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); - aNBT.setInteger("radiusConfig", radiusConfig); + if (radiusConfig != RADIUS[mTier]) aNBT.setInteger("radiusConfig", radiusConfig); } @Override diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java index b8d98039513..9bc720aa199 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEPump.java @@ -253,8 +253,8 @@ public void loadNBTData(NBTTagCompound aNBT) { @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); - aNBT.setInteger("radiusConfig", radiusConfig); - aNBT.setBoolean("mDisallowRetract", mDisallowRetract); + if (radiusConfig != getMaxDistanceForTier(mTier)) aNBT.setInteger("radiusConfig", radiusConfig); + if (!mDisallowRetract) aNBT.setBoolean("mDisallowRetract", false); } @Override diff --git a/src/main/java/gregtech/common/tileentities/storage/MTEQuantumChest.java b/src/main/java/gregtech/common/tileentities/storage/MTEQuantumChest.java index 5402ded8738..9ef1e9e8925 100644 --- a/src/main/java/gregtech/common/tileentities/storage/MTEQuantumChest.java +++ b/src/main/java/gregtech/common/tileentities/storage/MTEQuantumChest.java @@ -40,6 +40,7 @@ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @Override public void setItemNBT(NBTTagCompound aNBT) { mInvData = new NBTTagList(); + boolean hasInvData = false; for (int i = 0; i < 3; i++) { if (mInventory[i] != null) { NBTTagCompound tNBT = new NBTTagCompound(); @@ -51,12 +52,13 @@ public void setItemNBT(NBTTagCompound aNBT) { tNBT.setTag("tag", mInventory[i].getTagCompound()); } mInvData.appendTag(tNBT); + hasInvData = true; } } if (mItemStack != null) aNBT.setTag("mItemStack", getItemStack().writeToNBT(new NBTTagCompound())); - aNBT.setTag("Inventory", mInvData); - aNBT.setInteger("mItemCount", getItemCount()); - aNBT.setBoolean("mVoidOverflow", mVoidOverflow); + if (hasInvData) aNBT.setTag("Inventory", mInvData); + if (getItemCount() > 0) aNBT.setInteger("mItemCount", getItemCount()); + if (mVoidOverflow) aNBT.setBoolean("mVoidOverflow", true); super.setItemNBT(aNBT); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java index 438fe6a5367..5a423195489 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java @@ -793,8 +793,8 @@ public ITexture[] getTopFacingInactive(byte aColor) { @Override public void setItemNBT(NBTTagCompound aNBT) { - aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow); - aNBT.setBoolean("mSaveRotor", mSaveRotor); + if (mOptimalAirFlow > 0) aNBT.setInteger("mOptimalAirFlow", this.mOptimalAirFlow); + if (mSaveRotor) aNBT.setBoolean("mSaveRotor", true); super.setItemNBT(aNBT); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java index 7896dfb73ce..b6666cdc6d9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java @@ -334,7 +334,7 @@ public void initDefaultModes(NBTTagCompound aNBT) { @Override public void setItemNBT(NBTTagCompound aNBT) { super.setItemNBT(aNBT); - aNBT.setByte("mTier", (byte) controllerTier); + if (controllerTier > 1) aNBT.setByte("mTier", (byte) controllerTier); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java index c602e8f41f6..f09de3c6afd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java @@ -446,7 +446,7 @@ public boolean canDumpFluidToME() { @Override public void setItemNBT(NBTTagCompound aNBT) { - aNBT.setBoolean("mUpgraded", mUpgraded); + if (mUpgraded) aNBT.setBoolean("mUpgraded", true); super.setItemNBT(aNBT); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java index db02fe2af77..bc844cd1dd8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/MTEEnergyBuffer.java @@ -23,7 +23,8 @@ public class MTEEnergyBuffer extends GTPPMetaTileEntity { - protected byte aCurrentOutputAmperage = 4; + protected static final byte DEFAULT_OUTPUT_AMPERAGE = 4; + protected byte aCurrentOutputAmperage = DEFAULT_OUTPUT_AMPERAGE; public MTEEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) { @@ -403,7 +404,8 @@ public boolean isItemValidForSlot(final int p_94041_1_, final ItemStack p_94041_ @Override public void setItemNBT(NBTTagCompound aNBT) { - aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage); + if (aCurrentOutputAmperage != DEFAULT_OUTPUT_AMPERAGE) + aNBT.setByte("aCurrentOutputAmperage", aCurrentOutputAmperage); long aEU = this.getBaseMetaTileEntity() .getStoredEU(); if (aEU > 0) { diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java index 403208a3937..2c6c9bf1e71 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java @@ -1724,7 +1724,7 @@ public void addAdditionalTooltipInformation(ItemStack stack, List toolti @Override public void setItemNBT(NBTTagCompound NBT) { - NBT.setLong(ASTRAL_ARRAY_AMOUNT_NBT_TAG, astralArrayAmount); + if (astralArrayAmount > 0) NBT.setLong(ASTRAL_ARRAY_AMOUNT_NBT_TAG, astralArrayAmount); } @Override From e741976ea6a6fa5dbcb45813fd1e2ca368331ba5 Mon Sep 17 00:00:00 2001 From: HoleFish <48403212+HoleFish@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:13:52 +0800 Subject: [PATCH 25/38] Buff TGS sapling production (#3382) Co-authored-by: Martin Robertz --- .../tileentities/machines/multi/production/MTETreeFarm.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java index caecbaea927..303c5680047 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java @@ -124,7 +124,7 @@ protected MultiblockTooltipBuilder createTooltip() { .addInfo("Different tools are required for different outputs") .addInfo("Advanced tools multiply output amount") .addInfo(" Logs: Saw (1x), Buzzsaw (2x), Chainsaw (4x)") - .addInfo(" Saplings: Branch Cutter (1x), Grafter (3x)") + .addInfo(" Saplings: Branch Cutter (1x), Grafter (4x)") .addInfo(" Leaves: Shears (1x), Wire Cutter (2x), Automatic Snips (4x)") .addInfo(" Fruit: Knife (1x)") .addInfo("Multiple tools can be used at the same time") @@ -289,7 +289,7 @@ public enum Mode { private static final EnumMap modeMultiplier = new EnumMap<>(Mode.class); static { modeMultiplier.put(Mode.LOG, 5); - modeMultiplier.put(Mode.SAPLING, 1); + modeMultiplier.put(Mode.SAPLING, 5); modeMultiplier.put(Mode.LEAVES, 2); modeMultiplier.put(Mode.FRUIT, 1); } @@ -458,7 +458,7 @@ public static int getToolMultiplier(ItemStack toolStack, Mode mode) { return 1; } if (Forestry.isModLoaded() && tool instanceof IToolGrafter && tool.isDamageable()) { - return 3; + return 4; } break; From 901cb0d294b0c4f114bb247fbd7d6f97e7484f3c Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:21:33 +0200 Subject: [PATCH 26/38] Import pollution mixins from hodgepodge (#3395) Co-authored-by: Martin Robertz Co-authored-by: boubou19 --- .../common/configs/Configuration.java | 14 - .../classic/TileEntityHeatedWaterPump.java | 8 +- .../multis/mega/MTEMegaBlastFurnace.java | 3 +- .../BehaviourDetravToolProspector.java | 2 +- .../graphs/consumers/NodeEnergyReceiver.java | 2 +- .../api/interfaces/ICleanroomReceiver.java | 2 +- .../metatileentity/BaseMetaTileEntity.java | 2 +- .../implementations/MTEBasicGenerator.java | 2 +- .../implementations/MTEHatchMuffler.java | 2 +- .../implementations/MTEMultiBlockBase.java | 2 +- .../api/task/tasks/PollutionTask.java | 2 +- .../java/gregtech/api/util/GTUtility.java | 2 +- src/main/java/gregtech/asm/GTCorePlugin.java | 4 +- .../gregtech/client/GTGUIClientConfig.java | 2 + src/main/java/gregtech/common/GTClient.java | 4 +- src/main/java/gregtech/common/GTProxy.java | 1 + .../java/gregtech/common/config/Gregtech.java | 127 ------ .../java/gregtech/common/misc/GTCommand.java | 2 +- .../common/pollution/BlockMatcher.java | 96 +++++ .../common/pollution/ColorOverrideType.java | 28 ++ .../EntityFXPollution.java | 2 +- .../GTClientPollutionMap.java | 2 +- .../common/{ => pollution}/Pollution.java | 32 +- .../common/pollution/PollutionConfig.java | 397 ++++++++++++++++++ .../PollutionRenderer.java | 4 +- .../common/pollution/PollutionTooltip.java | 108 +++++ .../tileentities/boilers/MTEBoiler.java | 2 +- .../tileentities/boilers/MTEBoilerBronze.java | 2 +- .../machines/multi/MTECharcoalPit.java | 2 +- .../multi/MTEPrimitiveBlastFurnace.java | 2 +- .../gregtech/loaders/preload/GTPreLoad.java | 55 +-- src/main/java/gregtech/mixin/Mixin.java | 69 ++- .../gtPlusPlus/core/common/CommonProxy.java | 3 +- .../gtPlusPlus/core/config/Configuration.java | 171 -------- .../tileentities/base/TileEntityBase.java | 4 +- .../minecraft/gregtech/PollutionUtils.java | 157 ++----- .../MTEHatchMufflerAdvanced.java | 22 +- .../MTERocketFuelGeneratorBase.java | 24 +- .../generators/MTEBoilerBase.java | 5 +- .../generators/MTEGeothermalGenerator.java | 6 +- .../generators/MTERTGenerator.java | 4 +- .../generators/MTESemiFluidGenerator.java | 6 +- .../basic/MTEAtmosphericReconditioner.java | 30 +- .../machines/basic/MTEPollutionCreator.java | 6 +- .../machines/basic/MTEPollutionDetector.java | 4 +- .../multi/misc/MTEAmazonPackager.java | 4 +- .../processing/MTEIndustrialAlloySmelter.java | 4 +- .../processing/MTEIndustrialArcFurnace.java | 4 +- .../processing/MTEIndustrialCentrifuge.java | 4 +- .../multi/processing/MTEIndustrialChisel.java | 4 +- .../processing/MTEIndustrialCokeOven.java | 4 +- .../MTEIndustrialCuttingMachine.java | 4 +- .../processing/MTEIndustrialDehydrator.java | 4 +- .../processing/MTEIndustrialExtruder.java | 4 +- .../processing/MTEIndustrialFluidHeater.java | 4 +- .../processing/MTEIndustrialForgeHammer.java | 4 +- .../processing/MTEIndustrialMacerator.java | 4 +- .../multi/processing/MTEIndustrialMixer.java | 4 +- .../MTEIndustrialMolecularTransformer.java | 4 +- .../processing/MTEIndustrialMultiMachine.java | 8 +- .../processing/MTEIndustrialPlatePress.java | 6 +- .../multi/processing/MTEIndustrialSifter.java | 4 +- .../MTEIndustrialThermalCentrifuge.java | 4 +- .../MTEIndustrialVacuumFreezer.java | 4 +- .../processing/MTEIndustrialWashPlant.java | 6 +- .../processing/MTEIndustrialWireMill.java | 4 +- .../machines/multi/processing/MTEIsaMill.java | 4 +- .../MTENuclearSaltProcessingPlant.java | 4 +- .../processing/MTEndustrialElectrolyzer.java | 4 +- .../advanced/MTEAdvDistillationTower.java | 6 +- .../multi/processing/advanced/MTEAdvEBF.java | 4 +- .../advanced/MTEAdvImplosionCompressor.java | 4 +- .../production/MTEAlloyBlastSmelter.java | 4 +- .../multi/production/MTEAutoCrafter.java | 4 +- .../multi/production/MTECyclotron.java | 4 +- .../production/MTEElementalDuplicator.java | 4 +- .../production/MTEFrothFlotationCell.java | 4 +- .../production/MTEIndustrialFishingPond.java | 4 +- .../production/MTEIndustrialRockBreaker.java | 4 +- .../MTELargeSemifluidGenerator.java | 4 +- .../multi/production/MTEMassFabricator.java | 4 +- .../multi/production/MTERefinery.java | 4 +- .../multi/production/MTEThermalBoiler.java | 4 +- .../multi/production/MTETreeFarm.java | 4 +- .../production/algae/MTEAlgaePondBase.java | 4 +- .../turbines/MTELargerTurbineBase.java | 5 +- .../single/MTEDebugPollutor.java | 2 +- .../pollution/MixinExplosionPollution.java | 39 ++ ...xinRenderBlocks_PollutionWithOptifine.java | 86 ++++ ...RenderBlocks_PollutionWithoutOptifine.java | 75 ++++ .../MixinTileEntityFurnacePollution.java | 33 ++ .../MixinFoliageRendererPollution.java | 31 ++ .../MixinGalacticraftRocketPollution.java | 39 ++ .../ic2/MixinIC2IronFurnacePollution.java | 32 ++ .../mixin/mixins/late/ic2/MixinIc2Hazmat.java | 22 + .../MixinRailcraftBoilerPollution.java | 45 ++ .../MixinRailcraftCokeOvenPollution.java | 39 ++ .../MixinRailcraftTunnelBorePollution.java | 34 ++ ...ixinThaumcraftAlchemyFurnacePollution.java | 33 ++ 99 files changed, 1454 insertions(+), 657 deletions(-) create mode 100644 src/main/java/gregtech/common/pollution/BlockMatcher.java create mode 100644 src/main/java/gregtech/common/pollution/ColorOverrideType.java rename src/main/java/gregtech/common/{entities => pollution}/EntityFXPollution.java (98%) rename src/main/java/gregtech/common/{misc => pollution}/GTClientPollutionMap.java (99%) rename src/main/java/gregtech/common/{ => pollution}/Pollution.java (94%) create mode 100644 src/main/java/gregtech/common/pollution/PollutionConfig.java rename src/main/java/gregtech/common/{render => pollution}/PollutionRenderer.java (98%) create mode 100644 src/main/java/gregtech/common/pollution/PollutionTooltip.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinExplosionPollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithOptifine.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithoutOptifine.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinTileEntityFurnacePollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/biomesoplenty/MixinFoliageRendererPollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/galacticraftcore/MixinGalacticraftRocketPollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIC2IronFurnacePollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIc2Hazmat.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftBoilerPollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftCokeOvenPollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftTunnelBorePollution.java create mode 100644 src/mixin/java/gregtech/mixin/mixins/late/thaumcraft/MixinThaumcraftAlchemyFurnacePollution.java diff --git a/src/main/java/bartworks/common/configs/Configuration.java b/src/main/java/bartworks/common/configs/Configuration.java index 50d144dc326..5ac693b92c9 100644 --- a/src/main/java/bartworks/common/configs/Configuration.java +++ b/src/main/java/bartworks/common/configs/Configuration.java @@ -19,8 +19,6 @@ public class Configuration { public static final SingleBlocks singleBlocks = new SingleBlocks(); - public static final Pollution pollution = new Pollution(); - public static final RossRuinMetas rossRuinMetas = new RossRuinMetas(); @Config.Comment("Mixins section.") @@ -106,18 +104,6 @@ public static class SingleBlocks { public int mbWaterperSec; } - @Config.Comment("Pollution section.") - public static class Pollution { - - @Config.Comment("How much should the Simple Stirling Water Pump produce pollution per second") - @Config.DefaultInt(5) - public int pollutionHeatedWaterPumpSecond; - - @Config.Comment("How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") - @Config.DefaultInt(400) - public int basePollutionMBFSecond; - } - @Config.Comment("Ross' ruins machine metaIDs section.") public static class RossRuinMetas { diff --git a/src/main/java/bartworks/common/tileentities/classic/TileEntityHeatedWaterPump.java b/src/main/java/bartworks/common/tileentities/classic/TileEntityHeatedWaterPump.java index 046ecb40f2c..88afbd821c6 100644 --- a/src/main/java/bartworks/common/tileentities/classic/TileEntityHeatedWaterPump.java +++ b/src/main/java/bartworks/common/tileentities/classic/TileEntityHeatedWaterPump.java @@ -49,7 +49,8 @@ import bartworks.MainMod; import bartworks.common.configs.Configuration; import gregtech.api.util.GTUtility; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; public class TileEntityHeatedWaterPump extends TileEntity implements ITileDropsContent, IFluidHandler, IFluidTank, ITileWithModularUI, ITileAddsInformation, ITileHasDifferentTextureSides { @@ -167,8 +168,7 @@ private void causePollution() { .ifPresent(e -> { if (e.getTotalWorldTime() % 20 == 0) { Optional.ofNullable(e.getChunkFromBlockCoords(this.xCoord, this.zCoord)) - .ifPresent( - c -> Pollution.addPollution(c, Configuration.pollution.pollutionHeatedWaterPumpSecond)); + .ifPresent(c -> Pollution.addPollution(c, PollutionConfig.pollutionHeatedWaterPumpSecond)); } }); } @@ -334,7 +334,7 @@ public String[] getInfoData() { + GTUtility.formatNumbers(Configuration.singleBlocks.mbWaterperSec) + String.format( StatCollector.translateToLocal("tooltip.tile.waterpump.1.name"), - Configuration.pollution.pollutionHeatedWaterPumpSecond), + PollutionConfig.pollutionHeatedWaterPumpSecond), StatCollector.translateToLocal("tooltip.tile.waterpump.2.name") }; } diff --git a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java index 7a5e361c8de..9fb028d51c3 100644 --- a/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java +++ b/src/main/java/bartworks/common/tileentities/multis/mega/MTEMegaBlastFurnace.java @@ -71,6 +71,7 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; +import gregtech.common.pollution.PollutionConfig; public class MTEMegaBlastFurnace extends MegaMultiBlockBase implements ISurvivalConstructable { @@ -151,7 +152,7 @@ private static String[][] createShape() { Materials.CarbonMonoxide.getGas(1000), Materials.SulfurDioxide.getGas(1000) }; private int mHeatingCapacity; private byte glassTier; - private final static int polPtick = Configuration.pollution.basePollutionMBFSecond / 20 + private final static int polPtick = PollutionConfig.basePollutionMBFSecond / 20 * Configuration.Multiblocks.megaMachinesMax; public MTEMegaBlastFurnace(int aID, String aName, String aNameRegional) { diff --git a/src/main/java/detrav/items/behaviours/BehaviourDetravToolProspector.java b/src/main/java/detrav/items/behaviours/BehaviourDetravToolProspector.java index 79da529aeb8..22a9f7b220c 100644 --- a/src/main/java/detrav/items/behaviours/BehaviourDetravToolProspector.java +++ b/src/main/java/detrav/items/behaviours/BehaviourDetravToolProspector.java @@ -36,11 +36,11 @@ import gregtech.api.objects.ItemData; import gregtech.api.util.GTLanguageManager; import gregtech.api.util.GTOreDictUnificator; -import gregtech.common.Pollution; import gregtech.common.UndergroundOil; import gregtech.common.blocks.BlockOresAbstract; import gregtech.common.blocks.TileEntityOres; import gregtech.common.items.behaviors.BehaviourNone; +import gregtech.common.pollution.Pollution; /** * Created by wital_000 on 19.03.2016. diff --git a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java index e9364f922b4..3d6a33fe7f7 100644 --- a/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java +++ b/src/main/java/gregtech/api/graphs/consumers/NodeEnergyReceiver.java @@ -14,7 +14,7 @@ import gregtech.api.enums.SoundResource; import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; // consumer for RF machines public class NodeEnergyReceiver extends ConsumerNode { diff --git a/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java b/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java index b26c7035c76..c7c488ccbd4 100644 --- a/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java +++ b/src/main/java/gregtech/api/interfaces/ICleanroomReceiver.java @@ -4,7 +4,7 @@ import net.minecraft.tileentity.TileEntity; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; /** * Implement this interface for TileEntities that can have association to cleanroom. diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index e39f78cee08..da81e7d9cbc 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -83,8 +83,8 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; -import gregtech.common.Pollution; import gregtech.common.covers.CoverInfo; +import gregtech.common.pollution.Pollution; import ic2.api.Direction; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicGenerator.java index 963acf191f9..8ab0da4349a 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEBasicGenerator.java @@ -22,7 +22,7 @@ import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; public abstract class MTEBasicGenerator extends MTEBasicTank implements RecipeMapWorkable { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMuffler.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMuffler.java index 179ba562541..576389de806 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMuffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEHatchMuffler.java @@ -18,7 +18,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GTLanguageManager; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; @SuppressWarnings("unused") // Unused API is expected within scope public class MTEHatchMuffler extends MTEHatch { diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index 363c45bfc91..ce508433ec3 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -95,11 +95,11 @@ import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.client.GTSoundLoop; -import gregtech.common.Pollution; import gregtech.common.config.MachineStats; import gregtech.common.gui.modularui.widget.CheckRecipeResultSyncer; import gregtech.common.gui.modularui.widget.ShutDownReasonSyncer; import gregtech.common.items.MetaGeneratedTool01; +import gregtech.common.pollution.Pollution; import gregtech.common.tileentities.machines.IDualInputHatch; import gregtech.common.tileentities.machines.IDualInputInventory; import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; diff --git a/src/main/java/gregtech/api/task/tasks/PollutionTask.java b/src/main/java/gregtech/api/task/tasks/PollutionTask.java index 3770409fb16..c8c9705e6c7 100644 --- a/src/main/java/gregtech/api/task/tasks/PollutionTask.java +++ b/src/main/java/gregtech/api/task/tasks/PollutionTask.java @@ -8,7 +8,7 @@ import gregtech.api.interfaces.tileentity.IMachineProgress; import gregtech.api.task.TaskHost; import gregtech.api.task.TickableTask; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; public class PollutionTask extends TickableTask { diff --git a/src/main/java/gregtech/api/util/GTUtility.java b/src/main/java/gregtech/api/util/GTUtility.java index 83cd5ced7af..da805f995db 100644 --- a/src/main/java/gregtech/api/util/GTUtility.java +++ b/src/main/java/gregtech/api/util/GTUtility.java @@ -167,8 +167,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.threads.RunnableSound; import gregtech.api.util.extensions.ArrayExt; -import gregtech.common.Pollution; import gregtech.common.blocks.BlockOresAbstract; +import gregtech.common.pollution.Pollution; import ic2.api.recipe.IRecipeInput; import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.RecipeInputOreDict; diff --git a/src/main/java/gregtech/asm/GTCorePlugin.java b/src/main/java/gregtech/asm/GTCorePlugin.java index 3b8aa08d16b..f8dde28c582 100644 --- a/src/main/java/gregtech/asm/GTCorePlugin.java +++ b/src/main/java/gregtech/asm/GTCorePlugin.java @@ -10,6 +10,7 @@ import bartworks.common.configs.Configuration; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; +import gregtech.common.pollution.PollutionConfig; import gregtech.mixin.Mixin; import gtPlusPlus.core.config.ASMConfiguration; @@ -20,8 +21,9 @@ public class GTCorePlugin implements IFMLLoadingPlugin, IEarlyMixinLoader { static { try { - ConfigurationManager.registerConfig(Configuration.class); ConfigurationManager.registerConfig(ASMConfiguration.class); + ConfigurationManager.registerConfig(Configuration.class); + ConfigurationManager.registerConfig(PollutionConfig.class); } catch (ConfigException e) { throw new RuntimeException(e); } diff --git a/src/main/java/gregtech/client/GTGUIClientConfig.java b/src/main/java/gregtech/client/GTGUIClientConfig.java index cf063acf55c..875e62f7f86 100644 --- a/src/main/java/gregtech/client/GTGUIClientConfig.java +++ b/src/main/java/gregtech/client/GTGUIClientConfig.java @@ -11,6 +11,7 @@ import gregtech.common.config.Gregtech; import gregtech.common.config.MachineStats; import gregtech.common.config.Worldgen; +import gregtech.common.pollution.PollutionConfig; public class GTGUIClientConfig extends SimpleGuiConfig { @@ -23,6 +24,7 @@ public GTGUIClientConfig(GuiScreen parentScreen) throws ConfigException { Client.class, Gregtech.class, MachineStats.class, + PollutionConfig.class, Worldgen.class); } } diff --git a/src/main/java/gregtech/common/GTClient.java b/src/main/java/gregtech/common/GTClient.java index 844731e82fe..7cd673c0017 100644 --- a/src/main/java/gregtech/common/GTClient.java +++ b/src/main/java/gregtech/common/GTClient.java @@ -92,6 +92,8 @@ import gregtech.client.SeekingOggCodec; import gregtech.common.blocks.BlockFrameBox; import gregtech.common.blocks.ItemMachines; +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionRenderer; import gregtech.common.render.BlackholeRenderer; import gregtech.common.render.DroneRender; import gregtech.common.render.FlaskRenderer; @@ -101,7 +103,6 @@ import gregtech.common.render.LaserRenderer; import gregtech.common.render.MetaGeneratedToolRenderer; import gregtech.common.render.MultiTileRenderer; -import gregtech.common.render.PollutionRenderer; import gregtech.common.render.WormholeRenderer; import gregtech.common.render.items.DataStickRenderer; import gregtech.common.render.items.InfiniteSprayCanRenderer; @@ -670,6 +671,7 @@ public void onResourceManagerReload(IResourceManager l) { .forEach(CoverBehaviorBase::reloadColorOverride); } }); + Pollution.onPostInitClient(); } @Override diff --git a/src/main/java/gregtech/common/GTProxy.java b/src/main/java/gregtech/common/GTProxy.java index 643811234da..e7cb627c91b 100644 --- a/src/main/java/gregtech/common/GTProxy.java +++ b/src/main/java/gregtech/common/GTProxy.java @@ -167,6 +167,7 @@ import gregtech.common.misc.GlobalEnergyWorldSavedData; import gregtech.common.misc.GlobalMetricsCoverDatabase; import gregtech.common.misc.spaceprojects.SpaceProjectWorldSavedData; +import gregtech.common.pollution.Pollution; import gregtech.common.tileentities.machines.multi.drone.MTEDroneCentre; import gregtech.nei.GTNEIDefaultHandler; diff --git a/src/main/java/gregtech/common/config/Gregtech.java b/src/main/java/gregtech/common/config/Gregtech.java index a293b6cba70..e852a6b0221 100644 --- a/src/main/java/gregtech/common/config/Gregtech.java +++ b/src/main/java/gregtech/common/config/Gregtech.java @@ -27,9 +27,6 @@ public class Gregtech { @Config.Comment("Ore drop behavior section") public static final OreDropBehavior oreDropBehavior = new OreDropBehavior(); - @Config.Comment("Pollution section") - public static final Pollution pollution = new Pollution(); - @Config.LangKey("GT5U.gui.config.gregtech.debug") public static class Debug { @@ -558,128 +555,4 @@ public static class OreDropBehavior { @Config.RequiresMcRestart public GTProxy.OreDropSystem setting = GTProxy.OreDropSystem.FortuneItem; } - - @Config.LangKey("GT5U.gui.config.gregtech.pollution") - public static class Pollution { - - @Config.Comment("if true, enables pollution in the game.") - @Config.DefaultBoolean(true) - @Config.RequiresMcRestart - public boolean pollution; - - @Config.Comment("Controls the threshold starting from which you can see fog.") - @Config.DefaultInt(550_000) - @Config.RequiresMcRestart - public int pollutionSmogLimit; - @Config.Comment("Controls the threshold starting from which players get poison effect.") - @Config.DefaultInt(750_000) - @Config.RequiresMcRestart - public int pollutionPoisonLimit; - @Config.Comment("Controls the threshold starting from which vegetation starts to be killed.") - @Config.DefaultInt(1_000_000) - @Config.RequiresMcRestart - public int pollutionVegetationLimit; - @Config.Comment("Controls the threshold starting from which if it rains, will turn cobblestone into gravel and gravel into sand.") - @Config.DefaultInt(2_000_000) - @Config.RequiresMcRestart - public int pollutionSourRainLimit; - @Config.Comment("Controls the pollution released by an explosion.") - @Config.DefaultInt(100_000) - @Config.RequiresMcRestart - public int pollutionOnExplosion; - @Config.Comment("Controls the pollution released per second by the bricked blast furnace.") - @Config.DefaultInt(200) - @Config.RequiresMcRestart - public int pollutionPrimitveBlastFurnacePerSecond; - @Config.Comment("Controls the pollution released per second by the charcoal pile igniter.") - @Config.DefaultInt(100) - @Config.RequiresMcRestart - public int pollutionCharcoalPitPerSecond; - @Config.Comment("Controls the pollution released per second by the EBF.") - @Config.DefaultInt(400) - @Config.RequiresMcRestart - public int pollutionEBFPerSecond; - @Config.Comment("Controls the pollution released per second by the large combustion engine.") - @Config.DefaultInt(480) - @Config.RequiresMcRestart - public int pollutionLargeCombustionEnginePerSecond; - @Config.Comment("Controls the pollution released per second by the extreme combustion engine.") - @Config.DefaultInt(3_840) - @Config.RequiresMcRestart - public int pollutionExtremeCombustionEnginePerSecond; - @Config.Comment("Controls the pollution released per second by the implosion compressor.") - @Config.DefaultInt(10_000) - @Config.RequiresMcRestart - public int pollutionImplosionCompressorPerSecond; - @Config.Comment("Controls the pollution released per second by the large bronze boiler.") - @Config.DefaultInt(1_000) - @Config.RequiresMcRestart - public int pollutionLargeBronzeBoilerPerSecond; - @Config.Comment("Controls the pollution released per second by the large steel boiler.") - @Config.DefaultInt(2_000) - @Config.RequiresMcRestart - public int pollutionLargeSteelBoilerPerSecond; - @Config.Comment("Controls the pollution released per second by the large titanium boiler.") - @Config.DefaultInt(3_000) - @Config.RequiresMcRestart - public int pollutionLargeTitaniumBoilerPerSecond; - @Config.Comment("Controls the pollution released per second by the large tungstensteel boiler.") - @Config.DefaultInt(4_000) - @Config.RequiresMcRestart - public int pollutionLargeTungstenSteelBoilerPerSecond; - @Config.Comment("Controls the pollution reduction obtained with each increment of the circuit when throttling large boilers.") - @Config.DefaultFloat(1.0f / 24.0f) // divided by 24 because there are 24 circuit configs. - @Config.RequiresMcRestart - public float pollutionReleasedByThrottle; - @Config.Comment("Controls the pollution released per second by the large gas turbine.") - @Config.DefaultInt(300) - @Config.RequiresMcRestart - public int pollutionLargeGasTurbinePerSecond; - @Config.Comment("Controls the pollution released per second by the multi smelter.") - @Config.DefaultInt(400) - @Config.RequiresMcRestart - public int pollutionMultiSmelterPerSecond; - @Config.Comment("Controls the pollution released per second by the pyrolyse oven.") - @Config.DefaultInt(300) - @Config.RequiresMcRestart - public int pollutionPyrolyseOvenPerSecond; - @Config.Comment("Controls the pollution released per second by the small coil boiler.") - @Config.DefaultInt(20) - @Config.RequiresMcRestart - public int pollutionSmallCoalBoilerPerSecond; - @Config.Comment("Controls the pollution released per second by the high pressure lava boiler.") - @Config.DefaultInt(20) - @Config.RequiresMcRestart - public int pollutionHighPressureLavaBoilerPerSecond; - @Config.Comment("Controls the pollution released per second by the high pressure coil boiler.") - @Config.DefaultInt(30) - @Config.RequiresMcRestart - public int pollutionHighPressureCoalBoilerPerSecond; - - @Config.Comment("Controls the pollution released per second by the base diesel generator.") - @Config.DefaultInt(40) - @Config.RequiresMcRestart - public int pollutionBaseDieselGeneratorPerSecond; - - // reading double as strings, not perfect, but better than nothing - @Config.Comment({ - "Pollution released by tier, with the following formula: PollutionBaseDieselGeneratorPerSecond * PollutionDieselGeneratorReleasedByTier[Tier]", - "The first entry has meaning as it is here to since machine tier with array index: LV is 1, etc." }) - @Config.DefaultDoubleList({ 0.1, 1.0, 0.9, 0.8 }) - @Config.RequiresMcRestart - public double[] pollutionDieselGeneratorReleasedByTier; - - @Config.Comment("Controls the pollution released per second by the base gas turbine.") - @Config.DefaultInt(40) - @Config.RequiresMcRestart - public int pollutionBaseGasTurbinePerSecond; - - // reading double as strings, not perfect, but better than nothing - @Config.Comment({ - "Pollution released by tier, with the following formula: PollutionBaseGasTurbinePerSecond * PollutionGasTurbineReleasedByTier[Tier]", - "The first entry has meaning as it is here to since machine tier with array index: LV is 1, etc." }) - @Config.DefaultDoubleList({ 0.1, 1.0, 0.9, 0.8, 0.7, 0.6 }) - @Config.RequiresMcRestart - public double[] pollutionGasTurbineReleasedByTier; - } } diff --git a/src/main/java/gregtech/common/misc/GTCommand.java b/src/main/java/gregtech/common/misc/GTCommand.java index f1590ec792b..e6fbe121447 100644 --- a/src/main/java/gregtech/common/misc/GTCommand.java +++ b/src/main/java/gregtech/common/misc/GTCommand.java @@ -25,8 +25,8 @@ import gregtech.api.objects.GTChunkManager; import gregtech.api.util.GTMusicSystem; import gregtech.api.util.GTUtility; -import gregtech.common.Pollution; import gregtech.common.misc.spaceprojects.SpaceProjectManager; +import gregtech.common.pollution.Pollution; public final class GTCommand extends CommandBase { diff --git a/src/main/java/gregtech/common/pollution/BlockMatcher.java b/src/main/java/gregtech/common/pollution/BlockMatcher.java new file mode 100644 index 00000000000..a701d323bdb --- /dev/null +++ b/src/main/java/gregtech/common/pollution/BlockMatcher.java @@ -0,0 +1,96 @@ +package gregtech.common.pollution; + +import java.util.Map; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraftforge.event.world.WorldEvent; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; +import cpw.mods.fml.common.registry.GameData; +import gregtech.GTMod; + +// Shamelessly Taken from BetterFoliage by octarine-noise +public class BlockMatcher { + + public Map, ColorOverrideType> whiteList = Maps.newHashMap(); + public Set> blackList = Sets.newHashSet(); + public Map blockIDs = Maps.newHashMap(); + + public ColorOverrideType matchesID(int blockId) { + return blockIDs.get(blockId); + } + + public ColorOverrideType matchesID(Block block) { + return blockIDs.get(Block.blockRegistry.getIDForObject(block)); + } + + public void updateClassList(String[] cfg) { + whiteList.clear(); + blackList.clear(); + for (String line : cfg) { + GTMod.GT_FML_LOGGER.info("Checking for block:" + line); + String[] lines = line.split(":"); + ColorOverrideType type = null; + if (lines.length > 1) { + try { + type = ColorOverrideType.fromName(lines[1].trim()); + } catch (NumberFormatException e) { + GTMod.GT_FML_LOGGER.error(String.format("Invalid type [%s]", line)); + continue; + } + } + + if (lines[0].startsWith("-")) { + try { + blackList.add(Class.forName(lines[0].substring(1))); + GTMod.GT_FML_LOGGER.info("\t added blacklist:" + lines[0].substring(1)); + } catch (ClassNotFoundException ignored) {} + } else { + if (type == null) { + GTMod.GT_FML_LOGGER.error(String.format("Invalid type [%s]", line)); + continue; + } + + try { + whiteList.put(Class.forName(lines[0]), type); + GTMod.GT_FML_LOGGER.info("\t added whitelist:" + lines[0]); + } catch (ClassNotFoundException ignored) {} + } + } + // updateBlockIDs(); + } + + private void updateBlockIDs() { + blockIDs.clear(); + FMLControlledNamespacedRegistry blockRegistry = GameData.getBlockRegistry(); + for (Block block : blockRegistry.typeSafeIterable()) { + ColorOverrideType t = matchesClass(block); + if (t != null) blockIDs.put(Block.blockRegistry.getIDForObject(block), t); + } + } + + private ColorOverrideType matchesClass(Block block) { + for (Class clazz : blackList) if (clazz.isAssignableFrom(block.getClass())) return null; + for (Class clazz : whiteList.keySet()) + if (clazz.isAssignableFrom(block.getClass())) return whiteList.get(clazz); + return null; + } + + /** + * Caches block IDs on world load for fast lookup + * + * @param event + */ + @SubscribeEvent + public void handleWorldLoad(WorldEvent.Load event) { + if (event.world instanceof WorldClient) { + updateBlockIDs(); + } + } +} diff --git a/src/main/java/gregtech/common/pollution/ColorOverrideType.java b/src/main/java/gregtech/common/pollution/ColorOverrideType.java new file mode 100644 index 00000000000..de0a44a835a --- /dev/null +++ b/src/main/java/gregtech/common/pollution/ColorOverrideType.java @@ -0,0 +1,28 @@ +package gregtech.common.pollution; + +public enum ColorOverrideType { + + FLOWER, + GRASS, + LEAVES, + LIQUID; + + public static ColorOverrideType fromName(String name) { + return switch (name) { + case "FLOWER" -> FLOWER; + case "GRASS" -> GRASS; + case "LEAVES" -> LEAVES; + case "LIQUID" -> LIQUID; + default -> throw new RuntimeException(); + }; + } + + public int getColor(int oColor, int x, int z) { + return switch (this) { + case FLOWER -> PollutionRenderer.colorFoliage(oColor, x, z); + case GRASS -> PollutionRenderer.colorGrass(oColor, x, z); + case LEAVES -> PollutionRenderer.colorLeaves(oColor, x, z); + case LIQUID -> PollutionRenderer.colorLiquid(oColor, x, z); + }; + } +} diff --git a/src/main/java/gregtech/common/entities/EntityFXPollution.java b/src/main/java/gregtech/common/pollution/EntityFXPollution.java similarity index 98% rename from src/main/java/gregtech/common/entities/EntityFXPollution.java rename to src/main/java/gregtech/common/pollution/EntityFXPollution.java index facd3d3364f..f1a1f184475 100644 --- a/src/main/java/gregtech/common/entities/EntityFXPollution.java +++ b/src/main/java/gregtech/common/pollution/EntityFXPollution.java @@ -1,4 +1,4 @@ -package gregtech.common.entities; +package gregtech.common.pollution; import java.util.Random; diff --git a/src/main/java/gregtech/common/misc/GTClientPollutionMap.java b/src/main/java/gregtech/common/pollution/GTClientPollutionMap.java similarity index 99% rename from src/main/java/gregtech/common/misc/GTClientPollutionMap.java rename to src/main/java/gregtech/common/pollution/GTClientPollutionMap.java index 546f8e8d12c..0fd1da309bc 100644 --- a/src/main/java/gregtech/common/misc/GTClientPollutionMap.java +++ b/src/main/java/gregtech/common/pollution/GTClientPollutionMap.java @@ -1,4 +1,4 @@ -package gregtech.common.misc; +package gregtech.common.pollution; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; diff --git a/src/main/java/gregtech/common/Pollution.java b/src/main/java/gregtech/common/pollution/Pollution.java similarity index 94% rename from src/main/java/gregtech/common/Pollution.java rename to src/main/java/gregtech/common/pollution/Pollution.java index 4245a0ef120..10b8ffcfa78 100644 --- a/src/main/java/gregtech/common/Pollution.java +++ b/src/main/java/gregtech/common/pollution/Pollution.java @@ -1,4 +1,4 @@ -package gregtech.common; +package gregtech.common.pollution; import static gregtech.api.objects.XSTR.XSTR_INSTANCE; import static gregtech.common.GTProxy.dimensionWisePollution; @@ -45,7 +45,6 @@ import gregtech.api.net.GTPacketPollution; import gregtech.api.util.GTChunkAssociatedData; import gregtech.api.util.GTUtility; -import gregtech.common.render.PollutionRenderer; public class Pollution { @@ -101,6 +100,33 @@ public static void onWorldTick(TickEvent.WorldTickEvent aEvent) { // called from pollutionInstance.tickPollutionInWorld((int) (aEvent.world.getTotalWorldTime() % cycleLen)); } + public static BlockMatcher standardBlocks; + public static BlockMatcher liquidBlocks; + public static BlockMatcher doublePlants; + public static BlockMatcher crossedSquares; + public static BlockMatcher blockVine; + + public static void onPostInitClient() { + if (PollutionConfig.pollution) { + standardBlocks = new BlockMatcher(); + liquidBlocks = new BlockMatcher(); + doublePlants = new BlockMatcher(); + crossedSquares = new BlockMatcher(); + blockVine = new BlockMatcher(); + standardBlocks.updateClassList(PollutionConfig.renderStandardBlock); + liquidBlocks.updateClassList(PollutionConfig.renderBlockLiquid); + doublePlants.updateClassList(PollutionConfig.renderBlockDoublePlant); + crossedSquares.updateClassList(PollutionConfig.renderCrossedSquares); + blockVine.updateClassList(PollutionConfig.renderblockVine); + MinecraftForge.EVENT_BUS.register(standardBlocks); + MinecraftForge.EVENT_BUS.register(liquidBlocks); + MinecraftForge.EVENT_BUS.register(doublePlants); + MinecraftForge.EVENT_BUS.register(crossedSquares); + MinecraftForge.EVENT_BUS.register(blockVine); + MinecraftForge.EVENT_BUS.register(new PollutionTooltip()); + } + } + private void tickPollutionInWorld(int aTickID) { // called from method above // gen data set if (aTickID == 0 || blank) { @@ -406,7 +432,7 @@ public static void addPollution(World aWorld, ChunkPosition aPos, int aPollution addPollution(aWorld.getChunkFromBlockCoords(aPos.chunkPosX, aPos.chunkPosZ), aPollution); } - static void migrate(ChunkDataEvent.Load e) { + public static void migrate(ChunkDataEvent.Load e) { addPollution( e.getChunk(), e.getData() diff --git a/src/main/java/gregtech/common/pollution/PollutionConfig.java b/src/main/java/gregtech/common/pollution/PollutionConfig.java new file mode 100644 index 00000000000..90098791c46 --- /dev/null +++ b/src/main/java/gregtech/common/pollution/PollutionConfig.java @@ -0,0 +1,397 @@ +package gregtech.common.pollution; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +// needs to be loaded early from the coremod because +// it decides to load some mixins or not +@Config(modid = Mods.Names.GREG_TECH, category = "Pollution", configSubDirectory = "GregTech", filename = "Pollution") +public class PollutionConfig { + + // override name to be at the top of the cfg file + @Config.Name("Activate Pollution") + @Config.Comment("if true, enables pollution in the game.") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean pollution; + + @Config.Comment("Controls the threshold starting from which you can see fog.") + @Config.DefaultInt(550_000) + @Config.RequiresMcRestart + public static int pollutionSmogLimit; + @Config.Comment("Controls the threshold starting from which players get poison effect.") + @Config.DefaultInt(750_000) + @Config.RequiresMcRestart + public static int pollutionPoisonLimit; + @Config.Comment("Controls the threshold starting from which vegetation starts to be killed.") + @Config.DefaultInt(1_000_000) + @Config.RequiresMcRestart + public static int pollutionVegetationLimit; + @Config.Comment("Controls the threshold starting from which if it rains, will turn cobblestone into gravel and gravel into sand.") + @Config.DefaultInt(2_000_000) + @Config.RequiresMcRestart + public static int pollutionSourRainLimit; + @Config.Comment("Controls the pollution released by an explosion.") + @Config.DefaultInt(100_000) + @Config.RequiresMcRestart + public static int pollutionOnExplosion; + @Config.Comment("Controls the pollution released per second by the bricked blast furnace.") + @Config.DefaultInt(200) + @Config.RequiresMcRestart + public static int pollutionPrimitveBlastFurnacePerSecond; + @Config.Comment("Controls the pollution released per second by the charcoal pile igniter.") + @Config.DefaultInt(100) + @Config.RequiresMcRestart + public static int pollutionCharcoalPitPerSecond; + @Config.Comment("Controls the pollution released per second by the EBF.") + @Config.DefaultInt(400) + @Config.RequiresMcRestart + public static int pollutionEBFPerSecond; + @Config.Comment("Controls the pollution released per second by the large combustion engine.") + @Config.DefaultInt(480) + @Config.RequiresMcRestart + public static int pollutionLargeCombustionEnginePerSecond; + @Config.Comment("Controls the pollution released per second by the extreme combustion engine.") + @Config.DefaultInt(3_840) + @Config.RequiresMcRestart + public static int pollutionExtremeCombustionEnginePerSecond; + @Config.Comment("Controls the pollution released per second by the implosion compressor.") + @Config.DefaultInt(10_000) + @Config.RequiresMcRestart + public static int pollutionImplosionCompressorPerSecond; + @Config.Comment("Controls the pollution released per second by the large bronze boiler.") + @Config.DefaultInt(1_000) + @Config.RequiresMcRestart + public static int pollutionLargeBronzeBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the large steel boiler.") + @Config.DefaultInt(2_000) + @Config.RequiresMcRestart + public static int pollutionLargeSteelBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the large titanium boiler.") + @Config.DefaultInt(3_000) + @Config.RequiresMcRestart + public static int pollutionLargeTitaniumBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the large tungstensteel boiler.") + @Config.DefaultInt(4_000) + @Config.RequiresMcRestart + public static int pollutionLargeTungstenSteelBoilerPerSecond; + @Config.Comment("Controls the pollution reduction obtained with each increment of the circuit when throttling large boilers.") + @Config.DefaultFloat(1.0f / 24.0f) // divided by 24 because there are 24 circuit configs. + @Config.RequiresMcRestart + public static float pollutionReleasedByThrottle; + @Config.Comment("Controls the pollution released per second by the large gas turbine.") + @Config.DefaultInt(300) + @Config.RequiresMcRestart + public static int pollutionLargeGasTurbinePerSecond; + @Config.Comment("Controls the pollution released per second by the multi smelter.") + @Config.DefaultInt(400) + @Config.RequiresMcRestart + public static int pollutionMultiSmelterPerSecond; + @Config.Comment("Controls the pollution released per second by the pyrolyse oven.") + @Config.DefaultInt(300) + @Config.RequiresMcRestart + public static int pollutionPyrolyseOvenPerSecond; + @Config.Comment("Controls the pollution released per second by the small coil boiler.") + @Config.DefaultInt(20) + @Config.RequiresMcRestart + public static int pollutionSmallCoalBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the high pressure lava boiler.") + @Config.DefaultInt(20) + @Config.RequiresMcRestart + public static int pollutionHighPressureLavaBoilerPerSecond; + @Config.Comment("Controls the pollution released per second by the high pressure coil boiler.") + @Config.DefaultInt(30) + @Config.RequiresMcRestart + public static int pollutionHighPressureCoalBoilerPerSecond; + + @Config.Comment("Controls the pollution released per second by the base diesel generator.") + @Config.DefaultInt(40) + @Config.RequiresMcRestart + public static int pollutionBaseDieselGeneratorPerSecond; + + // reading double as strings, not perfect, but better than nothing + @Config.Comment({ + "Pollution released by tier, with the following formula: PollutionBaseDieselGeneratorPerSecond * PollutionDieselGeneratorReleasedByTier[Tier]", + "The first entry has meaning as it is here to since machine tier with array index: LV is 1, etc." }) + @Config.DefaultDoubleList({ 0.1, 1.0, 0.9, 0.8 }) + @Config.RequiresMcRestart + public static double[] pollutionDieselGeneratorReleasedByTier; + + @Config.Comment("Controls the pollution released per second by the base gas turbine.") + @Config.DefaultInt(40) + @Config.RequiresMcRestart + public static int pollutionBaseGasTurbinePerSecond; + + // reading double as strings, not perfect, but better than nothing + @Config.Comment({ + "Pollution released by tier, with the following formula: PollutionBaseGasTurbinePerSecond * PollutionGasTurbineReleasedByTier[Tier]", + "The first entry has meaning as it is here to since machine tier with array index: LV is 1, etc." }) + @Config.DefaultDoubleList({ 0.1, 1.0, 0.9, 0.8, 0.7, 0.6 }) + @Config.RequiresMcRestart + public static double[] pollutionGasTurbineReleasedByTier; + + // Minecraft + @Config.Comment("Explosion pollution") + @Config.DefaultFloat(333.34f) + public static float explosionPollutionAmount; + + @Config.Comment("Make furnaces Pollute") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean furnacesPollute; + + @Config.Comment("Furnace pollution per second, min 1!") + @Config.DefaultInt(20) + public static int furnacePollutionAmount; + + // Galacticraft + + @Config.Comment("Pollution Amount for Rockets") + @Config.DefaultInt(10000) + public static int rocketPollutionAmount; + + @Config.Comment("Make rockets Pollute") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean rocketsPollute; + + // Railcraft + + @Config.Comment("Pollution Amount for Advanced Coke Ovens") + @Config.DefaultInt(80) + public static int advancedCokeOvenPollutionAmount; + + @Config.Comment("Pollution Amount for Coke Ovens") + @Config.DefaultInt(10) + public static int cokeOvenPollutionAmount; + + @Config.Comment("Pollution Amount for RC Firebox") + @Config.DefaultInt(20) + public static int fireboxPollutionAmount; + + @Config.Comment("Pollution Amount for hobbyist steam engine") + @Config.DefaultInt(20) + public static int hobbyistEnginePollutionAmount; + + @Config.Comment("Make Railcraft Pollute") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean railcraftPollutes; + + @Config.Comment("Pollution Amount for tunnel bore") + @Config.DefaultInt(2) + public static int tunnelBorePollutionAmount; + + // bartworks + @Config.Comment("How much should the Simple Stirling Water Pump produce pollution per second") + @Config.DefaultInt(5) + public static int pollutionHeatedWaterPumpSecond; + + @Config.Comment("How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") + @Config.DefaultInt(400) + public static int basePollutionMBFSecond; + + @Config.Comment("Changes colors of certain blocks based on pollution levels") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean pollutionBlockRecolor; + + @Config.Comment("Double Plant Blocks - Recolor Block List") + @Config.DefaultStringList({ "net.minecraft.block.BlockDoublePlant:FLOWER", }) + @Config.RequiresMcRestart + public static String[] renderBlockDoublePlant; + + @Config.Comment("Liquid Blocks - Recolor Block List") + @Config.DefaultStringList({ "net.minecraft.block.BlockLiquid:LIQUID" }) + @Config.RequiresMcRestart + public static String[] renderBlockLiquid; + + @Config.Comment("Block Vine - Recolor Block List") + @Config.DefaultStringList({ "net.minecraft.block.BlockVine:FLOWER", }) + @Config.RequiresMcRestart + public static String[] renderblockVine; + + @Config.Comment("Crossed Squares - Recolor Block List") + @Config.DefaultStringList({ "net.minecraft.block.BlockTallGrass:FLOWER", "net.minecraft.block.BlockFlower:FLOWER", + "biomesoplenty.common.blocks.BlockBOPFlower:FLOWER", "biomesoplenty.common.blocks.BlockBOPFlower2:FLOWER", + "biomesoplenty.common.blocks.BlockBOPFoliage:FLOWER", }) + @Config.RequiresMcRestart + public static String[] renderCrossedSquares; + + @Config.Comment("Standard Blocks - Recolor Block List") + @Config.DefaultStringList({ "net.minecraft.block.BlockGrass:GRASS", "net.minecraft.block.BlockLeavesBase:LEAVES", + "biomesoplenty.common.blocks.BlockOriginGrass:GRASS", "biomesoplenty.common.blocks.BlockLongGrass:GRASS", + "biomesoplenty.common.blocks.BlockNewGrass:GRASS", "tconstruct.blocks.slime.SlimeGrass:GRASS", + "thaumcraft.common.blocks.BlockMagicalLeaves:LEAVES", }) + @Config.RequiresMcRestart + public static String[] renderStandardBlock; + + // gt++ + @Config.Comment("pollution rate in gibbl/s for the Amazon warehousing depot") + @Config.DefaultInt(40) + public static int pollutionPerSecondMultiPackager; + @Config.Comment("pollution rate in gibbl/s for the Alloy blast smelter") + @Config.DefaultInt(300) + public static int pollutionPerSecondMultiIndustrialAlloySmelter; + @Config.Comment("pollution rate in gibbl/s for the High current arc furnace") + @Config.DefaultInt(2_400) + public static int pollutionPerSecondMultiIndustrialArcFurnace; + @Config.Comment("pollution rate in gibbl/s for the Industrial centrifuge") + @Config.DefaultInt(300) + public static int pollutionPerSecondMultiIndustrialCentrifuge; + @Config.Comment("pollution rate in gibbl/s for the Industrial coke oven") + @Config.DefaultInt(80) + public static int pollutionPerSecondMultiIndustrialCokeOven; + @Config.Comment("pollution rate in gibbl/s for the Cutting factory") + @Config.DefaultInt(160) + public static int pollutionPerSecondMultiIndustrialCuttingMachine; + @Config.Comment("pollution rate in gibbl/s for the Utupu-Tanuri") + @Config.DefaultInt(500) + public static int pollutionPerSecondMultiIndustrialDehydrator; + @Config.Comment("pollution rate in gibbl/s for the Industrial electrolyzer") + @Config.DefaultInt(300) + public static int pollutionPerSecondMultiIndustrialElectrolyzer; + @Config.Comment("pollution rate in gibbl/s for the Industrial extrusion machine") + @Config.DefaultInt(1_000) + public static int pollutionPerSecondMultiIndustrialExtruder; + @Config.Comment("pollution rate in gibbl/s for the Maceration stack") + @Config.DefaultInt(400) + public static int pollutionPerSecondMultiIndustrialMacerator; + @Config.Comment("pollution rate in gibbl/s for the Industrial mixing machine") + @Config.DefaultInt(800) + public static int pollutionPerSecondMultiIndustrialMixer; + @Config.Comment("pollution rate in gibbl/s for the Large processing factory in metal mode") + @Config.DefaultInt(400) + public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal; + @Config.Comment("pollution rate in gibbl/s for the Large processing factory in fluid mode") + @Config.DefaultInt(400) + public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid; + @Config.Comment("pollution rate in gibbl/s for the Large processing factory in misc mode") + @Config.DefaultInt(600) + public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc; + @Config.Comment("pollution rate in gibbl/s for the Industrial material press in forming mode") + @Config.DefaultInt(240) + public static int pollutionPerSecondMultiIndustrialPlatePress_ModeForming; + @Config.Comment("pollution rate in gibbl/s for the Industrial material press in bending mode") + @Config.DefaultInt(480) + public static int pollutionPerSecondMultiIndustrialPlatePress_ModeBending; + @Config.Comment("pollution rate in gibbl/s for the Industrial Forge Hammer") + @Config.DefaultInt(250) + public static int pollutionPerSecondMultiIndustrialForgeHammer; + @Config.Comment("pollution rate in gibbl/s for the Large Sifter") + @Config.DefaultInt(40) + public static int pollutionPerSecondMultiIndustrialSifter; + @Config.Comment("pollution rate in gibbl/s for the Large thermal refinery") + @Config.DefaultInt(1_000) + public static int pollutionPerSecondMultiIndustrialThermalCentrifuge; + @Config.Comment("pollution rate in gibbl/s for the Industrial fluid heater") + @Config.DefaultInt(1_000) + public static int pollutionPerSecondMultiIndustrialFluidHeater; + @Config.Comment("pollution rate in gibbl/s for the Cryogenic freezer") + @Config.DefaultInt(500) + public static int pollutionPerSecondMultiIndustrialVacuumFreezer; + @Config.Comment("pollution rate in gibbl/s for the Ore washing plant in chemical bath mode") + @Config.DefaultInt(400) + public static int pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath; + @Config.Comment("pollution rate in gibbl/s for the Ore washing plant in ore washer mode") + @Config.DefaultInt(100) + public static int pollutionPerSecondMultiIndustrialWashPlant_ModeWasher; + @Config.Comment("pollution rate in gibbl/s for the Wire factory") + @Config.DefaultInt(100) + public static int pollutionPerSecondMultiIndustrialWireMill; + @Config.Comment("pollution rate in gibbl/s for the IsaMill grinding machine") + @Config.DefaultInt(1_280) + public static int pollutionPerSecondMultiIsaMill; + @Config.Comment("pollution rate in gibbl/s for the Dangote distillus in distillery mode") + @Config.DefaultInt(240) + public static int pollutionPerSecondMultiAdvDistillationTower_ModeDistillery; + @Config.Comment("pollution rate in gibbl/s for the Dangote distillus in distillation tower mode") + @Config.DefaultInt(480) + public static int pollutionPerSecondMultiAdvDistillationTower_ModeDT; + @Config.Comment("pollution rate in gibbl/s for the Volcanus") + @Config.DefaultInt(500) + public static int pollutionPerSecondMultiAdvEBF; + @Config.Comment("pollution rate in gibbl/s for the Density^2") + @Config.DefaultInt(5_000) + public static int pollutionPerSecondMultiAdvImplosion; + @Config.Comment("pollution rate in gibbl/s for the Alloy blast furnace") + @Config.DefaultInt(200) + public static int pollutionPerSecondMultiABS; + @Config.Comment("pollution rate in gibbl/s for the Cyclotron") + @Config.DefaultInt(200) + public static int pollutionPerSecondMultiCyclotron; + @Config.Comment("pollution rate in gibbl/s for the Zuhai - fishing port") + @Config.DefaultInt(20) + public static int pollutionPerSecondMultiIndustrialFishingPond; + // pollutionPerSecondMultiLargeRocketEngine; + @Config.Comment("pollution rate in gibbl/s for the Large semifluid burner") + @Config.DefaultInt(1_280) + public static int pollutionPerSecondMultiLargeSemiFluidGenerator; + @Config.Comment("pollution rate in gibbl/s for the Matter fabrication CPU") + @Config.DefaultInt(40) + public static int pollutionPerSecondMultiMassFabricator; + @Config.Comment("pollution rate in gibbl/s for the Reactor fuel processing plant") + @Config.DefaultInt(4_000) + public static int pollutionPerSecondMultiRefinery; + @Config.Comment("pollution rate in gibbl/s for the Industrial Rock Breaker") + @Config.DefaultInt(100) + public static int pollutionPerSecondMultiIndustrialRockBreaker; + @Config.Comment("pollution rate in gibbl/s for the Industrial Chisel") + @Config.DefaultInt(50) + public static int pollutionPerSecondMultiIndustrialChisel; + @Config.Comment("pollution rate in gibbl/s for the Tree growth simulator") + @Config.DefaultInt(100) + public static int pollutionPerSecondMultiTreeFarm; + @Config.Comment("pollution rate in gibbl/s for the Flotation cell regulator") + @Config.DefaultInt(0) + public static int pollutionPerSecondMultiFrothFlotationCell; + @Config.Comment("pollution rate in gibbl/s for the Large-Scale auto assembler v1.01") + @Config.DefaultInt(500) + public static int pollutionPerSecondMultiAutoCrafter; + @Config.Comment("pollution rate in gibbl/s for the Nuclear salt processing plant") + @Config.DefaultInt(500) + public static int pollutionPerSecondNuclearSaltProcessingPlant; + @Config.Comment("pollution rate in gibbl/s for the Multiblock Molecular Transformer") + @Config.DefaultInt(1_000) + public static int pollutionPerSecondMultiMolecularTransformer; + + @Config.Comment("pollution rate in gibbl/s for the Elemental Duplicator") + @Config.DefaultInt(1_000) + public static int pollutionPerSecondElementalDuplicator; + + @Config.Comment("pollution rate in gibbl/s for the Thermal boiler") + @Config.DefaultInt(700) + public static int pollutionPerSecondMultiThermalBoiler; + @Config.Comment("pollution rate in gibbl/s for the Algae farm") + @Config.DefaultInt(0) + public static int pollutionPerSecondMultiAlgaePond; + @Config.Comment("base pollution rate in gibbl/s for the single block semi fluid generators") + @Config.DefaultInt(40) + public static int basePollutionPerSecondSemiFluidGenerator; + @Config.Comment("coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)") + @Config.DefaultDoubleList({ 0.0, 2.0, 4.0, 8.0, 12.0, 16.0 }) + public static double[] pollutionReleasedByTierSemiFluidGenerator; + @Config.Comment("base pollution rate in gibbl/s for the single block boilers") + @Config.DefaultInt(35) + public static int basePollutionPerSecondBoiler; + @Config.Comment("coefficient applied to the base rate of the single block boilers based on its tier (first is tier 0 aka ULV)") + @Config.DefaultDoubleList({ 0.0, 1.0, 1.43, 1.86 }) + public static double[] pollutionReleasedByTierBoiler; + @Config.Comment("minimum base pollution rate in gibbl/s for the single block rocket engines") + @Config.DefaultInt(250) + public static int baseMinPollutionPerSecondRocketFuelGenerator; + @Config.Comment("maximum base pollution rate in gibbl/s for the single block rocket engines") + @Config.DefaultInt(2_000) + public static int baseMaxPollutionPerSecondRocketFuelGenerator; + @Config.Comment("coefficient applied to the base rate of the single block rocket engines based on its tier (first is tier 0 aka ULV)") + @Config.DefaultDoubleList({ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0 }) + public static double[] pollutionReleasedByTierRocketFuelGenerator; + @Config.Comment("base pollution rate in gibbl/s for the geothermal engines") + @Config.DefaultInt(100) + public static int basePollutionPerSecondGeothermalGenerator; + @Config.Comment("coefficient applied to the base rate of the single block geothermal engines based on its tier (first is tier 0 aka ULV)") + @Config.DefaultDoubleList({ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 }) + public static double[] pollutionReleasedByTierGeothermalGenerator; + +} diff --git a/src/main/java/gregtech/common/render/PollutionRenderer.java b/src/main/java/gregtech/common/pollution/PollutionRenderer.java similarity index 98% rename from src/main/java/gregtech/common/render/PollutionRenderer.java rename to src/main/java/gregtech/common/pollution/PollutionRenderer.java index 3b97fc820f5..d0b76a58b10 100644 --- a/src/main/java/gregtech/common/render/PollutionRenderer.java +++ b/src/main/java/gregtech/common/pollution/PollutionRenderer.java @@ -1,4 +1,4 @@ -package gregtech.common.render; +package gregtech.common.pollution; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -22,8 +22,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.GTMod; -import gregtech.common.entities.EntityFXPollution; -import gregtech.common.misc.GTClientPollutionMap; @SideOnly(Side.CLIENT) public class PollutionRenderer { diff --git a/src/main/java/gregtech/common/pollution/PollutionTooltip.java b/src/main/java/gregtech/common/pollution/PollutionTooltip.java new file mode 100644 index 00000000000..0fa338a6246 --- /dev/null +++ b/src/main/java/gregtech/common/pollution/PollutionTooltip.java @@ -0,0 +1,108 @@ +package gregtech.common.pollution; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.api.enums.Mods; +import gregtech.api.util.GTModHandler; +import gregtech.api.util.GTUtility; + +public class PollutionTooltip { + + private static final String PRODUCES_POLLUTION_FORMAT = "Produces %d Pollution/Second"; + private static final String MULTI_POLLUTION_FORMAT = "A complete Multiblock produces %d Pollution/Second"; + + @SubscribeEvent(priority = EventPriority.LOWEST) + public void getTooltip(ItemTooltipEvent event) { + if (event.itemStack == null) return; + + if (PollutionConfig.furnacesPollute) { + String furnacePollution = String.format(PRODUCES_POLLUTION_FORMAT, PollutionConfig.furnacePollutionAmount); + + // Furnace and Iron Furnace + if (GTUtility.areStacksEqual(event.itemStack, new ItemStack(Blocks.furnace)) + || GTUtility.areStacksEqual(event.itemStack, GTModHandler.getModItem("IC2", "blockMachine", 1, 1))) { + event.toolTip.add(furnacePollution); + } + + // Alchemical Furnace + if (Mods.Thaumcraft.isModLoaded()) { + if (GTUtility + .areStacksEqual(event.itemStack, GTModHandler.getModItem("Thaumcraft", "blockStoneDevice", 1, 0))) { + event.toolTip.add(furnacePollution); + } + } + + // Advanced Alchemical Furnace + if (Mods.ThaumicBases.isModLoaded()) { + if (GTUtility + .areStacksEqual(event.itemStack, GTModHandler.getModItem("thaumicbases", "advAlchFurnace", 1, 0))) { + event.toolTip.add(furnacePollution); + } + } + } + + if (Mods.Railcraft.isModLoaded() && PollutionConfig.railcraftPollutes) { + + // Solid and Liquid Boiler Firebox + if (GTUtility.areStacksEqual(event.itemStack, GTModHandler.getModItem("Railcraft", "machine.beta", 1, 5)) + || GTUtility + .areStacksEqual(event.itemStack, GTModHandler.getModItem("Railcraft", "machine.beta", 1, 6))) { + event.toolTip.add( + String.format("Produces %d Pollution/Second per firebox", PollutionConfig.fireboxPollutionAmount)); + } + + // Tunnel Bore + if (GTUtility.areStacksEqual(event.itemStack, GTModHandler.getModItem("Railcraft", "cart.bore", 1, 0))) { + event.toolTip.add(String.format(PRODUCES_POLLUTION_FORMAT, PollutionConfig.tunnelBorePollutionAmount)); + } + + // Coke Oven Brick + if (GTUtility + .areStacksEqual(event.itemStack, GTModHandler.getModItem("Railcraft", "machine.alpha", 1, 7))) { + event.toolTip.add(String.format(MULTI_POLLUTION_FORMAT, PollutionConfig.cokeOvenPollutionAmount)); + } + + // Advanced Coke Oven Brick + if (GTUtility + .areStacksEqual(event.itemStack, GTModHandler.getModItem("Railcraft", "machine.alpha", 1, 12))) { + event.toolTip + .add(String.format(MULTI_POLLUTION_FORMAT, PollutionConfig.advancedCokeOvenPollutionAmount)); + } + + // Hobbyist's Steam Engine + if (GTUtility.areStacksEqual(event.itemStack, GTModHandler.getModItem("Railcraft", "machine.beta", 1, 7))) { + event.toolTip + .add(String.format(PRODUCES_POLLUTION_FORMAT, PollutionConfig.hobbyistEnginePollutionAmount)); + } + } + + // Galacticraft (and Galaxy Space) rockets + if (Mods.GalacticraftCore.isModLoaded() && PollutionConfig.rocketsPollute + && event.itemStack.getItem() != null) { + String simpleName = event.itemStack.getItem() + .getClass() + .getSimpleName(); + // TODO I'm sure there is a better way to check the tier of a rocket.... + if (simpleName.contains("Rocket")) { + for (char d : simpleName.toCharArray()) { + if (Character.isDigit(d)) { + int tier = Character.getNumericValue(d); + event.toolTip.add( + String.format( + "Produces %d Pollution/Second when ignited", + (PollutionConfig.rocketPollutionAmount * tier / 100))); + event.toolTip.add( + String.format( + "Produces %d Pollution/Second when flying", + PollutionConfig.rocketPollutionAmount * tier)); + break; + } + } + } + } + } +} diff --git a/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java b/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java index b49da44e979..a84cb8ac910 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/MTEBoiler.java @@ -41,7 +41,7 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; public abstract class MTEBoiler extends MTEBasicTank implements IGetTitleColor, IAddUIWidgets { diff --git a/src/main/java/gregtech/common/tileentities/boilers/MTEBoilerBronze.java b/src/main/java/gregtech/common/tileentities/boilers/MTEBoilerBronze.java index e951656d237..632ff0ac1f0 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/MTEBoilerBronze.java +++ b/src/main/java/gregtech/common/tileentities/boilers/MTEBoilerBronze.java @@ -36,7 +36,7 @@ import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; public class MTEBoilerBronze extends MTEBoiler { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTECharcoalPit.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTECharcoalPit.java index bfa672577d4..f39ea70422d 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTECharcoalPit.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTECharcoalPit.java @@ -35,7 +35,7 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.WorldSpawnedEventBuilder; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; public class MTECharcoalPit extends MTETooltipMultiBlockBase implements ISecondaryDescribable { diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPrimitiveBlastFurnace.java index 0011a0efad2..9c92733322a 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEPrimitiveBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEPrimitiveBlastFurnace.java @@ -49,7 +49,7 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.WorldSpawnedEventBuilder; import gregtech.api.util.WorldSpawnedEventBuilder.ParticleEventBuilder; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; public abstract class MTEPrimitiveBlastFurnace extends MetaTileEntity implements IAlignment, ISurvivalConstructable, RecipeMapWorkable, IAddUIWidgets, IGetTitleColor { diff --git a/src/main/java/gregtech/loaders/preload/GTPreLoad.java b/src/main/java/gregtech/loaders/preload/GTPreLoad.java index bef36a2bdb4..a3d6572dd98 100644 --- a/src/main/java/gregtech/loaders/preload/GTPreLoad.java +++ b/src/main/java/gregtech/loaders/preload/GTPreLoad.java @@ -45,6 +45,7 @@ import gregtech.common.config.MachineStats; import gregtech.common.config.OPStuff; import gregtech.common.config.Worldgen; +import gregtech.common.pollution.PollutionConfig; import gregtech.common.tileentities.machines.long_distance.MTELongDistancePipelineBase; public class GTPreLoad { @@ -445,31 +446,31 @@ public static void loadConfig() { loadClientConfig(); // Pollution - GTMod.gregtechproxy.mPollution = Gregtech.pollution.pollution; - GTMod.gregtechproxy.mPollutionSmogLimit = Gregtech.pollution.pollutionSmogLimit; - GTMod.gregtechproxy.mPollutionPoisonLimit = Gregtech.pollution.pollutionPoisonLimit; - GTMod.gregtechproxy.mPollutionVegetationLimit = Gregtech.pollution.pollutionVegetationLimit; - GTMod.gregtechproxy.mPollutionSourRainLimit = Gregtech.pollution.pollutionSourRainLimit; - GTMod.gregtechproxy.mPollutionOnExplosion = Gregtech.pollution.pollutionOnExplosion; - GTMod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = Gregtech.pollution.pollutionPrimitveBlastFurnacePerSecond; - GTMod.gregtechproxy.mPollutionCharcoalPitPerSecond = Gregtech.pollution.pollutionCharcoalPitPerSecond; - GTMod.gregtechproxy.mPollutionEBFPerSecond = Gregtech.pollution.pollutionEBFPerSecond; - GTMod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond = Gregtech.pollution.pollutionLargeCombustionEnginePerSecond; - GTMod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = Gregtech.pollution.pollutionExtremeCombustionEnginePerSecond; - GTMod.gregtechproxy.mPollutionImplosionCompressorPerSecond = Gregtech.pollution.pollutionImplosionCompressorPerSecond; - GTMod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = Gregtech.pollution.pollutionLargeBronzeBoilerPerSecond; - GTMod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond = Gregtech.pollution.pollutionLargeSteelBoilerPerSecond; - GTMod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = Gregtech.pollution.pollutionLargeTitaniumBoilerPerSecond; - GTMod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = Gregtech.pollution.pollutionLargeTungstenSteelBoilerPerSecond; - GTMod.gregtechproxy.mPollutionReleasedByThrottle = Gregtech.pollution.pollutionReleasedByThrottle; - GTMod.gregtechproxy.mPollutionLargeGasTurbinePerSecond = Gregtech.pollution.pollutionLargeGasTurbinePerSecond; - GTMod.gregtechproxy.mPollutionMultiSmelterPerSecond = Gregtech.pollution.pollutionMultiSmelterPerSecond; - GTMod.gregtechproxy.mPollutionPyrolyseOvenPerSecond = Gregtech.pollution.pollutionPyrolyseOvenPerSecond; - GTMod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond = Gregtech.pollution.pollutionSmallCoalBoilerPerSecond; - GTMod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = Gregtech.pollution.pollutionHighPressureLavaBoilerPerSecond; - GTMod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = Gregtech.pollution.pollutionHighPressureCoalBoilerPerSecond; - GTMod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond = Gregtech.pollution.pollutionBaseDieselGeneratorPerSecond; - double[] mPollutionDieselGeneratorReleasedByTier = Gregtech.pollution.pollutionDieselGeneratorReleasedByTier; + GTMod.gregtechproxy.mPollution = PollutionConfig.pollution; + GTMod.gregtechproxy.mPollutionSmogLimit = PollutionConfig.pollutionSmogLimit; + GTMod.gregtechproxy.mPollutionPoisonLimit = PollutionConfig.pollutionPoisonLimit; + GTMod.gregtechproxy.mPollutionVegetationLimit = PollutionConfig.pollutionVegetationLimit; + GTMod.gregtechproxy.mPollutionSourRainLimit = PollutionConfig.pollutionSourRainLimit; + GTMod.gregtechproxy.mPollutionOnExplosion = PollutionConfig.pollutionOnExplosion; + GTMod.gregtechproxy.mPollutionPrimitveBlastFurnacePerSecond = PollutionConfig.pollutionPrimitveBlastFurnacePerSecond; + GTMod.gregtechproxy.mPollutionCharcoalPitPerSecond = PollutionConfig.pollutionCharcoalPitPerSecond; + GTMod.gregtechproxy.mPollutionEBFPerSecond = PollutionConfig.pollutionEBFPerSecond; + GTMod.gregtechproxy.mPollutionLargeCombustionEnginePerSecond = PollutionConfig.pollutionLargeCombustionEnginePerSecond; + GTMod.gregtechproxy.mPollutionExtremeCombustionEnginePerSecond = PollutionConfig.pollutionExtremeCombustionEnginePerSecond; + GTMod.gregtechproxy.mPollutionImplosionCompressorPerSecond = PollutionConfig.pollutionImplosionCompressorPerSecond; + GTMod.gregtechproxy.mPollutionLargeBronzeBoilerPerSecond = PollutionConfig.pollutionLargeBronzeBoilerPerSecond; + GTMod.gregtechproxy.mPollutionLargeSteelBoilerPerSecond = PollutionConfig.pollutionLargeSteelBoilerPerSecond; + GTMod.gregtechproxy.mPollutionLargeTitaniumBoilerPerSecond = PollutionConfig.pollutionLargeTitaniumBoilerPerSecond; + GTMod.gregtechproxy.mPollutionLargeTungstenSteelBoilerPerSecond = PollutionConfig.pollutionLargeTungstenSteelBoilerPerSecond; + GTMod.gregtechproxy.mPollutionReleasedByThrottle = PollutionConfig.pollutionReleasedByThrottle; + GTMod.gregtechproxy.mPollutionLargeGasTurbinePerSecond = PollutionConfig.pollutionLargeGasTurbinePerSecond; + GTMod.gregtechproxy.mPollutionMultiSmelterPerSecond = PollutionConfig.pollutionMultiSmelterPerSecond; + GTMod.gregtechproxy.mPollutionPyrolyseOvenPerSecond = PollutionConfig.pollutionPyrolyseOvenPerSecond; + GTMod.gregtechproxy.mPollutionSmallCoalBoilerPerSecond = PollutionConfig.pollutionSmallCoalBoilerPerSecond; + GTMod.gregtechproxy.mPollutionHighPressureLavaBoilerPerSecond = PollutionConfig.pollutionHighPressureLavaBoilerPerSecond; + GTMod.gregtechproxy.mPollutionHighPressureCoalBoilerPerSecond = PollutionConfig.pollutionHighPressureCoalBoilerPerSecond; + GTMod.gregtechproxy.mPollutionBaseDieselGeneratorPerSecond = PollutionConfig.pollutionBaseDieselGeneratorPerSecond; + double[] mPollutionDieselGeneratorReleasedByTier = PollutionConfig.pollutionDieselGeneratorReleasedByTier; if (mPollutionDieselGeneratorReleasedByTier.length == GTMod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier.length) { GTMod.gregtechproxy.mPollutionDieselGeneratorReleasedByTier = mPollutionDieselGeneratorReleasedByTier; @@ -477,8 +478,8 @@ public static void loadConfig() { GT_FML_LOGGER .error("The Length of the Diesel Turbine Pollution Array Config must be the same as the Default"); } - GTMod.gregtechproxy.mPollutionBaseGasTurbinePerSecond = Gregtech.pollution.pollutionBaseGasTurbinePerSecond; - double[] mPollutionGasTurbineReleasedByTier = Gregtech.pollution.pollutionGasTurbineReleasedByTier; + GTMod.gregtechproxy.mPollutionBaseGasTurbinePerSecond = PollutionConfig.pollutionBaseGasTurbinePerSecond; + double[] mPollutionGasTurbineReleasedByTier = PollutionConfig.pollutionGasTurbineReleasedByTier; if (mPollutionGasTurbineReleasedByTier.length == GTMod.gregtechproxy.mPollutionGasTurbineReleasedByTier.length) { GTMod.gregtechproxy.mPollutionGasTurbineReleasedByTier = mPollutionGasTurbineReleasedByTier; diff --git a/src/main/java/gregtech/mixin/Mixin.java b/src/main/java/gregtech/mixin/Mixin.java index b9ba1db098b..001477b5d1d 100644 --- a/src/main/java/gregtech/mixin/Mixin.java +++ b/src/main/java/gregtech/mixin/Mixin.java @@ -14,6 +14,7 @@ import bartworks.common.configs.Configuration; import cpw.mods.fml.relauncher.FMLLaunchHandler; +import gregtech.common.pollution.PollutionConfig; public enum Mixin { @@ -64,7 +65,73 @@ public enum Mixin { .addTargetedMod(TargetedMod.IC2) .setApplyIf(() -> true) .setPhase(Phase.LATE) - .setSide(Side.BOTH)); + .setSide(Side.BOTH)), + IC2_HAZMAT(new Builder("Hazmat").setPhase(Phase.LATE) + .setSide(Side.BOTH) + .addMixinClasses("ic2.MixinIc2Hazmat") + .setApplyIf(() -> true) + .addTargetedMod(TargetedMod.IC2) + .addExcludedMod(TargetedMod.GT6)), + + // Pollution + POLLUTION_RENDER_BLOCKS(new Builder("Changes colors of certain blocks based on pollution levels") + .addMixinClasses("minecraft.pollution.MixinRenderBlocks_PollutionWithoutOptifine") + .addTargetedMod(TargetedMod.VANILLA) + .addExcludedMod(TargetedMod.OPTIFINE) + .setSide(Side.CLIENT) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.pollutionBlockRecolor) + .setPhase(Phase.EARLY)), + POLLUTION_RENDER_BLOCKS_OPTIFINE(new Builder("Changes colors of certain blocks based on pollution levels") + .addMixinClasses("minecraft.pollution.MixinRenderBlocks_PollutionWithOptifine") + .addTargetedMod(TargetedMod.VANILLA) + .addTargetedMod(TargetedMod.OPTIFINE) + .addExcludedMod(TargetedMod.ANGELICA) + .setSide(Side.CLIENT) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.pollutionBlockRecolor) + .setPhase(Phase.EARLY)), + POLLUTION_RENDER_BLOCKS_BOP(new Builder("Changes colors of certain blocks based on pollution levels") + .addMixinClasses("biomesoplenty.MixinFoliageRendererPollution") + .addTargetedMod(TargetedMod.BOP) + .setSide(Side.CLIENT) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.pollutionBlockRecolor) + .setPhase(Phase.LATE)), + POLLUTION_MINECRAFT_FURNACE(new Builder("Minecraft Furnace Pollutes").setPhase(Phase.EARLY) + .addMixinClasses("minecraft.pollution.MixinTileEntityFurnacePollution") + .setSide(Side.BOTH) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.furnacesPollute) + .addTargetedMod(TargetedMod.VANILLA)), + POLLUTION_MINECRAFT_EXPLOSION(new Builder("Minecraft explosions pollute").setPhase(Phase.EARLY) + .addMixinClasses("minecraft.pollution.MixinExplosionPollution") + .setSide(Side.BOTH) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.explosionPollutionAmount != 0F) + .addTargetedMod(TargetedMod.VANILLA)), + POLLUTION_IC2_IRON_FURNACE( + new Builder("Ic2 Iron Furnace Pollutes").addMixinClasses("ic2.MixinIC2IronFurnacePollution") + .setPhase(Phase.LATE) + .setSide(Side.BOTH) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.furnacesPollute) + .addTargetedMod(TargetedMod.IC2)), + POLLUTION_THAUMCRAFT_ALCHEMICAL_FURNACE(new Builder("Thaumcraft Alchemical Construct Pollutes") + .addMixinClasses("thaumcraft.MixinThaumcraftAlchemyFurnacePollution") + .setPhase(Phase.LATE) + .setSide(Side.BOTH) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.furnacesPollute) + .addTargetedMod(TargetedMod.THAUMCRAFT)), + POLLUTION_RAILCRAFT(new Builder("Make Railcraft Pollute") + .addMixinClasses( + "railcraft.MixinRailcraftBoilerPollution", + "railcraft.MixinRailcraftCokeOvenPollution", + "railcraft.MixinRailcraftTunnelBorePollution") + .setPhase(Phase.LATE) + .setSide(Side.BOTH) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.railcraftPollutes) + .addTargetedMod(TargetedMod.RAILCRAFT)), + POLLUTION_ROCKET( + new Builder("Make Rockets Pollute").addMixinClasses("galacticraftcore.MixinGalacticraftRocketPollution") + .setPhase(Phase.LATE) + .setSide(Side.BOTH) + .setApplyIf(() -> PollutionConfig.pollution && PollutionConfig.rocketsPollute) + .addTargetedMod(TargetedMod.GALACTICRAFT_CORE)); public static final Logger LOGGER = LogManager.getLogger("GregTech-Mixin"); diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java index a53e088afcb..10edeeb32f1 100644 --- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java @@ -82,7 +82,8 @@ public void preInit(final FMLPreInitializationEvent e) { public void init(final FMLInitializationEvent e) { CI.init(); - if (Mods.AdvancedSolarPanel.isModLoaded()) { + if (e.getSide() + .isClient() && Mods.AdvancedSolarPanel.isModLoaded()) { MinecraftForge.EVENT_BUS.register(new MolecularTransformerTooltipNotice()); } // Handles Sleep Benefits diff --git a/src/main/java/gtPlusPlus/core/config/Configuration.java b/src/main/java/gtPlusPlus/core/config/Configuration.java index e2cd0463f1d..45ba7df8a3b 100644 --- a/src/main/java/gtPlusPlus/core/config/Configuration.java +++ b/src/main/java/gtPlusPlus/core/config/Configuration.java @@ -13,7 +13,6 @@ public class Configuration { public static final Debug debug = new Debug(); public static final Machines machines = new Machines(); public static final Gregtech gregtech = new Gregtech(); - public static final Pollution pollution = new Pollution(); public static final Features features = new Features(); public static final Visual visual = new Visual(); public static final Worldgen worldgen = new Worldgen(); @@ -58,176 +57,6 @@ public static class Gregtech { public int turbineCutoffBase; } - @Config.Comment("Pollution section") - public static class Pollution { - - @Config.Comment("pollution rate in gibbl/s for the Amazon warehousing depot") - @Config.DefaultInt(40) - public int pollutionPerSecondMultiPackager; - @Config.Comment("pollution rate in gibbl/s for the Alloy blast smelter") - @Config.DefaultInt(300) - public int pollutionPerSecondMultiIndustrialAlloySmelter; - @Config.Comment("pollution rate in gibbl/s for the High current arc furnace") - @Config.DefaultInt(2_400) - public int pollutionPerSecondMultiIndustrialArcFurnace; - @Config.Comment("pollution rate in gibbl/s for the Industrial centrifuge") - @Config.DefaultInt(300) - public int pollutionPerSecondMultiIndustrialCentrifuge; - @Config.Comment("pollution rate in gibbl/s for the Industrial coke oven") - @Config.DefaultInt(80) - public int pollutionPerSecondMultiIndustrialCokeOven; - @Config.Comment("pollution rate in gibbl/s for the Cutting factory") - @Config.DefaultInt(160) - public int pollutionPerSecondMultiIndustrialCuttingMachine; - @Config.Comment("pollution rate in gibbl/s for the Utupu-Tanuri") - @Config.DefaultInt(500) - public int pollutionPerSecondMultiIndustrialDehydrator; - @Config.Comment("pollution rate in gibbl/s for the Industrial electrolyzer") - @Config.DefaultInt(300) - public int pollutionPerSecondMultiIndustrialElectrolyzer; - @Config.Comment("pollution rate in gibbl/s for the Industrial extrusion machine") - @Config.DefaultInt(1_000) - public int pollutionPerSecondMultiIndustrialExtruder; - @Config.Comment("pollution rate in gibbl/s for the Maceration stack") - @Config.DefaultInt(400) - public int pollutionPerSecondMultiIndustrialMacerator; - @Config.Comment("pollution rate in gibbl/s for the Industrial mixing machine") - @Config.DefaultInt(800) - public int pollutionPerSecondMultiIndustrialMixer; - @Config.Comment("pollution rate in gibbl/s for the Large processing factory in metal mode") - @Config.DefaultInt(400) - public int pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal; - @Config.Comment("pollution rate in gibbl/s for the Large processing factory in fluid mode") - @Config.DefaultInt(400) - public int pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid; - @Config.Comment("pollution rate in gibbl/s for the Large processing factory in misc mode") - @Config.DefaultInt(600) - public int pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc; - @Config.Comment("pollution rate in gibbl/s for the Industrial material press in forming mode") - @Config.DefaultInt(240) - public int pollutionPerSecondMultiIndustrialPlatePress_ModeForming; - @Config.Comment("pollution rate in gibbl/s for the Industrial material press in bending mode") - @Config.DefaultInt(480) - public int pollutionPerSecondMultiIndustrialPlatePress_ModeBending; - @Config.Comment("pollution rate in gibbl/s for the Industrial Forge Hammer") - @Config.DefaultInt(250) - public int pollutionPerSecondMultiIndustrialForgeHammer; - @Config.Comment("pollution rate in gibbl/s for the Large Sifter") - @Config.DefaultInt(40) - public int pollutionPerSecondMultiIndustrialSifter; - @Config.Comment("pollution rate in gibbl/s for the Large thermal refinery") - @Config.DefaultInt(1_000) - public int pollutionPerSecondMultiIndustrialThermalCentrifuge; - @Config.Comment("pollution rate in gibbl/s for the Industrial fluid heater") - @Config.DefaultInt(1_000) - public int pollutionPerSecondMultiIndustrialFluidHeater; - @Config.Comment("pollution rate in gibbl/s for the Cryogenic freezer") - @Config.DefaultInt(500) - public int pollutionPerSecondMultiIndustrialVacuumFreezer; - @Config.Comment("pollution rate in gibbl/s for the Ore washing plant in chemical bath mode") - @Config.DefaultInt(400) - public int pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath; - @Config.Comment("pollution rate in gibbl/s for the Ore washing plant in ore washer mode") - @Config.DefaultInt(100) - public int pollutionPerSecondMultiIndustrialWashPlant_ModeWasher; - @Config.Comment("pollution rate in gibbl/s for the Wire factory") - @Config.DefaultInt(100) - public int pollutionPerSecondMultiIndustrialWireMill; - @Config.Comment("pollution rate in gibbl/s for the IsaMill grinding machine") - @Config.DefaultInt(1_280) - public int pollutionPerSecondMultiIsaMill; - @Config.Comment("pollution rate in gibbl/s for the Dangote distillus in distillery mode") - @Config.DefaultInt(240) - public int pollutionPerSecondMultiAdvDistillationTower_ModeDistillery; - @Config.Comment("pollution rate in gibbl/s for the Dangote distillus in distillation tower mode") - @Config.DefaultInt(480) - public int pollutionPerSecondMultiAdvDistillationTower_ModeDT; - @Config.Comment("pollution rate in gibbl/s for the Volcanus") - @Config.DefaultInt(500) - public int pollutionPerSecondMultiAdvEBF; - @Config.Comment("pollution rate in gibbl/s for the Density^2") - @Config.DefaultInt(5_000) - public int pollutionPerSecondMultiAdvImplosion; - @Config.Comment("pollution rate in gibbl/s for the Alloy blast furnace") - @Config.DefaultInt(200) - public int pollutionPerSecondMultiABS; - @Config.Comment("pollution rate in gibbl/s for the Cyclotron") - @Config.DefaultInt(200) - public int pollutionPerSecondMultiCyclotron; - @Config.Comment("pollution rate in gibbl/s for the Zuhai - fishing port") - @Config.DefaultInt(20) - public int pollutionPerSecondMultiIndustrialFishingPond; - // pollutionPerSecondMultiLargeRocketEngine; - @Config.Comment("pollution rate in gibbl/s for the Large semifluid burner") - @Config.DefaultInt(1_280) - public int pollutionPerSecondMultiLargeSemiFluidGenerator; - @Config.Comment("pollution rate in gibbl/s for the Matter fabrication CPU") - @Config.DefaultInt(40) - public int pollutionPerSecondMultiMassFabricator; - @Config.Comment("pollution rate in gibbl/s for the Reactor fuel processing plant") - @Config.DefaultInt(4_000) - public int pollutionPerSecondMultiRefinery; - @Config.Comment("pollution rate in gibbl/s for the Industrial Rock Breaker") - @Config.DefaultInt(100) - public int pollutionPerSecondMultiIndustrialRockBreaker; - @Config.Comment("pollution rate in gibbl/s for the Industrial Chisel") - @Config.DefaultInt(50) - public int pollutionPerSecondMultiIndustrialChisel; - @Config.Comment("pollution rate in gibbl/s for the Tree growth simulator") - @Config.DefaultInt(100) - public int pollutionPerSecondMultiTreeFarm; - @Config.Comment("pollution rate in gibbl/s for the Flotation cell regulator") - @Config.DefaultInt(0) - public int pollutionPerSecondMultiFrothFlotationCell; - @Config.Comment("pollution rate in gibbl/s for the Large-Scale auto assembler v1.01") - @Config.DefaultInt(500) - public int pollutionPerSecondMultiAutoCrafter; - @Config.Comment("pollution rate in gibbl/s for the Nuclear salt processing plant") - @Config.DefaultInt(500) - public int pollutionPerSecondNuclearSaltProcessingPlant; - @Config.Comment("pollution rate in gibbl/s for the Multiblock Molecular Transformer") - @Config.DefaultInt(1_000) - public int pollutionPerSecondMultiMolecularTransformer; - - @Config.Comment("pollution rate in gibbl/s for the Elemental Duplicator") - @Config.DefaultInt(1_000) - public int pollutionPerSecondElementalDuplicator; - - @Config.Comment("pollution rate in gibbl/s for the Thermal boiler") - @Config.DefaultInt(700) - public int pollutionPerSecondMultiThermalBoiler; - @Config.Comment("pollution rate in gibbl/s for the Algae farm") - @Config.DefaultInt(0) - public int pollutionPerSecondMultiAlgaePond; - @Config.Comment("base pollution rate in gibbl/s for the single block semi fluid generators") - @Config.DefaultInt(40) - public int basePollutionPerSecondSemiFluidGenerator; - @Config.Comment("coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)") - @Config.DefaultDoubleList({ 0.0, 2.0, 4.0, 8.0, 12.0, 16.0 }) - public double[] pollutionReleasedByTierSemiFluidGenerator; - @Config.Comment("base pollution rate in gibbl/s for the single block boilers") - @Config.DefaultInt(35) - public int basePollutionPerSecondBoiler; - @Config.Comment("coefficient applied to the base rate of the single block boilers based on its tier (first is tier 0 aka ULV)") - @Config.DefaultDoubleList({ 0.0, 1.0, 1.43, 1.86 }) - public double[] pollutionReleasedByTierBoiler; - @Config.Comment("minimum base pollution rate in gibbl/s for the single block rocket engines") - @Config.DefaultInt(250) - public int baseMinPollutionPerSecondRocketFuelGenerator; - @Config.Comment("maximum base pollution rate in gibbl/s for the single block rocket engines") - @Config.DefaultInt(2_000) - public int baseMaxPollutionPerSecondRocketFuelGenerator; - @Config.Comment("coefficient applied to the base rate of the single block rocket engines based on its tier (first is tier 0 aka ULV)") - @Config.DefaultDoubleList({ 0.0, 0.0, 0.0, 0.0, 1.0, 2.0, 3.0 }) - public double[] pollutionReleasedByTierRocketFuelGenerator; - @Config.Comment("base pollution rate in gibbl/s for the geothermal engines") - @Config.DefaultInt(100) - public int basePollutionPerSecondGeothermalGenerator; - @Config.Comment("coefficient applied to the base rate of the single block geothermal engines based on its tier (first is tier 0 aka ULV)") - @Config.DefaultDoubleList({ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0 }) - public double[] pollutionReleasedByTierGeothermalGenerator; - } - @Config.Comment("Features section") public static class Features { diff --git a/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java b/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java index 35a569578f2..811fb0cab13 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java +++ b/src/main/java/gtPlusPlus/core/tileentities/base/TileEntityBase.java @@ -28,10 +28,10 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.ISerializableObject; import gregtech.common.covers.CoverInfo; +import gregtech.common.pollution.Pollution; import gtPlusPlus.api.interfaces.ILazyCoverable; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BTF_Inventory; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import ic2.api.Direction; public class TileEntityBase extends TileEntity implements ILazyCoverable, IGregTechDeviceInformation, IDescribable { @@ -1316,7 +1316,7 @@ public void doExplosion(long aAmount) { } this.mReleaseEnergy = false; this.onExplosion(); - PollutionUtils.addPollution(this, 100000); + Pollution.addPollution(this, 100000); this.mMetaTileEntity.doExplosion(aAmount); } } diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java index f753561d717..1914a5a39d8 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java @@ -1,18 +1,9 @@ package gtPlusPlus.core.util.minecraft.gregtech; -import java.util.ArrayList; - import net.minecraft.item.ItemStack; -import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; - -import gregtech.GTMod; import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.common.Pollution; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.material.MaterialGenerator; @@ -22,127 +13,41 @@ public class PollutionUtils { - public static ArrayList mPollutionFluidStacks = new ArrayList<>(); - - public static boolean isPollutionEnabled() { - return GTMod.gregtechproxy.mPollution; - } - - public static boolean addPollution(IGregTechTileEntity te, int pollutionValue) { - if (GTMod.gregtechproxy.mPollution) { - Pollution.addPollution(te, pollutionValue); - return true; - } - return false; - } - - public static void addPollution(IHasWorldObjectAndCoords aTileOfSomeSort, int pollutionValue) { - if (GTMod.gregtechproxy.mPollution) { - Chunk c = aTileOfSomeSort.getWorld() - .getChunkFromBlockCoords(aTileOfSomeSort.getXCoord(), aTileOfSomeSort.getZCoord()); - addPollution(c, pollutionValue); - } - } - - public static void addPollution(Chunk aChunk, int pollutionValue) { - if (GTMod.gregtechproxy.mPollution) { - Pollution.addPollution(aChunk, pollutionValue); - } - } - - public static void removePollution(IGregTechTileEntity te, int pollutionValue) { - addPollution(te, -pollutionValue); - } - - public static void removePollution(Chunk aChunk, int pollutionValue) { - addPollution(aChunk, -pollutionValue); - } - - public static void nullifyPollution(IGregTechTileEntity te) { - if (te == null) { - return; - } - nullifyPollution((IHasWorldObjectAndCoords) te); - } - - public static void nullifyPollution(IHasWorldObjectAndCoords aTileOfSomeSort) { - if (aTileOfSomeSort == null) { - return; - } - Chunk c = aTileOfSomeSort.getWorld() - .getChunkFromBlockCoords(aTileOfSomeSort.getXCoord(), aTileOfSomeSort.getZCoord()); - nullifyPollution(c); - } - - public static void nullifyPollution(Chunk aChunk) { - if (GTMod.gregtechproxy.mPollution) { - if (aChunk == null) { - return; - } - int getCurrentPollution = getPollution(aChunk); - if (getCurrentPollution > 0) { - removePollution(aChunk, getCurrentPollution); - } - } - } - - public static int getPollution(IGregTechTileEntity te) { - return Pollution.getPollution(te); - } - - public static int getPollution(Chunk te) { - return Pollution.getPollution(te); - } - public static void setPollutionFluids() { - if (mPollutionFluidStacks.isEmpty()) { - FluidStack CD, CM, SD; - CD = FluidUtils.getFluidStack("carbondioxide", 1000); - CM = FluidUtils.getFluidStack("carbonmonoxide", 1000); - SD = FluidUtils.getFluidStack("sulfurdioxide", 1000); - if (PollutionUtils.mPollutionFluidStacks.isEmpty()) { - if (CD != null) { - Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it."); - PollutionUtils.mPollutionFluidStacks.add(CD); - MaterialMisc.CARBON_DIOXIDE.registerComponentForMaterial(CD); - ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1); - if (ItemUtils.checkForInvalidItems(cellCD)) { - Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component."); - MaterialMisc.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); - } else { - Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component."); - new BaseItemCell(MaterialMisc.CARBON_DIOXIDE); - } - } else { - MaterialGenerator.generate(MaterialMisc.CARBON_DIOXIDE, false, false); - } - - if (CM != null) { - Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it."); - PollutionUtils.mPollutionFluidStacks.add(CM); - MaterialMisc.CARBON_MONOXIDE.registerComponentForMaterial(CM); - ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1); - if (ItemUtils.checkForInvalidItems(cellCD)) { - Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component."); - MaterialMisc.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); - } else { - Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component."); - new BaseItemCell(MaterialMisc.CARBON_MONOXIDE); - } - } else { - MaterialGenerator.generate(MaterialMisc.CARBON_MONOXIDE, false, false); - } - - if (SD != null) { - Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it."); - PollutionUtils.mPollutionFluidStacks.add(SD); - } + FluidStack CD, CM, SD; + CD = FluidUtils.getFluidStack("carbondioxide", 1000); + CM = FluidUtils.getFluidStack("carbonmonoxide", 1000); + SD = FluidUtils.getFluidStack("sulfurdioxide", 1000); + if (CD != null) { + Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it."); + MaterialMisc.CARBON_DIOXIDE.registerComponentForMaterial(CD); + ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1); + if (ItemUtils.checkForInvalidItems(cellCD)) { + Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component."); + MaterialMisc.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); + } else { + Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component."); + new BaseItemCell(MaterialMisc.CARBON_DIOXIDE); } } else { - if (mPollutionFluidStacks.size() != 3) { - Logger.INFO("Unable to detect all 3 pollution fluids. Found: "); - Logger.INFO(ArrayUtils.toString(mPollutionFluidStacks)); + MaterialGenerator.generate(MaterialMisc.CARBON_DIOXIDE, false, false); + } + if (CM != null) { + Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it."); + MaterialMisc.CARBON_MONOXIDE.registerComponentForMaterial(CM); + ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1); + if (ItemUtils.checkForInvalidItems(cellCD)) { + Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component."); + MaterialMisc.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD); + } else { + Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component."); + new BaseItemCell(MaterialMisc.CARBON_MONOXIDE); } + } else { + MaterialGenerator.generate(MaterialMisc.CARBON_MONOXIDE, false, false); + } + if (SD != null) { + Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it."); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java index dd38f1ab26e..5919a71b250 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java @@ -20,10 +20,9 @@ import gregtech.api.metatileentity.implementations.MTEHatchMuffler; import gregtech.api.metatileentity.implementations.MTEMultiBlockBase; import gregtech.api.objects.GTRenderedTexture; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.lib.GTPPCore; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPPUITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -31,21 +30,6 @@ public class MTEHatchMufflerAdvanced extends MTEHatchMuffler implements IAddGreg protected int SLOT_FILTER = 0; - @Override - public void onConfigLoad() { - super.onConfigLoad(); - try { - int a1 = GTMod.gregtechproxy.mPollutionSmogLimit; - if (a1 > 0) { - mPollutionSmogLimit = a1; - } - } catch (Throwable t) { - mPollutionSmogLimit = 500000; - } - } - - private int mPollutionSmogLimit = 500000; - public MTEHatchMufflerAdvanced(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, new String[] { "" }); } @@ -271,8 +255,8 @@ public void pollutionParticles(World aWorld, String name) { boolean chk1 = ran1 * 100.0F < (float) this.calculatePollutionReduction(100); boolean chk2; boolean chk3; - int aPollutionAmount = PollutionUtils.getPollution(getBaseMetaTileEntity()); - if (aPollutionAmount >= mPollutionSmogLimit) { + int aPollutionAmount = Pollution.getPollution(getBaseMetaTileEntity()); + if (aPollutionAmount >= GTMod.gregtechproxy.mPollutionSmogLimit) { ran2 = GTPPCore.RANDOM.nextFloat(); ran3 = GTPPCore.RANDOM.nextFloat(); chk2 = ran2 * 100.0F < (float) this.calculatePollutionReduction(100); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java index 40678f203f6..e7480e0f129 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java @@ -21,10 +21,10 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; -import gtPlusPlus.core.config.Configuration; +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; public abstract class MTERocketFuelGeneratorBase extends MTEBasicTank implements RecipeMapWorkable { @@ -33,19 +33,19 @@ public abstract class MTERocketFuelGeneratorBase extends MTEBasicTank implements public MTERocketFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); - pollMin = (int) (Configuration.pollution.baseMinPollutionPerSecondRocketFuelGenerator - * Configuration.pollution.pollutionReleasedByTierRocketFuelGenerator[mTier]); - pollMax = (int) (Configuration.pollution.baseMaxPollutionPerSecondRocketFuelGenerator - * Configuration.pollution.pollutionReleasedByTierRocketFuelGenerator[mTier]); + pollMin = (int) (PollutionConfig.baseMinPollutionPerSecondRocketFuelGenerator + * PollutionConfig.pollutionReleasedByTierRocketFuelGenerator[mTier]); + pollMax = (int) (PollutionConfig.baseMaxPollutionPerSecondRocketFuelGenerator + * PollutionConfig.pollutionReleasedByTierRocketFuelGenerator[mTier]); } public MTERocketFuelGeneratorBase(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); - pollMin = (int) (Configuration.pollution.baseMinPollutionPerSecondRocketFuelGenerator - * Configuration.pollution.pollutionReleasedByTierRocketFuelGenerator[mTier]); - pollMax = (int) (Configuration.pollution.baseMaxPollutionPerSecondRocketFuelGenerator - * Configuration.pollution.pollutionReleasedByTierRocketFuelGenerator[mTier]); + pollMin = (int) (PollutionConfig.baseMinPollutionPerSecondRocketFuelGenerator + * PollutionConfig.pollutionReleasedByTierRocketFuelGenerator[mTier]); + pollMax = (int) (PollutionConfig.baseMaxPollutionPerSecondRocketFuelGenerator + * PollutionConfig.pollutionReleasedByTierRocketFuelGenerator[mTier]); } @Override @@ -233,7 +233,7 @@ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed) / 3), 1); this.mFluid.amount -= aSafeFloor; - PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution()); + Pollution.addPollution(getBaseMetaTileEntity(), 10 * getPollution()); } } } @@ -247,7 +247,7 @@ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); - PollutionUtils.addPollution(getBaseMetaTileEntity(), getPollution() / 2); + Pollution.addPollution(getBaseMetaTileEntity(), getPollution() / 2); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java index c16cec179ef..97167ca7986 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEBoilerBase.java @@ -23,6 +23,7 @@ import gregtech.api.objects.GTItemStack; import gregtech.api.objects.GTRenderedTexture; import gregtech.api.util.GTOreDictUnificator; +import gregtech.common.pollution.PollutionConfig; import gregtech.common.tileentities.boilers.MTEBoiler; import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.lib.GTPPCore; @@ -232,8 +233,8 @@ protected boolean isAutomatable() { @Override protected int getPollution() { - return (int) (Configuration.pollution.basePollutionPerSecondBoiler - * Configuration.pollution.pollutionReleasedByTierBoiler[this.tier]); + return (int) (PollutionConfig.basePollutionPerSecondBoiler + * PollutionConfig.pollutionReleasedByTierBoiler[this.tier]); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java index e1fc5c57f0b..b89a6092dc0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTEGeothermalGenerator.java @@ -18,7 +18,7 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTModHandler; -import gtPlusPlus.core.config.Configuration; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -161,7 +161,7 @@ public RecipeMap getRecipeMap() { @Override public int getPollution() { - return (int) (Configuration.pollution.basePollutionPerSecondGeothermalGenerator - * Configuration.pollution.pollutionReleasedByTierGeothermalGenerator[mTier]); + return (int) (PollutionConfig.basePollutionPerSecondGeothermalGenerator + * PollutionConfig.pollutionReleasedByTierGeothermalGenerator[mTier]); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java index 9f70912cad2..ddad318ccf3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTERTGenerator.java @@ -18,11 +18,11 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; +import gregtech.common.pollution.Pollution; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import tectech.util.TTUtility; @@ -147,7 +147,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { } } if ((tProducedEU > 0L) && (getPollution() > 0)) { - PollutionUtils + Pollution .addPollution(aBaseMetaTileEntity, (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java index d4990932470..3e22764a6ef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/MTESemiFluidGenerator.java @@ -17,9 +17,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.lib.GTPPCore; public class MTESemiFluidGenerator extends MTEBasicGenerator { @@ -38,8 +38,8 @@ public MTESemiFluidGenerator(String aName, int aTier, String[] aDescription, ITe @Override public int getPollution() { - return (int) (Configuration.pollution.basePollutionPerSecondSemiFluidGenerator - * Configuration.pollution.pollutionReleasedByTierSemiFluidGenerator[this.mTier]); + return (int) (PollutionConfig.basePollutionPerSecondSemiFluidGenerator + * PollutionConfig.pollutionReleasedByTierSemiFluidGenerator[this.mTier]); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java index 5a423195489..2dde10f1873 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java @@ -21,7 +21,6 @@ import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.GTMod; import gregtech.api.enums.Materials; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; @@ -37,12 +36,12 @@ import gregtech.api.util.GTUtility; import gregtech.common.items.IDMetaTool01; import gregtech.common.items.MetaGeneratedTool01; +import gregtech.common.pollution.Pollution; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPPUITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -54,7 +53,6 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { protected boolean mHasPollution = false; protected int SLOT_ROTOR = 5; protected int SLOT_FILTER = 6; - protected static boolean mPollutionEnabled = true; protected boolean mSaveRotor = false; @@ -76,12 +74,10 @@ public MTEAtmosphericReconditioner(int aID, String aName, String aNameRegional, new GTRenderedTexture(TexturesGtBlock.Overlay_Machine_Vent), new GTRenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), new GTRenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)); - mPollutionEnabled = GTMod.gregtechproxy.mPollution; } public MTEAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 2, aDescription, aTextures, 2, 0); - mPollutionEnabled = GTMod.gregtechproxy.mPollution; } @Override @@ -105,13 +101,6 @@ public String[] getDescription() { "High Efficiency: Removes full pollution, Turbine takes 100% dmg", "Turbine Rotor will not break in LE mode", "Insert an equal tier Conveyor Module to enable automation"); - if (!mPollutionEnabled) { - String[] B = new String[] { "===============================================", - "Pollution is disabled, scrubbers will now have a bonus use", - "They are now able to remove ALL lingering pollution as GT ignores it", "and it will linger forever!", - "===============================================", }; - A = ArrayUtils.addAll(A, B); - } return A; } @@ -239,15 +228,6 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { Logger .INFO("Has Pollution? " + mHasPollution + ", Current Pollution: " + mCurrentPollution); - // Only check every 30s. - if (!isIdle && aTick % (20L * 30) == 0L) { - mPollutionEnabled = GTMod.gregtechproxy.mPollution; - // Clear out pollution if it's disabled, because I am a nice gal. - if (!GTMod.gregtechproxy.mPollution) { - PollutionUtils.nullifyPollution(this.getBaseMetaTileEntity()); - } - } - // Use a Turbine if (hasRotor(stackRotor) && hasAirFilter(stackFilter)) { Logger.INFO("Found Turbine."); @@ -352,7 +332,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { public int getCurrentChunkPollution() { int mCurrentChunkPollution = 0; if (this.mTier < 7) { - mCurrentChunkPollution = PollutionUtils.getPollution(getBaseMetaTileEntity()); + mCurrentChunkPollution = Pollution.getPollution(getBaseMetaTileEntity()); } else { ArrayList aSurrounding = new ArrayList<>(); World aWorld = this.getBaseMetaTileEntity() @@ -388,7 +368,7 @@ public int getCurrentChunkPollution() { } public int getPollutionInChunk(Chunk aChunk) { - int mCurrentChunkPollution = PollutionUtils.getPollution(aChunk); + int mCurrentChunkPollution = Pollution.getPollution(aChunk); mHasPollution = mCurrentChunkPollution > 0; return mCurrentChunkPollution; } @@ -565,7 +545,7 @@ public boolean removePollution(int toRemove) { if (this.mTier < 7) { int startPollution = getCurrentChunkPollution(); Logger.INFO("Current Chunk Pollution: " + startPollution); - PollutionUtils.removePollution(this.getBaseMetaTileEntity(), toRemove); + Pollution.addPollution(this.getBaseMetaTileEntity(), -toRemove); int after = getCurrentChunkPollution(); Logger.INFO("Current Chunk Pollution: " + after); return (after < startPollution); @@ -654,7 +634,7 @@ public boolean removePollution(int toRemove) { public boolean removePollution(Chunk aChunk, int toRemove) { int before = getCurrentChunkPollution(); - PollutionUtils.removePollution(aChunk, toRemove); + Pollution.addPollution(aChunk, -toRemove); int after = getCurrentChunkPollution(); return (after < before); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java index 0226214c44c..e1a2d5c8027 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionCreator.java @@ -12,9 +12,9 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GTRenderedTexture; +import gregtech.common.pollution.Pollution; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -283,7 +283,7 @@ private void showPollution(final World worldIn, final EntityPlayer playerIn) { } private boolean addPollution() { - PollutionUtils.addPollution(getBaseMetaTileEntity(), 100000 * pollutionMultiplier); + Pollution.addPollution(getBaseMetaTileEntity(), 100000 * pollutionMultiplier); return true; } @@ -304,7 +304,7 @@ public int getCurrentChunkPollution() { } public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity) { - return PollutionUtils.getPollution(aBaseMetaTileEntity); + return Pollution.getPollution(aBaseMetaTileEntity); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java index 87e18931b5e..f8c1ddbdeb1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEPollutionDetector.java @@ -13,10 +13,10 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GTRenderedTexture; import gregtech.api.util.GTUtility; +import gregtech.common.pollution.Pollution; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -296,7 +296,7 @@ public int getCurrentChunkPollution() { } public int getCurrentChunkPollution(IGregTechTileEntity aBaseMetaTileEntity) { - return PollutionUtils.getPollution(aBaseMetaTileEntity); + return Pollution.getPollution(aBaseMetaTileEntity); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java index ae487fadb6d..84ff99eb001 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/MTEAmazonPackager.java @@ -41,8 +41,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -166,7 +166,7 @@ public int getMaxEfficiency(ItemStack p0) { @Override public int getPollutionPerSecond(ItemStack arg0) { - return Configuration.pollution.pollutionPerSecondMultiPackager; + return PollutionConfig.pollutionPerSecondMultiPackager; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialAlloySmelter.java index 3b626fee5c8..fe7f6d4918d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialAlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialAlloySmelter.java @@ -33,8 +33,8 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; public class MTEIndustrialAlloySmelter extends GTPPMultiBlockBase @@ -93,7 +93,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialAlloySmelter; + return PollutionConfig.pollutionPerSecondMultiIndustrialAlloySmelter; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java index 95a6c68df16..1983049c37c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialArcFurnace.java @@ -45,8 +45,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -260,7 +260,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialArcFurnace; + return PollutionConfig.pollutionPerSecondMultiIndustrialArcFurnace; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java index 02015b20eb8..186a69f2df7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCentrifuge.java @@ -31,10 +31,10 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; @@ -184,7 +184,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialCentrifuge; + return PollutionConfig.pollutionPerSecondMultiIndustrialCentrifuge; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java index 214d118a60f..f9085bd063c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialChisel.java @@ -37,8 +37,8 @@ import gregtech.api.util.GTStreamUtil; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchChiselBus; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; @@ -324,7 +324,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialChisel; + return PollutionConfig.pollutionPerSecondMultiIndustrialChisel; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java index 0921d8f3eac..34384cbf8ad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCokeOven.java @@ -29,9 +29,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -196,7 +196,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialCokeOven; + return PollutionConfig.pollutionPerSecondMultiIndustrialCokeOven; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java index 26524798018..11bfaaca7e2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialCuttingMachine.java @@ -46,8 +46,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -190,7 +190,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialCuttingMachine; + return PollutionConfig.pollutionPerSecondMultiIndustrialCuttingMachine; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java index 96eaf9c33f0..cb7822a4216 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialDehydrator.java @@ -48,9 +48,9 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -186,7 +186,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialDehydrator; + return PollutionConfig.pollutionPerSecondMultiIndustrialDehydrator; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialExtruder.java index 7badb903f14..c7440fa9b8b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialExtruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialExtruder.java @@ -28,8 +28,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -164,7 +164,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialExtruder; + return PollutionConfig.pollutionPerSecondMultiIndustrialExtruder; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialFluidHeater.java index 364b8195e14..3d07f38a175 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialFluidHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialFluidHeater.java @@ -29,8 +29,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -172,7 +172,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialFluidHeater; + return PollutionConfig.pollutionPerSecondMultiIndustrialFluidHeater; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java index 8176db29d65..d8d5dfacb7a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialForgeHammer.java @@ -44,8 +44,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -224,7 +224,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialForgeHammer; + return PollutionConfig.pollutionPerSecondMultiIndustrialForgeHammer; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java index b6666cdc6d9..7b3301d6c87 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMacerator.java @@ -45,9 +45,9 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gregtech.common.tileentities.machines.IDualInputHatch; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; @@ -357,7 +357,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialMacerator; + return PollutionConfig.pollutionPerSecondMultiIndustrialMacerator; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java index 9d62d6a4200..ded54a6a8ef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMixer.java @@ -33,9 +33,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -185,7 +185,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialMixer; + return PollutionConfig.pollutionPerSecondMultiIndustrialMixer; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMolecularTransformer.java index d6cef056493..1a2196a4eca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMolecularTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMolecularTransformer.java @@ -26,9 +26,9 @@ import gregtech.api.logic.ProcessingLogic; import gregtech.api.recipe.RecipeMap; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -223,7 +223,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiMolecularTransformer; + return PollutionConfig.pollutionPerSecondMultiMolecularTransformer; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java index 24a245833f3..f8117df4802 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialMultiMachine.java @@ -58,12 +58,12 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gregtech.common.tileentities.machines.IDualInputHatch; import gregtech.common.tileentities.machines.IDualInputInventory; import gregtech.common.tileentities.machines.MTEHatchCraftingInputME; import gregtech.common.tileentities.machines.MTEHatchInputME; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSolidifier; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; @@ -222,13 +222,13 @@ public int getMaxEfficiency(final ItemStack aStack) { public int getPollutionPerSecond(final ItemStack aStack) { switch (machineMode) { case MACHINEMODE_METAL -> { - return Configuration.pollution.pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal; + return PollutionConfig.pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal; } case MACHINEMODE_FLUID -> { - return Configuration.pollution.pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid; + return PollutionConfig.pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid; } default -> { - return Configuration.pollution.pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc; + return PollutionConfig.pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc; } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java index 20f56c56cbd..e509dec41e7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialPlatePress.java @@ -41,8 +41,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -190,8 +190,8 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { if (machineMode == MACHINEMODE_FORMER) - return Configuration.pollution.pollutionPerSecondMultiIndustrialPlatePress_ModeForming; - return Configuration.pollution.pollutionPerSecondMultiIndustrialPlatePress_ModeBending; + return PollutionConfig.pollutionPerSecondMultiIndustrialPlatePress_ModeForming; + return PollutionConfig.pollutionPerSecondMultiIndustrialPlatePress_ModeBending; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java index 2e8d742135a..d57c20adf00 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialSifter.java @@ -34,8 +34,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -194,7 +194,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialSifter; + return PollutionConfig.pollutionPerSecondMultiIndustrialSifter; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java index f4ca5361d9b..b838637d699 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialThermalCentrifuge.java @@ -32,8 +32,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -162,7 +162,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialThermalCentrifuge; + return PollutionConfig.pollutionPerSecondMultiIndustrialThermalCentrifuge; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java index 1a20e07ab60..4a4ddafbdb1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialVacuumFreezer.java @@ -36,9 +36,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.shutdown.ShutDownReasonRegistry; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.MTEHatchCustomFluidBase; @@ -217,7 +217,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialVacuumFreezer; + return PollutionConfig.pollutionPerSecondMultiIndustrialVacuumFreezer; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java index 6db9b8466e3..0f9fa3497e7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWashPlant.java @@ -62,10 +62,10 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; @@ -246,8 +246,8 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { if (machineMode == MACHINEMODE_CHEMBATH) - return Configuration.pollution.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath; - return Configuration.pollution.pollutionPerSecondMultiIndustrialWashPlant_ModeWasher; + return PollutionConfig.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath; + return PollutionConfig.pollutionPerSecondMultiIndustrialWashPlant_ModeWasher; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java index 215db1a7455..d6f4efc4f7f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIndustrialWireMill.java @@ -32,8 +32,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -183,7 +183,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialWireMill; + return PollutionConfig.pollutionPerSecondMultiIndustrialWireMill; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java index 667582d60b7..3eee133b128 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java @@ -47,11 +47,11 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.EntityUtils; @@ -396,7 +396,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIsaMill; + return PollutionConfig.pollutionPerSecondMultiIsaMill; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTENuclearSaltProcessingPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTENuclearSaltProcessingPlant.java index e74045dfe95..1335922a46e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTENuclearSaltProcessingPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTENuclearSaltProcessingPlant.java @@ -30,9 +30,9 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; public class MTENuclearSaltProcessingPlant extends GTPPMultiBlockBase @@ -67,7 +67,7 @@ public int getMaxEfficiency(ItemStack itemStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondNuclearSaltProcessingPlant; + return PollutionConfig.pollutionPerSecondNuclearSaltProcessingPlant; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEndustrialElectrolyzer.java index 1a243207625..4e4f23a8e18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEndustrialElectrolyzer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEndustrialElectrolyzer.java @@ -27,9 +27,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -150,7 +150,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialElectrolyzer; + return PollutionConfig.pollutionPerSecondMultiIndustrialElectrolyzer; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java index f09de3c6afd..059bfdc5070 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java @@ -52,8 +52,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gregtech.common.tileentities.machines.MTEHatchOutputME; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -302,8 +302,8 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { if (this.mMode == Mode.Distillery) - return Configuration.pollution.pollutionPerSecondMultiAdvDistillationTower_ModeDistillery; - return Configuration.pollution.pollutionPerSecondMultiAdvDistillationTower_ModeDT; + return PollutionConfig.pollutionPerSecondMultiAdvDistillationTower_ModeDistillery; + return PollutionConfig.pollutionPerSecondMultiAdvDistillationTower_ModeDT; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java index dccf03487e1..2ad5976e79c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvEBF.java @@ -51,8 +51,8 @@ import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; import gregtech.api.util.shutdown.ShutDownReasonRegistry; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.MTEHatchCustomFluidBase; @@ -256,7 +256,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiAdvEBF; + return PollutionConfig.pollutionPerSecondMultiAdvEBF; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java index 6c06f205149..58e86b705b8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvImplosionCompressor.java @@ -26,7 +26,7 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; -import gtPlusPlus.core.config.Configuration; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -154,7 +154,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiAdvImplosion; + return PollutionConfig.pollutionPerSecondMultiAdvImplosion; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java index d47953dabaf..3e9d0d55bcd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAlloyBlastSmelter.java @@ -33,10 +33,10 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -210,7 +210,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiABS; + return PollutionConfig.pollutionPerSecondMultiABS; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java index 3a216b20eff..59a0d0e1fc2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEAutoCrafter.java @@ -29,8 +29,8 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; public class MTEAutoCrafter extends GTPPMultiBlockBase implements ISurvivalConstructable { @@ -79,7 +79,7 @@ public int getMaxEfficiency(ItemStack itemStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiAutoCrafter; + return PollutionConfig.pollutionPerSecondMultiAutoCrafter; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java index fed3767cce3..38173d19b94 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTECyclotron.java @@ -36,9 +36,9 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; @@ -294,7 +294,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiCyclotron; + return PollutionConfig.pollutionPerSecondMultiCyclotron; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java index 0901c027d5f..e891742d8c7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEElementalDuplicator.java @@ -35,8 +35,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchElementalDataOrbHolder; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -311,7 +311,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondElementalDuplicator; + return PollutionConfig.pollutionPerSecondElementalDuplicator; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java index ff530a9ff93..a00419c4024 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEFrothFlotationCell.java @@ -41,9 +41,9 @@ import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.material.Material; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -180,7 +180,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiFrothFlotationCell; + return PollutionConfig.pollutionPerSecondMultiFrothFlotationCell; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java index 8c72a027e69..3e6d1f397d9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java @@ -47,9 +47,9 @@ import gregtech.api.util.OverclockCalculator; import gregtech.api.util.ParallelHelper; import gregtech.api.util.ReflectionUtil; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -279,7 +279,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialFishingPond; + return PollutionConfig.pollutionPerSecondMultiIndustrialFishingPond; } private Block getCasingBlock() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java index ac993e73e59..55a686cd912 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialRockBreaker.java @@ -44,8 +44,8 @@ import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; import gregtech.api.util.ParallelHelper; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -340,7 +340,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiIndustrialRockBreaker; + return PollutionConfig.pollutionPerSecondMultiIndustrialRockBreaker; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeSemifluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeSemifluidGenerator.java index c28973e4574..db98863b173 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeSemifluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTELargeSemifluidGenerator.java @@ -39,8 +39,8 @@ import gregtech.api.recipe.check.SimpleCheckRecipeResult; import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; public class MTELargeSemifluidGenerator extends GTPPMultiBlockBase @@ -295,7 +295,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiLargeSemiFluidGenerator; + return PollutionConfig.pollutionPerSecondMultiLargeSemiFluidGenerator; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java index 7a4eefb0a30..d2aeee46834 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEMassFabricator.java @@ -55,9 +55,9 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.config.MachineStats; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; @@ -218,7 +218,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiMassFabricator; + return PollutionConfig.pollutionPerSecondMultiMassFabricator; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java index 5f5735a777f..db83cc352ba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTERefinery.java @@ -29,9 +29,9 @@ import gregtech.api.metatileentity.implementations.MTEHatchMuffler; import gregtech.api.recipe.RecipeMap; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; public class MTERefinery extends GTPPMultiBlockBase implements ISurvivalConstructable { @@ -197,7 +197,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiRefinery; + return PollutionConfig.pollutionPerSecondMultiRefinery; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEThermalBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEThermalBoiler.java index ff4dfc2658c..ee92ebf15ca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEThermalBoiler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEThermalBoiler.java @@ -43,9 +43,9 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.ParallelHelper; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -272,7 +272,7 @@ public int getMaxEfficiency(ItemStack aStack) { @Override public int getPollutionPerSecond(ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiThermalBoiler; + return PollutionConfig.pollutionPerSecondMultiThermalBoiler; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java index 303c5680047..c93caaffe9c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java @@ -72,11 +72,11 @@ import gregtech.api.util.VoidProtectionHelper; import gregtech.common.items.IDMetaTool01; import gregtech.common.items.MetaGeneratedTool01; +import gregtech.common.pollution.PollutionConfig; import gregtech.common.tileentities.machines.MTEHatchInputBusME; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -207,7 +207,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiTreeFarm; + return PollutionConfig.pollutionPerSecondMultiTreeFarm; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java index 8024078aa6a..779148199e4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/MTEAlgaePondBase.java @@ -48,9 +48,9 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.ReflectionUtil; +import gregtech.common.pollution.PollutionConfig; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.math.MathUtils; @@ -314,7 +314,7 @@ public int getMaxEfficiency(final ItemStack aStack) { @Override public int getPollutionPerSecond(final ItemStack aStack) { - return Configuration.pollution.pollutionPerSecondMultiAlgaePond; + return PollutionConfig.pollutionPerSecondMultiAlgaePond; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java index 0a305bcf1f1..0feff0f6997 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java @@ -49,11 +49,11 @@ import gregtech.api.util.TurbineStatCalculator; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; +import gregtech.common.pollution.Pollution; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchTurbine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GTPPMultiBlockBase; import gtPlusPlus.xmod.gregtech.api.objects.GTPPRenderedTexture; @@ -659,7 +659,8 @@ public boolean polluteEnvironment(int aPollutionLevel) { mPollution += aPollutionLevel * getPollutionMultiplier() * mufflerReduction; for (MTEHatchMuffler tHatch : validMTEList(mMufflerHatches)) { if (mPollution >= 10000) { - if (PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10000)) { + if (GTMod.gregtechproxy.mPollution) { + Pollution.addPollution(this.getBaseMetaTileEntity(), 10000); mPollution -= 10000; } } else { diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPollutor.java b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPollutor.java index d70a0e3c430..ffc5f2a04c6 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPollutor.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPollutor.java @@ -31,7 +31,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.MTETieredMachineBlock; import gregtech.api.objects.GTRenderedTexture; -import gregtech.common.Pollution; +import gregtech.common.pollution.Pollution; import tectech.TecTech; import tectech.util.CommonValues; import tectech.util.TTUtility; diff --git a/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinExplosionPollution.java b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinExplosionPollution.java new file mode 100644 index 00000000000..b7ed0232435 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinExplosionPollution.java @@ -0,0 +1,39 @@ +package gregtech.mixin.mixins.early.minecraft.pollution; + +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(Explosion.class) +public class MixinExplosionPollution { + + @Shadow + public float explosionSize; + + @Shadow + private World worldObj; + + @Shadow + public double explosionX; + + @Shadow + public double explosionZ; + + @Inject(method = "doExplosionA", at = @At(value = "TAIL")) + public void gt5u$addExplosionPollution(CallbackInfo ci) { + if (!this.worldObj.isRemote) { + Pollution.addPollution( + this.worldObj.getChunkFromBlockCoords((int) this.explosionX, (int) this.explosionZ), + (int) Math.ceil(explosionSize * PollutionConfig.explosionPollutionAmount)); + } + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithOptifine.java b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithOptifine.java new file mode 100644 index 00000000000..f15e2e17163 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithOptifine.java @@ -0,0 +1,86 @@ +package gregtech.mixin.mixins.early.minecraft.pollution; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderBlocks; + +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; + +import gregtech.common.pollution.ColorOverrideType; +import gregtech.common.pollution.Pollution; + +@Mixin(RenderBlocks.class) +public class MixinRenderBlocks_PollutionWithOptifine { + + @Dynamic("Target is an optifine method") + @ModifyExpressionValue( + method = "renderStandardBlock", + at = @At( + value = "INVOKE", + target = "LCustomColorizer;getColorMultiplier(Lnet/minecraft/block/Block;Lnet/minecraft/world/IBlockAccess;III)I", + remap = false)) + private int gt5u$pollutionStandardBlock(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.standardBlocks.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } + + @Dynamic("Target is an optifine method") + @ModifyExpressionValue( + method = "renderBlockLiquid", + at = @At( + value = "INVOKE", + target = "LCustomColorizer;getFluidColor(Lnet/minecraft/block/Block;Lnet/minecraft/world/IBlockAccess;III)I", + remap = false)) + private int gt5u$pollutionBlockLiquid(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.liquidBlocks.matchesID(block); + if (type == null || block.getMaterial() != Material.water) { + return color; + } + return type.getColor(color, blockX, blockZ); + } + + @Dynamic("Target is an optifine method") + @ModifyExpressionValue( + method = "renderBlockDoublePlant", + at = @At( + value = "INVOKE", + target = "LCustomColorizer;getColorMultiplier(Lnet/minecraft/block/Block;Lnet/minecraft/world/IBlockAccess;III)I", + remap = false)) + private int gt5u$pollutionBlockDoublePlant(int color, BlockDoublePlant block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.doublePlants.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } + + @Dynamic("Target is an optifine method") + @ModifyExpressionValue( + method = "renderCrossedSquares", + at = @At( + value = "INVOKE", + target = "LCustomColorizer;getColorMultiplier(Lnet/minecraft/block/Block;Lnet/minecraft/world/IBlockAccess;III)I", + remap = false)) + private int gt5u$pollutionCrossedSquares(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.crossedSquares.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } + + @Dynamic("Target is an optifine method") + @ModifyExpressionValue( + method = "renderBlockVine", + at = @At( + value = "INVOKE", + target = "LCustomColorizer;getColorMultiplier(Lnet/minecraft/block/Block;Lnet/minecraft/world/IBlockAccess;III)I", + remap = false)) + private int gt5u$pollutionBlockVine(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.blockVine.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithoutOptifine.java b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithoutOptifine.java new file mode 100644 index 00000000000..e400f049047 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinRenderBlocks_PollutionWithoutOptifine.java @@ -0,0 +1,75 @@ +package gregtech.mixin.mixins.early.minecraft.pollution; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.RenderBlocks; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; + +import gregtech.common.pollution.ColorOverrideType; +import gregtech.common.pollution.Pollution; + +@Mixin(RenderBlocks.class) +public class MixinRenderBlocks_PollutionWithoutOptifine { + + @ModifyExpressionValue( + method = "renderStandardBlock", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/Block;colorMultiplier(Lnet/minecraft/world/IBlockAccess;III)I")) + private int gt5u$pollutionStandardBlock(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.standardBlocks.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } + + @ModifyExpressionValue( + method = "renderBlockLiquid", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/Block;colorMultiplier(Lnet/minecraft/world/IBlockAccess;III)I")) + private int gt5u$pollutionBlockLiquid(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.liquidBlocks.matchesID(block); + if (type == null || block.getMaterial() != Material.water) { + return color; + } + return type.getColor(color, blockX, blockZ); + } + + @ModifyExpressionValue( + method = "renderBlockDoublePlant", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/BlockDoublePlant;colorMultiplier(Lnet/minecraft/world/IBlockAccess;III)I")) + private int gt5u$pollutionBlockDoublePlant(int color, BlockDoublePlant block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.doublePlants.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } + + @ModifyExpressionValue( + method = "renderCrossedSquares", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/Block;colorMultiplier(Lnet/minecraft/world/IBlockAccess;III)I")) + private int gt5u$pollutionCrossedSquares(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.crossedSquares.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } + + @ModifyExpressionValue( + method = "renderBlockVine", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/Block;colorMultiplier(Lnet/minecraft/world/IBlockAccess;III)I")) + private int gt5u$pollutionBlockVine(int color, Block block, int blockX, int blockY, int blockZ) { + ColorOverrideType type = Pollution.blockVine.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinTileEntityFurnacePollution.java b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinTileEntityFurnacePollution.java new file mode 100644 index 00000000000..4a1e0885249 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/early/minecraft/pollution/MixinTileEntityFurnacePollution.java @@ -0,0 +1,33 @@ +package gregtech.mixin.mixins.early.minecraft.pollution; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; + +import org.objectweb.asm.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(TileEntityFurnace.class) +public abstract class MixinTileEntityFurnacePollution extends TileEntity { + + @Inject( + method = "updateEntity", + at = @At( + value = "FIELD", + target = "net/minecraft/tileentity/TileEntityFurnace.furnaceBurnTime:I", + opcode = Opcodes.GETFIELD, + ordinal = 2)) + private void gt5u$addPollution(CallbackInfo ci) { + if (!this.worldObj.isRemote && (this.worldObj.getTotalWorldTime() % 20) == 0) { + Pollution.addPollution( + this.worldObj.getChunkFromBlockCoords(this.xCoord, this.zCoord), + PollutionConfig.furnacePollutionAmount); + } + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/biomesoplenty/MixinFoliageRendererPollution.java b/src/mixin/java/gregtech/mixin/mixins/late/biomesoplenty/MixinFoliageRendererPollution.java new file mode 100644 index 00000000000..3b6b7f54234 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/biomesoplenty/MixinFoliageRendererPollution.java @@ -0,0 +1,31 @@ +package gregtech.mixin.mixins.late.biomesoplenty; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; + +import biomesoplenty.client.render.blocks.FoliageRenderer; +import gregtech.common.pollution.ColorOverrideType; +import gregtech.common.pollution.Pollution; + +@Mixin(FoliageRenderer.class) +public class MixinFoliageRendererPollution { + + @ModifyExpressionValue( + method = "renderCrossedSquares", + remap = false, + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/block/Block;func_149720_d(Lnet/minecraft/world/IBlockAccess;III)I", + remap = false)) + private int gt5u$pollutionCrossedSquares(int color, Block block, int blockX, int blockY, int blockZ, + RenderBlocks renderer) { + ColorOverrideType type = Pollution.blockVine.matchesID(block); + if (type == null) return color; + return type.getColor(color, blockX, blockZ); + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/galacticraftcore/MixinGalacticraftRocketPollution.java b/src/mixin/java/gregtech/mixin/mixins/late/galacticraftcore/MixinGalacticraftRocketPollution.java new file mode 100644 index 00000000000..53aee62ba5e --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/galacticraftcore/MixinGalacticraftRocketPollution.java @@ -0,0 +1,39 @@ +package gregtech.mixin.mixins.late.galacticraftcore; + +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; +import micdoodle8.mods.galacticraft.api.entity.IRocketType; +import micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket; +import micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(EntityTieredRocket.class) +public abstract class MixinGalacticraftRocketPollution extends EntityAutoRocket implements IRocketType { + + private MixinGalacticraftRocketPollution(World world) { + super(world); + } + + @Inject(method = "onUpdate", at = @At("HEAD")) + private void gt5u$addRocketPollution(CallbackInfo ci) { + if (this.worldObj.isRemote || !(launchPhase == EnumLaunchPhase.LAUNCHED.ordinal() + || launchPhase == EnumLaunchPhase.IGNITED.ordinal())) { + return; + } + + int pollutionAmount = 0; + if (launchPhase == EnumLaunchPhase.LAUNCHED.ordinal()) { + pollutionAmount = PollutionConfig.rocketPollutionAmount * this.getRocketTier(); + } else if (launchPhase == EnumLaunchPhase.IGNITED.ordinal()) { + pollutionAmount = PollutionConfig.rocketPollutionAmount * this.getRocketTier() / 100; + } + Pollution.addPollution(worldObj.getChunkFromBlockCoords((int) posX, (int) posZ), pollutionAmount); + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIC2IronFurnacePollution.java b/src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIC2IronFurnacePollution.java new file mode 100644 index 00000000000..0df3897d511 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIC2IronFurnacePollution.java @@ -0,0 +1,32 @@ +package gregtech.mixin.mixins.late.ic2; + +import net.minecraft.tileentity.TileEntity; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; +import ic2.core.block.machine.tileentity.TileEntityIronFurnace; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(value = TileEntityIronFurnace.class, remap = false) +public abstract class MixinIC2IronFurnacePollution extends TileEntity { + + @Shadow + public abstract boolean isBurning(); + + @Inject(method = "updateEntityServer", at = @At("TAIL")) + private void gt5u$updateEntityServer(CallbackInfo ci) { + if (worldObj.isRemote || !isBurning()) { + return; + } + if ((worldObj.getTotalWorldTime() % 20) == 0) { + Pollution + .addPollution(worldObj.getChunkFromBlockCoords(xCoord, zCoord), PollutionConfig.furnacePollutionAmount); + } + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIc2Hazmat.java b/src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIc2Hazmat.java new file mode 100644 index 00000000000..cd451f0a46d --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/ic2/MixinIc2Hazmat.java @@ -0,0 +1,22 @@ +package gregtech.mixin.mixins.late.ic2; + +import net.minecraft.entity.EntityLivingBase; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import gregtech.api.util.GTUtility; +import ic2.core.item.armor.ItemArmorHazmat; + +@Mixin(value = ItemArmorHazmat.class, remap = false) +public class MixinIc2Hazmat { + + /** + * @author Sphyix + * @reason Hazmat - IC2 logic superseded by GT check + */ + @Overwrite + public static boolean hasCompleteHazmat(EntityLivingBase entity) { + return GTUtility.isWearingFullRadioHazmat(entity); + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftBoilerPollution.java b/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftBoilerPollution.java new file mode 100644 index 00000000000..f86255ed45a --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftBoilerPollution.java @@ -0,0 +1,45 @@ +package gregtech.mixin.mixins.late.railcraft; + +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; +import mods.railcraft.common.blocks.RailcraftTileEntity; +import mods.railcraft.common.blocks.machine.TileMultiBlock; +import mods.railcraft.common.blocks.machine.beta.TileEngineSteamHobby; +import mods.railcraft.common.util.steam.SteamBoiler; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(SteamBoiler.class) +public class MixinRailcraftBoilerPollution { + + @Shadow(remap = false) + private RailcraftTileEntity tile; + + @Shadow(remap = false) + protected boolean isBurning; + + @Inject(method = "tick", at = @At(value = "HEAD"), remap = false) + private void gt5u$tick(int x, CallbackInfo ci) { + if (!this.isBurning || this.tile == null || this.tile.getWorld() == null) return; + final World world = this.tile.getWorldObj(); + if ((world.getTotalWorldTime() % 20) == 0) { + int pollutionAmount; + if (this.tile instanceof TileMultiBlock) { + pollutionAmount = (((TileMultiBlock) this.tile).getComponents() + .size() - x) * PollutionConfig.fireboxPollutionAmount; + } else if (this.tile instanceof TileEngineSteamHobby) { + pollutionAmount = PollutionConfig.hobbyistEnginePollutionAmount; + } else { + pollutionAmount = 40; + } + Pollution.addPollution(world.getChunkFromBlockCoords(this.tile.getX(), this.tile.getZ()), pollutionAmount); + } + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftCokeOvenPollution.java b/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftCokeOvenPollution.java new file mode 100644 index 00000000000..147fe554c4a --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftCokeOvenPollution.java @@ -0,0 +1,39 @@ +package gregtech.mixin.mixins.late.railcraft; + +import java.util.List; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; +import mods.railcraft.common.blocks.machine.MultiBlockPattern; +import mods.railcraft.common.blocks.machine.TileMultiBlock; +import mods.railcraft.common.blocks.machine.TileMultiBlockOven; +import mods.railcraft.common.blocks.machine.alpha.TileBlastFurnace; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(TileMultiBlockOven.class) +public abstract class MixinRailcraftCokeOvenPollution extends TileMultiBlock { + + @Shadow(remap = false) + protected boolean cooking; + + private MixinRailcraftCokeOvenPollution(List patterns) { + super(patterns); + } + + @Inject(method = "updateEntity", at = @At("HEAD")) + private void gt5u$addPollution(CallbackInfo ci) { + if (this.worldObj.isRemote || !this.cooking || !this.isMaster) return; + if ((this.worldObj.getTotalWorldTime() % 20) == 0) { + final int pollution = (((TileMultiBlock) this) instanceof TileBlastFurnace) + ? PollutionConfig.advancedCokeOvenPollutionAmount + : PollutionConfig.cokeOvenPollutionAmount; + Pollution.addPollution(this.worldObj.getChunkFromBlockCoords(this.xCoord, this.zCoord), pollution); + } + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftTunnelBorePollution.java b/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftTunnelBorePollution.java new file mode 100644 index 00000000000..7ddc4031a2d --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/railcraft/MixinRailcraftTunnelBorePollution.java @@ -0,0 +1,34 @@ +package gregtech.mixin.mixins.late.railcraft; + +import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; +import mods.railcraft.common.carts.EntityTunnelBore; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(EntityTunnelBore.class) +public abstract class MixinRailcraftTunnelBorePollution extends EntityMinecart { + + @Shadow(remap = false) + private boolean active; + + private MixinRailcraftTunnelBorePollution(World world) { + super(world); + } + + @Inject(method = "onUpdate", at = @At("HEAD")) + private void gt5u$addPollution(CallbackInfo ci) { + if (!worldObj.isRemote || !active) return; + Pollution.addPollution( + worldObj.getChunkFromBlockCoords((int) posX, (int) posZ), + PollutionConfig.tunnelBorePollutionAmount); + } +} diff --git a/src/mixin/java/gregtech/mixin/mixins/late/thaumcraft/MixinThaumcraftAlchemyFurnacePollution.java b/src/mixin/java/gregtech/mixin/mixins/late/thaumcraft/MixinThaumcraftAlchemyFurnacePollution.java new file mode 100644 index 00000000000..a842f42d579 --- /dev/null +++ b/src/mixin/java/gregtech/mixin/mixins/late/thaumcraft/MixinThaumcraftAlchemyFurnacePollution.java @@ -0,0 +1,33 @@ +package gregtech.mixin.mixins.late.thaumcraft; + +import net.minecraft.tileentity.TileEntity; + +import org.spongepowered.asm.lib.Opcodes; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import gregtech.common.pollution.Pollution; +import gregtech.common.pollution.PollutionConfig; +import thaumcraft.common.tiles.TileAlchemyFurnace; + +// Merged from ModMixins under the MIT License Copyright bartimaeusnek & GTNewHorizons +@Mixin(TileAlchemyFurnace.class) +public abstract class MixinThaumcraftAlchemyFurnacePollution extends TileEntity { + + @Inject( + method = "updateEntity", + at = @At( + value = "FIELD", + target = "thaumcraft/common/tiles/TileAlchemyFurnace.furnaceBurnTime:I", + opcode = Opcodes.PUTFIELD, + remap = false)) + private void gt5u$addPollution(CallbackInfo ci) { + if (!this.worldObj.isRemote && (this.worldObj.getTotalWorldTime() % 20) == 0) { + Pollution.addPollution( + this.worldObj.getChunkFromBlockCoords(this.xCoord, this.zCoord), + PollutionConfig.furnacePollutionAmount); + } + } +} From 14b8acb4795a9e1e1e726bf3020148e51f96bce2 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 21 Oct 2024 21:26:11 +0200 Subject: [PATCH 27/38] update --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index ce6c7523497..ed3124c21a0 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -58,10 +58,10 @@ dependencies { compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.54:dev") - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta8:api') { transitive = false } + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta9:api') { transitive = false } compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.3:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.39:dev") { transitive = false } - compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.18:dev") { transitive = false } + compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.19:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.9.16:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.10.5-GTNH:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.15.14:dev") { transitive = false } @@ -121,7 +121,7 @@ dependencies { functionalTestImplementation('org.junit.platform:junit-platform-reporting') runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev") - runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.8.18:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.8.19:dev') // For testing //runtimeOnlyNonPublishable('com.github.GTNewHorizons:TCNEIAdditions:1.4.1:dev') From 4a64dd8ef3bbe98bcc411ab909b86e34bc17fb09 Mon Sep 17 00:00:00 2001 From: GDCloud <93287602+GDCloudstrike@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:44:36 +0200 Subject: [PATCH 28/38] Godforge afterparty (#3345) Co-authored-by: Martin Robertz Co-authored-by: serenibyss <10861407+serenibyss@users.noreply.github.com> --- .../java/tectech/loader/recipe/Godforge.java | 14 +- .../tectech/loader/thing/MachineLoader.java | 10 +- .../tectech/loader/thing/ThingsLoader.java | 2 + .../java/tectech/thing/CustomItemList.java | 1 + .../thing/block/RenderForgeOfGods.java | 8 +- .../thing/block/TileEntityForgeOfGods.java | 169 +-- .../tectech/thing/gui/TecTechUITextures.java | 36 + .../java/tectech/thing/item/FakeItemQGP.java | 34 + .../ForgeOfGodsRingsStructureString.java | 2 +- .../ForgeOfGodsStructureString.java | 2 +- .../multi/godforge/ForgeOfGodsUI.java | 549 +++++++ .../MTEBaseModule.java | 115 +- .../MTEExoticModule.java | 190 ++- .../multi/{ => godforge}/MTEForgeOfGods.java | 1256 ++++++++++------- .../MTEMoltenModule.java | 2 +- .../MTEPlasmaModule.java | 135 +- .../MTESmeltingModule.java | 32 +- .../godforge/color/ForgeOfGodsStarColor.java | 346 +++++ .../godforge/color/StarColorSetting.java | 89 ++ .../godforge/color/StarColorStorage.java | 130 ++ src/main/java/tectech/util/GodforgeMath.java | 31 +- .../resources/assets/tectech/lang/en_US.lang | 80 +- .../gui/background/white_glow_half.png | Bin 0 -> 9261 bytes .../gui/overlay_button/batch_mode_off.png | Bin 0 -> 207 bytes .../gui/overlay_button/batch_mode_on.png | Bin 0 -> 423 bytes .../gui/overlay_button/furnace_mode_off.png | Bin 0 -> 349 bytes .../gui/overlay_button/furnace_mode_on.png | Bin 0 -> 381 bytes .../overlay_button/input_separation_off.png | Bin 0 -> 196 bytes .../overlay_button/input_separation_on.png | Bin 0 -> 376 bytes .../gui/overlay_button/loaf_mode_off.png | Bin 0 -> 182 bytes .../gui/overlay_button/loaf_mode_on.png | Bin 0 -> 296 bytes .../gui/overlay_button/recipe_locked.png | Bin 0 -> 407 bytes .../gui/overlay_button/recipe_unlocked.png | Bin 0 -> 213 bytes .../overlay_button/structure_check_off.png | Bin 0 -> 186 bytes .../gui/overlay_button/structure_check_on.png | Bin 0 -> 352 bytes .../gui/overlay_button/voiding_both.png | Bin 0 -> 401 bytes .../gui/overlay_button/voiding_disabled.png | Bin 0 -> 224 bytes .../gui/overlay_button/voiding_fluids.png | Bin 0 -> 338 bytes .../gui/overlay_button/voiding_items.png | Bin 0 -> 338 bytes .../textures/gui/picture/heat_sink_16x8.png | Bin 0 -> 151 bytes .../gui/picture/unselected_option.png | Bin 0 -> 219 bytes .../tectech/textures/items/fakeItemQGP.png | Bin 0 -> 2631 bytes .../textures/items/fakeItemQGP.png.mcmeta | 1 + .../color/ForgeOfGodsStarColorTest.java | 21 + 44 files changed, 2411 insertions(+), 844 deletions(-) create mode 100644 src/main/java/tectech/thing/item/FakeItemQGP.java rename src/main/java/tectech/thing/metaTileEntity/multi/{ => godforge}/ForgeOfGodsRingsStructureString.java (99%) rename src/main/java/tectech/thing/metaTileEntity/multi/{ => godforge}/ForgeOfGodsStructureString.java (99%) create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java rename src/main/java/tectech/thing/metaTileEntity/multi/{godforge_modules => godforge}/MTEBaseModule.java (84%) rename src/main/java/tectech/thing/metaTileEntity/multi/{godforge_modules => godforge}/MTEExoticModule.java (83%) rename src/main/java/tectech/thing/metaTileEntity/multi/{ => godforge}/MTEForgeOfGods.java (81%) rename src/main/java/tectech/thing/metaTileEntity/multi/{godforge_modules => godforge}/MTEMoltenModule.java (99%) rename src/main/java/tectech/thing/metaTileEntity/multi/{godforge_modules => godforge}/MTEPlasmaModule.java (67%) rename src/main/java/tectech/thing/metaTileEntity/multi/{godforge_modules => godforge}/MTESmeltingModule.java (91%) create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorSetting.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorStorage.java create mode 100644 src/main/resources/assets/tectech/textures/gui/background/white_glow_half.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/batch_mode_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/batch_mode_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/furnace_mode_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/furnace_mode_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/input_separation_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/input_separation_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/loaf_mode_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/loaf_mode_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/recipe_locked.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/recipe_unlocked.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/structure_check_off.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/structure_check_on.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_both.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_disabled.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_fluids.png create mode 100644 src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_items.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/heat_sink_16x8.png create mode 100644 src/main/resources/assets/tectech/textures/gui/picture/unselected_option.png create mode 100644 src/main/resources/assets/tectech/textures/items/fakeItemQGP.png create mode 100644 src/main/resources/assets/tectech/textures/items/fakeItemQGP.png.mcmeta create mode 100644 src/test/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColorTest.java diff --git a/src/main/java/tectech/loader/recipe/Godforge.java b/src/main/java/tectech/loader/recipe/Godforge.java index 30e3a37f2ce..981f6b139a7 100644 --- a/src/main/java/tectech/loader/recipe/Godforge.java +++ b/src/main/java/tectech/loader/recipe/Godforge.java @@ -758,13 +758,13 @@ public void run() { public static void runDevEnvironmentRecipes() { // put something in here to not crash the game in dev environment when opening the manual insertion window - godforgeUpgradeMats.put(0, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); - godforgeUpgradeMats.put(5, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); - godforgeUpgradeMats.put(7, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); - godforgeUpgradeMats.put(11, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); - godforgeUpgradeMats.put(26, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); - godforgeUpgradeMats.put(29, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); - godforgeUpgradeMats.put(30, new ItemStack[] { new ItemStack(Blocks.cobblestone) }); + godforgeUpgradeMats.put(0, new ItemStack[] { new ItemStack(Blocks.cobblestone, 4) }); + godforgeUpgradeMats.put(5, new ItemStack[] { new ItemStack(Blocks.cobblestone, 8) }); + godforgeUpgradeMats.put(7, new ItemStack[] { new ItemStack(Blocks.cobblestone, 12) }); + godforgeUpgradeMats.put(11, new ItemStack[] { new ItemStack(Blocks.cobblestone, 16) }); + godforgeUpgradeMats.put(26, new ItemStack[] { new ItemStack(Blocks.cobblestone, 32) }); + godforgeUpgradeMats.put(29, new ItemStack[] { new ItemStack(Blocks.cobblestone, 48) }); + godforgeUpgradeMats.put(30, new ItemStack[] { new ItemStack(Blocks.cobblestone, 64) }); } public static void initMoltenModuleRecipes() { diff --git a/src/main/java/tectech/loader/thing/MachineLoader.java b/src/main/java/tectech/loader/thing/MachineLoader.java index 36b8b03c12a..bf8f2e740a8 100644 --- a/src/main/java/tectech/loader/thing/MachineLoader.java +++ b/src/main/java/tectech/loader/thing/MachineLoader.java @@ -641,16 +641,16 @@ import tectech.thing.metaTileEntity.multi.MTEDataBank; import tectech.thing.metaTileEntity.multi.MTEEnergyInfuser; import tectech.thing.metaTileEntity.multi.MTEEyeOfHarmony; -import tectech.thing.metaTileEntity.multi.MTEForgeOfGods; import tectech.thing.metaTileEntity.multi.MTEMicrowave; import tectech.thing.metaTileEntity.multi.MTENetworkSwitch; import tectech.thing.metaTileEntity.multi.MTEQuantumComputer; import tectech.thing.metaTileEntity.multi.MTEResearchStation; import tectech.thing.metaTileEntity.multi.MTETeslaTower; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEExoticModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEMoltenModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEPlasmaModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTESmeltingModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEExoticModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEForgeOfGods; +import tectech.thing.metaTileEntity.multi.godforge.MTEMoltenModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEPlasmaModule; +import tectech.thing.metaTileEntity.multi.godforge.MTESmeltingModule; import tectech.thing.metaTileEntity.pipe.MTEPipeBlockData; import tectech.thing.metaTileEntity.pipe.MTEPipeBlockEnergy; import tectech.thing.metaTileEntity.pipe.MTEPipeData; diff --git a/src/main/java/tectech/loader/thing/ThingsLoader.java b/src/main/java/tectech/loader/thing/ThingsLoader.java index 7844a6865e9..219bed88520 100644 --- a/src/main/java/tectech/loader/thing/ThingsLoader.java +++ b/src/main/java/tectech/loader/thing/ThingsLoader.java @@ -17,6 +17,7 @@ import tectech.thing.casing.StabilisationFieldCasing; import tectech.thing.casing.TTCasingsContainer; import tectech.thing.casing.TimeAccelerationFieldCasing; +import tectech.thing.item.FakeItemQGP; import tectech.thing.item.ItemAstralArrayFabricator; import tectech.thing.item.ItemEnderFluidLinkCover; import tectech.thing.item.ItemEuMeterGT; @@ -84,6 +85,7 @@ public void run() { ItemTeslaCoilComponent.run(); ItemAstralArrayFabricator.run(); + FakeItemQGP.run(); TecTech.LOGGER.info("Crafting Components registered"); TecTech.LOGGER.info("Debug Items registered"); diff --git a/src/main/java/tectech/thing/CustomItemList.java b/src/main/java/tectech/thing/CustomItemList.java index 2c4b4c895b9..5788b822591 100644 --- a/src/main/java/tectech/thing/CustomItemList.java +++ b/src/main/java/tectech/thing/CustomItemList.java @@ -461,6 +461,7 @@ public enum CustomItemList implements IItemContainer { Godforge_GravitonFlowModulatorTier2, Godforge_GravitonFlowModulatorTier3, Godforge_HarmonicPhononTransmissionConduit, + Godforge_FakeItemQGP, astralArrayFabricator; diff --git a/src/main/java/tectech/thing/block/RenderForgeOfGods.java b/src/main/java/tectech/thing/block/RenderForgeOfGods.java index 498db3b9edf..90914344900 100644 --- a/src/main/java/tectech/thing/block/RenderForgeOfGods.java +++ b/src/main/java/tectech/thing/block/RenderForgeOfGods.java @@ -28,8 +28,8 @@ import com.gtnewhorizon.gtnhlib.client.renderer.vbo.VertexBuffer; import tectech.Reference; -import tectech.thing.metaTileEntity.multi.ForgeOfGodsRingsStructureString; -import tectech.thing.metaTileEntity.multi.ForgeOfGodsStructureString; +import tectech.thing.metaTileEntity.multi.godforge.ForgeOfGodsRingsStructureString; +import tectech.thing.metaTileEntity.multi.godforge.ForgeOfGodsStructureString; import tectech.util.StructureVBO; import tectech.util.TextureUpdateRequester; @@ -429,9 +429,7 @@ public void renderTileEntityAt(TileEntity tile, double x, double y, double z, fl long millis = System.currentTimeMillis() % (1000 * 36000); float timer = millis / (50f); // to ticks - if (forgeTile.getRainbowMode()) { - forgeTile.incrementRainbowColors(); - } + forgeTile.incrementColors(); RenderEntireStar(forgeTile, x, y, z, timer); RenderRings(forgeTile, x, y, z, timer); diff --git a/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java b/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java index 49ab89de2b1..a8a8992a638 100644 --- a/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java +++ b/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java @@ -1,5 +1,10 @@ package tectech.thing.block; +import static tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor.DEFAULT_BLUE; +import static tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor.DEFAULT_GAMMA; +import static tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor.DEFAULT_GREEN; +import static tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor.DEFAULT_RED; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; @@ -9,33 +14,41 @@ import net.minecraftforge.common.util.ForgeDirection; import com.gtnewhorizon.structurelib.alignment.enumerable.Rotation; +import com.gtnewhorizons.modularui.api.math.Color; + +import tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor; +import tectech.thing.metaTileEntity.multi.godforge.color.StarColorSetting; public class TileEntityForgeOfGods extends TileEntity { private float radius = 32; private float rotationSpeed = 10; private int ringCount = 1; - private float colorR = .7f, colorG = .8f, colorB = 1f, gamma = 3f; private float rotAngle = 0, rotAxisX = 1, rotAxisY = 0, rotAxisZ = 0; - private int rainbowR = 255, rainbowG = 0, rainbowB = 0; - private int rainbowState = 0; - private boolean rainbowMode = false; - private int rainbowCycleSpeed = 1; + + private ForgeOfGodsStarColor starColor = ForgeOfGodsStarColor.DEFAULT; + + // current color data + private int currentColor = Color.rgb(DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE); + private float gamma = DEFAULT_GAMMA; + + // interpolation color data + private int cycleStep; + private int interpIndex; + private int interpA; + private int interpB; + private float interpGammaA; + private float interpGammaB; private static final String NBT_TAG = "FOG:"; private static final String ROTATION_SPEED_NBT_TAG = NBT_TAG + "ROTATION"; private static final String SIZE_NBT_TAG = NBT_TAG + "RADIUS"; private static final String RINGS_NBT_TAG = NBT_TAG + "RINGS"; - private static final String COLOR_RED_NBT_TAG = NBT_TAG + "COLOR_RED"; - private static final String COLOR_GREEN_NBT_TAG = NBT_TAG + "COLOR_GREEN"; - private static final String COLOR_BLUE_NBT_TAG = NBT_TAG + "COLOR_BLUE"; - private static final String COLOR_GAMMA_NBT_TAG = NBT_TAG + "COLOR_GAMMA"; private static final String ROT_ANGLE_NBT_TAG = NBT_TAG + "ROT_ANGLE"; private static final String ROT_AXIS_X_NBT_TAG = NBT_TAG + "ROT_AXIS_X"; private static final String ROT_AXIS_Y_NBT_TAG = NBT_TAG + "ROT_AXIS_Y"; private static final String ROT_AXIS_Z_NBT_TAG = NBT_TAG + "ROT_AXIS_Z"; - private static final String RAINBOW_MODE_NBT_TAG = NBT_TAG + "RAINBOW_MODE"; - private static final String RAINBOW_MODE_CYCLE_SPEED_NBT_TAG = NBT_TAG + "RAINBOW_MODE_CYCLE_SPEED"; + private static final String STAR_COLOR_TAG = NBT_TAG + "STAR_COLOR"; public static final float BACK_PLATE_DISTANCE = -121.5f, BACK_PLATE_RADIUS = 13f; @@ -66,39 +79,39 @@ public void setRotationSpeed(float speed) { } public float getColorR() { - return rainbowMode ? rainbowR / 255f : colorR; + return Color.getRedF(currentColor); } public float getColorG() { - return rainbowMode ? rainbowG / 255f : colorG; + return Color.getGreenF(currentColor); } public float getColorB() { - return rainbowMode ? rainbowB / 255f : colorB; + return Color.getBlueF(currentColor); } public float getGamma() { return gamma; } - public void setColor(float r, float g, float b) { - setColor(r, g, b, 1); - } - - public void setColor(float r, float g, float b, float gamma) { - colorR = r; - colorG = g; - colorB = b; - this.gamma = gamma; - } - - public void setRainbowMode(boolean state, int cycleSpeed) { - this.rainbowMode = state; - this.rainbowCycleSpeed = cycleSpeed; - } + public void setColor(ForgeOfGodsStarColor color) { + this.starColor = color; + if (this.starColor == null) { + this.starColor = ForgeOfGodsStarColor.DEFAULT; + } - public boolean getRainbowMode() { - return rainbowMode; + StarColorSetting colorSetting = starColor.getColor(0); + currentColor = Color.rgb(colorSetting.getColorR(), colorSetting.getColorG(), colorSetting.getColorB()); + gamma = colorSetting.getGamma(); + + if (starColor.numColors() > 1) { + cycleStep = 0; + interpA = currentColor; + interpGammaA = gamma; + colorSetting = starColor.getColor(1); + interpB = Color.rgb(colorSetting.getColorR(), colorSetting.getColorG(), colorSetting.getColorB()); + interpGammaB = colorSetting.getGamma(); + } } public int getRingCount() { @@ -172,49 +185,46 @@ public static float interpolate(float x0, float x1, float y0, float y1, float x) return y0 + ((x - x0) * (y1 - y0)) / (x1 - x0); } - public void incrementRainbowColors() { - if (rainbowState == 0) { - rainbowG += rainbowCycleSpeed; - if (rainbowG >= 255) { - rainbowG = 255; - rainbowState = 1; + public void incrementColors() { + if (starColor.numColors() > 1) { + cycleStep += starColor.getCycleSpeed(); + + if (cycleStep < 255) { + // interpolate like normal between these two colors + interpolateColors(); + } else if (cycleStep == 255) { + // interpolate like normal, but then update interp values to the next set and reset cycleStep + cycleStarColors(); + currentColor = interpA; + gamma = interpGammaA; + cycleStep = 0; + } else { + // update interp values to the next set, reset cycleStep then interpolate + cycleStep = -255; + cycleStarColors(); + interpolateColors(); } } - if (rainbowState == 1) { - rainbowR -= rainbowCycleSpeed; - if (rainbowR <= 0) { - rainbowR = 0; - rainbowState = 2; - } - } - if (rainbowState == 2) { - rainbowB += rainbowCycleSpeed; - if (rainbowB >= 255) { - rainbowB = 255; - rainbowState = 3; - } - } - if (rainbowState == 3) { - rainbowG -= rainbowCycleSpeed; - if (rainbowG <= 0) { - rainbowG = 0; - rainbowState = 4; - } - } - if (rainbowState == 4) { - rainbowR += rainbowCycleSpeed; - if (rainbowR >= 255) { - rainbowR = 255; - rainbowState = 5; - } - } - if (rainbowState == 5) { - rainbowB -= rainbowCycleSpeed; - if (rainbowB <= 0) { - rainbowB = 0; - rainbowState = 0; - } + } + + private void interpolateColors() { + float position = cycleStep / 255.0f; + currentColor = Color.interpolate(interpA, interpB, position); + gamma = interpGammaA + (interpGammaB - interpGammaA) * position; + } + + private void cycleStarColors() { + interpA = interpB; + interpGammaA = interpGammaB; + + interpIndex++; + if (interpIndex >= starColor.numColors()) { + interpIndex = 0; } + StarColorSetting nextColor = starColor.getColor(interpIndex); + + interpB = Color.rgb(nextColor.getColorR(), nextColor.getColorG(), nextColor.getColorB()); + interpGammaB = nextColor.getGamma(); } @Override @@ -223,16 +233,11 @@ public void writeToNBT(NBTTagCompound compound) { compound.setFloat(ROTATION_SPEED_NBT_TAG, rotationSpeed); compound.setFloat(SIZE_NBT_TAG, radius); compound.setInteger(RINGS_NBT_TAG, ringCount); - compound.setFloat(COLOR_RED_NBT_TAG, colorR); - compound.setFloat(COLOR_GREEN_NBT_TAG, colorG); - compound.setFloat(COLOR_BLUE_NBT_TAG, colorB); - compound.setFloat(COLOR_GAMMA_NBT_TAG, gamma); compound.setFloat(ROT_ANGLE_NBT_TAG, rotAngle); compound.setFloat(ROT_AXIS_X_NBT_TAG, rotAxisX); compound.setFloat(ROT_AXIS_Y_NBT_TAG, rotAxisY); compound.setFloat(ROT_AXIS_Z_NBT_TAG, rotAxisZ); - compound.setBoolean(RAINBOW_MODE_NBT_TAG, rainbowMode); - compound.setInteger(RAINBOW_MODE_CYCLE_SPEED_NBT_TAG, rainbowCycleSpeed); + compound.setTag(STAR_COLOR_TAG, starColor.serializeToNBT()); } @Override @@ -244,16 +249,14 @@ public void readFromNBT(NBTTagCompound compound) { ringCount = compound.getInteger(RINGS_NBT_TAG); if (ringCount < 1) ringCount = 1; - colorR = compound.getFloat(COLOR_RED_NBT_TAG); - colorG = compound.getFloat(COLOR_GREEN_NBT_TAG); - colorB = compound.getFloat(COLOR_BLUE_NBT_TAG); - gamma = compound.getFloat(COLOR_GAMMA_NBT_TAG); rotAngle = compound.getFloat(ROT_ANGLE_NBT_TAG); rotAxisX = compound.getFloat(ROT_AXIS_X_NBT_TAG); rotAxisY = compound.getFloat(ROT_AXIS_Y_NBT_TAG); rotAxisZ = compound.getFloat(ROT_AXIS_Z_NBT_TAG); - rainbowMode = compound.getBoolean(RAINBOW_MODE_NBT_TAG); - rainbowCycleSpeed = compound.getInteger(RAINBOW_MODE_CYCLE_SPEED_NBT_TAG); + + if (compound.hasKey(STAR_COLOR_TAG)) { + setColor(ForgeOfGodsStarColor.deserialize(compound.getCompoundTag(STAR_COLOR_TAG))); + } } @Override diff --git a/src/main/java/tectech/thing/gui/TecTechUITextures.java b/src/main/java/tectech/thing/gui/TecTechUITextures.java index 298d528e21c..89fb7c5b110 100644 --- a/src/main/java/tectech/thing/gui/TecTechUITextures.java +++ b/src/main/java/tectech/thing/gui/TecTechUITextures.java @@ -24,6 +24,8 @@ public class TecTechUITextures { public static final UITexture BACKGROUND_GLOW_GREEN = UITexture.fullImage(MODID, "gui/background/green_glow"); public static final UITexture BACKGROUND_GLOW_RED = UITexture.fullImage(MODID, "gui/background/red_glow"); public static final UITexture BACKGROUND_GLOW_WHITE = UITexture.fullImage(MODID, "gui/background/white_glow"); + public static final UITexture BACKGROUND_GLOW_WHITE_HALF = UITexture + .fullImage(MODID, "gui/background/white_glow_half"); public static final UITexture BACKGROUND_GLOW_RAINBOW = UITexture.fullImage(MODID, "gui/background/rainbow_glow"); public static final UITexture BACKGROUND_SPACE = UITexture.fullImage(MODID, "gui/background/space"); @@ -89,6 +91,38 @@ public class TecTechUITextures { .fullImage(MODID, "gui/overlay_button/rainbow_spiral"); public static final UITexture OVERLAY_BUTTON_RAINBOW_SPIRAL_OFF = UITexture .fullImage(MODID, "gui/overlay_button/rainbow_spiral_off"); + public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION = UITexture + .fullImage(MODID, "gui/overlay_button/input_separation_on"); + public static final UITexture OVERLAY_BUTTON_INPUT_SEPARATION_OFF = UITexture + .fullImage(MODID, "gui/overlay_button/input_separation_off"); + public static final UITexture OVERLAY_BUTTON_BATCH_MODE = UITexture + .fullImage(MODID, "gui/overlay_button/batch_mode_on"); + public static final UITexture OVERLAY_BUTTON_BATCH_MODE_OFF = UITexture + .fullImage(MODID, "gui/overlay_button/batch_mode_off"); + public static final UITexture OVERLAY_BUTTON_LOAF_MODE = UITexture + .fullImage(MODID, "gui/overlay_button/loaf_mode_on"); + public static final UITexture OVERLAY_BUTTON_LOAF_MODE_OFF = UITexture + .fullImage(MODID, "gui/overlay_button/loaf_mode_off"); + public static final UITexture OVERLAY_BUTTON_RECIPE_LOCKED = UITexture + .fullImage(MODID, "gui/overlay_button/recipe_locked"); + public static final UITexture OVERLAY_BUTTON_RECIPE_UNLOCKED = UITexture + .fullImage(MODID, "gui/overlay_button/recipe_unlocked"); + public static final UITexture OVERLAY_BUTTON_VOIDING_OFF = UITexture + .fullImage(MODID, "gui/overlay_button/voiding_disabled"); + public static final UITexture OVERLAY_BUTTON_VOIDING_ITEMS = UITexture + .fullImage(MODID, "gui/overlay_button/voiding_items"); + public static final UITexture OVERLAY_BUTTON_VOIDING_FLUIDS = UITexture + .fullImage(MODID, "gui/overlay_button/voiding_fluids"); + public static final UITexture OVERLAY_BUTTON_VOIDING_BOTH = UITexture + .fullImage(MODID, "gui/overlay_button/voiding_both"); + public static final UITexture OVERLAY_BUTTON_STRUCTURE_CHECK = UITexture + .fullImage(MODID, "gui/overlay_button/structure_check_on"); + public static final UITexture OVERLAY_BUTTON_STRUCTURE_CHECK_OFF = UITexture + .fullImage(MODID, "gui/overlay_button/structure_check_off"); + public static final UITexture OVERLAY_BUTTON_FURNACE_MODE = UITexture + .fullImage(MODID, "gui/overlay_button/furnace_mode_on"); + public static final UITexture OVERLAY_BUTTON_FURNACE_MODE_OFF = UITexture + .fullImage(MODID, "gui/overlay_button/furnace_mode_off"); public static final UITexture OVERLAY_CYCLIC_BLUE = UITexture.fullImage(MODID, "gui/overlay_button/cyclic_blue"); public static final UITexture OVERLAY_EJECTION_LOCKED = UITexture .fullImage(MODID, "gui/overlay_button/eject_disabled"); @@ -145,6 +179,7 @@ public class TecTechUITextures { .collect(Collectors.toList()) .toArray(new UITexture[0]); public static final UITexture PICTURE_HEAT_SINK_SMALL = UITexture.fullImage(MODID, "gui/picture/heat_sink_small"); + public static final UITexture PICTURE_HEAT_SINK_16x8 = UITexture.fullImage(MODID, "gui/picture/heat_sink_16x8"); public static final UITexture PICTURE_PARAMETER_BLANK = UITexture.fullImage(MODID, "gui/picture/parameter_blank"); public static final UITexture[] PICTURE_PARAMETER_BLUE = IntStream.range(0, 20) .mapToObj(i -> UITexture.partly(MODID, "gui/picture/parameter_blue", 158, 4, i * 8, 0, i * 8 + 6, 4)) @@ -190,6 +225,7 @@ public class TecTechUITextures { public static final UITexture PICTURE_UPGRADE_CONNECTOR_RED_OPAQUE = UITexture .fullImage(MODID, "gui/picture/connector_red_opaque"); public static final UITexture SLOT_OUTLINE_GREEN = UITexture.fullImage(MODID, "gui/picture/green_selector"); + public static final UITexture UNSELECTED_OPTION = UITexture.fullImage(MODID, "gui/picture/unselected_option"); public static final UITexture PICTURE_GODFORGE_MILESTONE_CHARGE = UITexture .fullImage(MODID, "gui/picture/milestone_charge"); public static final UITexture PICTURE_GODFORGE_MILESTONE_CONVERSION = UITexture diff --git a/src/main/java/tectech/thing/item/FakeItemQGP.java b/src/main/java/tectech/thing/item/FakeItemQGP.java new file mode 100644 index 00000000000..a3d6929e0f3 --- /dev/null +++ b/src/main/java/tectech/thing/item/FakeItemQGP.java @@ -0,0 +1,34 @@ +package tectech.thing.item; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import tectech.Reference; +import tectech.thing.CustomItemList; + +public class FakeItemQGP extends Item { + + public static FakeItemQGP INSTANCE; + + private FakeItemQGP() { + setHasSubtypes(false); + setUnlocalizedName("tm.fakeItemQGP"); + setTextureName(Reference.MODID + ":fakeItemQGP"); + } + + public static void run() { + INSTANCE = new FakeItemQGP(); + GameRegistry.registerItem(INSTANCE, INSTANCE.getUnlocalizedName()); + CustomItemList.Godforge_FakeItemQGP.set(INSTANCE) + .hidden(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + itemIcon = iconRegister.registerIcon(getIconString()); + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsRingsStructureString.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsRingsStructureString.java similarity index 99% rename from src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsRingsStructureString.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsRingsStructureString.java index 56aabb28ec9..fcff5c7026f 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsRingsStructureString.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsRingsStructureString.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi; +package tectech.thing.metaTileEntity.multi.godforge; import static tectech.util.TTUtility.replaceLetters; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsStructureString.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsStructureString.java similarity index 99% rename from src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsStructureString.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsStructureString.java index 776689eee5f..1780be0079b 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsStructureString.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsStructureString.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi; +package tectech.thing.metaTileEntity.multi.godforge; import static tectech.util.TTUtility.appendStringArrays; import static tectech.util.TTUtility.replaceLetters; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java new file mode 100644 index 00000000000..a63ba81d7e3 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/ForgeOfGodsUI.java @@ -0,0 +1,549 @@ +package tectech.thing.metaTileEntity.multi.godforge; + +import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; +import static net.minecraft.util.StatCollector.translateToLocal; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.DoubleConsumer; +import java.util.function.DoubleSupplier; +import java.util.function.Supplier; + +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.drawable.Text; +import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.math.Alignment; +import com.gtnewhorizons.modularui.api.math.Size; +import com.gtnewhorizons.modularui.api.screen.ModularUIContext; +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.widget.IWidgetBuilder; +import com.gtnewhorizons.modularui.api.widget.Widget; +import com.gtnewhorizons.modularui.common.widget.ButtonWidget; +import com.gtnewhorizons.modularui.common.widget.DrawableWidget; +import com.gtnewhorizons.modularui.common.widget.DynamicTextWidget; +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; +import com.gtnewhorizons.modularui.common.widget.MultiChildWidget; +import com.gtnewhorizons.modularui.common.widget.Scrollable; +import com.gtnewhorizons.modularui.common.widget.SliderWidget; +import com.gtnewhorizons.modularui.common.widget.TextWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; + +import gregtech.api.enums.VoidingMode; +import gregtech.api.gui.modularui.GTUITextures; +import gregtech.api.interfaces.modularui.IControllerWithOptionalFeatures; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import tectech.TecTech; +import tectech.thing.gui.TecTechUITextures; +import tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor; + +/** + * Holds UI element builders and other conveniences shared between the primary Forge of the Gods and its modules. + */ +public class ForgeOfGodsUI { + + // ARGB representations of the 4 colors used in the color selector (red, green, blue, gold) + public static final int RED_ARGB = 0xFFFF5555; + public static final int GREEN_ARGB = 0xFF55FF55; + public static final int BLUE_ARGB = 0xFF0000AA; + public static final int GOLD_ARGB = 0xFFFFAA00; + + public static ButtonWidget createPowerSwitchButton(final IGregTechTileEntity tileEntity) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(tileEntity, "fx_click"); + if (tileEntity.isAllowedToWork()) { + tileEntity.disableWorking(); + } else { + tileEntity.enableWorking(); + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + if (tileEntity.isAllowedToWork()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED); + } + return ret.toArray(new IDrawable[0]); + }) + .setPos(174, 148) + .setSize(16, 16); + button.addTooltip("Power Switch") + .setTooltipShowUpDelay(TOOLTIP_DELAY); + return (ButtonWidget) button; + } + + public static ButtonWidget createInputSeparationButton(final IGregTechTileEntity tileEntity, + final IControllerWithOptionalFeatures mte, IWidgetBuilder builder) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(tileEntity, "fx_click"); + mte.setInputSeparation(!mte.isInputSeparationEnabled()); + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + if (mte.isInputSeparationEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_INPUT_SEPARATION); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_INPUT_SEPARATION_OFF); + } + return ret.toArray(new IDrawable[0]); + }) + .attachSyncer( + new FakeSyncWidget.BooleanSyncer(mte::isInputSeparationEnabled, mte::setInputSeparation), + builder) + .addTooltip(StatCollector.translateToLocal("GT5U.gui.button.input_separation")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(mte.getInputSeparationButtonPos()) + .setSize(16, 16); + return (ButtonWidget) button; + } + + public static ButtonWidget createBatchModeButton(final IGregTechTileEntity tileEntity, + final IControllerWithOptionalFeatures mte, IWidgetBuilder builder) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(tileEntity, "fx_click"); + mte.setBatchMode(!mte.isBatchModeEnabled()); + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + if (mte.isBatchModeEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_BATCH_MODE); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_BATCH_MODE_OFF); + } + return ret.toArray(new IDrawable[0]); + }) + .attachSyncer(new FakeSyncWidget.BooleanSyncer(mte::isBatchModeEnabled, mte::setBatchMode), builder) + .addTooltip(StatCollector.translateToLocal("GT5U.gui.button.batch_mode")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(mte.getBatchModeButtonPos()) + .setSize(16, 16); + return (ButtonWidget) button; + } + + public static ButtonWidget createLockToSingleRecipeButton(final IGregTechTileEntity tileEntity, + final IControllerWithOptionalFeatures mte, IWidgetBuilder builder) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(tileEntity, "fx_click"); + mte.setRecipeLocking(!mte.isRecipeLockingEnabled()); + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + if (mte.isRecipeLockingEnabled()) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_RECIPE_LOCKED); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_RECIPE_UNLOCKED); + } + return ret.toArray(new IDrawable[0]); + }) + .attachSyncer(new FakeSyncWidget.BooleanSyncer(mte::isRecipeLockingEnabled, mte::setRecipeLocking), builder) + .addTooltip(StatCollector.translateToLocal("GT5U.gui.button.lock_recipe")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(mte.getRecipeLockingButtonPos()) + .setSize(16, 16); + return (ButtonWidget) button; + } + + public static ButtonWidget createStructureUpdateButton(final IGregTechTileEntity tileEntity, + final IControllerWithOptionalFeatures mte, IWidgetBuilder builder) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(tileEntity, "fx_click"); + if (mte.getStructureUpdateTime() <= -20) { + mte.setStructureUpdateTime(1); + } + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + if (mte.getStructureUpdateTime() > -20) { + ret.add(TecTechUITextures.OVERLAY_BUTTON_STRUCTURE_CHECK); + } else { + ret.add(TecTechUITextures.OVERLAY_BUTTON_STRUCTURE_CHECK_OFF); + } + return ret.toArray(new IDrawable[0]); + }) + .attachSyncer( + new FakeSyncWidget.IntegerSyncer(mte::getStructureUpdateTime, mte::setStructureUpdateTime), + builder) + .addTooltip(StatCollector.translateToLocal("GT5U.gui.button.structure_update")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(mte.getStructureUpdateButtonPos()) + .setSize(16, 16); + return (ButtonWidget) button; + } + + public static ButtonWidget createVoidExcessButton(final IGregTechTileEntity tileEntity, + final IControllerWithOptionalFeatures mte, IWidgetBuilder builder) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(tileEntity, "fx_click"); + Set allowed = mte.getAllowedVoidingModes(); + switch (clickData.mouseButton) { + case 0 -> mte.setVoidingMode( + mte.getVoidingMode() + .nextInCollection(allowed)); + case 1 -> mte.setVoidingMode( + mte.getVoidingMode() + .previousInCollection(allowed)); + } + widget.notifyTooltipChange(); + }) + .setPlayClickSound(false) + .setBackground(() -> { + List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + switch (mte.getVoidingMode()) { + case VOID_NONE -> ret.add(TecTechUITextures.OVERLAY_BUTTON_VOIDING_OFF); + case VOID_ITEM -> ret.add(TecTechUITextures.OVERLAY_BUTTON_VOIDING_ITEMS); + case VOID_FLUID -> ret.add(TecTechUITextures.OVERLAY_BUTTON_VOIDING_FLUIDS); + case VOID_ALL -> ret.add(TecTechUITextures.OVERLAY_BUTTON_VOIDING_BOTH); + } + return ret.toArray(new IDrawable[0]); + }) + .attachSyncer( + new FakeSyncWidget.IntegerSyncer( + () -> mte.getVoidingMode() + .ordinal(), + val -> mte.setVoidingMode(VoidingMode.fromOrdinal(val))), + builder) + .dynamicTooltip( + () -> Arrays.asList( + StatCollector.translateToLocal("GT5U.gui.button.voiding_mode"), + StatCollector.translateToLocal( + mte.getVoidingMode() + .getTransKey()))) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(mte.getVoidingModeButtonPos()) + .setSize(16, 16); + return (ButtonWidget) button; + } + + public static ModularWindow createGeneralInfoWindow(Supplier inversionGetter, + Consumer inversionSetter) { + final Scrollable scrollable = new Scrollable().setVerticalScroll(); + final int WIDTH = 300; + final int HEIGHT = 300; + ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); + + builder.setDraggable(true); + scrollable.widget( + new TextWidget(EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.introduction")) + .setDefaultColor(EnumChatFormatting.DARK_PURPLE) + .setTextAlignment(Alignment.TopCenter) + .setPos(7, 13) + .setSize(280, 15)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.introductioninfotext")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 30) + .setSize(280, 50)) + .widget( + new TextWidget( + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.tableofcontents")) + .setDefaultColor(EnumChatFormatting.AQUA) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 80) + .setSize(150, 15)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(150)) + .setBackground( + new Text(EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.fuel")) + .alignment(Alignment.CenterLeft) + .color(0x55ffff)) + .setPos(7, 95) + .setSize(150, 15)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(434)) + .setBackground( + new Text( + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.modules")) + .alignment(Alignment.CenterLeft) + .color(0x55ffff)) + .setPos(7, 110) + .setSize(150, 15)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(1088)) + .setBackground( + new Text( + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.upgrades")) + .alignment(Alignment.CenterLeft) + .color(0x55ffff)) + .setPos(7, 125) + .setSize(150, 15)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(1412)) + .setBackground( + new Text( + EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.milestones")) + .alignment(Alignment.CenterLeft) + .color(0x55ffff)) + .setPos(7, 140) + .setSize(150, 15)) + .widget( + TextWidget.dynamicText(() -> inversionInfoText(inversionGetter.get())) + .setDefaultColor(EnumChatFormatting.WHITE) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 155) + .setSize(150, 15)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (inversionGetter.get()) { + scrollable.setVerticalScrollOffset(1766); + } + }) + .setPlayClickSound(inversionGetter.get()) + .setPos(7, 155) + .setSize(150, 15) + .attachSyncer(new FakeSyncWidget.BooleanSyncer(inversionGetter, inversionSetter), scrollable)) + .widget( + new TextWidget( + EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.fuel")) + .setDefaultColor(EnumChatFormatting.DARK_PURPLE) + .setTextAlignment(Alignment.TopCenter) + .setPos(127, 160) + .setSize(40, 15)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfotext")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 177) + .setSize(280, 250)) + .widget( + new TextWidget( + EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.modules")) + .setDefaultColor(EnumChatFormatting.DARK_PURPLE) + .setTextAlignment(Alignment.TopCenter) + .setPos(7, 440) + .setSize(280, 15)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.moduleinfotext")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 461) + .setSize(280, 620)) + .widget( + new TextWidget( + EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.upgrades")) + .setDefaultColor(EnumChatFormatting.DARK_PURPLE) + .setTextAlignment(Alignment.TopCenter) + .setPos(7, 1098) + .setSize(280, 15)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.upgradeinfotext")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 1115) + .setSize(280, 290)) + .widget( + new TextWidget( + EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.milestones")) + .setDefaultColor(EnumChatFormatting.DARK_PURPLE) + .setTextAlignment(Alignment.TopCenter) + .setPos(7, 1422) + .setSize(280, 15)) + .widget( + new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.milestoneinfotext")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 1439) + .setSize(280, 320)) + .widget( + TextWidget.dynamicText(() -> inversionHeaderText(inversionGetter.get())) + .setDefaultColor(EnumChatFormatting.WHITE) + .setTextAlignment(Alignment.TopCenter) + .setPos(7, 1776) + .setSize(280, 15)) + .widget( + TextWidget.dynamicText(() -> inversionInfoText(inversionGetter.get())) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(7, 1793) + .setSize(280, 160)) + .widget( + new TextWidget("").setPos(7, 1965) + .setSize(10, 10)); + + builder.widget( + new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_GLOW_WHITE) + .setPos(0, 0) + .setSize(300, 300)) + .widget( + scrollable.setSize(292, 292) + .setPos(4, 4)) + .widget( + ButtonWidget.closeWindowButton(true) + .setPos(284, 4)); + + return builder.build(); + } + + private static Text inversionHeaderText(boolean inversion) { + return inversion + ? new Text( + EnumChatFormatting.BOLD + "§k2" + + EnumChatFormatting.RESET + + EnumChatFormatting.WHITE + + EnumChatFormatting.BOLD + + translateToLocal("gt.blockmachines.multimachine.FOG.inversion") + + EnumChatFormatting.BOLD + + "§k2") + : new Text(""); + } + + private static Text inversionInfoText(boolean inversion) { + return inversion ? new Text(translateToLocal("gt.blockmachines.multimachine.FOG.inversioninfotext")) + : new Text(""); + } + + public static void reopenWindow(Widget widget, int windowId) { + if (!widget.isClient()) { + ModularUIContext ctx = widget.getContext(); + if (ctx.isWindowOpen(windowId)) { + ctx.closeWindow(windowId); + } + ctx.openSyncedWindow(windowId); + } + } + + public enum StarColorRGBM { + + RED(EnumChatFormatting.RED, RED_ARGB, 0, 255, ForgeOfGodsStarColor.DEFAULT_RED), + GREEN(EnumChatFormatting.GREEN, GREEN_ARGB, 0, 255, ForgeOfGodsStarColor.DEFAULT_GREEN), + BLUE(EnumChatFormatting.DARK_BLUE, BLUE_ARGB, 0, 255, ForgeOfGodsStarColor.DEFAULT_BLUE), + GAMMA(EnumChatFormatting.GOLD, GOLD_ARGB, 0, 100, ForgeOfGodsStarColor.DEFAULT_GAMMA); + + private final String title; + private final EnumChatFormatting mcColor; + private final int muiColor; + private final float lowerBound, upperBound; + private final float defaultValue; + + StarColorRGBM(EnumChatFormatting mcColor, int muiColor, float lower, float upper, float defaultVal) { + this.title = "fog.cosmetics.color." + name().toLowerCase(); + this.mcColor = mcColor; + this.muiColor = muiColor; + this.lowerBound = lower; + this.upperBound = upper; + this.defaultValue = defaultVal; + } + + public String tooltip(float value) { + if (this == GAMMA) { + return String.format("%s%s: %.1f", mcColor, translateToLocal(title), value); + } + return String.format("%s%s: %d", mcColor, translateToLocal(title), (int) value); + } + } + + public static Widget createStarColorRGBMGroup(StarColorRGBM color, DoubleConsumer setter, DoubleSupplier getter) { + MultiChildWidget widget = new MultiChildWidget(); + widget.setSize(184, 16); + + // Title + widget.addChild( + new TextWidget(translateToLocal(color.title)).setDefaultColor(color.mcColor) + .setTextAlignment(Alignment.CenterLeft) + .setPos(0, 0) + .setSize(32, 16)); + + // Color slider + widget.addChild(new SliderWidget().setSetter(val -> { + int aux = (int) (val * 10); + setter.accept(aux / 10d); + }) + .setGetter(() -> (float) getter.getAsDouble()) + .setBounds(color.lowerBound, color.upperBound) + .setHandleSize(new Size(4, 0)) + .dynamicTooltip(() -> { + List ret = new ArrayList<>(); + ret.add(color.tooltip((float) getter.getAsDouble())); + return ret; + }) + .setUpdateTooltipEveryTick(true) + .setSize(118, 8) + .setPos(32, 4)); + + // Color manual text box + Widget numberEntry = new NumericWidget().setSetter(setter) + .setGetter(getter) + .setBounds(color.lowerBound, color.upperBound) + .setDefaultValue(color.defaultValue) + .setTextAlignment(Alignment.Center) + .setTextColor(color.muiColor) + .setSize(32, 16) + .setPos(152, 0) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD); + + if (color == StarColorRGBM.GAMMA) { + numberEntry.addTooltip(translateToLocal("fog.cosmetics.onlydecimals")); + ((NumericWidget) numberEntry).setIntegerOnly(false); + } else { + numberEntry.addTooltip(translateToLocal("fog.cosmetics.onlyintegers")); + } + + return widget.addChild(numberEntry); + } + + public static Widget createStarColorButton(String text, String tooltip, + BiConsumer onClick) { + MultiChildWidget widget = new MultiChildWidget(); + widget.setSize(35, 15); + + widget.addChild( + new ButtonWidget().setOnClick(onClick) + .setSize(35, 15) + .setBackground(GTUITextures.BUTTON_STANDARD) + .addTooltip(translateToLocal(tooltip)) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(0, 0)); + + widget.addChild( + TextWidget.localised(text) + .setTextAlignment(Alignment.Center) + .setPos(0, 0) + .setSize(35, 15)); + + return widget; + } + + public static Widget createStarColorButton(Supplier text, Supplier tooltip, + BiConsumer onClick) { + MultiChildWidget widget = new MultiChildWidget(); + widget.setSize(35, 15); + + widget.addChild( + new ButtonWidget().setOnClick(onClick) + .setSize(35, 15) + .setBackground(GTUITextures.BUTTON_STANDARD) + .dynamicTooltip(() -> { + List ret = new ArrayList<>(); + ret.add(translateToLocal(tooltip.get())); + return ret; + }) + .setUpdateTooltipEveryTick(true) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(0, 0)); + + widget.addChild( + new DynamicTextWidget(() -> new Text(translateToLocal(text.get()))).setTextAlignment(Alignment.Center) + .setPos(0, 0) + .setSize(35, 15)); + + return widget; + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEBaseModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java similarity index 84% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEBaseModule.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java index eb89e8bf6c9..8b432d2ce86 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEBaseModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEBaseModule.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge_modules; +package tectech.thing.metaTileEntity.multi.godforge; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; @@ -54,8 +54,8 @@ import gregtech.api.recipe.RecipeMaps; import gregtech.api.render.TextureFactory; import gregtech.api.util.GTStructureUtility; +import tectech.TecTech; import tectech.thing.gui.TecTechUITextures; -import tectech.thing.metaTileEntity.multi.MTEForgeOfGods; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; public class MTEBaseModule extends TTMultiblockBase { @@ -295,66 +295,73 @@ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget( - new DrawableWidget().setDrawable(GTUITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(190, 85)); - final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1); - builder.widget( - inventorySlot.setPos(173, 167) - .setBackground(GTUITextures.SLOT_DARK_GRAY)); - final DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); + final SlotWidget inventorySlot = new SlotWidget(inventoryHandler, 1); drawTexts(screenElements, inventorySlot); - builder.widget( - new Scrollable().setVerticalScroll() - .widget(screenElements.setPos(10, 0)) - .setPos(0, 7) - .setSize(190, 79)); buildContext.addSyncedWindow(VOLTAGE_WINDOW_ID, this::createVoltageWindow); + buildContext.addSyncedWindow(GENERAL_INFO_WINDOW_ID, this::createGeneralInfoWindow); builder.widget( - TextWidget.dynamicText(this::connectionStatus) - .setDefaultColor(EnumChatFormatting.BLACK) - .setPos(75, 94) - .setSize(100, 10)); - - builder.widget( - new ButtonWidget().setOnClick( - (data, widget) -> { - if (!widget.isClient()) widget.getContext() - .openSyncedWindow(GENERAL_INFO_WINDOW_ID); - }) - .setSize(18, 18) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.clickhere")) + new DrawableWidget().setSize(18, 18) .setPos(172, 67) + .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.clickhere")) .setTooltipShowUpDelay(TOOLTIP_DELAY)); - buildContext.addSyncedWindow(GENERAL_INFO_WINDOW_ID, this::createGeneralInfoWindow); - - builder.widget(createPowerSwitchButton(builder)) - .widget(createVoidExcessButton(builder)) - .widget(createInputSeparationButton(builder)) - .widget(createBatchModeButton(builder)) - .widget(createLockToSingleRecipeButton(builder)) + builder.widget( + new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(4, 4) + .setSize(190, 85)) + .widget( + inventorySlot.setPos(173, 167) + .setBackground(getGUITextureSet().getItemSlot(), TecTechUITextures.OVERLAY_SLOT_MESH)) + .widget( + new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_HEAT_SINK_SMALL) + .setPos(173, 185) + .setSize(18, 6)) + .widget( + new Scrollable().setVerticalScroll() + .widget(screenElements.setPos(10, 0)) + .setPos(0, 7) + .setSize(190, 79)) + .widget( + TextWidget.dynamicText(this::connectionStatus) + .setDefaultColor(EnumChatFormatting.BLACK) + .setPos(75, 94) + .setSize(100, 10)) + .widget( + new ButtonWidget().setOnClick( + (data, widget) -> { + if (!widget.isClient()) widget.getContext() + .openSyncedWindow(GENERAL_INFO_WINDOW_ID); + }) + .setSize(18, 18) + .setPos(172, 67) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) + .widget(createPowerSwitchButton(builder)) .widget(createVoltageButton(builder)) .widget(createStructureUpdateButton(builder)); + + if (supportsVoidProtection()) builder.widget(createVoidExcessButton(builder)); + if (supportsInputSeparation()) builder.widget(createInputSeparationButton(builder)); + if (supportsBatchMode()) builder.widget(createBatchModeButton(builder)); + if (supportsSingleRecipeLocking()) builder.widget(createLockToSingleRecipeButton(builder)); } protected Widget createVoltageButton(IWidgetBuilder builder) { Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { if (isVoltageConfigUnlocked) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); if (!widget.isClient()) { widget.getContext() .openSyncedWindow(VOLTAGE_WINDOW_ID); } } }) - .setPlayClickSound(isVoltageConfigUnlocked) + .setPlayClickSound(false) .setBackground(() -> { List ret = new ArrayList<>(); - ret.add(GTUITextures.BUTTON_STANDARD); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); if (isVoltageConfigUnlocked) { ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_PASS_ON); } else { @@ -412,7 +419,37 @@ protected ModularWindow createVoltageWindow(final EntityPlayer player) { } protected ModularWindow createGeneralInfoWindow(final EntityPlayer player) { - return MTEForgeOfGods.createGeneralInfoWindow(() -> isInversionUnlocked, val -> isInversionUnlocked = val); + return ForgeOfGodsUI.createGeneralInfoWindow(() -> isInversionUnlocked, val -> isInversionUnlocked = val); + } + + @Override + public ButtonWidget createPowerSwitchButton(IWidgetBuilder builder) { + return ForgeOfGodsUI.createPowerSwitchButton(getBaseMetaTileEntity()); + } + + @Override + public ButtonWidget createInputSeparationButton(IWidgetBuilder builder) { + return ForgeOfGodsUI.createInputSeparationButton(getBaseMetaTileEntity(), this, builder); + } + + @Override + public ButtonWidget createBatchModeButton(IWidgetBuilder builder) { + return ForgeOfGodsUI.createBatchModeButton(getBaseMetaTileEntity(), this, builder); + } + + @Override + public ButtonWidget createLockToSingleRecipeButton(IWidgetBuilder builder) { + return ForgeOfGodsUI.createLockToSingleRecipeButton(getBaseMetaTileEntity(), this, builder); + } + + @Override + public ButtonWidget createStructureUpdateButton(IWidgetBuilder builder) { + return ForgeOfGodsUI.createStructureUpdateButton(getBaseMetaTileEntity(), this, builder); + } + + @Override + public ButtonWidget createVoidExcessButton(IWidgetBuilder builder) { + return ForgeOfGodsUI.createVoidExcessButton(getBaseMetaTileEntity(), this, builder); } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java similarity index 83% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java index dcf4389e2eb..d30f9402d91 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEExoticModule.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge_modules; +package tectech.thing.metaTileEntity.multi.godforge; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GTRecipeBuilder.INGOTS; @@ -17,9 +17,7 @@ import java.math.BigInteger; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.stream.Stream; @@ -34,13 +32,14 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.ArrayUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import com.google.common.collect.ImmutableList; import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.drawable.IDrawable; -import com.gtnewhorizons.modularui.api.drawable.UITexture; +import com.gtnewhorizons.modularui.api.drawable.ItemDrawable; import com.gtnewhorizons.modularui.api.fluids.FluidTanksHandler; import com.gtnewhorizons.modularui.api.fluids.IFluidTanksHandler; import com.gtnewhorizons.modularui.api.math.Alignment; @@ -57,21 +56,24 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget; import gregtech.api.enums.MaterialsUEVplus; +import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TierEU; import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; import gregtech.api.recipe.RecipeMap; -import gregtech.api.recipe.RecipeMapBackend; -import gregtech.api.recipe.RecipeMapBuilder; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.recipe.check.SimpleCheckRecipeResult; +import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipe; +import gregtech.api.util.GTStreamUtil; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; +import tectech.TecTech; import tectech.recipe.TecTechRecipeMaps; +import tectech.thing.CustomItemList; import tectech.thing.gui.TecTechUITextures; import tectech.util.GodforgeMath; @@ -87,13 +89,8 @@ public class MTEExoticModule extends MTEBaseModule { private boolean magmatterMode = false; private FluidStack[] randomizedFluidInput = new FluidStack[] {}; private ItemStack[] randomizedItemInput = new ItemStack[] {}; - List inputPlasmas = new ArrayList<>(); private GTRecipe plasmaRecipe = null; private BigInteger powerForRecipe = BigInteger.ZERO; - private static final RecipeMap tempRecipeMap = RecipeMapBuilder.of("godforgeExoticTempRecipeMap") - .maxIO(0, 0, 7, 2) - .disableRegisterNEI() - .build(); private static final int NUMBER_OF_INPUTS = 7; private static final int INPUT_LIST_WINDOW_ID = 11; @@ -118,17 +115,13 @@ protected ProcessingLogic createProcessingLogic() { @Override protected Stream findRecipeMatches(@Nullable RecipeMap map) { if (!recipeInProgress) { - if (magmatterMode) { plasmaRecipe = generateMagmatterRecipe(); } else { plasmaRecipe = generateQuarkGluonRecipe(); } - - tempRecipeMap.add(plasmaRecipe); } - return tempRecipeMap.getAllRecipes() - .parallelStream(); + return GTStreamUtil.ofNullable(plasmaRecipe); } @NotNull @@ -138,8 +131,7 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { powerForRecipe = BigInteger.valueOf(getProcessingVoltage()) .multiply(BigInteger.valueOf(recipe.mDuration * actualParallel)); if (getUserEU(userUUID).compareTo(powerForRecipe) < 0) { - tempRecipeMap.getBackend() - .clearRecipes(); + plasmaRecipe = null; return CheckRecipeResultRegistry.insufficientStartupPower(powerForRecipe); } @@ -161,10 +153,13 @@ protected CheckRecipeResult validateRecipe(@Nonnull GTRecipe recipe) { recipeInProgress = true; recipeRegenerated = false; } - if (new HashSet<>(Arrays.asList(inputFluids)).containsAll(inputPlasmas)) { - return CheckRecipeResultRegistry.SUCCESSFUL; + + for (FluidStack stack : recipe.mFluidInputs) { + if (!ArrayUtils.contains(inputFluids, stack)) { + return SimpleCheckRecipeResult.ofFailure("waiting_for_inputs"); + } } - return SimpleCheckRecipeResult.ofFailure("waiting_for_inputs"); + return CheckRecipeResultRegistry.SUCCESSFUL; } @NotNull @@ -181,8 +176,7 @@ protected CheckRecipeResult onRecipeStart(@Nonnull GTRecipe recipe) { addToPowerTally(powerForRecipe); addToRecipeTally(calculatedParallels); setCalculatedEut(0); - tempRecipeMap.getBackend() - .clearRecipes(); + plasmaRecipe = null; recipeInProgress = false; return CheckRecipeResultRegistry.SUCCESSFUL; } @@ -213,8 +207,6 @@ public RecipeMap getRecipeMap() { private GTRecipe generateQuarkGluonRecipe() { actualParallel = getMaxParallel(); - tempRecipeMap.getBackend() - .clearRecipes(); numberOfFluids = GodforgeMath.getRandomIntInRange(0, NUMBER_OF_INPUTS); numberOfItems = NUMBER_OF_INPUTS - numberOfFluids; randomizedFluidInput = getRandomFluidInputs(exoticModulePlasmaFluidMap, numberOfFluids); @@ -232,16 +224,14 @@ private GTRecipe generateQuarkGluonRecipe() { } } - inputPlasmas = new ArrayList<>(Arrays.asList(convertItemToPlasma(randomizedItemInput, 1))); - inputPlasmas.addAll(Arrays.asList(convertFluidToPlasma(randomizedFluidInput, 1))); - return new GTRecipe( false, null, null, null, null, - inputPlasmas.toArray(new FluidStack[0]), + ArrayUtils + .addAll(convertItemToPlasma(randomizedItemInput, 1), convertFluidToPlasma(randomizedFluidInput, 1)), new FluidStack[] { MaterialsUEVplus.QuarkGluonPlasma.getFluid(1000 * actualParallel) }, 10 * SECONDS, (int) TierEU.RECIPE_MAX, @@ -250,8 +240,6 @@ private GTRecipe generateQuarkGluonRecipe() { private GTRecipe generateMagmatterRecipe() { actualParallel = getMaxParallel(); - tempRecipeMap.getBackend() - .clearRecipes(); randomizedItemInput = getRandomItemInputs(exoticModuleMagmatterItemMap, 1); numberOfItems = 1; numberOfFluids = 2; @@ -259,10 +247,6 @@ private GTRecipe generateMagmatterRecipe() { int spaceAmount = GodforgeMath.getRandomIntInRange(51, 100); randomizedFluidInput = new FluidStack[] { MaterialsUEVplus.Time.getMolten(timeAmount * 1000L), MaterialsUEVplus.Space.getMolten(spaceAmount * 1000L) }; - inputPlasmas = new ArrayList<>( - Arrays.asList(convertItemToPlasma(randomizedItemInput, spaceAmount - timeAmount))); - inputPlasmas.add(MaterialsUEVplus.Time.getMolten(timeAmount)); - inputPlasmas.add(MaterialsUEVplus.Space.getMolten(spaceAmount)); return new GTRecipe( false, @@ -270,7 +254,10 @@ private GTRecipe generateMagmatterRecipe() { null, null, null, - inputPlasmas.toArray(new FluidStack[0]), + ArrayUtils.addAll( + convertItemToPlasma(randomizedItemInput, spaceAmount - timeAmount), + MaterialsUEVplus.Time.getMolten(timeAmount), + MaterialsUEVplus.Space.getMolten(spaceAmount)), new FluidStack[] { MaterialsUEVplus.MagMatter.getMolten(576 * actualParallel) }, 10 * SECONDS, (int) TierEU.RECIPE_MAX, @@ -394,17 +381,22 @@ public void saveNBTData(NBTTagCompound NBT) { // Store damage values/stack sizes of input plasmas NBTTagCompound fluidStackListNBTTag = new NBTTagCompound(); - fluidStackListNBTTag.setLong("numberOfPlasmas", inputPlasmas.size()); - int indexFluids = 0; - for (FluidStack fluidStack : inputPlasmas) { - // Save fluid amount to NBT - fluidStackListNBTTag.setLong(indexFluids + "fluidAmount", fluidStack.amount); + if (plasmaRecipe != null) { + fluidStackListNBTTag.setLong("numberOfPlasmas", plasmaRecipe.mFluidInputs.length); - // Save FluidStack to NBT - NBT.setTag(indexFluids + "fluidStack", fluidStack.writeToNBT(new NBTTagCompound())); + int index = 0; + for (FluidStack stack : plasmaRecipe.mFluidInputs) { + // Save fluid amount to NBT + fluidStackListNBTTag.setLong(index + "fluidAmount", stack.amount); - indexFluids++; + // Save FluidStack to NBT + NBT.setTag(index + "fluidStack", stack.writeToNBT(new NBTTagCompound())); + + index++; + } + } else { + fluidStackListNBTTag.setLong("numberOfPlasmas", 0); } NBT.setTag("inputPlasmas", fluidStackListNBTTag); @@ -421,35 +413,39 @@ public void loadNBTData(final NBTTagCompound NBT) { // Load damage values/fluid amounts of input plasmas and convert back to fluids NBTTagCompound tempFluidTag = NBT.getCompoundTag("inputPlasmas"); - // Iterate over all stored fluids - for (int indexFluids = 0; indexFluids < tempFluidTag.getLong("numberOfPlasmas"); indexFluids++) { + long numberOfPlasmas = tempFluidTag.getLong("numberOfPlasmas"); + if (numberOfPlasmas > 0) { - // Load fluid amount from NBT - int fluidAmount = tempFluidTag.getInteger(indexFluids + "fluidAmount"); + FluidStack[] stacks = new FluidStack[(int) numberOfPlasmas]; + for (int i = 0; i < numberOfPlasmas; i++) { + // Load fluid amount from NBT + int amount = tempFluidTag.getInteger(i + "fluidAmount"); - // Load FluidStack from NBT - FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(NBT.getCompoundTag(indexFluids + "fluidStack")); + // Load FluidStack from NBT + FluidStack stack = FluidStack.loadFluidStackFromNBT(NBT.getCompoundTag(i + "fluidStack")); - inputPlasmas.add(new FluidStack(fluidStack, fluidAmount)); - } - FluidStack outputFluid = MaterialsUEVplus.QuarkGluonPlasma.getFluid(1000L * actualParallel); + stacks[i] = new FluidStack(stack, amount); + } - if (magmatterMode) { - outputFluid = MaterialsUEVplus.MagMatter.getMolten(576L * actualParallel); - } + FluidStack outputFluid; + if (magmatterMode) { + outputFluid = MaterialsUEVplus.MagMatter.getMolten(576L * actualParallel); + } else { + outputFluid = MaterialsUEVplus.QuarkGluonPlasma.getFluid(1000L * actualParallel); + } - tempRecipeMap.add( - new GTRecipe( + plasmaRecipe = new GTRecipe( false, null, null, null, null, - inputPlasmas.toArray(new FluidStack[0]), + stacks, new FluidStack[] { outputFluid }, 10 * SECONDS, (int) TierEU.RECIPE_MAX, - 0)); + 0); + } super.loadNBTData(NBT); } @@ -469,7 +465,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont .setTooltipShowUpDelay(TOOLTIP_DELAY)); super.addUIWidgets(builder, buildContext); buildContext.addSyncedWindow(INPUT_LIST_WINDOW_ID, this::createInputListWindow); - builder.widget(magmatterSwitch(builder)); + builder.widget(createMagmatterSwitch(builder)); builder.widget(createExpectedInputsButton()); builder.widget( new DrawableWidget().setDrawable(ModularUITextures.ICON_INFO) @@ -496,8 +492,8 @@ protected ModularWindow createInputListWindow(final EntityPlayer player) { IFluidTanksHandler tanksHandler = new FluidTanksHandler(7, 128000); for (int i = 0; i < 7; i++) { - if (i < inputPlasmas.size()) { - FluidStack plasma = inputPlasmas.get(i); + if (plasmaRecipe != null && i < plasmaRecipe.mFluidInputs.length) { + FluidStack plasma = plasmaRecipe.mFluidInputs[i]; tanksHandler.setFluidInTank(i, plasma.getFluid(), plasma.amount); } builder.widget( @@ -530,19 +526,15 @@ protected ModularWindow createInputListWindow(final EntityPlayer player) { plasmaRecipe = generateQuarkGluonRecipe(); } recipeRegenerated = true; - tempRecipeMap.add(plasmaRecipe); for (int i = 0; i < 7; i++) { - if (i < inputPlasmas.size()) { - FluidStack plasma = inputPlasmas.get(i); + if (i < plasmaRecipe.mFluidInputs.length) { + FluidStack plasma = plasmaRecipe.mFluidInputs[i]; tanksHandler.setFluidInTank(i, plasma.getFluid(), plasma.amount); } } ticker = 0; - widget.getContext() - .closeWindow(INPUT_LIST_WINDOW_ID); - widget.getContext() - .openSyncedWindow(INPUT_LIST_WINDOW_ID); + ForgeOfGodsUI.reopenWindow(widget, INPUT_LIST_WINDOW_ID); } }) .setPlayClickSound(true) @@ -571,46 +563,43 @@ private Widget createExpectedInputsButton() { .setPos(8, 69); } - protected ButtonWidget magmatterSwitch(IWidgetBuilder builder) { + protected ButtonWidget createMagmatterSwitch(IWidgetBuilder builder) { Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { if (isMagmatterCapable) { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); magmatterMode = !magmatterMode; + widget.notifyTooltipChange(); } }) - .setPlayClickSound(isMagmatterCapable) - .setBackground(() -> { - List ret = new ArrayList<>(); - if (isMagmatterModeOn()) { - ret.add(GTUITextures.BUTTON_STANDARD_PRESSED); - if (isMagmatterCapable) { - ret.add(GTUITextures.OVERLAY_BUTTON_CHECKMARK); - } else { - ret.add(GTUITextures.OVERLAY_BUTTON_DISABLE); - } - } else { - ret.add(GTUITextures.BUTTON_STANDARD); - if (isMagmatterCapable) { - ret.add(GTUITextures.OVERLAY_BUTTON_CROSS); - } else { - ret.add(GTUITextures.OVERLAY_BUTTON_DISABLE); - } + .setPlayClickSound(false) + .setBackground( + () -> new IDrawable[] { TecTechUITextures.BUTTON_CELESTIAL_32x32, + new ItemDrawable( + isMagmatterCapable && isMagmatterModeOn() + ? GTOreDictUnificator.get(OrePrefixes.dust, MaterialsUEVplus.MagMatter, 1) + : CustomItemList.Godforge_FakeItemQGP.get(1)) + + }) + .attachSyncer(new FakeSyncWidget.BooleanSyncer(this::isMagmatterModeOn, this::setMagmatterMode), builder) + .dynamicTooltip(() -> { + List ret = new ArrayList<>(); + if (!isMagmatterModeOn()) { + ret.add(translateToLocal("fog.button.magmattermode.tooltip.01")); + } + if (isMagmatterCapable && isMagmatterModeOn()) { + ret.add(translateToLocal("fog.button.magmattermode.tooltip.02")); } if (!isMagmatterCapable) { - ret.add(GTUITextures.OVERLAY_BUTTON_DISABLE); + ret.add(EnumChatFormatting.GRAY + translateToLocal("fog.button.magmattermode.tooltip.03")); } - return ret.toArray(new IDrawable[0]); + return ret; }) - .attachSyncer(new FakeSyncWidget.BooleanSyncer(this::isMagmatterModeOn, this::setMagmatterMode), builder) - .addTooltip(translateToLocal("fog.button.magmattermode.tooltip.01")) .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(174, 91) .setSize(16, 16) + .setPos(174, 91) .attachSyncer( new FakeSyncWidget.BooleanSyncer(() -> isMagmatterCapable, this::setMagmatterCapable), builder); - if (!isMagmatterCapable) { - button.addTooltip(EnumChatFormatting.GRAY + translateToLocal("fog.button.magmattermode.tooltip.02")); - } return (ButtonWidget) button; } @@ -634,6 +623,15 @@ private void setMagmatterMode(boolean enabled) { magmatterMode = enabled; } + @Override + public void setMagmatterCapable(boolean isCapable) { + if (!isCapable && isMagmatterCapable) { + // only set when it previously was capable + setMagmatterMode(false); + } + super.setMagmatterCapable(isCapable); + } + @Override protected boolean filtersFluid() { return false; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java similarity index 81% rename from src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java index 5824b99beda..c7d52215c99 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEForgeOfGods.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi; +package tectech.thing.metaTileEntity.multi.godforge; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.enums.Mods.Avaritia; @@ -27,14 +27,19 @@ import static tectech.util.GodforgeMath.setMiscModuleParameters; import static tectech.util.TTUtility.toExponentForm; +import java.awt.Desktop; +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; +import java.util.function.Function; + +import javax.annotation.Nullable; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -76,6 +81,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedRow; +import com.gtnewhorizons.modularui.common.widget.DynamicTextWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.FluidNameHolderWidget; import com.gtnewhorizons.modularui.common.widget.MultiChildWidget; @@ -85,11 +91,14 @@ import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; +import com.gtnewhorizons.modularui.common.widget.textfield.TextFieldWidget; +import blockrenderer6343.client.world.ClientFakePlayer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; import gregtech.api.enums.MaterialsUEVplus; +import gregtech.api.enums.Mods; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; @@ -113,11 +122,10 @@ import tectech.thing.block.TileEntityForgeOfGods; import tectech.thing.gui.TecTechUITextures; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEBaseModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEExoticModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEMoltenModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEPlasmaModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTESmeltingModule; +import tectech.thing.metaTileEntity.multi.godforge.ForgeOfGodsUI.StarColorRGBM; +import tectech.thing.metaTileEntity.multi.godforge.color.ForgeOfGodsStarColor; +import tectech.thing.metaTileEntity.multi.godforge.color.StarColorSetting; +import tectech.thing.metaTileEntity.multi.godforge.color.StarColorStorage; public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, ISurvivalConstructable { @@ -132,12 +140,6 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private int ringAmount = 1; private int stellarFuelAmount = 0; private int neededStartupFuel = 0; - private int rendererColorRed = 179; - private int rendererColorGreen = 204; - private int rendererColorBlue = 255; - private int rotationSpeed = 5; - private int starSize = 20; - private int rainbowCycleSpeed = 1; private long fuelConsumption = 0; private long totalRecipesProcessed = 0; private long totalFuelConsumed = 0; @@ -150,7 +152,6 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private float invertedRecipeMilestonePercentage = 0; private float invertedFuelMilestonePercentage = 0; private float invertedStructureMilestonePercentage = 0; - private float rendererGamma = 3f; private BigInteger totalPowerConsumed = BigInteger.ZERO; private boolean batteryCharging = false; private boolean inversion = false; @@ -158,11 +159,24 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private FormattingMode formattingMode = FormattingMode.NONE; private boolean isRenderActive = false; private boolean secretUpgrade = false; - private boolean rainbowMode = false; private final ItemStack[] storedUpgradeWindowItems = new ItemStack[16]; public ArrayList moduleHatches = new ArrayList<>(); protected ItemStackHandler inputSlotHandler = new ItemStackHandler(16); + // Star cosmetics fields + // actual star cosmetics + private final StarColorStorage starColors = new StarColorStorage(); + private String selectedStarColor = ForgeOfGodsStarColor.DEFAULT.getName(); + private int rotationSpeed = 5; + private int starSize = 20; + // editing star color + private ForgeOfGodsStarColor newStarColor = starColors.newTemplateColor(); + private int starColorR, starColorG, starColorB; + private float starGamma; + private int editingStarIndex; // editing a full color preset + private int editingColorIndex; // editing a single color in a preset + private ForgeOfGodsStarColor importedStarColor; + private static final int FUEL_CONFIG_WINDOW_ID = 9; private static final int UPGRADE_TREE_WINDOW_ID = 10; private static final int INDIVIDUAL_UPGRADE_WINDOW_ID = 11; @@ -172,7 +186,9 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private static final int MANUAL_INSERTION_WINDOW_ID = 15; private static final int GENERAL_INFO_WINDOW_ID = 16; private static final int SPECIAL_THANKS_WINDOW_ID = 17; - private static final int STAR_COLOR_CONFIG_WINDOW_ID = 18; + private static final int STAR_COSMETICS_WINDOW_ID = 18; + private static final int STAR_CUSTOM_COLOR_WINDOW_ID = 19; + private static final int STAR_CUSTOM_COLOR_IMPORT_WINDOW_ID = 20; private static final int TEXTURE_INDEX = 960; private static final int[] FIRST_SPLIT_UPGRADES = new int[] { 12, 13, 14 }; private static final Integer[] UPGRADE_MATERIAL_ID_CONVERSION = { 0, 5, 7, 11, 26, 29, 30 }; @@ -197,15 +213,44 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private static final String SCANNER_INFO_BAR = EnumChatFormatting.BLUE.toString() + EnumChatFormatting.STRIKETHROUGH + "--------------------------------------------"; private static final ItemStack STELLAR_FUEL = Avaritia.isModLoaded() ? getModItem(Avaritia.ID, "Resource", 1, 8) - : GTOreDictUnificator.get(OrePrefixes.block, Materials.CosmicNeutronium, 1); + : GTOreDictUnificator.get(OrePrefixes.block, Materials.Neutronium, 1); public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { // 1000 blocks max per placement. int realBudget = elementBudget >= 1000 ? elementBudget : Math.min(1000, elementBudget * 5); + int built = 0; + + if (Mods.BlockRenderer6343.isModLoaded() && env.getActor() instanceof ClientFakePlayer) { + built = survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 63, 14, 1, elementBudget, env, false, true); + if (stackSize.stackSize > 1) { + built += survivialBuildPiece( + STRUCTURE_PIECE_SECOND_RING, + stackSize, + 55, + 11, + -67, + realBudget, + env, + false, + true); + } + if (stackSize.stackSize > 2) { + built += survivialBuildPiece( + STRUCTURE_PIECE_THIRD_RING, + stackSize, + 47, + 13, + -76, + realBudget, + env, + false, + true); + } + return built; + } survivialBuildPiece(STRUCTURE_PIECE_SHAFT, stackSize, 63, 14, 1, realBudget, env, false, true); - int built = 0; if (stackSize.stackSize > 0 && ringAmount < 1) { built += survivialBuildPiece( STRUCTURE_PIECE_FIRST_RING, @@ -393,7 +438,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac if (checkPiece(STRUCTURE_PIECE_SECOND_RING, 55, 11, -67)) { ringAmount = 2; destroySecondRing(); - UpdateRenderer(); + updateRenderer(); } if (isRenderActive && ringAmount >= 2 && !checkPiece(STRUCTURE_PIECE_SECOND_RING_AIR, 55, 11, -67)) { destroyRenderer(); @@ -404,7 +449,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac } if (ringAmount >= 2) { ringAmount = 1; - UpdateRenderer(); + updateRenderer(); buildSecondRing(); } } @@ -413,7 +458,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac if (checkPiece(STRUCTURE_PIECE_THIRD_RING, 47, 13, -76)) { ringAmount = 3; destroyThirdRing(); - UpdateRenderer(); + updateRenderer(); } if (isRenderActive && ringAmount == 3 && !checkPiece(STRUCTURE_PIECE_THIRD_RING_AIR, 47, 13, -76)) { destroyRenderer(); @@ -421,7 +466,7 @@ public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStac } else { if (ringAmount == 3) { ringAmount = 2; - UpdateRenderer(); + updateRenderer(); buildThirdRing(); } } @@ -448,14 +493,21 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (upgrades[29]) { maxModuleCount += 4; } + + boolean isFinalUpgradeUnlocked = upgrades[30]; + if (!mInputBusses.isEmpty()) { - if (internalBattery == 0) { + if (internalBattery == 0 || isFinalUpgradeUnlocked) { MTEHatchInputBus inputBus = mInputBusses.get(0); ItemStack[] inputBusInventory = inputBus.getRealInventory(); + ItemStack itemToAbsorb = STELLAR_FUEL; + if (isFinalUpgradeUnlocked && internalBattery != 0) { + itemToAbsorb = GTOreDictUnificator.get(OrePrefixes.gem, MaterialsUEVplus.GravitonShard, 1); + } if (inputBusInventory != null) { for (int i = 0; i < inputBusInventory.length; i++) { ItemStack itemStack = inputBusInventory[i]; - if (itemStack != null && itemStack.isItemEqual(STELLAR_FUEL)) { + if (itemStack != null && itemStack.isItemEqual(itemToAbsorb)) { int stacksize = itemStack.stackSize; if (inputBus instanceof MTEHatchInputBusME meBus) { ItemStack realItem = meBus.getRealInventory()[i + 16]; @@ -465,22 +517,30 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { stacksize = realItem.stackSize; } inputBus.decrStackSize(i, stacksize); - stellarFuelAmount += stacksize; + if (internalBattery == 0) { + stellarFuelAmount += stacksize; + } else { + gravitonShardsAvailable += stacksize; + } inputBus.updateSlots(); } } } - neededStartupFuel = calculateStartupFuelConsumption(this); - if (stellarFuelAmount >= neededStartupFuel) { - stellarFuelAmount -= neededStartupFuel; - increaseBattery(neededStartupFuel); - createRenderer(); + if (internalBattery == 0) { + neededStartupFuel = calculateStartupFuelConsumption(this); + if (stellarFuelAmount >= neededStartupFuel) { + stellarFuelAmount -= neededStartupFuel; + increaseBattery(neededStartupFuel); + createRenderer(); + } } - } else { - drainFuel(); } } + if (internalBattery != 0) { + drainFuel(); + } + determineCompositionMilestoneLevel(); checkInversionStatus(); determineMilestoneProgress(); @@ -611,15 +671,14 @@ private TileEntityForgeOfGods getRenderer() { return null; } - private void UpdateRenderer() { + private void updateRenderer() { TileEntityForgeOfGods tile = getRenderer(); if (tile == null) return; tile.setRingCount(ringAmount); tile.setStarRadius(starSize); tile.setRotationSpeed(rotationSpeed); - tile.setColor(rendererColorRed / 255f, rendererColorGreen / 255f, rendererColorBlue / 255f, rendererGamma); - tile.setRainbowMode(rainbowMode, rainbowCycleSpeed); + tile.setColor(starColors.getByName(selectedStarColor)); tile.updateToClient(); } @@ -662,7 +721,7 @@ private void createRenderer() { } rendererTileEntity.setRenderRotation(getRotation(), getDirection()); - UpdateRenderer(); + updateRenderer(); isRenderActive = true; } @@ -769,17 +828,6 @@ public void onRemoval() { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - if (doesBindPlayerInventory()) { - builder.widget( - new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) - .setPos(4, 4) - .setSize(190, 85)); - } else { - builder.widget( - new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE_NO_INVENTORY) - .setPos(4, 4) - .setSize(190, 171)); - } buildContext.addSyncedWindow(UPGRADE_TREE_WINDOW_ID, this::createUpgradeTreeWindow); buildContext.addSyncedWindow(INDIVIDUAL_UPGRADE_WINDOW_ID, this::createIndividualUpgradeWindow); buildContext.addSyncedWindow(FUEL_CONFIG_WINDOW_ID, this::createFuelConfigWindow); @@ -789,27 +837,34 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont buildContext.addSyncedWindow(MANUAL_INSERTION_WINDOW_ID, this::createManualInsertionWindow); buildContext.addSyncedWindow(GENERAL_INFO_WINDOW_ID, this::createGeneralInfoWindow); buildContext.addSyncedWindow(SPECIAL_THANKS_WINDOW_ID, this::createSpecialThanksWindow); - buildContext.addSyncedWindow(STAR_COLOR_CONFIG_WINDOW_ID, this::createStarColorConfigWindow); + buildContext.addSyncedWindow(STAR_COSMETICS_WINDOW_ID, this::createStarCosmeticsWindow); + buildContext.addSyncedWindow(STAR_CUSTOM_COLOR_WINDOW_ID, this::createStarCustomColorWindow); + buildContext.addSyncedWindow(STAR_CUSTOM_COLOR_IMPORT_WINDOW_ID, this::createStarColorImportWindow); + builder.widget( - new ButtonWidget().setOnClick( - (clickData, widget) -> { - if (!widget.isClient()) widget.getContext() - .openSyncedWindow(UPGRADE_TREE_WINDOW_ID); - }) - .setSize(16, 16) - .setBackground(() -> { - List button = new ArrayList<>(); - button.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); - button.add(TecTechUITextures.OVERLAY_BUTTON_ARROW_BLUE_UP); - return button.toArray(new IDrawable[0]); - }) - .addTooltip("Path of Celestial Transcendence") - .setPos(174, 167) - .setTooltipShowUpDelay(TOOLTIP_DELAY)) + new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_SCREEN_BLUE) + .setPos(4, 4) + .setSize(190, 85)) + .widget( + new ButtonWidget().setOnClick( + (clickData, widget) -> { + if (!widget.isClient()) widget.getContext() + .openSyncedWindow(UPGRADE_TREE_WINDOW_ID); + }) + .setSize(16, 16) + .setBackground(() -> { + List button = new ArrayList<>(); + button.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); + button.add(TecTechUITextures.OVERLAY_BUTTON_ARROW_BLUE_UP); + return button.toArray(new IDrawable[0]); + }) + .addTooltip("Path of Celestial Transcendence") + .setPos(174, 167) + .setTooltipShowUpDelay(TOOLTIP_DELAY)) .widget( - new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_HEAT_SINK_SMALL) + new DrawableWidget().setDrawable(TecTechUITextures.PICTURE_HEAT_SINK_16x8) .setPos(174, 183) - .setSize(16, 6)) + .setSize(16, 8)) .widget(new ButtonWidget().setOnClick((clickData, widget) -> { if (!widget.isClient()) { widget.getContext() @@ -898,7 +953,7 @@ public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildCont new ButtonWidget().setOnClick( (clickData, widget) -> { if (!widget.isClient()) widget.getContext() - .openSyncedWindow(STAR_COLOR_CONFIG_WINDOW_ID); + .openSyncedWindow(STAR_COSMETICS_WINDOW_ID); }) .setSize(16, 16) .addTooltip(translateToLocal("fog.button.color.tooltip")) @@ -922,30 +977,7 @@ public void addGregTechLogo(ModularWindow.Builder builder) { @Override protected ButtonWidget createPowerSwitchButton() { - Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { - TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); - if (getBaseMetaTileEntity().isAllowedToWork()) { - getBaseMetaTileEntity().disableWorking(); - } else { - getBaseMetaTileEntity().enableWorking(); - } - }) - .setPlayClickSound(false) - .setBackground(() -> { - List ret = new ArrayList<>(); - ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); - if (getBaseMetaTileEntity().isAllowedToWork()) { - ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON); - } else { - ret.add(TecTechUITextures.OVERLAY_BUTTON_POWER_SWITCH_DISABLED); - } - return ret.toArray(new IDrawable[0]); - }) - .setPos(174, doesBindPlayerInventory() ? 148 : 172) - .setSize(16, 16); - button.addTooltip("Power Switch") - .setTooltipShowUpDelay(TOOLTIP_DELAY); - return (ButtonWidget) button; + return ForgeOfGodsUI.createPowerSwitchButton(getBaseMetaTileEntity()); } protected ButtonWidget createEjectionSwitch(IWidgetBuilder builder) { @@ -1395,7 +1427,7 @@ protected ModularWindow createIndividualMilestoneWindow(final EntityPlayer playe .setPos(5, 30) .setSize(140, 30)) .widget( - TextWidget.dynamicText(() -> currentMilestone(currentMilestoneID)) + TextWidget.dynamicText(() -> currentMilestoneLevel(currentMilestoneID)) .setScale(0.7f) .setDefaultColor(EnumChatFormatting.WHITE) .setTextAlignment(Alignment.Center) @@ -1439,7 +1471,7 @@ protected ModularWindow createIndividualMilestoneWindow(final EntityPlayer playe private Widget createMilestoneButton(int milestoneID, int width, int height, Pos2d pos) { return new ButtonWidget().setOnClick((clickData, widget) -> { currentMilestoneID = milestoneID; - reopenWindow(widget, INDIVIDUAL_MILESTONE_WINDOW_ID); + ForgeOfGodsUI.reopenWindow(widget, INDIVIDUAL_MILESTONE_WINDOW_ID); }) .setSize(width, height) .setBackground(() -> switch (milestoneID) { @@ -2217,6 +2249,10 @@ private void respecUpgrade() { gravitonShardsAvailable += gravitonShardCost; gravitonShardsSpent -= gravitonShardCost; upgrades[currentUpgradeID] = false; + + if (currentUpgradeID == 30) { + gravitonShardEjection = false; + } } } @@ -2296,7 +2332,7 @@ private Widget createUpgradeBox(int upgradeID, int colorCode, int milestone, int ctx.closeWindow(UPGRADE_TREE_WINDOW_ID); } } else { - reopenWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); + ForgeOfGodsUI.reopenWindow(widget, INDIVIDUAL_UPGRADE_WINDOW_ID); } } else if (clickData.mouseButton == 1) { respecUpgrade(); @@ -2455,9 +2491,7 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { if (i < uniqueItems) { ItemStack stack = inputs[i]; if (stack != null) { - stack = stack.copy(); - stack.stackSize = 1; - upgradeMatsHandler.setStackInSlot(i, stack); + upgradeMatsHandler.setStackInSlot(i, stack.copy()); } builder.widget( new DrawableWidget().setDrawable(GTUITextures.BUTTON_STANDARD_PRESSED) @@ -2466,6 +2500,7 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { columnList.get(cleanDiv4) .addChild( new SlotWidget(upgradeMatsHandler, i).setAccess(false, false) + .setRenderStackSize(false) .disableInteraction()); columnList.get(cleanDiv4 + 3) .addChild( @@ -2506,168 +2541,7 @@ protected ModularWindow createManualInsertionWindow(final EntityPlayer player) { } protected ModularWindow createGeneralInfoWindow(final EntityPlayer player) { - return createGeneralInfoWindow(() -> inversion, val -> inversion = val); - } - - // because modularui1 creates its synced windows following a specific interface spec, so we have to create a - // second method in order to pass a parameter :( - public static ModularWindow createGeneralInfoWindow(Supplier inversionGetter, - Consumer inversionSetter) { - final Scrollable scrollable = new Scrollable().setVerticalScroll(); - final int WIDTH = 300; - final int HEIGHT = 300; - ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); - - builder.setDraggable(true); - scrollable.widget( - new TextWidget(EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.introduction")) - .setDefaultColor(EnumChatFormatting.DARK_PURPLE) - .setTextAlignment(Alignment.TopCenter) - .setPos(7, 13) - .setSize(280, 15)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.introductioninfotext")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 30) - .setSize(280, 50)) - .widget( - new TextWidget( - EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.tableofcontents")) - .setDefaultColor(EnumChatFormatting.AQUA) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 80) - .setSize(150, 15)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(150)) - .setBackground( - new Text(EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.fuel")) - .alignment(Alignment.CenterLeft) - .color(0x55ffff)) - .setPos(7, 95) - .setSize(150, 15)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(434)) - .setBackground( - new Text( - EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.modules")) - .alignment(Alignment.CenterLeft) - .color(0x55ffff)) - .setPos(7, 110) - .setSize(150, 15)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(1088)) - .setBackground( - new Text( - EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.upgrades")) - .alignment(Alignment.CenterLeft) - .color(0x55ffff)) - .setPos(7, 125) - .setSize(150, 15)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> scrollable.setVerticalScrollOffset(1412)) - .setBackground( - new Text( - EnumChatFormatting.BOLD + translateToLocal("gt.blockmachines.multimachine.FOG.milestones")) - .alignment(Alignment.CenterLeft) - .color(0x55ffff)) - .setPos(7, 140) - .setSize(150, 15)) - .widget( - TextWidget.dynamicText(() -> inversionInfoText(inversionGetter.get())) - .setDefaultColor(EnumChatFormatting.WHITE) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 155) - .setSize(150, 15)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (inversionGetter.get()) { - scrollable.setVerticalScrollOffset(1766); - } - }) - .setPlayClickSound(inversionGetter.get()) - .setPos(7, 155) - .setSize(150, 15) - .attachSyncer(new FakeSyncWidget.BooleanSyncer(inversionGetter, inversionSetter), scrollable)) - .widget( - new TextWidget( - EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.fuel")) - .setDefaultColor(EnumChatFormatting.DARK_PURPLE) - .setTextAlignment(Alignment.TopCenter) - .setPos(127, 160) - .setSize(40, 15)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.fuelinfotext")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 177) - .setSize(280, 250)) - .widget( - new TextWidget( - EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.modules")) - .setDefaultColor(EnumChatFormatting.DARK_PURPLE) - .setTextAlignment(Alignment.TopCenter) - .setPos(7, 440) - .setSize(280, 15)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.moduleinfotext")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 461) - .setSize(280, 620)) - .widget( - new TextWidget( - EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.upgrades")) - .setDefaultColor(EnumChatFormatting.DARK_PURPLE) - .setTextAlignment(Alignment.TopCenter) - .setPos(7, 1098) - .setSize(280, 15)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.upgradeinfotext")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 1115) - .setSize(280, 290)) - .widget( - new TextWidget( - EnumChatFormatting.BOLD + "§N" + translateToLocal("gt.blockmachines.multimachine.FOG.milestones")) - .setDefaultColor(EnumChatFormatting.DARK_PURPLE) - .setTextAlignment(Alignment.TopCenter) - .setPos(7, 1422) - .setSize(280, 15)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.milestoneinfotext")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 1439) - .setSize(280, 320)) - .widget( - TextWidget.dynamicText(() -> inversionHeaderText(inversionGetter.get())) - .setDefaultColor(EnumChatFormatting.WHITE) - .setTextAlignment(Alignment.TopCenter) - .setPos(7, 1776) - .setSize(280, 15)) - .widget( - TextWidget.dynamicText(() -> inversionInfoText(inversionGetter.get())) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(7, 1793) - .setSize(280, 160)) - .widget( - new TextWidget("").setPos(7, 1965) - .setSize(10, 10)); - - builder.widget( - new DrawableWidget().setDrawable(TecTechUITextures.BACKGROUND_GLOW_WHITE) - .setPos(0, 0) - .setSize(300, 300)) - .widget( - scrollable.setSize(292, 292) - .setPos(4, 4)) - .widget( - ButtonWidget.closeWindowButton(true) - .setPos(284, 4)); - - return builder.build(); + return ForgeOfGodsUI.createGeneralInfoWindow(() -> inversion, val -> inversion = val); } protected ModularWindow createSpecialThanksWindow(final EntityPlayer player) { @@ -2786,176 +2660,99 @@ protected ModularWindow createSpecialThanksWindow(final EntityPlayer player) { return builder.build(); } - protected ModularWindow createStarColorConfigWindow(final EntityPlayer player) { + protected ModularWindow createStarCosmeticsWindow(final EntityPlayer player) { final int WIDTH = 200; final int HEIGHT = 200; ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_WHITE); builder.setDraggable(true); + + // Syncers + builder.widget(new FakeSyncWidget.StringSyncer(() -> selectedStarColor, val -> selectedStarColor = val)); + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> rotationSpeed, val -> rotationSpeed = val)); + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> starSize, val -> starSize = val)); + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> editingStarIndex, val -> editingStarIndex = val)); + builder.widget(starColors.getSyncer()); + + // Exit button and header builder.widget( ButtonWidget.closeWindowButton(true) .setPos(184, 4)) .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.cosmetics")) - .setDefaultColor(EnumChatFormatting.GOLD) + new TextWidget(translateToLocal("fog.cosmetics.header")).setDefaultColor(EnumChatFormatting.GOLD) .setTextAlignment(Alignment.Center) .setScale(1f) .setPos(0, 5) - .setSize(200, 15)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.color")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 25) - .setSize(60, 10)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.red")) - .setDefaultColor(EnumChatFormatting.RED) - .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 45) - .setSize(60, 18)) - .widget( - new NumericWidget().setSetter(val -> rendererColorRed = (int) val) - .setGetter(() -> rendererColorRed) - .setBounds(0, 255) - .setDefaultValue(179) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(35, 18) - .setPos(40, 45) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.integers")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> rendererColorRed, val -> rendererColorRed = val), - builder)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.green")) - .setDefaultColor(EnumChatFormatting.GREEN) - .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 65) - .setSize(60, 18)) - .widget( - new NumericWidget().setSetter(val -> rendererColorGreen = (int) val) - .setGetter(() -> rendererColorGreen) - .setBounds(0, 255) - .setDefaultValue(204) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(35, 18) - .setPos(40, 65) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.integers")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> rendererColorGreen, val -> rendererColorGreen = val), - builder)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.blue")) - .setDefaultColor(EnumChatFormatting.DARK_BLUE) - .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 85) - .setSize(60, 18)) - .widget( - new NumericWidget().setSetter(val -> rendererColorBlue = (int) val) - .setGetter(() -> rendererColorBlue) - .setBounds(0, 255) - .setDefaultValue(255) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(35, 18) - .setPos(40, 85) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.integers")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> rendererColorBlue, val -> rendererColorBlue = val), - builder)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.gamma")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 105) - .setSize(60, 18)) - .widget( - new NumericWidget().setSetter(val -> rendererGamma = (float) val) - .setGetter(() -> rendererGamma) - .setBounds(0, 100) - .setDefaultValue(3) - .setIntegerOnly(false) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(35, 18) - .setPos(40, 105) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.decimals")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.FloatSyncer(() -> rendererGamma, val -> rendererGamma = val), - builder)) - .widget( - new DrawableWidget().setDrawable( - () -> new Rectangle().setColor(Color.rgb(rendererColorRed, rendererColorGreen, rendererColorBlue))) - .setSize(80, 80) - .setPos(100, 45)) - .widget( - new DrawableWidget().setDrawable(() -> rainbowMode ? TecTechUITextures.PICTURE_RAINBOW_SQUARE : null) - .setSize(80, 80) - .setPos(100, 45)) - .widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (!widget.isClient()) { - rainbowMode = !rainbowMode; - } - }) - .setPlayClickSound(true) - .setBackground(() -> { - if (rainbowMode) { - return new IDrawable[] { TecTechUITextures.BUTTON_CELESTIAL_32x32, - TecTechUITextures.OVERLAY_BUTTON_RAINBOW_SPIRAL }; - } else { - return new IDrawable[] { TecTechUITextures.BUTTON_CELESTIAL_32x32, - TecTechUITextures.OVERLAY_BUTTON_RAINBOW_SPIRAL_OFF }; - } - }) - .addTooltip(translateToLocal("fog.button.rainbowmode.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(100, 130) + .setSize(200, 15)); + + // Color options + // Header + builder.widget( + new TextWidget(EnumChatFormatting.UNDERLINE + translateToLocal("fog.cosmetics.color")) + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setPos(9, 25) + .setSize(60, 10)); + + // Current presets + for (int i = 0; i < 7; i++) { + MultiChildWidget widget = createColorGroup(i); + widget.setPos(8, 45 + i * 20); + builder.widget(widget); + } + + // Option to add a new preset, only shown if there is room available + MultiChildWidget newPreset = new MultiChildWidget(); + Function newPresetEnabled = $ -> !starColors.isFull(); + newPreset.setSize(18, 80); + newPreset.setPosProvider(($, $$, $$$) -> new Pos2d(8, 45 + starColors.size() * 20)); + newPreset.setEnabled(newPresetEnabled); + + // New preset button + newPreset.addChild(new ButtonWidget().setOnClick((data, widget) -> { + if (!widget.isClient()) { + editingStarIndex = -1; + openCustomStarColorWindowFresh(widget, null); + } + }) + .setPlayClickSound(true) + .setBackground(GTUITextures.BUTTON_STANDARD) + .addTooltip(translateToLocal("fog.cosmetics.starcolor")) + .setSize(16, 16) + .setPos(0, 0) + .setEnabled(newPresetEnabled)); + + // Text overlaid on the above button + newPreset.addChild( + new TextWidget("+").setDefaultColor(EnumChatFormatting.DARK_GRAY) + .setTextAlignment(Alignment.Center) .setSize(16, 16) - .attachSyncer(new FakeSyncWidget.BooleanSyncer(() -> rainbowMode, (val) -> rainbowMode = val), builder)) + .setPos(0, 0) + .setEnabled(newPresetEnabled)); + + // Text for what this button does + newPreset.addChild( + new TextWidget(translateToLocal("fog.cosmetics.customstarcolor")).setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.CenterLeft) + .setSize(60, 18) + .setPos(20, 0) + .setEnabled(newPresetEnabled)); + + builder.widget(newPreset); + + // Miscellaneous options not related to color settings + builder .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.speed")) + new TextWidget(EnumChatFormatting.UNDERLINE + translateToLocal("fog.cosmetics.misc")) .setDefaultColor(EnumChatFormatting.GOLD) .setTextAlignment(Alignment.CenterLeft) - .setPos(120, 129) - .setSize(60, 18)) + .setPos(120, 25) + .setSize(80, 10)) .widget( - new NumericWidget().setSetter(val -> rainbowCycleSpeed = (int) val) - .setGetter(() -> rainbowCycleSpeed) - .setBounds(0, 100) - .setDefaultValue(1) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setSize(28, 18) - .setPos(152, 129) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.integers")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> rainbowCycleSpeed, val -> rainbowCycleSpeed = val), - builder)) - .widget( - new TextWidget( - EnumChatFormatting.UNDERLINE + translateToLocal("gt.blockmachines.multimachine.FOG.misc")) - .setDefaultColor(EnumChatFormatting.GOLD) - .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 130) - .setSize(80, 10)) - .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.spin")) + TextWidget.localised("fog.cosmetics.spin") .setDefaultColor(EnumChatFormatting.GOLD) .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 150) + .setPos(120, 45) .setSize(60, 18)) .widget( new NumericWidget().setSetter(val -> rotationSpeed = (int) val) @@ -2965,18 +2762,15 @@ protected ModularWindow createStarColorConfigWindow(final EntityPlayer player) { .setTextAlignment(Alignment.Center) .setTextColor(Color.WHITE.normal) .setSize(35, 18) - .setPos(40, 150) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.integers")) + .setPos(155, 45) + .addTooltip(translateToLocal("fog.cosmetics.onlyintegers")) .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> rotationSpeed, val -> rotationSpeed = val), - builder)) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)) .widget( - new TextWidget(translateToLocal("gt.blockmachines.multimachine.FOG.size")) + TextWidget.localised("fog.cosmetics.size") .setDefaultColor(EnumChatFormatting.GOLD) .setTextAlignment(Alignment.CenterLeft) - .setPos(8, 170) + .setPos(120, 65) .setSize(60, 18)) .widget( new NumericWidget().setSetter(val -> starSize = (int) val) @@ -2986,63 +2780,538 @@ protected ModularWindow createStarColorConfigWindow(final EntityPlayer player) { .setTextAlignment(Alignment.Center) .setTextColor(Color.WHITE.normal) .setSize(35, 18) - .setPos(40, 170) - .addTooltip(translateToLocal("gt.blockmachines.multimachine.FOG.integers")) + .setPos(155, 65) + .addTooltip(translateToLocal("fog.cosmetics.onlyintegers")) .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) - .attachSyncer(new FakeSyncWidget.IntegerSyncer(() -> starSize, val -> starSize = val), builder)) - .widget(new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)); + + return builder.build(); + } + + private MultiChildWidget createColorGroup(final int index) { + final int textWidth = 60; // for convenient changing, if we need to make this wider + + MultiChildWidget parent = new MultiChildWidget(); + parent.setSize(18, 20 + textWidth); + Function enabledCheck = $ -> index < starColors.size(); + + // Button to enable this star color + parent.addChild(new ButtonWidget().setOnClick((data, widget) -> { + if (!widget.isClient()) { + if (index < starColors.size()) { + ForgeOfGodsStarColor color = starColors.getByIndex(index); + if (data.shift && !color.isPresetColor()) { + // if shift is held, open color editor for this preset, if not a default preset + editingStarIndex = index; + openCustomStarColorWindowFresh(widget, color); + } else { + // otherwise select this color + selectedStarColor = color.getName(); + updateRenderer(); + } + } + } + }) + .setPlayClickSound(true) + .setBackground(() -> { + IDrawable bg = GTUITextures.BUTTON_STANDARD; + if (index < starColors.size()) { + ForgeOfGodsStarColor color = starColors.getByIndex(index); + if (color.getName() + .equals(selectedStarColor)) { + bg = GTUITextures.BUTTON_STANDARD_PRESSED; + } + } + return new IDrawable[] { bg }; + }) + .addTooltips( + ImmutableList.of( + translateToLocal("fog.cosmetics.selectcolor.tooltip.1"), + translateToLocal("fog.cosmetics.selectcolor.tooltip.2"))) + .setSize(16, 16) + .setPos(0, 0) + .setEnabled(enabledCheck)); + + // Drawable representation of this star color, overlaid on the above button + parent.addChild(new DrawableWidget().setDrawable(() -> { + if (index < starColors.size()) { + return starColors.getByIndex(index) + .getDrawable(); + } + return IDrawable.EMPTY; + }) + .setPos(1, 1) + .setSize(14, 14) + .setEnabled(enabledCheck)); + + // Name of this star color + parent.addChild(new DynamicTextWidget(() -> { + if (index < starColors.size()) { + ForgeOfGodsStarColor color = starColors.getByIndex(index); + return new Text(color.getName()); + } + return Text.EMPTY; + }).setDefaultColor(ForgeOfGodsUI.GOLD_ARGB) + .setTextAlignment(Alignment.CenterLeft) + .setSize(textWidth, 18) + .setPos(20, 0) + .setEnabled(enabledCheck)); + + return parent; + } + + protected ModularWindow createStarCustomColorWindow(final EntityPlayer player) { + ModularWindow.Builder builder = ModularWindow.builder(200, 200); + builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_WHITE); + builder.setDraggable(true); + + // Syncers + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> starColorR, val -> starColorR = val)); + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> starColorG, val -> starColorG = val)); + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> starColorB, val -> starColorB = val)); + builder.widget(new FakeSyncWidget.FloatSyncer(() -> starGamma, val -> starGamma = val)); + builder.widget(new FakeSyncWidget.IntegerSyncer(() -> editingColorIndex, val -> editingColorIndex = val)); + + builder.widget( + new FakeSyncWidget<>( + () -> newStarColor, + val -> newStarColor = val, + ForgeOfGodsStarColor::writeToBuffer, + ForgeOfGodsStarColor::readFromBuffer)); + + // Exit button and header + builder.widget( + ButtonWidget.closeWindowButton(true) + .setPos(184, 4)) + .widget( + TextWidget.localised("fog.cosmetics.starcolor") + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setScale(1f) + .setPos(0, 5) + .setSize(200, 15)); + + // *********** + // Color Entry + // *********** + + // RGB + Gamma text fields + Widget redField = ForgeOfGodsUI + .createStarColorRGBMGroup(StarColorRGBM.RED, val -> starColorR = (int) val, () -> starColorR); + builder.widget(redField.setPos(8, 21)); + + Widget greenField = ForgeOfGodsUI + .createStarColorRGBMGroup(StarColorRGBM.GREEN, val -> starColorG = (int) val, () -> starColorG); + builder.widget(greenField.setPos(8, 40)); + + Widget blueField = ForgeOfGodsUI + .createStarColorRGBMGroup(StarColorRGBM.BLUE, val -> starColorB = (int) val, () -> starColorB); + builder.widget(blueField.setPos(8, 59)); + + Widget gammaField = ForgeOfGodsUI + .createStarColorRGBMGroup(StarColorRGBM.GAMMA, val -> starGamma = (float) val, () -> starGamma); + builder.widget(gammaField.setPos(8, 78)); + + // Color preview box + Widget colorPreviewBox = new DrawableWidget() + .setDrawable(() -> new Rectangle().setColor(Color.rgb(starColorR, starColorG, starColorB))) + .setSize(168, 15) + .setPos(16, 99); + builder.widget(colorPreviewBox); + + // Apply color button + Widget colorApplyButton = ForgeOfGodsUI.createStarColorButton(() -> { + if (editingColorIndex >= 0) { + return "fog.cosmetics.applycolor"; + } + return "fog.cosmetics.addcolor"; + }, () -> { + if (editingColorIndex >= 0) { + return "fog.cosmetics.applycolor.tooltip"; + } + return "fog.cosmetics.addcolor.tooltip"; + }, (clickData, widget) -> { + if (!widget.isClient()) { + StarColorSetting color = new StarColorSetting(starColorR, starColorG, starColorB, starGamma); + if (editingColorIndex >= 0 && editingColorIndex < newStarColor.numColors()) { + // insert into the list, as we are editing an existing color + newStarColor.setColor(editingColorIndex, color); + } else { + // add a new color at the end of the list + newStarColor.addColor(color); + } + ForgeOfGodsUI.reopenWindow(widget, STAR_CUSTOM_COLOR_WINDOW_ID); + } + }); + builder.widget(colorApplyButton.setPos(63, 118)); + + // Reset color button + Widget colorResetButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.resetcolor", + "fog.cosmetics.resetcolor.tooltip", + (clickData, widget) -> { if (!widget.isClient()) { - UpdateRenderer(); - reopenWindow(widget, STAR_COLOR_CONFIG_WINDOW_ID); + starColorR = ForgeOfGodsStarColor.DEFAULT_RED; + starColorG = ForgeOfGodsStarColor.DEFAULT_GREEN; + starColorB = ForgeOfGodsStarColor.DEFAULT_BLUE; + starGamma = ForgeOfGodsStarColor.DEFAULT_GAMMA; + } + }); + builder.widget(colorResetButton.setPos(102, 118)); + + // ********** + // Color List + // ********** + + // Color list + for (int i = 0; i < 9; i++) { + final int ii = i; + + MultiChildWidget colorListEntry = new MultiChildWidget(); + colorListEntry.setSize(18, 18); + colorListEntry.setPos(8 + i * 18, 136); + + // List entry button + selector outline + colorListEntry.addChild(new ButtonWidget().setOnClick((clickData, widget) -> { + if (widget.isClient()) return; + + if (clickData.mouseButton == 0) { // left click + // deselect this if its already selected + if (editingColorIndex == ii) { + editingColorIndex = -1; + return; + } + + // otherwise select this if it's valid to select + if (ii < newStarColor.numColors()) { + editingColorIndex = ii; + StarColorSetting color = newStarColor.getColor(ii); + starColorR = color.getColorR(); + starColorG = color.getColorG(); + starColorB = color.getColorB(); + starGamma = color.getGamma(); + } + } else if (clickData.mouseButton == 1) { // right click + // if this is valid, remove it and shift other values down + if (ii < newStarColor.numColors()) { + newStarColor.removeColor(ii); + + if (editingColorIndex == ii) { + // deselect if this index was selected + editingColorIndex = -1; + } else if (editingColorIndex > ii) { + // shift down the editing index if it was after this entry + editingColorIndex -= 1; + } + ForgeOfGodsUI.reopenWindow(widget, STAR_CUSTOM_COLOR_WINDOW_ID); + } } }) - .setSize(35, 15) - .setBackground(GTUITextures.BUTTON_STANDARD) - .addTooltip(translateToLocal("fog.button.updaterenderer.tooltip")) + .setPlayClickSound(false) + .setBackground(() -> { + if (editingColorIndex == ii) { + return new IDrawable[] { TecTechUITextures.UNSELECTED_OPTION, + TecTechUITextures.SLOT_OUTLINE_GREEN }; + } + return new IDrawable[] { TecTechUITextures.UNSELECTED_OPTION }; + }) + .dynamicTooltip(() -> { + List ret = new ArrayList<>(); + ret.add(translateToLocal("fog.cosmetics.colorlist.tooltip.1")); + ret.add(translateToLocal("fog.cosmetics.colorlist.tooltip.2")); + + if (ii < newStarColor.numColors()) { + ret.add(""); + StarColorSetting color = newStarColor.getColor(ii); + ret.add(StarColorRGBM.RED.tooltip(color.getColorR())); + ret.add(StarColorRGBM.GREEN.tooltip(color.getColorG())); + ret.add(StarColorRGBM.BLUE.tooltip(color.getColorB())); + ret.add(StarColorRGBM.GAMMA.tooltip(color.getGamma())); + } + return ret; + }) + .setUpdateTooltipEveryTick(true) .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(0, 0)) - .addChild( - TextWidget.localised("gt.blockmachines.multimachine.FOG.apply") - .setTextAlignment(Alignment.Center) - .setPos(0, 0) - .setSize(35, 15)) - .setSize(35, 15) - .setPos(157, 177)) - .widget(new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { + .setSize(18, 18) + .setPos(0, 0)); + + // List entry color + colorListEntry.addChild(new DrawableWidget().setDrawable(() -> { + if (ii < newStarColor.numColors()) { + StarColorSetting color = newStarColor.getColor(ii); + return new Rectangle().setColor(Color.rgb(color.getColorR(), color.getColorG(), color.getColorB())); + } + return IDrawable.EMPTY; + }) + .setSize(16, 16) + .setPos(1, 1)); + + builder.widget(colorListEntry); + } + + // Cycle rate text field + Widget cycleRateField = new NumericWidget().setSetter(val -> newStarColor.setCycleSpeed((int) val)) + .setGetter(() -> newStarColor.getCycleSpeed()) + .setBounds(1, 100) + .setDefaultValue(1) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .addTooltip(translateToLocal("fog.cosmetics.cyclespeed")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) + .setSize(21, 16) + .setPos(171, 137); + builder.widget(cycleRateField); + + // Name text field + Widget nameEntryField = new TextFieldWidget().setSetter(val -> newStarColor.setName(val)) + .setGetter(() -> newStarColor.getName()) + .setMaxLength(15) + .setTextAlignment(Alignment.CenterLeft) + .setTextColor(ForgeOfGodsUI.GOLD_ARGB) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) + .addTooltips( + ImmutableList.of( + translateToLocal("fog.cosmetics.starcolorname.tooltip.1"), + translateToLocal("fog.cosmetics.starcolorname.tooltip.2"))) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(101, 158) + .setSize(91, 16); + builder.widget(nameEntryField); + + // Name label + Widget nameLabel = TextWidget.localised("fog.cosmetics.starcolorname") + .setTextAlignment(Alignment.CenterLeft) + .setDefaultColor(EnumChatFormatting.GOLD) + .setPos(8, 158) + .setSize(100, 16); + builder.widget(nameLabel); + + // ************** + // Preset Buttons + // ************** + + // Save preset button + Widget savePresetButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.savecolors", + "fog.cosmetics.savecolors.tooltip", + (clickData, widget) -> { + if (!widget.isClient()) { + if (newStarColor.numColors() == 0) return; + if (editingStarIndex >= 0) { + starColors.insert(newStarColor, editingStarIndex); + selectedStarColor = newStarColor.getName(); + updateRenderer(); + } else { + starColors.store(newStarColor); + } + widget.getWindow() + .closeWindow(); + ForgeOfGodsUI.reopenWindow(widget, STAR_COSMETICS_WINDOW_ID); + } + }); + builder.widget(savePresetButton.setPos(138, 177)); + + // Delete preset button + Widget deletePresetButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.deletecolors", + "fog.cosmetics.deletecolors.tooltip", + (clickData, widget) -> { + if (!widget.isClient()) { + starColors.drop(newStarColor); + if (selectedStarColor.equals(newStarColor.getName())) { + // set to default if the deleted color was selected + selectedStarColor = ForgeOfGodsStarColor.DEFAULT.getName(); + updateRenderer(); + } + widget.getWindow() + .closeWindow(); + ForgeOfGodsUI.reopenWindow(widget, STAR_COSMETICS_WINDOW_ID); + } + }); + builder.widget(deletePresetButton.setPos(101, 177)); + + // Import preset button + Widget importPresetButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.importcolors", + "fog.cosmetics.importcolors.tooltip", + (clickData, widget) -> { if (!widget.isClient()) { - rendererColorRed = 179; - rendererColorGreen = 204; - rendererColorBlue = 255; - rendererGamma = 3f; - rotationSpeed = 5; - starSize = 20; - rainbowMode = false; - rainbowCycleSpeed = 1; + // reset state from before if it exists + importedStarColor = null; + widget.getContext() + .openSyncedWindow(STAR_CUSTOM_COLOR_IMPORT_WINDOW_ID); + } + }); + builder.widget(importPresetButton.setPos(64, 177)); + + // Export preset button + Widget exportPresetButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.exportcolors", + "fog.cosmetics.exportcolors.tooltip", + (clickData, widget) -> { + if (widget.isClient()) { + if (newStarColor.numColors() == 0) return; + if (Desktop.isDesktopSupported()) { + String output = newStarColor.serializeToString(); + Clipboard clipboard = Toolkit.getDefaultToolkit() + .getSystemClipboard(); + clipboard.setContents(new StringSelection(output), null); + } + } + }); + builder.widget(exportPresetButton.setPos(27, 177)); + + return builder.build(); + } + + protected ModularWindow createStarColorImportWindow(final EntityPlayer player) { + ModularWindow.Builder builder = ModularWindow.builder(200, 100); + builder.setBackground(TecTechUITextures.BACKGROUND_GLOW_WHITE_HALF); + builder.setDraggable(true); + + // Syncers + builder.widget( + new FakeSyncWidget<>( + () -> importedStarColor, + val -> importedStarColor = val, + ForgeOfGodsStarColor::writeToBuffer, + ForgeOfGodsStarColor::readFromBuffer)); + + // Exit button and header + builder.widget( + ButtonWidget.closeWindowButton(true) + .setPos(184, 4)) + .widget( + TextWidget.localised("fog.cosmetics.importer.import") + .setDefaultColor(EnumChatFormatting.GOLD) + .setTextAlignment(Alignment.Center) + .setScale(1f) + .setPos(0, 5) + .setSize(200, 15)); + + // Serialized star color input + TextFieldWidget textField = new TextFieldWidget(); + textField.setSynced(false, true) + .setSetter(val -> { + if (!textField.isClient()) { + if (val == null || val.isEmpty()) { + importedStarColor = null; + return; + } + importedStarColor = ForgeOfGodsStarColor.deserialize(val); } }) - .setSize(35, 15) - .setBackground(GTUITextures.BUTTON_STANDARD) - .addTooltip(translateToLocal("fog.button.resetcosmetics.tooltip")) - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(0, 0)) - .addChild( - TextWidget.localised("fog.debug.resetbutton.text") - .setTextAlignment(Alignment.Center) - .setPos(0, 0) - .setSize(35, 15)) - .setSize(35, 15) - .setPos(120, 177)); + .setMaxLength(32767) + .setScrollBar() + .setTextAlignment(Alignment.CenterLeft) + .setTextColor(Color.WHITE.normal) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) + .setSize(184, 18) + .setPos(8, 20); + builder.widget(textField); + + // Color preview for a valid star color string + for (int i = 0; i < 9; i++) { + int ii = i; + Widget colorEntry = new DrawableWidget().setDrawable(() -> { + if (importedStarColor != null && ii < importedStarColor.numColors()) { + StarColorSetting color = importedStarColor.getColor(ii); + return new Rectangle().setColor(Color.rgb(color.getColorR(), color.getColorG(), color.getColorB())) + .withOffset(1, 1, -2, -2); + } + return IDrawable.EMPTY; + }) + .setBackground(TecTechUITextures.UNSELECTED_OPTION) + .dynamicTooltip(() -> { + if (importedStarColor != null && ii < importedStarColor.numColors()) { + StarColorSetting color = importedStarColor.getColor(ii); + List ret = new ArrayList<>(); + ret.add(StarColorRGBM.RED.tooltip(color.getColorR())); + ret.add(StarColorRGBM.GREEN.tooltip(color.getColorG())); + ret.add(StarColorRGBM.BLUE.tooltip(color.getColorB())); + ret.add(StarColorRGBM.GAMMA.tooltip(color.getGamma())); + return ret; + } + return Collections.emptyList(); + }) + .setSize(18, 18) + .setPos(8 + i * 18, 42); + builder.widget(colorEntry); + } + + // Cycle rate + Widget cycleRateText = new DynamicTextWidget(() -> { + if (importedStarColor != null) { + return new Text(Integer.toString(importedStarColor.getCycleSpeed())); + } + return Text.EMPTY; + }).setTextAlignment(Alignment.Center) + .setDefaultColor(Color.WHITE.normal) + .addTooltip(translateToLocal("fog.cosmetics.cyclespeed")) + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD) + .setSize(21, 16) + .setPos(171, 43); + builder.widget(cycleRateText); + + // Validator string + Widget validatorText = new DynamicTextWidget(() -> { + if (importedStarColor == null) { + return new Text(EnumChatFormatting.RED + translateToLocal("fog.cosmetics.importer.error")); + } + return new Text(EnumChatFormatting.GREEN + translateToLocal("fog.cosmetics.importer.valid")); + }).setTextAlignment(Alignment.Center) + .setPos(0, 62) + .setSize(200, 16); + builder.widget(validatorText); + + // Confirm button + Widget confirmImportButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.importer.apply", + "fog.cosmetics.importer.apply.tooltip", + (clickData, widget) -> { + if (!widget.isClient()) { + // no action if a valid star color isn't provided + if (importedStarColor != null) { + widget.getWindow() + .closeWindow(); + openCustomStarColorWindowFresh(widget, importedStarColor); + } + } + }); + builder.widget(confirmImportButton.setPos(101, 77)); + + // Reset button + Widget resetImportButton = ForgeOfGodsUI.createStarColorButton( + "fog.cosmetics.importer.reset", + "fog.cosmetics.importer.reset.tooltip", + (clickData, widget) -> { + if (!widget.isClient()) { + importedStarColor = null; + } + }); + builder.widget(resetImportButton.setPos(64, 77)); + return builder.build(); } - private void reopenWindow(Widget widget, int windowId) { + // Opens the custom color window while also resetting the editing values. + // Can optionally pass a star color to set as the editing color + private void openCustomStarColorWindowFresh(Widget widget, @Nullable ForgeOfGodsStarColor importedColor) { if (!widget.isClient()) { - ModularUIContext ctx = widget.getContext(); - if (ctx.isWindowOpen(windowId)) { - ctx.closeWindow(windowId); + // Reset star color state + if (importedColor == null) { + importedColor = starColors.newTemplateColor(); } - ctx.openSyncedWindow(windowId); + newStarColor = importedColor; + editingColorIndex = -1; + starColorR = ForgeOfGodsStarColor.DEFAULT_RED; + starColorG = ForgeOfGodsStarColor.DEFAULT_GREEN; + starColorB = ForgeOfGodsStarColor.DEFAULT_BLUE; + starGamma = ForgeOfGodsStarColor.DEFAULT_GAMMA; + + ForgeOfGodsUI.reopenWindow(widget, STAR_CUSTOM_COLOR_WINDOW_ID); } } @@ -3532,11 +3801,12 @@ private Text totalMilestoneProgress(int milestoneID) { + suffix); } - private Text currentMilestone(int milestoneID) { + private Text currentMilestoneLevel(int milestoneID) { + int milestoneLevel = inversion ? milestoneProgress[milestoneID] : Math.min(milestoneProgress[milestoneID], 7); return new Text( translateToLocal("gt.blockmachines.multimachine.FOG.milestoneprogress") + ": " + EnumChatFormatting.GRAY - + milestoneProgress[milestoneID]); + + milestoneLevel); } private Text milestoneProgressText(int milestoneID) { @@ -3586,24 +3856,6 @@ private Text milestoneProgressText(int milestoneID) { return new Text(progressText + ": " + EnumChatFormatting.GRAY + formattingMode.format(max) + " " + suffix); } - private static Text inversionHeaderText(boolean inversion) { - return inversion - ? new Text( - EnumChatFormatting.BOLD + "§k2" - + EnumChatFormatting.RESET - + EnumChatFormatting.WHITE - + EnumChatFormatting.BOLD - + translateToLocal("gt.blockmachines.multimachine.FOG.inversion") - + EnumChatFormatting.BOLD - + "§k2") - : new Text(""); - } - - private static Text inversionInfoText(boolean inversion) { - return inversion ? new Text(translateToLocal("gt.blockmachines.multimachine.FOG.inversioninfotext")) - : new Text(""); - } - private Text constructionStatusText() { return upgrades[currentUpgradeID] ? new Text(translateToLocal("fog.upgrade.respec")) : new Text(translateToLocal("fog.upgrade.confirm")); @@ -3704,6 +3956,9 @@ public void setItemNBT(NBTTagCompound NBT) { } NBT.setTag("upgradeMaterials", upgradeMaterialBooleanArrayNBTTag); + + starColors.serializeToNBT(NBT); + super.saveNBTData(NBT); } @@ -3721,18 +3976,8 @@ public void saveNBTData(NBTTagCompound NBT) { NBT.setLong("totalFuelConsumed", totalFuelConsumed); NBT.setInteger("starFuelStored", stellarFuelAmount); NBT.setBoolean("gravitonShardEjection", gravitonShardEjection); - NBT.setBoolean("isRenderActive", isRenderActive); NBT.setInteger("ringAmount", ringAmount); NBT.setBoolean("secretUpgrade", secretUpgrade); - NBT.setInteger("rendererColorRed", rendererColorRed); - NBT.setInteger("rendererColorGreen", rendererColorGreen); - NBT.setInteger("rendererColorBlue", rendererColorBlue); - NBT.setFloat("rendererGamma", rendererGamma); - NBT.setInteger("rotationSpeed", rotationSpeed); - NBT.setInteger("starSize", starSize); - NBT.setBoolean("rainbowMode", rainbowMode); - NBT.setInteger("rainbowCycleSpeed", rainbowCycleSpeed); - NBT.setBoolean("isRenderActive", isRenderActive); // Store booleanArray of all upgrades NBTTagCompound upgradeBooleanArrayNBTTag = new NBTTagCompound(); @@ -3768,6 +4013,15 @@ public void saveNBTData(NBTTagCompound NBT) { } NBT.setTag("upgradeWindowStorage", upgradeWindowStorageNBTTag); + + // Renderer information + NBT.setInteger("rotationSpeed", rotationSpeed); + NBT.setInteger("starSize", starSize); + NBT.setString("selectedStarColor", selectedStarColor); + NBT.setBoolean("isRenderActive", isRenderActive); + + starColors.serializeToNBT(NBT); + super.saveNBTData(NBT); } @@ -3785,18 +4039,8 @@ public void loadNBTData(NBTTagCompound NBT) { totalFuelConsumed = NBT.getLong("totalFuelConsumed"); stellarFuelAmount = NBT.getInteger("starFuelStored"); gravitonShardEjection = NBT.getBoolean("gravitonShardEjection"); - isRenderActive = NBT.getBoolean("isRenderActive"); ringAmount = NBT.getInteger("ringAmount"); secretUpgrade = NBT.getBoolean("secretUpgrade"); - rendererColorRed = NBT.getInteger("rendererColorRed"); - rendererColorGreen = NBT.getInteger("rendererColorGreen"); - rendererColorBlue = NBT.getInteger("rendererColorBlue"); - rendererGamma = NBT.getFloat("rendererGamma"); - rotationSpeed = NBT.getInteger("rotationSpeed"); - starSize = NBT.getInteger("starSize"); - rainbowMode = NBT.getBoolean("rainbowMode"); - rainbowCycleSpeed = NBT.getInteger("rainbowCycleSpeed"); - isRenderActive = NBT.getBoolean("isRenderActive"); NBTTagCompound tempBooleanTag = NBT.getCompoundTag("upgrades"); @@ -3824,6 +4068,14 @@ public void loadNBTData(NBTTagCompound NBT) { } } + // Renderer information + rotationSpeed = NBT.getInteger("rotationSpeed"); + starSize = NBT.getInteger("starSize"); + selectedStarColor = NBT.getString("selectedStarColor"); + isRenderActive = NBT.getBoolean("isRenderActive"); + + starColors.rebuildFromNBT(NBT); + super.loadNBTData(NBT); } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java similarity index 99% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java index 63f8879805c..51bfe51ac00 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEMoltenModule.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge_modules; +package tectech.thing.metaTileEntity.multi.godforge; import static gregtech.api.util.GTUtility.formatNumbers; import static gregtech.common.misc.WirelessNetworkManager.addEUToGlobalEnergyMap; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java similarity index 67% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java index faebecff471..29675ae5cef 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTEPlasmaModule.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge_modules; +package tectech.thing.metaTileEntity.multi.godforge; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GTRecipeConstants.FOG_PLASMA_MULTISTEP; @@ -16,6 +16,7 @@ import javax.annotation.Nonnull; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.EnumChatFormatting; import org.jetbrains.annotations.NotNull; @@ -23,9 +24,9 @@ import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.math.Alignment; import com.gtnewhorizons.modularui.api.math.Color; +import com.gtnewhorizons.modularui.api.math.Size; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.api.widget.IWidgetBuilder; import com.gtnewhorizons.modularui.api.widget.Widget; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; @@ -45,6 +46,7 @@ import gregtech.api.util.OverclockCalculator; import tectech.loader.ConfigHandler; import tectech.recipe.TecTechRecipeMaps; +import tectech.thing.gui.TecTechUITextures; public class MTEPlasmaModule extends MTEBaseModule { @@ -52,6 +54,8 @@ public class MTEPlasmaModule extends MTEBaseModule { private int currentParallel = 0; private int inputMaxParallel = 0; + private static final int DEBUG_WINDOW_ID = 11; + public MTEPlasmaModule(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -124,64 +128,95 @@ protected void setProcessingLogicPower(ProcessingLogic logic) { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); + buildContext.addSyncedWindow(DEBUG_WINDOW_ID, this::createDebugWindow); if (ConfigHandler.debug.DEBUG_MODE) { - builder.widget(createTestButton(builder)) - .widget(createTestButton2()) - .widget(createTestButton3()); + builder.widget(createDebugWindowButton()); } } - protected Widget createTestButton(IWidgetBuilder builder) { - return new ButtonWidget() - .setOnClick((clickData, widget) -> isMultiStepPlasmaCapable = !isMultiStepPlasmaCapable) - .setPlayClickSoundResource( - () -> isAllowedToWork() ? SoundResource.GUI_BUTTON_UP.resourceLocation - : SoundResource.GUI_BUTTON_DOWN.resourceLocation) - .setBackground(() -> { - if (isMultiStepPlasmaCapable) { - return new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED, - GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON }; - } else { - return new IDrawable[] { GTUITextures.BUTTON_STANDARD, - GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF }; - } + protected ButtonWidget createDebugWindowButton() { + Widget button = new ButtonWidget().setOnClick( + (data, widget) -> { + if (!widget.isClient()) widget.getContext() + .openSyncedWindow(DEBUG_WINDOW_ID); }) - .attachSyncer(new FakeSyncWidget.BooleanSyncer(this::isAllowedToWork, val -> { - if (val) enableWorking(); - else disableWorking(); - }), builder) - .addTooltip("multi-step") + .setPlayClickSound(false) + .setBackground(TecTechUITextures.BUTTON_CELESTIAL_32x32, TecTechUITextures.OVERLAY_BUTTON_LOAF_MODE) + .addTooltip("Debug Window") .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setPos(174, 100) + .setPos(174, 91) .setSize(16, 16); + return (ButtonWidget) button; } - protected Widget createTestButton2() { - return new TextFieldWidget().setSetterInt(this::setPlasmaTier) - .setGetterInt(this::getPlasmaTier) - .setNumbers(0, 2) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setPos(3, 18) - .addTooltip("fusion tier") - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setSize(16, 16) - .setPos(174, 80) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD); - } + protected ModularWindow createDebugWindow(final EntityPlayer player) { + final int WIDTH = 78; + final int HEIGHT = 60; + final int PARENT_WIDTH = getGUIWidth(); + final int PARENT_HEIGHT = getGUIHeight(); + ModularWindow.Builder builder = ModularWindow.builder(WIDTH, HEIGHT); + builder.setBackground(GTUITextures.BACKGROUND_SINGLEBLOCK_DEFAULT); + builder.setGuiTint(getGUIColorization()); + builder.setDraggable(true); + builder.setPos( + (size, window) -> Alignment.Center.getAlignedPos(size, new Size(PARENT_WIDTH, PARENT_HEIGHT)) + .add( + Alignment.TopRight.getAlignedPos(new Size(PARENT_WIDTH, PARENT_HEIGHT), new Size(WIDTH, HEIGHT)) + .add(WIDTH - 3, 0))); - protected Widget createTestButton3() { - return new TextFieldWidget().setSetterInt(val -> inputMaxParallel = val) - .setGetterInt(() -> inputMaxParallel) - .setNumbers(0, Integer.MAX_VALUE) - .setTextAlignment(Alignment.Center) - .setTextColor(Color.WHITE.normal) - .setPos(3, 18) - .addTooltip("parallel") - .setTooltipShowUpDelay(TOOLTIP_DELAY) - .setSize(70, 16) - .setPos(174, 60) - .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD); + // Debug enable/disable multi-step + builder.widget( + new ButtonWidget().setOnClick((clickData, widget) -> isMultiStepPlasmaCapable = !isMultiStepPlasmaCapable) + .setPlayClickSoundResource( + () -> isAllowedToWork() ? SoundResource.GUI_BUTTON_UP.resourceLocation + : SoundResource.GUI_BUTTON_DOWN.resourceLocation) + .setBackground(() -> { + if (isMultiStepPlasmaCapable) { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD_PRESSED, + GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_ON }; + } else { + return new IDrawable[] { GTUITextures.BUTTON_STANDARD, + GTUITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF }; + } + }) + .attachSyncer(new FakeSyncWidget.BooleanSyncer(this::isAllowedToWork, val -> { + if (val) enableWorking(); + else disableWorking(); + }), builder) + .addTooltip("multi-step") + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setPos(4, 40) + .setSize(16, 16)); + + // Debug set plasma tier + builder.widget( + new TextFieldWidget().setSetterInt(this::setPlasmaTier) + .setGetterInt(this::getPlasmaTier) + .setNumbers(0, 2) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .setPos(3, 18) + .addTooltip("fusion tier") + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setSize(16, 16) + .setPos(4, 20) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)); + + // Debug set max parallel + builder.widget( + new TextFieldWidget().setSetterInt(val -> inputMaxParallel = val) + .setGetterInt(() -> inputMaxParallel) + .setNumbers(0, Integer.MAX_VALUE) + .setTextAlignment(Alignment.Center) + .setTextColor(Color.WHITE.normal) + .setPos(3, 18) + .addTooltip("parallel") + .setTooltipShowUpDelay(TOOLTIP_DELAY) + .setSize(70, 16) + .setPos(4, 4) + .setBackground(GTUITextures.BACKGROUND_TEXT_FIELD)); + + return builder.build(); } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java similarity index 91% rename from src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java rename to src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java index 779280b1fe6..ba8e5f26661 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/MTESmeltingModule.java @@ -1,4 +1,4 @@ -package tectech.thing.metaTileEntity.multi.godforge_modules; +package tectech.thing.metaTileEntity.multi.godforge; import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY; import static gregtech.api.util.GTUtility.formatNumbers; @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.List; import javax.annotation.Nonnull; @@ -32,7 +33,6 @@ import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; -import gregtech.api.gui.modularui.GTUITextures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.logic.ProcessingLogic; @@ -43,6 +43,8 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; +import tectech.TecTech; +import tectech.thing.gui.TecTechUITextures; public class MTESmeltingModule extends MTEBaseModule { @@ -149,27 +151,31 @@ protected void setProcessingLogicPower(ProcessingLogic logic) { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); - builder.widget(furnaceSwitch(builder)); - + builder.widget(createFurnaceModeButton(builder)); } - protected ButtonWidget furnaceSwitch(IWidgetBuilder builder) { - Widget button = new ButtonWidget().setOnClick((clickData, widget) -> furnaceMode = !furnaceMode) - .setPlayClickSound(true) + protected ButtonWidget createFurnaceModeButton(IWidgetBuilder builder) { + Widget button = new ButtonWidget().setOnClick((clickData, widget) -> { + TecTech.proxy.playSound(getBaseMetaTileEntity(), "fx_click"); + furnaceMode = !furnaceMode; + widget.notifyTooltipChange(); + }) + .setPlayClickSound(false) .setBackground(() -> { List ret = new ArrayList<>(); + ret.add(TecTechUITextures.BUTTON_CELESTIAL_32x32); if (isFurnaceModeOn()) { - ret.add(GTUITextures.BUTTON_STANDARD_PRESSED); - ret.add(GTUITextures.OVERLAY_BUTTON_CHECKMARK); + ret.add(TecTechUITextures.OVERLAY_BUTTON_FURNACE_MODE); } else { - ret.add(GTUITextures.BUTTON_STANDARD); - ret.add(GTUITextures.OVERLAY_BUTTON_CROSS); - + ret.add(TecTechUITextures.OVERLAY_BUTTON_FURNACE_MODE_OFF); } return ret.toArray(new IDrawable[0]); }) .attachSyncer(new FakeSyncWidget.BooleanSyncer(this::isFurnaceModeOn, this::setFurnaceMode), builder) - .addTooltip(translateToLocal("fog.button.furnacemode.tooltip")) + .dynamicTooltip( + () -> Collections.singletonList( + translateToLocal( + furnaceMode ? "fog.button.furnacemode.tooltip.02" : "fog.button.furnacemode.tooltip.01"))) .setTooltipShowUpDelay(TOOLTIP_DELAY) .setPos(174, 91) .setSize(16, 16); diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java new file mode 100644 index 00000000000..9593c1db95b --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColor.java @@ -0,0 +1,346 @@ +package tectech.thing.metaTileEntity.multi.godforge.color; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; + +import org.jetbrains.annotations.Nullable; + +import com.cleanroommc.modularui.utils.Color; +import com.gtnewhorizons.modularui.api.drawable.IDrawable; +import com.gtnewhorizons.modularui.api.drawable.shapes.Rectangle; + +import tectech.thing.gui.TecTechUITextures; + +@SuppressWarnings("unused") // for the preset color fields +public class ForgeOfGodsStarColor { + + private static final int LATEST_VERSION = 1; + + // Preset colors + private static final Map PRESETS = new LinkedHashMap<>(4); + + public static final int DEFAULT_RED = 179; + public static final int DEFAULT_GREEN = 204; + public static final int DEFAULT_BLUE = 255; + public static final float DEFAULT_GAMMA = 3.0f; + + public static final ForgeOfGodsStarColor DEFAULT = new ForgeOfGodsStarColor("Default") + .addColor(DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, DEFAULT_GAMMA) + .registerPreset(); + + public static final ForgeOfGodsStarColor RAINBOW = new ForgeOfGodsStarColor("Rainbow").addColor(255, 0, 0, 3.0f) + .addColor(255, 255, 0, 3.0f) + .addColor(0, 255, 0, 3.0f) + .addColor(0, 255, 255, 3.0f) + .addColor(255, 0, 255, 3.0f) + .setCycleSpeed(1) + .setCustomDrawable(TecTechUITextures.PICTURE_RAINBOW_SQUARE) + .registerPreset(); + + public static final ForgeOfGodsStarColor CLOUD_PICK = new ForgeOfGodsStarColor("Cloud's Pick") + .addColor(DEFAULT_RED, DEFAULT_GREEN, DEFAULT_BLUE, DEFAULT_GAMMA) // todo @cloud + .registerPreset(); + + public static final ForgeOfGodsStarColor MAYA_PICK = new ForgeOfGodsStarColor("Maya's Pick") + .addColor(91, 206, 250, 3.0f) + .addColor(245, 169, 184, 3.0f) + .addColor(255, 255, 255, 3.0f) + .setCycleSpeed(1) + .registerPreset(); + + public static List getDefaultColors() { + return new ArrayList<>(PRESETS.values()); + } + + // "Metadata" about this star color, not related to star rendering + private String name; + // version currently unused, but can be used to retain compatibility with old serialized star colors + // if the structure of the data changes significantly. + private final int version; + private boolean isPreset; + private IDrawable drawable; + + // Star render settings + private final List settings = new ArrayList<>(); + private int cycleSpeed = 1; + + protected ForgeOfGodsStarColor(String name) { + this(name, LATEST_VERSION); + } + + private ForgeOfGodsStarColor(String name, int version) { + this.name = name; + this.version = version; + } + + private ForgeOfGodsStarColor registerPreset() { + this.isPreset = true; + PRESETS.put(getName(), this); + return this; + } + + public boolean isPresetColor() { + return isPreset; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ForgeOfGodsStarColor setCycleSpeed(int speed) { + this.cycleSpeed = speed; + return this; + } + + public int getCycleSpeed() { + return cycleSpeed; + } + + public ForgeOfGodsStarColor addColor(int r, int g, int b, float gamma) { + settings.add(new StarColorSetting(r, g, b, gamma)); + return this; + } + + public ForgeOfGodsStarColor addColor(StarColorSetting color) { + settings.add(color); + return this; + } + + private ForgeOfGodsStarColor addColors(List colors) { + settings.addAll(colors); + return this; + } + + public int numColors() { + return settings.size(); + } + + public StarColorSetting getColor(int index) { + return settings.get(index); + } + + public void setColor(int index, StarColorSetting color) { + settings.set(index, color); + } + + public void removeColor(int index) { + settings.remove(index); + } + + public ForgeOfGodsStarColor setCustomDrawable(IDrawable drawable) { + this.drawable = drawable; + return this; + } + + /** @return a picture representation of this star color. */ + public IDrawable getDrawable() { + if (drawable == null) { + StarColorSetting setting = settings.get(0); + drawable = new Rectangle() + .setColor(Color.rgb(setting.getColorR(), setting.getColorG(), setting.getColorB())); + } + return drawable; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ForgeOfGodsStarColor that = (ForgeOfGodsStarColor) o; + + if (cycleSpeed != that.cycleSpeed) return false; + if (!name.equals(that.name)) return false; + if (settings.size() != that.settings.size()) return false; + for (int i = 0; i < settings.size(); i++) { + StarColorSetting thisSetting = settings.get(i); + StarColorSetting thatSetting = that.settings.get(i); + if (!thisSetting.equals(thatSetting)) return false; + } + return true; + } + + @Override + public String toString() { + return serializeToString(); + } + + public NBTTagCompound serializeToNBT() { + NBTTagCompound NBT = new NBTTagCompound(); + + if (isPresetColor()) { + // Known color, we can just do this with a simple key + NBT.setString("Preset", getName()); + return NBT; + } + + NBT.setString("Name", getName()); + NBT.setInteger("CycleSpeed", cycleSpeed); + NBT.setInteger("Version", version); + + if (!settings.isEmpty()) { + NBTTagCompound settingsNBT = new NBTTagCompound(); + settingsNBT.setInteger("Size", settings.size()); + + for (int i = 0; i < settings.size(); i++) { + StarColorSetting setting = settings.get(i); + settingsNBT.setTag(Integer.toString(i), setting.serialize()); + } + + NBT.setTag("Settings", settingsNBT); + } + + return NBT; + } + + public static ForgeOfGodsStarColor deserialize(NBTTagCompound NBT) { + if (NBT.hasKey("Preset")) { + return PRESETS.get(NBT.getString("Preset")); + } + + ForgeOfGodsStarColor color = new ForgeOfGodsStarColor(NBT.getString("Name")); + color.setCycleSpeed(NBT.getInteger("CycleSpeed")); + + if (NBT.hasKey("Settings")) { + NBTTagCompound settingsNBT = NBT.getCompoundTag("Settings"); + int size = settingsNBT.getInteger("Size"); + for (int i = 0; i < size; i++) { + NBTTagCompound colorNBT = settingsNBT.getCompoundTag(Integer.toString(i)); + StarColorSetting setting = StarColorSetting.deserialize(colorNBT); + color.settings.add(setting); + } + } + + return color; + } + + public String serializeToString() { + StringBuilder sb = new StringBuilder(); + sb.append("StarColorV1:{"); + sb.append("Name:"); + sb.append(getName()); + sb.append(",Cycle:"); + sb.append(getCycleSpeed()); + + for (StarColorSetting setting : settings) { + sb.append("|"); + sb.append("r:"); + sb.append(setting.getColorR()); + sb.append(",g:"); + sb.append(setting.getColorG()); + sb.append(",b:"); + sb.append(setting.getColorB()); + sb.append(",m:"); + sb.append(setting.getGamma()); + } + + sb.append("}"); + return sb.toString(); + } + + @Nullable + public static ForgeOfGodsStarColor deserialize(String raw) { + if (raw == null) return null; + if (!raw.startsWith("StarColorV1:{") || !raw.endsWith("}")) return null; + + // Wrap in try-catch for easy format "checking" + try { + String[] data = raw.substring(13, raw.length() - 1) + .split("\\|"); + + // Parse the header (name and cycle rate) + String header = data[0]; + String[] headerData = header.split(","); + + // Name + String name = null; + if (headerData[0].startsWith("Name:")) { + name = headerData[0].substring(5); + } + + // Cycle Rate + Integer cycleRate = null; + if (headerData[1].startsWith("Cycle:")) { + cycleRate = Integer.valueOf(headerData[1].substring(6)); + } + + List colorSettings = new ArrayList<>(); + for (int i = 1; i < data.length; i++) { + String[] colorData = data[i].split(","); + int r = -1, g = -1, b = -1; + float m = -1; + for (String color : colorData) { + String[] singleData = color.split(":"); + switch (singleData[0]) { + case "r" -> r = Integer.parseInt(singleData[1]); + case "g" -> g = Integer.parseInt(singleData[1]); + case "b" -> b = Integer.parseInt(singleData[1]); + case "m" -> m = Float.parseFloat(singleData[1]); + } + } + if (r != -1 && g != -1 && b != -1 && m != -1) { + colorSettings.add(new StarColorSetting(r, g, b, m)); + } + } + + if (name != null && cycleRate != null && !colorSettings.isEmpty()) { + return new ForgeOfGodsStarColor(name).setCycleSpeed(cycleRate) + .addColors(colorSettings); + } + return null; + } catch (Throwable ignored) { + return null; + } + } + + public static void writeToBuffer(PacketBuffer buf, ForgeOfGodsStarColor color) { + buf.writeBoolean(color == null); + if (color != null) { + buf.writeBoolean(color.isPresetColor()); + try { + buf.writeStringToBuffer(color.name); + } catch (IOException ignored) {} + + if (!color.isPresetColor()) { + buf.writeInt(color.cycleSpeed); + buf.writeInt(color.settings.size()); + for (StarColorSetting setting : color.settings) { + StarColorSetting.writeToBuffer(buf, setting); + } + } + } + } + + public static ForgeOfGodsStarColor readFromBuffer(PacketBuffer buf) { + if (buf.readBoolean()) return null; + boolean isPresetColor = buf.readBoolean(); + String name; + try { + name = buf.readStringFromBuffer(32767); + } catch (IOException ignored) { + return null; + } + + if (isPresetColor) { + return PRESETS.get(name); + } + + ForgeOfGodsStarColor color = new ForgeOfGodsStarColor(name); + color.setCycleSpeed(buf.readInt()); + int size = buf.readInt(); + for (int i = 0; i < size; i++) { + color.addColor(StarColorSetting.readFromBuffer(buf)); + } + return color; + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorSetting.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorSetting.java new file mode 100644 index 00000000000..b096d80fbda --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorSetting.java @@ -0,0 +1,89 @@ +package tectech.thing.metaTileEntity.multi.godforge.color; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; + +import org.apache.commons.lang3.builder.ToStringBuilder; + +public class StarColorSetting { + + private final int r, g, b; + private final float gamma; + + public StarColorSetting(int r, int g, int b, float gamma) { + this.r = r; + this.g = g; + this.b = b; + this.gamma = gamma; + } + + public int getColorR() { + return r; + } + + public int getColorG() { + return g; + } + + public int getColorB() { + return b; + } + + public float getGamma() { + return gamma; + } + + protected NBTTagCompound serialize() { + NBTTagCompound NBT = new NBTTagCompound(); + NBT.setInteger("R", r); + NBT.setInteger("G", g); + NBT.setInteger("B", b); + NBT.setFloat("Gamma", gamma); + return NBT; + } + + protected static StarColorSetting deserialize(NBTTagCompound NBT) { + int r = NBT.getInteger("R"); + int g = NBT.getInteger("G"); + int b = NBT.getInteger("B"); + float gamma = NBT.getFloat("Gamma"); + return new StarColorSetting(r, g, b, gamma); + } + + public static void writeToBuffer(PacketBuffer buf, StarColorSetting color) { + buf.writeInt(color.r); + buf.writeInt(color.g); + buf.writeInt(color.b); + buf.writeFloat(color.gamma); + } + + public static StarColorSetting readFromBuffer(PacketBuffer buf) { + int r = buf.readInt(); + int g = buf.readInt(); + int b = buf.readInt(); + float gamma = buf.readFloat(); + return new StarColorSetting(r, g, b, gamma); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + StarColorSetting that = (StarColorSetting) o; + + if (r != that.r) return false; + if (g != that.g) return false; + if (b != that.b) return false; + return gamma == that.gamma; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("r", r) + .append("g", g) + .append("b", b) + .append("gamma", gamma) + .build(); + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorStorage.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorStorage.java new file mode 100644 index 00000000000..a7a4e252987 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge/color/StarColorStorage.java @@ -0,0 +1,130 @@ +package tectech.thing.metaTileEntity.multi.godforge.color; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.util.Constants; + +import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; + +public class StarColorStorage { + + public static final int MAX_STAR_COLORS = 7; + private static final String NBT_LIST_KEY = "customStarColors"; + + private final Map nameMapping = new HashMap<>(MAX_STAR_COLORS); + private List indexMapping = new ArrayList<>(MAX_STAR_COLORS); + + public StarColorStorage() { + initPresets(); + } + + private void initPresets() { + List presets = ForgeOfGodsStarColor.getDefaultColors(); + for (ForgeOfGodsStarColor preset : presets) { + nameMapping.put(preset.getName(), preset); + indexMapping.add(preset); + } + } + + public ForgeOfGodsStarColor newTemplateColor() { + String name = "New Star Color"; + for (int i = 0; i < MAX_STAR_COLORS; i++) { + if (nameMapping.containsKey(name)) { + name = "New Star Color " + (i + 1); + } else break; + } + return new ForgeOfGodsStarColor(name); + } + + /** Store a unique star color. Will append numbers to the name to guarantee a unique name. */ + public void store(ForgeOfGodsStarColor color) { + indexMapping.add(color); + if (!nameMapping.containsKey(color.getName())) { + nameMapping.put(color.getName(), color); + return; + } + for (int i = 0; i < MAX_STAR_COLORS; i++) { + String newName = color.getName() + " " + (i + 1); + if (!nameMapping.containsKey(newName)) { + nameMapping.put(newName, color); + color.setName(newName); + return; + } + } + } + + /** Insert a star color at a given position. */ + public void insert(ForgeOfGodsStarColor color, int pos) { + ForgeOfGodsStarColor existing = indexMapping.set(pos, color); + if (existing != null) { + nameMapping.remove(existing.getName()); + nameMapping.put(color.getName(), color); + } + } + + public void drop(ForgeOfGodsStarColor color) { + ForgeOfGodsStarColor existing = nameMapping.remove(color.getName()); + if (existing != null) { + indexMapping.remove(existing); + } + } + + public ForgeOfGodsStarColor getByName(String name) { + return nameMapping.get(name); + } + + public ForgeOfGodsStarColor getByIndex(int index) { + return indexMapping.get(index); + } + + public boolean isFull() { + return indexMapping.size() >= MAX_STAR_COLORS; + } + + public int size() { + return indexMapping.size(); + } + + public void serializeToNBT(NBTTagCompound NBT) { + NBTTagList tagList = new NBTTagList(); + for (ForgeOfGodsStarColor color : indexMapping) { + if (color.isPresetColor()) continue; + tagList.appendTag(color.serializeToNBT()); + } + if (tagList.tagCount() > 0) { + NBT.setTag(NBT_LIST_KEY, tagList); + } + } + + public void rebuildFromNBT(NBTTagCompound NBT) { + nameMapping.clear(); + indexMapping.clear(); + initPresets(); + + if (NBT.hasKey(NBT_LIST_KEY)) { + NBTTagList tagList = NBT.getTagList(NBT_LIST_KEY, Constants.NBT.TAG_COMPOUND); + for (int i = 0; i < tagList.tagCount(); i++) { + NBTTagCompound colorNBT = tagList.getCompoundTagAt(i); + ForgeOfGodsStarColor color = ForgeOfGodsStarColor.deserialize(colorNBT); + if (!color.isPresetColor()) { + store(color); + } + } + } + } + + public FakeSyncWidget getSyncer() { + return new FakeSyncWidget.ListSyncer<>(() -> indexMapping, val -> { + indexMapping = val; + nameMapping.clear(); + for (ForgeOfGodsStarColor color : indexMapping) { + nameMapping.put(color.getName(), color); + } + }, ForgeOfGodsStarColor::writeToBuffer, ForgeOfGodsStarColor::readFromBuffer); + } +} diff --git a/src/main/java/tectech/util/GodforgeMath.java b/src/main/java/tectech/util/GodforgeMath.java index 1a0fa968052..d4d43f01cf2 100644 --- a/src/main/java/tectech/util/GodforgeMath.java +++ b/src/main/java/tectech/util/GodforgeMath.java @@ -2,12 +2,12 @@ import java.math.BigInteger; -import tectech.thing.metaTileEntity.multi.MTEForgeOfGods; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEBaseModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEExoticModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEMoltenModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTEPlasmaModule; -import tectech.thing.metaTileEntity.multi.godforge_modules.MTESmeltingModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEBaseModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEExoticModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEForgeOfGods; +import tectech.thing.metaTileEntity.multi.godforge.MTEMoltenModule; +import tectech.thing.metaTileEntity.multi.godforge.MTEPlasmaModule; +import tectech.thing.metaTileEntity.multi.godforge.MTESmeltingModule; public class GodforgeMath { @@ -150,14 +150,13 @@ public static void calculateMaxParallelForModules(MTEBaseModule module, MTEForge } if (godforge.isUpgradeActive(6)) { + fuelFactorMultiplier = 1 + calculateEffectiveFuelFactor(godforge) / 15f; if (godforge.isUpgradeActive(13)) { if (isMoltenOrSmeltingWithUpgrade) { - fuelFactorMultiplier = 1 + calculateEffectiveFuelFactor(godforge) / 15f * 3; + fuelFactorMultiplier *= 3; } else { - fuelFactorMultiplier = 1 + calculateEffectiveFuelFactor(godforge) / 15f * 2; + fuelFactorMultiplier *= 2; } - } else { - fuelFactorMultiplier = 1 + calculateEffectiveFuelFactor(godforge) / 15f; } } @@ -197,7 +196,7 @@ public static void calculateEnergyDiscountForModules(MTEBaseModule module, MTEFo double maxBatteryDiscount = 1; if (godforge.isUpgradeActive(8)) { - maxBatteryDiscount = 1 - (1 - Math.pow(1.001, -0.01 * godforge.getMaxBatteryCharge())) / 20; + maxBatteryDiscount = 1 - (1 - Math.pow(1.05, -0.05 * godforge.getMaxBatteryCharge())) / 20; } if (godforge.isUpgradeActive(19)) { @@ -211,12 +210,12 @@ public static void calculateEnergyDiscountForModules(MTEBaseModule module, MTEFo } if (module instanceof MTEExoticModule) { - if (!godforge.isUpgradeActive(25)) { - fillRatioDiscount = 1; - maxBatteryDiscount = 1; - } else { + if (godforge.isUpgradeActive(25)) { fillRatioDiscount = Math.sqrt(fillRatioDiscount); maxBatteryDiscount = Math.sqrt(maxBatteryDiscount); + } else { + fillRatioDiscount = 1; + maxBatteryDiscount = 1; } } @@ -224,7 +223,7 @@ public static void calculateEnergyDiscountForModules(MTEBaseModule module, MTEFo } public static void calculateProcessingVoltageForModules(MTEBaseModule module, MTEForgeOfGods godforge) { - long voltage = Integer.MAX_VALUE; + long voltage = 2_000_000_000; if (godforge.isUpgradeActive(4)) { voltage += calculateEffectiveFuelFactor(godforge) * 100_000_000L; diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index eceda5a5c1e..adadc268b93 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -987,7 +987,7 @@ fog.upgrade.lore.28=The usage of graviton shards in electrical systems to create fog.upgrade.lore.29=The final external structural upgrade to the Forge requires the most advanced understanding of graviton shards and their applications in extreme environments. With this, the last 4 module slots of the Forge of the Gods are available to construct, ascending your operation to unseen heights of technological mastery. fog.upgrade.lore.30=With total mastery of the Forge of the Gods achieved, it is possible to begin a new universe-spanning initiative. It is now possible to quantize and extract graviton shards for use outside the Forge in powerful new technological endeavours; produce the most exotic plasmas beyond merely periodic elements; and most importantly, begin to understand the immense power of magmatter, a form of matter made entirely of magnetic monopoles with density and stability billions of times that of conventional bosonic matter. It is with this development you realise that the completion of the Forge was not the end goal, but merely a stepping stone to universal transcendence. -fog.upgrade.text.0=Unlocks the base functionality of the Forge of the Gods, meaning 8 module slots, 1 ring and the Helioflare Power Forge module. +fog.upgrade.text.0=Unlocks the base functionality of the Forge of the Gods, meaning 8 module slots, 1 ring, the Helioflare Power Forge module, 2 billion EU/t processing voltage and 15,000K heat bonus cap. fog.upgrade.text.1=Unlocks a recipe time reduction multiplier based on the current heat the multi is running at. This bonus is calculated via following formula: Multiplier = 1 / (Heat^0.01) fog.upgrade.text.2=Increases fuel efficiency by multiplying the actual fuel consumption by 0.8 fog.upgrade.text.3=Multiplies the maximum fuel consumption by 1.2 @@ -999,7 +999,7 @@ fog.upgrade.text.8=Unlocks a configuration window for maximum battery size and i fog.upgrade.text.9=Increases maximum fuel consumption by 1 Stellar Fuel Unit/sec for every purchased upgrade. fog.upgrade.text.10=Adds a x2 multiplier to maximum parallel. fog.upgrade.text.11=Unlocks the Heliofusion Exoticizer module and quark gluon plasma creation. At this point this module is not affected by any other multipliers or bonuses from other upgrades. -fog.upgrade.text.12=Improves the fuel consumption -> heat conversion formula. Improved formula: Heat = log1.2(Stellar Fuel Units/sec) * 1000 + 12601 +fog.upgrade.text.12=Improves the fuel consumption -> heat conversion formula. Improved formula: Heat = log1.12(Stellar Fuel Units/sec) * 1000 + 12601 fog.upgrade.text.13=Improves the formula of SA to: Multiplier = 1 + (Stellar Fuel Units/sec) / 5 fog.upgrade.text.14=Improves the OC formula from 4/2 OCs to 4/2.3 OCs. fog.upgrade.text.15=Allows the Heliothermal Plasma Fabricator to process multi step plasmas. Tier restriction still applies. @@ -1010,14 +1010,14 @@ fog.upgrade.text.19=Improves the EBF energy reduction heat bonus from 5% to 8% a fog.upgrade.text.20=EBF heat bonuses are granted above 30,000K, but the heat value used in heat bonus calculations is determined by this formula: Actual Heat = 30000 + (Current Heat - 30000)^0.85 fog.upgrade.text.21=Unlocks a multiplier to maximum parallel based on total amount of purchased upgrades. This bonus is calculated via this formula: Multiplier = 1 + Upgrade Amount / 5 fog.upgrade.text.22=Improves IGCC based on current maximum parallel. Improved Formula: Multiplier = (1 / Heat^0.01) / (Parallel^0.02) -fog.upgrade.text.23=Increases maximum processing voltage by 1 tier per active ring. +fog.upgrade.text.23=Multiplies maximum processing voltage by 4 per active ring, applies after other bonuses. fog.upgrade.text.24=Allows the Heliothermal Plasma Fabricator to process up to T5 plasmas. fog.upgrade.text.25=Allows the Heliofusion Exoticizer to be affected by other upgrade benefits, but those benefits are square rooted first. The overclock bonus is adjusted via the following formula: OC Factor = 2 + (Base OC Factor - 2)^2 fog.upgrade.text.26=Allows construction of the second ring and adds 4 module slots. -fog.upgrade.text.27=Uncaps maximum fuel consumption, but fuel consumption used in bonus calculations scales according to this formula: Actual FC = Current Max FC + (Current FC - Current Max FC)^0.75, where FC refers to fuel consumption and max FC refers to the max fuel consumption without this upgrade. +fog.upgrade.text.27=Uncaps maximum fuel consumption, but fuel consumption used in bonus calculations scales according to this formula: Actual FC = Current Max FC + (Current FC - Current Max FC)^0.4, where FC refers to fuel consumption and max FC refers to the max fuel consumption without this upgrade. fog.upgrade.text.28=Uncaps maximum processing voltage. Voltage can be set in each module's GUI. fog.upgrade.text.29=Allows construction of the third ring and adds 4 module slots. -fog.upgrade.text.30=Unlocks Magmatter production in the Heliofusion Exoticizer, creation of exotic plasmas in the Heliothermal Plasma Fabricator and Graviton Shard ejection. +fog.upgrade.text.30=Unlocks Magmatter production in the Heliofusion Exoticizer, creation of exotic plasmas in the Heliothermal Plasma Fabricator and Graviton Shard ejection & injection. fog.debug.resetbutton.text=Reset fog.debug.resetbutton.tooltip=Resets all upgrades to zero @@ -1025,9 +1025,11 @@ fog.debug.unlockall.text=Unlock all upgrades fog.debug.gravitonshardsetter.tooltip=Set the amount of availabe graviton shards fog.button.fuelconfig.tooltip=Fuel Configuration Menu -fog.button.furnacemode.tooltip=Toggle Furnace Mode -fog.button.magmattermode.tooltip.01=Toggle Magmatter Mode -fog.button.magmattermode.tooltip.02=Magmatter Mode locked, missing upgrade +fog.button.furnacemode.tooltip.01=Blast Mode +fog.button.furnacemode.tooltip.02=Furnace Mode +fog.button.magmattermode.tooltip.01=Quark-Gluon Plasma Mode +fog.button.magmattermode.tooltip.02=Magmatter Mode +fog.button.magmattermode.tooltip.03=Magmatter Mode locked, missing upgrade fog.button.battery.tooltip.01=Toggle Battery Charging fog.button.battery.tooltip.02=Right click to open configuration menu (if unlocked) fog.button.voltageconfig.tooltip.01=Open voltage config @@ -1045,9 +1047,6 @@ fog.button.refreshtimer.tooltip=Reset ready in fog.button.seconds=Seconds fog.button.thanks.tooltip=List of Contributors fog.button.color.tooltip=Cosmetics Menu -fog.button.updaterenderer.tooltip=Apply Changes -fog.button.resetcosmetics.tooltip=Reset Values -fog.button.rainbowmode.tooltip=Toggle Rainbow Mode achievement.gt.blockmachines.multimachine.em.forge_of_gods=Forge of the Gods @@ -1110,7 +1109,7 @@ gt.blockmachines.multimachine.FOG.modules=Modules gt.blockmachines.multimachine.FOG.upgrades=Upgrades gt.blockmachines.multimachine.FOG.milestones=Milestones gt.blockmachines.multimachine.FOG.fuelinfotext=Once the structure of the Forge is built and the multiblock is formed, just simply turning it on is not sufficient to make it functional. The Forge must be supplied with a certain amount of Star Fuel (the item) to actually boot up. The amount of Star Fuel needed depends on the current fuel consumption factor, which can be set in the fuel configuration menu. By default the maximum is 5, but it can be increased later on with upgrades. Star Fuel scaling is as follows: factor*25*1.2^factor. Star Fuel can be supplied via an input bus, it gets consumed periodically and stored internally. Once there is enough Star Fuel stored in the multi, it turns on for real (allowing modules to connect) and converts the consumed Star Fuel into stored Stellar Fuel. From this point onwards, the Forge must be fueled via one of the liquid fuels (type can be selected in the fuel config menu). If there isn't enough of the selected fuel present in the input hatch, the stored fuel amount will decrease and if it reaches 0, the Forge enters the previous 'off' state where modules disconnect and it has to be supplied with Star Fuel again. The amount of internally stored Stellar Fuel (liquid) can be increased by turning on battery charging, this will cause the fuel usage to double, but half of it will be stored in the internal battery. -gt.blockmachines.multimachine.FOG.moduleinfotext=There are 4 types of modules that can be used in the Forge, the Helioflare Power Forge, Helioflux Melting Core, Heliothermal Plasma Fabricator and Heliofusion Exoticizer. These modules are separate multiblocks that have to be built into the Godforge structure at their designated spots. Once built, these modules have to connect to the Godforge, which happens automatically if all requirements for the respective module are met. Alternatively, there is a button to refresh their status without waiting for the timer. Each of these modules has its specialized functionality & requirements and is affected differently by certain upgrades. The first unlocked module is the §BHelioflare Power Forge§6, which simply put is a blast furnace even more powerful than the mega version. Additionally, this module has a furnace mode, turning it into a hyper powerful multi smelter. This module is unlocked by default and has 1024 base parallel. The second unlock is the §BHelioflux Melting Core§6, which also processes blast furnace recipes, but with a twist, the outputs are ejected in their molten form instead of hot/regular ingots. If an output does not have a molten form, it will output its regular form. This module has to be unlocked by an upgrade to function and has 512 base parallel. The third module is the §BHeliothermal Plasma Fabricator§6, which possesses a unique recipemap featuring direct material to plasma conversion recipes. These recipes are grouped by two properties, fusion tier and steps required, limiting which recipes can be processed before their respective upgrades are unlocked. Unlike regular fusion, these recipes produce the plasma of the input material. This module has 384 base parallel. The fourth and last module is the §BHeliofusion Exoticizer§6, a module capable of producing quark gluon plasma and later on magmatter. This module has unique automation challenges for both materials, so it is recommended to have two of these, as they have to be locked to either one of the materials. The common rule for both modes' automation challenges is as follows: the module outputs materials at the start of a recipe cycle and waits for the correct inputs to arrive before starting the actual processing of the output material. If producing quark-gluon plasma, the module outputs up to 7 different fluids/tiny piles with amounts between 1 and 64, and their corresponding plasmas and amounts have to be returned in order for the recipe to process. For each L of fluid, a bucket of plasma and for each tiny pile an ingot's worth of plasma must be returned for the recipe to work. If magmatter mode is active, the automation challenge changes. Now the module outputs 1-50L of tachyon rich temporal fluid, 51-100L of spatially enlarged fluid and one tiny pile of a high tier material. The challenge is to return both the tachyon rich and spatially enlarged fluids, plus as much plasma of the tiny pile's material (in ingots) as the difference between the amounts of spatially enlarged and tachyon rich fluid. Once all of these have been returned in the correct amounts, the recipe will start to process and output magmatter. This module has 64 base parallel. +gt.blockmachines.multimachine.FOG.moduleinfotext=There are 4 types of modules that can be used in the Forge, the Helioflare Power Forge, Helioflux Melting Core, Heliothermal Plasma Fabricator and Heliofusion Exoticizer. These modules are separate multiblocks that have to be built into the Godforge structure at their designated spots. Once built, these modules have to connect to the Godforge, which happens automatically if all requirements for the respective module are met. Alternatively, there is a button to refresh their status without waiting for the timer. Each of these modules has its specialized functionality & requirements and is affected differently by certain upgrades. The first unlocked module is the §BHelioflare Power Forge§6, which simply put is a blast furnace even more powerful than the mega version. Additionally, this module has a furnace mode, turning it into a hyper powerful multi smelter. This module is unlocked by default and has 1024 base parallel. The second unlock is the §BHelioflux Melting Core§6, which also processes blast furnace recipes, but with a twist, the outputs are ejected in their molten form instead of hot/regular ingots. If an output does not have a molten form, it will output its regular form. This module has to be unlocked by an upgrade to function and has 512 base parallel. The third module is the §BHeliothermal Plasma Fabricator§6, which possesses a unique recipemap featuring direct material to plasma conversion recipes. These recipes are grouped by two properties, fusion tier and steps required, limiting which recipes can be processed before their respective upgrades are unlocked. Unlike regular fusion, these recipes produce the plasma of the input material. This module has 384 base parallel. The fourth and last module is the §BHeliofusion Exoticizer§6, a module capable of producing quark gluon plasma and later on magmatter. This module has unique automation challenges for both materials, so it is recommended to have two of these, as they have to be locked to either one of the materials. The common rule for both modes' automation challenges is as follows: the module outputs materials at the start of a recipe cycle and waits for the correct inputs to arrive before starting the actual processing of the output material. If producing quark-gluon plasma, the module outputs up to 7 different fluids/tiny piles with amounts between 1 and 64, and their corresponding plasmas and amounts have to be returned in order for the recipe to process. For each L of fluid, a bucket of plasma and for each tiny pile an ingot's worth of plasma must be returned for the recipe to work. The tiny piles are always ejected in multiples of 9. If magmatter mode is active, the automation challenge changes. Now the module outputs 1-50L of tachyon rich temporal fluid, 51-100L of spatially enlarged fluid and one tiny pile of a high tier material. The challenge is to return both the tachyon rich and spatially enlarged fluids, plus as much plasma of the tiny pile's material (in ingots) as the difference between the amounts of spatially enlarged and tachyon rich fluid. Once all of these have been returned in the correct amounts, the recipe will start to process and output magmatter. This module has 64 base parallel. gt.blockmachines.multimachine.FOG.upgradeinfotext=Upgrades are the heart and soul of the Godforge, they unlock most of its functionality and processing power. The upgrade tree can be accessed via its button on the main gui and each upgrade node can be clicked for more information on its effects and unlock requirements. In general, each upgrade can only be unlocked if the prior one is unlocked and there are enough available graviton shards. One exception to this is the first upgrade, as that one has no prior upgrade. Some upgrades can also have extra material costs, which are denoted next to the unlock button if applicable. If an upgrade has more than 1 connected prior upgrade, then there are two options, either the upgrade requires ALL connected prior upgrades or AT LEAST ONE (indicated by the connection's color, red means ALL, blue means AT LEAST ONE). Upgrades can be refunded by simply pressing the unlock button again, but this only works if ALL connected later upgrades are not active/unlocked. The block of upgrades following the unlock of the Heliufusion Exoticizer module are special, as they are what is considered §Bthe Split§6. As the name suggests, only one path out of the three may be chosen at first, and the others will be locked. Each path has specialized buffs that are primarily targeted towards a specific module, and thus affect other module types with reduced effect (unless stated otherwise). The amount of unlockable paths depends on the amount of rings the Godforge has, which in turn are limited by later upgrades. gt.blockmachines.multimachine.FOG.milestoneinfotext=Milestones are essential for upgrading the Godforge, as they are the source of graviton shards, the main currency needed for unlocking upgrades. In essence, milestones are just what their name suggests, thresholds that when reached, grant graviton shards. There are four types of milestones, Charge, Conversion, Catalyst and Composition, each referring to a stat of the Godforge. Each milestone has 7 tiers, each being harder to reach than the last, but also granting more graviton shards. The first tier grants 1 graviton shard, the second 2, etc. The §BCharge§6 milestone scales off total power consumption of all modules combined, the first tier being unlocked at 1e15 EU consumed, and each subsequent milestone scaling by 9x. The §BConversion§6 milestone scales off total recipes processed across all modules (excluding the Helioflare Power Forge's furnace mode) and its first tier is unlocked at 10M processed recipes. Following tiers scale by 6x. The §BCatalyst§6 milestone is based on the Forge's fuel consumption, counted in Stellar Fuel units (the number entered in the fuel config menu). Reaching the first tier requires 10,000 fuel units to be consumed, and each tier above scales by 3x. Last but not least, the §BComposition§6 milestone works a bit differently, as it scales off the Forge's structure. Milestone levels are granted for each unique type of module present in the structure (Heliofusion Exoticizer modules on quark-gluon and magmatter mode count as unique) and for each additional ring built. Your research suggests that something strange might happen if all milestones reach their final tier... Make sure to check back! gt.blockmachines.multimachine.FOG.contributors=Contributors @@ -1128,23 +1127,54 @@ gt.blockmachines.multimachine.FOG.bucket=BucketBrigade gt.blockmachines.multimachine.FOG.playtesting=Playtesting gt.blockmachines.multimachine.FOG.misi=Misi gt.blockmachines.multimachine.FOG.thanks=A huge thank you to these incredible people for helping to make this a reality! -Cloud -gt.blockmachines.multimachine.FOG.cosmetics=Star Cosmetics -gt.blockmachines.multimachine.FOG.color=Color -gt.blockmachines.multimachine.FOG.misc=Miscellaneous -gt.blockmachines.multimachine.FOG.red=Red -gt.blockmachines.multimachine.FOG.green=Green -gt.blockmachines.multimachine.FOG.blue=Blue -gt.blockmachines.multimachine.FOG.gamma=Gamma -gt.blockmachines.multimachine.FOG.speed=Speed -gt.blockmachines.multimachine.FOG.spin=Spin -gt.blockmachines.multimachine.FOG.size=Size -gt.blockmachines.multimachine.FOG.apply=Apply -gt.blockmachines.multimachine.FOG.decimals=Accepts Decimals -gt.blockmachines.multimachine.FOG.integers=Accepts Integers gt.blockmachines.multimachine.FOG.hint.0=1 - Classic Hatches or Transcendentally Amplified Magnetic Confinement Casing gt.blockmachines.multimachine.FOG.hint.1=2 - Module Controllers or Singularity Reinforced Stellar Shielding Casing +# Godforge Star Cosmetics +fog.cosmetics.header=Star Cosmetics +fog.cosmetics.color=Color +fog.cosmetics.color.red=Red +fog.cosmetics.color.green=Green +fog.cosmetics.color.blue=Blue +fog.cosmetics.color.gamma=Gamma +fog.cosmetics.selectcolor.tooltip.1=Left click to select this Star Color +fog.cosmetics.selectcolor.tooltip.2=Shift-Left click to edit this Star Color (must be a custom color) +fog.cosmetics.starcolor=Custom Star Color +fog.cosmetics.customstarcolor=Custom... +fog.cosmetics.misc=Miscellaneous +fog.cosmetics.spin=Spin +fog.cosmetics.size=Size +fog.cosmetics.cyclespeed=Cycle speed between colors +fog.cosmetics.onlyintegers=Accepts Integers +fog.cosmetics.onlydecimals=Accepts Decimals +fog.cosmetics.starcolorname=Star Color Name: +fog.cosmetics.starcolorname.tooltip.1=Set the name for this Star Color (max 15 chars) +fog.cosmetics.starcolorname.tooltip.2=Must be unique! Will have a number appended otherwise +fog.cosmetics.colorlist.tooltip.1=Left click to select this Star Color +fog.cosmetics.colorlist.tooltip.2=Right click to remove this Star Color from the list +fog.cosmetics.applycolor=Apply +fog.cosmetics.applycolor.tooltip=Apply color to selected Star Color +fog.cosmetics.addcolor=Add +fog.cosmetics.addcolor.tooltip=Add to Star Color List +fog.cosmetics.resetcolor=Reset +fog.cosmetics.resetcolor.tooltip=Reset Current Color +fog.cosmetics.savecolors=Save +fog.cosmetics.savecolors.tooltip=Save this Star Color +fog.cosmetics.deletecolors=Delete +fog.cosmetics.deletecolors.tooltip=Delete this Star Color +fog.cosmetics.importcolors=Import +fog.cosmetics.importcolors.tooltip=Import a Star Color from text +fog.cosmetics.exportcolors=Export +fog.cosmetics.exportcolors.tooltip=Save exported Star Color to clipboard +fog.cosmetics.importer.import=Import Star Color +fog.cosmetics.importer.error=Invalid Star Color +fog.cosmetics.importer.valid=Valid Star Color +fog.cosmetics.importer.apply=Apply +fog.cosmetics.importer.apply.tooltip=Apply imported Star Color to color editor +fog.cosmetics.importer.reset=Reset +fog.cosmetics.importer.reset.tooltip=Reset imported Star Color + # Optical Circuits achievement.gt.metaitem.03.32155=Optical Assembly achievement.gt.metaitem.03.32156=Optical Computer diff --git a/src/main/resources/assets/tectech/textures/gui/background/white_glow_half.png b/src/main/resources/assets/tectech/textures/gui/background/white_glow_half.png new file mode 100644 index 0000000000000000000000000000000000000000..69f46d998d740a004a9bdac0ebe14746d2db6939 GIT binary patch literal 9261 zcmV+|B+}c7P)Px#1ZP1_K>z@;j|==^1poj5=TJ;kMgRZ*#>U1~RaK0PjE#+ri;IhiiHU}WhJ=KK zgM)*Df`WyGg^G%be}8{`e0+F#cy@Mnb8~ZXadC2Ta(#V$baZrXZfB_$*zBp@Il6B82=5fL379UmVb7Z(>A8X6%XAtNIr z8yg!E5)u^^6&xHK7#J876cia586qMg78VvB9v;QT#s2>OaBy%iFfdPbY5F z00009a7bBm000id000id0mpBsWB>pn&q+inh zwiL%>E|+U_Cu1jh|K}M1g({*pHm{^_zWJde-6oq`vrYjh6l(jA4>*mFc>4j@@zKY; z^8r`!(Z@vAM;~wkA2V5>06zT`KX7k{^A*8|KII*~Wza*!ed;uQwXPG`j|Z;^9aP8Y z6F$T@`c!)ay~|tLsD1w2FMwTn6$AG5aY5E+pWL~7_ul;n@Q*$osIA%IZ}bNr_(>Z+ zp^oA{{-+Hc)F&-8-LKWZk*<@X;54eEj&yWBgN}fT#QiU)1hXI`tI)KYl`& z;0J!eeY1h{utyj1fv0%CdI}w*btrN zKGas7#Ba`JbOX zyt9+_-+%f3`46xD`r}Urc+J~4;!|%Bugw*&)ee2ahdxXYH|*E*me0M0o&7R((t3sk zeI;*cgID9Vrh+~eju+_5JF@#EiK{qX$DM|XF!{_ykPzkc=0|NNT#A0XxJ+aP!^ zAC%|bcv8EjO8)8nx3o-K6T#;q!@m=O!HZ5(>y8>OC$j5ug>*S~J zUOavv$a;)q)otKChNUg*s_)miXi|O?iK$%N6gsGrn)d)3Wc$kd3M=qYYf*6DJA-5C zCF5_1JlS~9AYV$}ySX&{1piI@HVb8GkuB6%Ikrfrv|82um1 zxAqEEfLaI)WMqjc#f5k$z!bH}9>+G$=rMngqm6 zVQ!WIP6AmkC0P$h4dHjoAp0?NLn~A)jzI|1ib7P17cAlXMeE_h2Q^S_fvkzYA_^&} zfP86<`Dhlkd+~^=({QE^zMwMdrBrWCWC=BVpd<@0EK#C8%u8{S+O6G_I}O8(D6|Xy7;n4QCw|C!4jEgU)Ua2u7KVQt*!e8OGL27Wz&y!$-4je1(S6%p3o~o z-()hwkC81qtt>@LF;3ldA!{|Gl_xmt6P1N!;lb#OH(cA)q_$6$l;lP&H42eg7N)Sp z>YH-E0m*vm8F+PWS_-vuh^}aTV;=|D72X4wvd>`3c_(oa)#I_Uuq0(mT0=&i?p&E1 zVfEQDuy*>GgGJ$`kxxLfo>*#VBnuLj`96e;b=ln9JI2(C1fxxtXcQ?3C!IuMcCoU5 zH08jQCBhr1`R3Y9|0O0@m~R0GAhRFfso|5C-@Vafq0~k+T%!m$8CTFtwkpeO1mQ6B z1<9H%E7ifxm{s|ZCW3}MRT`1IiZu%1b5SIoT=b2Tw&aZ@>mQaHBI?vGacoS@b914?=E%#l?wU9e8W2)YjSU~3jJ2(WxYT`ajp^hK(0f7!N+ zRLa63tMlZ_mn>He5k(U6qPi@-wYf6rGFea5swm;w8!9;a(v}u3IxVg)Ttd!{9Oc3v zuHXkThXkL4LzeIP6Ip?}A)nNkQ_C47Op8;q3!w{;%ovhJWUTK)xC)N?+1@y{Fy)j9 z&kc<}zpB)9#J2OiCCvgq7!s?8#RDG|OIqDl|B>ekEFfXzmaGg1Oo ztrS@JX2Vf}4v!VNWA;_iX&o!LPUs5OWE}J^Gmc?in#jj$d%?0AWY+b>+xTCPS_6}T=qe(=M zHSg+dSuzYK75e(ls_k?#ykX#y6;wk+4{Ba=HjGfd8~ODxVmKiiM)kIkKqt7cqgo_g zs=mW;GZwXQbF>f)AHw2w))LpNixh3oJek_8@oge+NT#iAL+l~?~+<1t83=v`tdW`*#S z0Clvs9VK|Ef>g~yy9chLxf|h@LbZuVCs?eunvPZq3glM`- z5xh!%?b|6|+HEGu(l+Z@4H2vRd@|CJ463!lI3KP_mu~ z$-=0^5m{K#KQLL~4n;VbF}-or+8$Z~B!vk|feHvU0yn3^MFS>H-j#+E-fC!D*0+m$ zYD*^-d%lQN$pnH8;JcI8(kVrobu3vNZiDJ5xgVyt>R`I z8>==%4cCT!vUGBTCiRj|C~*01v?_5KlxdtKbRBeQc-1L|f@e36a~h0if$)Vo5)eS3 zZ>@+}#q4xEZ{+B@i;~NZlIxUi$U&w&MS-L6g8dmdA+d7hj~nyzB%HLNt&rYgf4s#uxHXg{ zB1^jtNY<068g`2-!$puS^zxgKw4=#*8yi2fysQzq0&GgOMm9;4TkdAcuIJ(U1sI4L zFQ|6wZ}~7CI)TkBOGD+sKYj7t>o8fHZ2wiLgHbK;ufhHg0f7gb7k=9#bZnh-*@Wf* zQi~hitlYUpGB-zbv7g_T0kXH-dzws^JJwMZzlGA!kVT~-c<^De#*k3VVf!?YpD*hV z3h1SUjK(2YYHpf6-+c_~qL!2E79;~({uo){Yhg}+^k_JWj8XdpJop#CO9LOP?&Pwu zZ^syJt}>co^$S|2GlE)R zX(;1aF{iYQl=@?&_ds`1u>>hz)I%ofhDDI6^i@}GRE;_{8?B3Tan5R?9Wf7ZBfMy= z#-lJHSu*$+s~gtQe4V|XDjF5WPe8mj?)#=1B|P0c2K!K5d!??_Q3tV!D-f$!94Z|y z-Of20UAo~92;Z^x4Gh{W>1RbG>!{_sjwhq%*k{^o#l}&qpplECR90xXdY=-lmNV70 zZ`_q3{+KPrMnoOL2Xww@QE4bV_(*jpix%2|I$lcMOdOCkII_|KbjnobLC@WS60MCr zF1I;)ReCr_mAOx_%giYBaQ5WGA?wpHS$0n!4>A(uLC3EdAj4Ma97aa!lc!fK76H3; zcd4r2=k5(GQ*F$`LkWUC9m#SrdRLv0EcW0PSs}@4jte3{apj72$l5erhFe#5QZm@X zDTiamx>U)5FRw4uLN=|4KdHgrTBQiPt%pRGuvzG5y>{5Y9M~j{@|K0%Nvuk3;__et ztIKmt4=eI2`nb`Ankyv2>KZB<;SsK61#H$NnvUY|$1%JQD8H#X8Dqts-(9MLNPYvn za#)*qOpOAUwXEuQc8C+nVyBeJ@@$r0YYCytZs`-8LP3RC5smpfzyTH+m)uTI7BFKi z=6V$ut*(XN(KS(p-cl;hzj&tQ?-Qc1(bmmm__Z17SrjRKYN=u8C}EBSZTc8?Qm}%ha!BHP!HA(%_&8O@ zAckbUB!wbl^C`~Jh95Qe7Eti+-2n-mY0^cqWb^$4+k@Y1Zw0wZ=bLF9imkX*Im(%I z%6$X(j-Zy6y)EiGrlgsZLS1ebWeR*y3o7Kdm^vMifb*^;bc z(Iwk=;HfF0-X~?tx#8WhB}sd$V04o-NycyC)}|3vnlxZ_qbdMw!tdFVJoEEBnBnN9+_X>%=r!^nsCVjtBGNzvCv!Gsj6F4!u7gwKGs9}q z>@rs41;vUWf~fiJn^BL!gD7mpH~@8xpSipbwwkLRd7c+$K+$$PbGn7(0m!oZXNl6# z>BOotIW^VcPWPD=7hd9T@pe$**0Vl58XZU~zt9}Cb?S*xZ-hDuIhmt+2MV&N7mf6@ z93|wpwvOh0Qo?;8-X3HqZCyVE24@GId%Je^Bf&_(kosyJ#2U7nmEm=s`?m859 zW^xA_H?Ob*EhJ@Us6JhCodmOWR=?3$Y#UQM1m#=}`H9;29QDOX1w|92fww!etxk18 zm4W_`D-*EiQ+FyzaT{Ow(^NZX+@0sFbV z=g#{B^`AKBZGqG@d+0ARg#bP-o~hUx>}u)SDm4@~OOxexBquG8s zx~FFx2rwAsPF59ZgT@5KGZnlCFYG^LuFYZ(-mSIJD9C7F16{CG)S<7noZSlG3UI_4 zJAR!gYJsd_C##FRHmHgdijhFUb4doLJZRu2SBUWDs9-4_7yQ283L-jAYK*`H8WvBW z23$0D`(=?ya?rzw_R=8X@J=r7paE5p_8LvG>^^E51fdp|>ad0S_P_z>YUmb@n!EaJ zASck=HSFx*c;m~}njF-QZ57G;b)6jk)>IEbph)ex zsFoN)N1nqLDW0Nad7};pNY?M3f#;J3r)qnmi8Ti&rMxm2lO{;q`Rr;na|TFHHpogF zT&6vEJbP^28GGE49C#@B!n6cNm?;EJKlWC(Y*tteo#w+ZWI>!xSnD_zEe!gYE36qX zfH2YRt#5TLomx!J2>IUFTcQ00a~Jj!qm9DeNGSwXq#XkvBI{J=D>-hhUC{?Vlmgi) zp6C9MNcU0D6FS>O9>p22X*Xc6oZ^Hm#Bor{qx}tnJsF2{l69(PY>`!A?dqD-Z-PEP zSAczjJS+*xZ6F8YMC4&l0FHn~5e|3Y^(JA_2zH-RQHSef@%9ihH`&a2^U`i-M5X%$5jjXB%fl*pZDGV}IUU06fPfD^waD_uSSH zwePi6^FJI(7Li3ch~k3LFf%z~+Agg!_(rp_ArAEqu7OhXiU}3tcY!RG1!3zn1w|{| zKn1GckQJP`ConOE4>`u~Qc|n?q0J&YMKx}`7JosBK+7Y^R+^f|GmH6HB<&MQVrw|H#UOpQy9_%vTP6DCo8DI9%NH_qvlIF)LzxRg)#zJPe~!clG6*$ zjc6l58;9O_mQ>W;@d$g=qga%2jI~a5i?4|GWT*^kJ#(TCAp;-OU=N~dIHih-Siwvn z*Mam5%p1A`)a32>1#@Gbfo2OYpV9^hJC^mmeQAW+GCnujIx%@{g@;g*GJ7E!pR7~8 z7esXoWScC`m8ce7gP90qp^d;I!O!O1dQb*XF|g)p;6)VNMF`NPBNrPHJp{dx!VEtX zOfD+n83P}6Ml1-&A#auB3%@G_Dlf6XER}Hs@?r@hkRpJ!!ZEe+(Om@56Sgc>I%AEV zfI?5M1sIp$9JVCZimYP~UeB9$2x-@NWZ|`NsnSD`fr1PQwjdmfFr^y!#EGBGBq2eF z;%rT5l74k(1bvAMPOR&^wZfPPP{adLn`o73Eo3DiJ=6^>%YnHrZB(Tn0F+G)0kRxehK_!D^BVX|edp*OiwXOpub1 z)DTS4VSxakA^;R|Nb@V>%Z2|mrQCV&Oq*jErZ(m_Sh!?)QzQf-ym#d-otYYhy4XRT zCZ}pHP;*#YV_)`M`L>YkHb+EJP8AG=u z?SgukqOpQP>xz*h(aO+L!69G=kjn(1 zB5gED%B=@uWy#W`Wx?EcT?dz}bAn}TE%-ter0A?EEkXa<7K|7C47|~agtTeiwad+f z_U%}-CK<`W0uk=0)4;r*M}Ts$?6B@enu27RS&n?0bz8yO&|&aqLy7{Y0l_7|a0(f4 zyN=x~!UgWYyKs`<>R7aN|84>Z6_N+4c$-BxrUhhvZc?@?S0w9{VC`c@S9~fe)>&YY z1_FZZrcfrH;JCwnLR;I>z;8Y6VFaQ?B$G(w!S?j)t!+Bq;H1jzwYdh~_Tary*&&E# zBb>yfOV2e|5iTH7b26=%kmXb=aL$je9cZ3qYK=I6wYmuyY0`kIO-}aXtZ~|dxok97 zWZ>l@MYd!e8U+oUc}n4ej$(1-DZ9wA;dd!+7I4e9SQy0u%^fo14Bn6>jVSU0$QP-n zGtbV8b6?wa=OFS7=i;q5G1Di_MdOmCizRoipfC)hG~-uf>ZllS(upz6ag;q6tur}Z zAWPYHgQ1n`itB5yaAGD8UmKe6;t+F-6U1K%HA-6nCChUin5=_-69T=-UFw5irZ+wZ z>|PEk)!~FY=VpDSESb{2#;QedWkG?_GP?WZ;ZVSZtIQ0b6DLx9dp(`2y-iqZ0#!7cX}RXxY?kZ+Te=j< z(M1i2!!)#t#x<)Ndu1V?EF)R&>QNCGvS^V}Gp(j-`i*(X zu{e=)IE7*NhXJ;X=;QoLi`B298w;qcs_Acw4Lk>%0#6NrEVZzj8PRc!N#~SWizT{% zW`+GemVJ2-0~&8twYXLa26s-_c(p1_Gg8Y;puxdLZg)e(wlrh)JDgd)&5C*+=NczL zP8*(cv&u&D94z3%YL@F@BrB@XHfH^@WZw7HZ5)6-A_V4p9Wc$HQz{O2rl$Z+qrWZ_ zYH+YA#zJNLeNcmu3!&uordq<&rM#?s<(d^ec@8$BYIxA!(n6snl~&_$R*5qhz#NTv zjti3bG42Hk&MrJs_5@o!c??-iBPRXDrd)_QA`#e@>-t&N(o5E86D)ICw#cePNSSZ6|_5jC0GT8ofCeb4%(r?4@wb=3e=B*0ru^_lB6 zV|N@Kvb9g;Au*QCoL^eGdX)efcqv&-mT$3e)t$f^eVVMA?0a}3#nr0FRC1UPK@D!N zmWkQAKG_|~%Cyix1)3K57&r`7f?8`l;itVlrB`KpqvU3k>E1;6y8vNx+y=JRSmgKSoK zi-8QhSCJN7+7(c+ngUhPsVC>B$ny0hbEScM7gkWV>FLalVszZOZ=tH6DjW~t=^>Vp z^ebsfn%`a@z(A7ax9)iTPvLo42X@k{>gM_-RO>-_&`u!q;!o4cZC5>1jkRzE+aeN{a(wD=e#S<+@v)WJ1b*oOmO4k|59CTgCHT3jOX^X$T#dWv8)`@j_TRG*7CxH2uq`8996Y#cc%N*Ro4A@K3P^Jr_p};L zYR;GO< z2JD?c2Mn}+sbOCCepC zOBRx4=S0W0o5`A80tmj!A!_evZiWdCs()EtM@Qyzwp0t5jKVKMY@BfOuftVCH1MxI zH3X8V^uq3B>WG0&R(MJWYV7mTc#1d~w)*B^v^Rp|#hqH>ba1^<_2_H0>1dSUHt-BQ*(@(E zfSq5n8B27xpyYS%RB0HQho%oW4}gmwMV|JC(L6h1Kr3FMCYBZJDTMHTCNUucZ&i1Y zEU&kpnnMY}?`WV|XjI6Pd{ zKL(O4M-5*mas&W_!vS6f>Sc%;6^zd#IXs3Hu@2OPI$38L0wFYl>5k2dI7MbNQgG#c zx-^iSHW>dq0FouEJKQnEox=`*>$wNIAlICuC3ifEE#aVMcK2YnVk%f{&Guy18l5RJ zGSx=XAB?J!Q%(SQJs?0VCn6vN@7XL!TOiHj<}Q*BSeb(hD_}Gvo&|@X=51hYwodw( z;dS~($#@x`e73r0og2zEOZ?(cLPp$2-+*H3Xa#sim+}8 zP8GI>x(QA)_!(qtFvVNXnmk8MytM9lnKZn>6fh2S-G(j4!0+qsoSq7wZAF*y{OeI) zd1`|Lc88EPv)cMX6#!na5TO@K!#QxUUQAt0>6Y24azD%y0(GBEJuqg3sg z0qP90S)S`arw---lDM#P6%{u_^wAOD;UaMgj!d;&?$UjvS+W*j1dsh<8~v`)d9zJh zx>f2m$C3j5)A=5-o`L_v&tHB0>X(21s!9tV+THqpgj>JTTc+XHfBy37>%aeecPH!a zU%r3-!>hmk_|plz5ubWv9}PwWS@}J;klTQ~P50 z_B(I!#1lA8m;bId@cG2PU2Wjt6S$H-4d8&f7#{|IPxaM+CjdM_ANZY)0_YHJ&8~jv z{^Ix@4)SUK4czb*c*0!#^eO(Gxo_Y@ZSeEny}SRu^Z93=7_vU#1Qc1g`G7O{z|}4AfveN__~ZWtZD@J`Q`9W4 P00000NkvXXu0mjf5!Ql$ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/batch_mode_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/batch_mode_off.png new file mode 100644 index 0000000000000000000000000000000000000000..eab0aef166a7f650f1e939b8331645fafef2d7b2 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0G|+73kwS`FE1c(GW$;-AjMn~anMprC`Ni(`mJaPK)sJ_ZF2X2&Q0`@_5!vgn%`UOXvhBLAED@FUp`=i(BS6D~9Q svYS{$Fq<-&vEIDnz31!gmRk(pdC%!ER@Soef~;lmboFyt=akR{0G@<7JOBUy literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/batch_mode_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/batch_mode_on.png new file mode 100644 index 0000000000000000000000000000000000000000..bd39bf20a890469bc6532ed960b8ef845a089fa8 GIT binary patch literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc4K|)Gjv*HQ$r8UB1ihLY8}2UopR>k?N9K(V z&zu|`o;MC>PM$kcP*kYXWtGyPr1;S2YkiWJ*x~;BJUsS|5-#&^?w;`Q(khlYYzB^* z1`IdsaxiQVPGJZz4&Xl`FhRRvS%>ry;~Msv zZLA497}iL3Ip$1o6Oc}skaweoXL>>@;|;w;I- zb0>F8U7R%TF`TzNPe8GXnIecEi_6>iQTN{6TwOBnNfq_BSY*z5n`?qX> Pfy?0O>gTe~DWM4f7ht6b literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/furnace_mode_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/furnace_mode_off.png new file mode 100644 index 0000000000000000000000000000000000000000..ea2eaab096e2cd987d3483f547e75952afa66aed GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en@RO&DV~B&&fIc3}@VZ!~;P@H^S^Il<8XVC9vM8=cN5JUe)_a)ZUQK=;Qzo6r7y$+S3F s>_}_p)B8aeGPfRiyD9rco%8|jN3EInqZS+P1Nxr9)78&qol`;+03@-Fv;Y7A literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/furnace_mode_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/furnace_mode_on.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd41221fdaf987e3b6b2237c812f2622b099929 GIT binary patch literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc4MLtSjv*HQ$r8UB1icnBNPd6$|K^Puk~bn} zO5Ru?am3EZp3B*`t)b!WlK)bCJ9%W*@Fbk!Tk81Z-OHyu?#~uV9b#Gfu%UHk=fnT? zY;E)F6@G{d{rme{KSY!%VTZ%1+*|+WJGB1)_qV-*@s+5=?>n0+*4$H*eqiEzu9)qH zs(t-m*6P=1|H-V$GGzIBSp3g_)+;NLW*+(Q*qm9$-oi}uO|QDOap0E)1vx^~|Auex zamo0@%HyFSEwW&NL}f({+u_Hu9L@nrjZ>#~HqK>TA<)(+b)&(AgITxz*fIMRSsV_A z4ZW>18%0-1^etp-Fc7{FH{tsP#xC)iPuKtbXXP;oc+e=)lxgu_KIYBc#u$-WW=;tS ZhL)g;;DEAQvw=az;OXk;vd$@?2>=X@m*xNf literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/input_separation_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/input_separation_off.png new file mode 100644 index 0000000000000000000000000000000000000000..b6278699b686d747b8a96e4a5fd31f1dfe40ee67 GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+726i0_3kxqVFQ7o=^^3PmwAg8%>j&)}f7@(Ym9S>O>_%)r2R z7=#&*=dVZs3L1L4IEH8hCnvZu?_g;VX*zo5%!v~WZXAqi1`c8g2~0|Rn6_MKdS_tJ gny`?`gfT6R!Rskg?hogDPM~H6Pgg&ebxsLQ09LUyZ~y=R literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/input_separation_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/input_separation_on.png new file mode 100644 index 0000000000000000000000000000000000000000..b8202b199b1de320a1cc7d8cac2f260eae267e32 GIT binary patch literal 376 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc4ZNN%jv*HQ$r48zVxQYjX+7n}>=Pix*CM0# zU%Ye{)3pV12G9399$_-Lt(p6@{{0P~)mnxCz0y~CfU>H^If z3TaiFx)RU#6o}YL=p`hlru|^Ma%KLa(;vQyUl35J4&JJF*j(ZF^Y{A$LOB`|8LXv` zFbMqMyTWov;Q-5)@7MK{co=pvtkB%?+31FXz&4HjXAT_oTf%)HjzMa}HklW!3(_Xc z6P~+^=T44;_=H!j^7|zZm^Cw~pI|*w!T5w}!r5g@9nzU|Ss#AL~k1i6u4{8X6fH9D52+ Uz1;SW2^d-op00i_>zopr08~p88#{UBnWab9A!&rVVu$_zJUFS#sUrl0|tf} X%3_?sS6(Rsjb-q3^>bP0l+XkKQMfRh literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/loaf_mode_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/loaf_mode_on.png new file mode 100644 index 0000000000000000000000000000000000000000..d48f2323c802c9de6c1e92f9413c694003ad8403 GIT binary patch literal 296 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!M&a?jv*HQ$r7wnnB6pZ*(a^L{O|vtzv5@o z(o@qCn3L5wX7|o~cxO|Eh^>Z<=>D7kMb89F)cr|I`0+&7q zjtoZ`CcHFQe#qdCzyh}!iu>#TH@|Y?W}bZ{^#Q}5pRe@~=P%Gz_@=KQ?ehQM=l;g2 otU@#V%hDFTkY*KOWMgCaIVDJAy@&Y?php-yUHx3vIVCg!01rWFD*ylh literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/recipe_locked.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/recipe_locked.png new file mode 100644 index 0000000000000000000000000000000000000000..5206242d36005763fe2cb3f47f9bc56189a4c7c0 GIT binary patch literal 407 zcmV;I0cie-P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0W3*GK~y+TV;K5? z5lUkKwSYPQ*;$zxSXr4EK=kp2F<8}N6_j$D_Fuy;6R44aft>}2f%KDe%NUL>h{jOQ z1f@~HuiyU|e*Ix!*j~=axS^Pl@#k-#*q?t;SyX^wqL}lP{~!ZcSs+elV`GNUK+Fzg zpIRJ?q6dYeD;V1IXXU z8yOi+H8V0Csb^%^Q_ToA5agBLAXAY5iUA;Jf(!s*xAy-~Q3eL{+W+7%0pZ_3?;!(J z7l5J+WB|~qAVXk)5$Ir$W{@j>{r(FTg#e5|G>lyMU(-4c?qo2AvY(uq!SHlvChkCl z0fUGIz?k^U@blMSu#G=~7!)%f4&`B0KcoQz0|3#rY|=83o)`cC002ovPDHLkV1igG Bq8|VN literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/recipe_unlocked.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/recipe_unlocked.png new file mode 100644 index 0000000000000000000000000000000000000000..be51c795eb19bbdc6759c77a2ffa75f0a492d0da GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+73kwS`FE1bu2=3laDgsh0B|(0{|NsAIaL`)$1<2lBSEK+1ojhF}Lo|YWdmZ^06gUna`TPI85gTX4MY(Ag8}wpox}T;5&zc;X=^$>S xp!%rch{DFXig(WRYQ7RIb*oz}b+dx=0fT)dQ=ne1zzv{j44$rjF6*2UngGx+KB@o! literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/structure_check_off.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/structure_check_off.png new file mode 100644 index 0000000000000000000000000000000000000000..91ec06ce4984fa966f4074ea80eaefd9793eb4f7 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+73kwS`FE0jm9iTv~{JJL~btOT5!TJ3`31=5EbxddW?@TtE4Tmv literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/structure_check_on.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/structure_check_on.png new file mode 100644 index 0000000000000000000000000000000000000000..c53015c00525786ad2a1a29c1d66128448e2a210 GIT binary patch literal 352 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!LOb!jv*HQ$r8UB1icP7Hr!qE|4q&r9+?~+ zo;h!HcofV!o-rf|?5*|U=#t}MJ~C(dpYToR(jFwFG9>$%vHX4TMysuM^P#{m29B8) z3F)b9m+k9}4gUOLKH~9Z{r&obMJE^zGng%4beL}R=Xd|ApX@W#4lzuaf3wk#O_C|7 zKj*~x_!(>pe-5u>-ZGix!)LAteK&>cr^_7v@K;<##zEqVkl%vUa&u>$EvWaF z`scvX&S=8saE~D|ZGqMV^A0YT0G$TYCLV^Qgd&E|jtun@4vpdGX8pHs;Hv-g>+lEJ ujJNy>Y!?;ID*QUU(1yp>S<1kGfkEg^(yx2|la2!efWgz%&t;ucLK6VyIfSzS literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_both.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_both.png new file mode 100644 index 0000000000000000000000000000000000000000..3f15a3253db8aa77ac3e911f8be2003339e372ba GIT binary patch literal 401 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%Lh_0G|-o!nOYcr~h~D{%_y>-?ZkxcGg{mq&rGU*Zwbwk_cQU6};#FG;;yF zNxTkI|4-98k-{|Bm*M|p$+>|Huj_>V&ro?<#<@KXWZ3Rl#y6F0yP{a07IH51Vi2&N zBptL}%x9f*>;L>U|A7iFBv&2-QpzPke!>3<0){lr=4n9XoCO|{#S9F5he4R}c>anM zpkR}yi(`mJaPGN4p(XJ}TlRwGFR*?-*F@?0@8V>^PhM-Ov}-K2Ar1vmbL+ z3CEq;>dOC1?A~XYO^yH9G`jDkHwVnoJ-N#E(DpKh8iuV6G7J;6l>33MVeoYIb6Mw< G&;$Su<*2X# literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_disabled.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc3c331e82213b002aa6cbc0bef7c6c6d26b0ea GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|>0G|+73kwS`FE1bu2=3laDgsh0B|(0{|NsAIaL`)$1<2lBSEK+1eLYkif5Vo8YI0Zpvc~XtNEpjAIlgfgUJW#u!PC{x JWt~$(698O3LH_^% literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_fluids.png b/src/main/resources/assets/tectech/textures/gui/overlay_button/voiding_fluids.png new file mode 100644 index 0000000000000000000000000000000000000000..c7ecfc0675abc749c90c973750d7a95cb811d96e GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|~0G|-o!nOYcr~h~D{%_y>-?ZkxcGg{mq&rGU*CYbhNd@l_u$#o|FjXRO zmw@#oNuSj~O=3Rll+vzA2W@w5{hz<)KTu?u^a?wWL`jfe@PBN8f$`FTCqNaP1s;*b z3=DjSL74G){)!Z!V7aG@V~9p@ZtrcO76l&X?v~R{>sH+U|NpA5Yh}S1gOZ|*rWelZ z9qv52`1S^e;mrlRl`ZQlb~ADXST5r}!>SZv@`LY^_@;GDVv)WLGxRrnoO*zLt=P)V zM>%gS;SM-6uc7|sy{PYO6%jIrU+y+ODF5!b<$<;A0e_h&NS%G|~0G|-o|4X9&Pc#2NP3!**mH(3^U)Kq}sbqUv#xwJ+8xXIw2<>i3fuo#8vhqZ07dRkG?xQXVkJR-!T+%V2F6PVo&Z&F7I;J! zGcfQS24TkI`72U@g5{nrjv*SsxxKfAS`>JkyIW2-ty^*X|NpDLu9XF63`&YJnqD}s zcewN9;@cY>hBp`NR<^9K*v-flV7ZL@469Ov$q&9u;+xhriADN0%+TNPaq0o~wPGtb zALYEUggfBOyoUOh_oBYDRYb@fe!1KDp!~bzmIv0d2mEEeJVoG8`^sfmKqoMGy85}S Ib4q9e0Ju7e)&Kwi literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_16x8.png b/src/main/resources/assets/tectech/textures/gui/picture/heat_sink_16x8.png new file mode 100644 index 0000000000000000000000000000000000000000..b6a31a4923469261e4d46d78d0408e208518b185 GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~c!3HEhl+{lMQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjKtUZ(7sn8d;ADoz{|*Uxd3=jJ7CBbUJfIf9 r;Kth^!NBKhbgQaFeV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0G|+7O-;?n$Veb>=c=6LK#I8}$S?T+e}?O)c!6peI14-?iy0XB4ude` z@%$AjKtUf*7sn8d;Mz0MLI)H$oC8z-cdt{M?)SP|e)407Cq@$u&vr&F)^wcFByMPb zC+OkgbKkr6s1)zIFya3qt+Yiy1g~~6rxdRGJpblplbQT&?-))R9FWfen#gTe~ HDWM4f0WU~R literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/items/fakeItemQGP.png b/src/main/resources/assets/tectech/textures/items/fakeItemQGP.png new file mode 100644 index 0000000000000000000000000000000000000000..4acc83482e66542e58ad908dcb9945c0dd017980 GIT binary patch literal 2631 zcmV-N3b^%&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA3EW9UK~!i%?O9oK z6WJL(y-I3%-)&ioEfWaC;9?-;*W@WLNmZ6fQmHJD8N$o}W?xb>$y4%@{}J$pyaU4w zFa-&lH@wJNdeP0fZCOUNL?BfZsg%Demo2Hk)8B2~bH4LkzR{P zAWHc+7BZJbM@N{6I&yXsK}aui;Ceuw36_~-k`33DpXw;O2CK3V zF%1IpqH%pVtE;dj{TyNR|O#B{=(nI zGQWYLWDbf_fbHrCnGq~47E!QY;PCf;U6m66*on;OCqkBM>a4&PO#Ha+wR`a{V`}uG zn4i4(-|4~p+eQS=;-T9VS4;euh)aQiBn=|Fir+W5H?MpNMtV@C(BBfad0S#dvl*v zfm8rS|1m-_X=la;rEG=C8*ocSZe%{@j##N!eyg7P_dMQr4BtgXCwy&l}1`I|6E;ii^#E=S6` ziKeK9yZ2XoasA-vuc~qa06Q@=e!|xSC{mG1IP(2HJ$OIy_4E}X$yI(?GXiYfiOCz6 zMXW!8^gxUxJNtHe@XhRH(bF6EKeU}SZf6(E%Qg-j{c+&>Kn3%Y=R{j)f{c`evB`rx z!l5vd@f2nzuDo6k?#+&fR5HfBA7Ka9P;ev%O7sRf0=_^x*+jn7^#|ugPj>@Zr;*le zWT(Rq3ryVdDXy!A&kIG>@c6Ox2iu&eRG=!Ygfo4*7K$&JP~=Ym(J;^u)@U|Du&gA( zWre#%Q~;!D2$h9G*Az0(=A8wJh+RT8c3U1Vr|J*WvV zJ$6a-_QiY>MM6cy`&&u2pw*WV09d$riIm<4!G@wJHZLgny>Z__oW|o?0Hg|FVe*uS z_mgeHf~FV*Fi0ksrrRNrmXS&{^9E%I4-)YX(t4fNe~D~dN4}Wl5;StaW~(pI zXt-!<>tfp*sen`fH0nXlrkP-C*A(fCvb6jKL<~Uy7i(LTC#8$JKp$b!x|gE@pz9%j z77%<(RaM?ydIOp)PxH-%$q5Due`_Aw{8l;Z6*k`HGLlJpBu7UylBY5i_#8}Mm2D@- zcPzT1r8fM?1>65$RieOA;=ds zK>`4iH%3Hy;5+{KYv?Y!vz%UmzE~%B>3{GCQ==!vzCk*2qmf%!qp6mSRYkJ}I`$28 zb~SNnyHu7@*`5oTb0QIAA{n=3M_GP|N|dF!*z%`!O;zX(EdH%wd1;Au=jVRzOBFP; zb(>V4B70$ucVA|Q&a-^Jrbh@FI>B2A+KPsdUe0+5Kn~eb3lv2|u24dIqec3LeH|z| z6cx@9Rw%?_gRTX|a@H$s%#3no8b~og4jppb_k2Al35P;bWCbC*wN<1)++}8fqF+sa zDI8Crw?`JIP^nt{XCTi_q-Q#G>;#QSKlKYu$tm>oY$f6(Lq-DJ5K8ffQ0diBlpATxSK>`M>PnTLEm z*km6px(Wu8y?C$?1gQd;9s5-5Psd?<@?g&N59XvZ*Hi-KH__GAj_L908L9#>Gk%I? zw~;UfPVPC61$03bjInn3KS+B5hcH*??>+2(k zN);;kPQ>*>6q7tWcZ)h{;Mvnv9Qf#$mAn8&@6A!Z`EF~QRH+clZl*Hx{cpeZPdE=B z|4mg+0AMF(<-EYs6*WR24F^B^S>0>*;$6nn=!lqo&FC*9z{Z`Jo46>31_zK%#mLa= z1Gtx?Ccyl}h)5=SxeJAFxc8^qF?RiQO_0Fm_-6XNXzPmkeK2Rs?!3mmZ=k_y#Pes% z7&uhjV5%y}+&Ce+db{{;BeyU)#|jKhlFEfEyL7YEg9}xaRM2L|KNJ15GP0RQLQNdD z0f$NOb->#m`IRW&Z^FYzPcVFZ`#7XhL4(!JWZBMv<@GfxP=RiJi;40W#PJDLq>GpT zDv2soo&p?{02us;2 zmZ*(U-kDkesRue9JbcdbcPU*3Ama|5SkAW5-)GS$Srph7-VwO}@IInu2}8rXVj?2| zuoE}0|3MhW_IaYkYW5B9`GfZpa~yH!$jtJ~no*O^GNfzoV;>w$^>E;>?+P;jgP{AC#^gt?wkSUEfTbd`&4+Oh%Co2gqrwU+d^n_^X zlt%!K2!#wLx}>kkO5|l8$KfP0W7TIWm6E=iIwiWgo7q$?6dbvQOWeZp6IMVikjLYm zh_KzaQkkCNz>y#Nxs?hEP7CiA=4fwI&Pqg9kl>{XqpF`N0pA$4{21g}QI=RmJwt5(T7N zYvWxN|14#ZzX9l#b<@35U_1Z-002ovPDHLkV1fjM-Yx(D literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/tectech/textures/items/fakeItemQGP.png.mcmeta b/src/main/resources/assets/tectech/textures/items/fakeItemQGP.png.mcmeta new file mode 100644 index 00000000000..cc8a1f3c962 --- /dev/null +++ b/src/main/resources/assets/tectech/textures/items/fakeItemQGP.png.mcmeta @@ -0,0 +1 @@ +{"animation": {"frametime": 1}} \ No newline at end of file diff --git a/src/test/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColorTest.java b/src/test/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColorTest.java new file mode 100644 index 00000000000..f30f0dcce9d --- /dev/null +++ b/src/test/java/tectech/thing/metaTileEntity/multi/godforge/color/ForgeOfGodsStarColorTest.java @@ -0,0 +1,21 @@ +package tectech.thing.metaTileEntity.multi.godforge.color; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +public class ForgeOfGodsStarColorTest { + + @Test + public void testSerializeToString() { + ForgeOfGodsStarColor starColor = new ForgeOfGodsStarColor("Test Color").setCycleSpeed(10) + .addColor(1, 2, 3, 4) + .addColor(71, 82, 155, 9) + .addColor(3, 8, 94, 20); + + String serialized = starColor.serializeToString(); + System.out.printf("Tested Star Color: %s\n", serialized); + ForgeOfGodsStarColor deserialized = ForgeOfGodsStarColor.deserialize(serialized); + assertEquals(starColor, deserialized); + } +} From 2fc1d3c347f259bc14d511e12253459ae82ab22d Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Mon, 21 Oct 2024 22:48:53 +0200 Subject: [PATCH 29/38] update --- dependencies.gradle | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index ed3124c21a0..fcc6fbb8c6d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -38,11 +38,11 @@ dependencies { api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") api("com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev") api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev") - api("com.github.GTNewHorizons:GTNHLib:0.5.15:dev") + api("com.github.GTNewHorizons:GTNHLib:0.5.16:dev") api("com.github.GTNewHorizons:ModularUI:1.2.11:dev") api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") - api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-469-GTNH:dev") + api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-470-GTNH:dev") api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.41-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") @@ -54,14 +54,14 @@ dependencies { // Required to prevent an older bauble api from Extra Utilities from loading first in the javac classpath compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive=false} - devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.9.0-GTNH:dev") + devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.9.1-GTNH:dev") compileOnlyApi("com.github.GTNewHorizons:Avaritia:1.54:dev") - compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta9:api') { transitive = false } + compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta10:api') { transitive = false } compileOnlyApi("com.github.GTNewHorizons:AppleCore:3.3.3:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:BuildCraft:7.1.39:dev") { transitive = false } - compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.19:dev") { transitive = false } + compileOnlyApi("com.github.GTNewHorizons:EnderIO:2.8.20:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:ForestryMC:4.9.16:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:ProjectRed:4.10.5-GTNH:dev") { transitive = false } compileOnlyApi("com.github.GTNewHorizons:Railcraft:9.15.14:dev") { transitive = false } @@ -75,12 +75,12 @@ dependencies { compileOnlyApi("com.github.GTNewHorizons:Galacticraft:3.2.5-GTNH:dev") { transitive = false } implementation("com.github.GTNewHorizons:TinkersConstruct:1.12.12-GTNH:dev") - compileOnly("com.github.GTNewHorizons:Chisel:2.15.2-GTNH:dev") { transitive = false } + compileOnly("com.github.GTNewHorizons:Chisel:2.15.3-GTNH:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Translocators:1.2.1:dev") { transitive = false } compileOnly rfg.deobf("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:Nuclear-Control:2.6.7:dev") { transitive = false } compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") { transitive = false } - implementation("com.github.GTNewHorizons:Hodgepodge:2.5.73:dev") + implementation("com.github.GTNewHorizons:Hodgepodge:2.5.74:dev") compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') { transitive = false } compileOnly('com.github.GTNewHorizons:HoloInventory:2.4.13-GTNH:dev') { transitive = false } compileOnly rfg.deobf("curse.maven:extra-utilities-225561:2264384") @@ -121,7 +121,7 @@ dependencies { functionalTestImplementation('org.junit.platform:junit-platform-reporting') runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev") - runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.8.19:dev') + runtimeOnlyNonPublishable('com.github.GTNewHorizons:EnderIO:2.8.20:dev') // For testing //runtimeOnlyNonPublishable('com.github.GTNewHorizons:TCNEIAdditions:1.4.1:dev') From 9288097b3783f04aef27a0d7713021f0659b6d8b Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Tue, 22 Oct 2024 03:29:33 -0400 Subject: [PATCH 30/38] Superdense plate integration (#3400) --- .../tectech/TecTechResearchLoader.java | 3 ++- .../ComponentAssemblyLineMiscRecipes.java | 14 ++++++------- .../java/gregtech/api/enums/Materials.java | 1 - .../loaders/postload/chains/NaniteChain.java | 3 ++- .../postload/recipes/AssemblyLineRecipes.java | 4 ++-- .../recipe/RecipeLoaderChemicalSkips.java | 8 +++---- .../tectech/loader/recipe/AssemblyLine.java | 4 +++- .../recipe/ResearchStationAssemblyLine.java | 21 ++++++++++--------- 8 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/main/java/bwcrossmod/tectech/TecTechResearchLoader.java b/src/main/java/bwcrossmod/tectech/TecTechResearchLoader.java index 2a1a66d6e05..43e152a16a9 100644 --- a/src/main/java/bwcrossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/bwcrossmod/tectech/TecTechResearchLoader.java @@ -73,7 +73,8 @@ public static void runResearches() { 48, (int) TierEU.RECIPE_UV, 8, - new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), Materials.Neutronium.getBlocks(5), + new Object[] { ItemList.Machine_Multi_ImplosionCompressor.get(1L), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Neutronium, 1), GTOreDictUnificator.get(OrePrefixes.stickLong, Materials.Osmium, 64), GTOreDictUnificator.get(OrePrefixes.ring, Materials.Osmium, 64), GTOreDictUnificator.get(OrePrefixes.wireGt01, Materials.SuperconductorUHV, 64), diff --git a/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java b/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java index 36a22a928de..1fb69d6700c 100644 --- a/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java +++ b/src/main/java/goodgenerator/loader/ComponentAssemblyLineMiscRecipes.java @@ -75,7 +75,7 @@ static void run() { ComponentType.Electric_Motor.getComponent(7) .get(32), GTOreDictUnificator.get(OrePrefixes.pipeMedium, Materials.Polybenzimidazole, 16), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Iridium, 32), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Iridium, 4), ItemList.FluidSolidifierZPM.get(16L), getALCircuit(8, 16), getALCircuit(7, 20), @@ -234,7 +234,7 @@ private static void generateCasingRecipes() { .metadata(RESEARCH_TIME, (2250 << t) * TICKS) .itemInputs( GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Iridium, 1), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Iridium, 6), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Iridium, 1), ComponentType.Robot_Arm.getComponent(t) .get(8), ComponentType.Electric_Piston.getComponent(t) @@ -263,7 +263,7 @@ private static void generateCasingRecipes() { .metadata(RESEARCH_TIME, (2250 << t) * TICKS) .itemInputs( GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Osmium, 1), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Osmium, 6), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Osmium, 1), ComponentType.Robot_Arm.getComponent(t) .get(8), ComponentType.Electric_Piston.getComponent(t) @@ -293,7 +293,7 @@ private static void generateCasingRecipes() { (int) TierEU.RECIPE_UV, 1, new Object[] { GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.CosmicNeutronium, 1), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.CosmicNeutronium, 6), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.CosmicNeutronium, 1), ComponentType.Robot_Arm.getComponent(t) .get(8), ComponentType.Electric_Piston.getComponent(t) @@ -319,7 +319,7 @@ private static void generateCasingRecipes() { (int) TierEU.RECIPE_UHV, 1, new Object[] { GTOreDictUnificator.get(OrePrefixes.frameGt, Materials.Infinity, 1), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Infinity, 6), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Infinity, 1), ComponentType.Robot_Arm.getComponent(t) .get(8), ComponentType.Electric_Piston.getComponent(t) @@ -344,7 +344,7 @@ private static void generateCasingRecipes() { (int) TierEU.RECIPE_UEV, 1, new Object[] { GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.ProtoHalkonite, 1), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.TranscendentMetal, 6), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.TranscendentMetal, 1), ComponentType.Robot_Arm.getComponent(t) .get(8), ComponentType.Electric_Piston.getComponent(t) @@ -370,7 +370,7 @@ private static void generateCasingRecipes() { (int) TierEU.RECIPE_UIV, 1, new Object[] { GTOreDictUnificator.get(OrePrefixes.frameGt, MaterialsUEVplus.SpaceTime, 1), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SpaceTime, 6), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SpaceTime, 1), ComponentType.Robot_Arm.getComponent(t) .get(8), ComponentType.Electric_Piston.getComponent(t) diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 76a626744e7..bf4c397b7e2 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -2518,7 +2518,6 @@ private static void initSubTags() { Carbon.add(SubTag.NO_SMELTING); Boron.add(SubTag.SMELTING_TO_FLUID); - Infinity.add(SubTag.BLACK_HOLE); MaterialsUEVplus.TranscendentMetal.add(SubTag.BLACK_HOLE); } diff --git a/src/main/java/gregtech/loaders/postload/chains/NaniteChain.java b/src/main/java/gregtech/loaders/postload/chains/NaniteChain.java index ab1981ee98c..eb51d852809 100644 --- a/src/main/java/gregtech/loaders/postload/chains/NaniteChain.java +++ b/src/main/java/gregtech/loaders/postload/chains/NaniteChain.java @@ -53,7 +53,8 @@ public static void run() { ItemList.Conveyor_Module_UV.get(16), ItemList.Electric_Motor_UV.get(32), new Object[] { OrePrefixes.circuit.get(Materials.LuV), 16 }, - GTOreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 32)) + GTOreDictUnificator.get(OrePrefixes.wireGt08, Materials.Naquadah, 32), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.NaquadahAlloy, 4)) .fluidInputs( new FluidStack(solderIndalloy, 144 * 32), Materials.HSSS.getMolten(144L * 32), diff --git a/src/main/java/gregtech/loaders/postload/recipes/AssemblyLineRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/AssemblyLineRecipes.java index 28630668c04..1c91dcd7861 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/AssemblyLineRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/AssemblyLineRecipes.java @@ -739,7 +739,7 @@ public void run() { new Object[] { OrePrefixes.circuit.get(Materials.UV), 1 }, new Object[] { OrePrefixes.circuit.get(Materials.UV), 1 }, new Object[] { OrePrefixes.circuit.get(Materials.UV), 1 }, - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Europium, 4), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Europium, 1), ItemList.Field_Generator_ZPM.get(2), ItemList.Circuit_Wafer_PPIC.get(48), GTOreDictUnificator.get(OrePrefixes.wireGt02, Materials.SuperconductorZPM, 32)) @@ -759,7 +759,7 @@ public void run() { new Object[] { OrePrefixes.circuit.get(Materials.UHV), 1 }, new Object[] { OrePrefixes.circuit.get(Materials.UHV), 1 }, new Object[] { OrePrefixes.circuit.get(Materials.UHV), 1 }, - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Americium, 4), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Americium, 1), ItemList.Field_Generator_UV.get(2), ItemList.Circuit_Wafer_QPIC.get(64), GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUV, 32)) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderChemicalSkips.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderChemicalSkips.java index 4782ce71389..e0f97f018d6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderChemicalSkips.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderChemicalSkips.java @@ -749,7 +749,7 @@ private static void tieredCasingRecipes() { 32, new ItemStack[] { MaterialsAlloy.QUANTUM.getFrameBox(1), GTOreDictUnificator.get("plateDensePreciousMetalsAlloy", 4), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 16), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Neutronium, 2), ItemList.Field_Generator_UV.get(1), MaterialsElements.STANDALONE.CHRONOMATIC_GLASS.getScrew(16) }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(144 * 10), }, GregtechItemList.NeutronShieldingCore.get(1), @@ -764,7 +764,7 @@ private static void tieredCasingRecipes() { 32, new ItemStack[] { MaterialsAlloy.QUANTUM.getFrameBox(2), GTOreDictUnificator.get("plateDenseEnrichedNaquadahAlloy", 4), - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Infinity, 16), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Infinity, 2), ItemList.Field_Generator_UEV.get(1), // Radox polymer screw. GTOreDictUnificator.get(OrePrefixes.screw, Materials.get("RadoxPoly"), 16), @@ -782,7 +782,7 @@ private static void tieredCasingRecipes() { 32, new ItemStack[] { MaterialsAlloy.QUANTUM.getFrameBox(4), MaterialsElements.STANDALONE.HYPOGEN.getPlateDense(4), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.ProtoHalkonite, 16), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.ProtoHalkonite, 2), ItemList.Field_Generator_UIV.get(1), GTOreDictUnificator.get("screwMetastableOganesson", 16), ItemList.SuperconductorComposite.get(4) }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(144 * 40), }, @@ -797,7 +797,7 @@ private static void tieredCasingRecipes() { (int) TierEU.RECIPE_UEV, 32, new ItemStack[] { MaterialsAlloy.QUANTUM.getFrameBox(8), GTOreDictUnificator.get("plateDenseShirabon", 4), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SpaceTime, 16), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SpaceTime, 2), ItemList.Field_Generator_UMV.get(1), GTOreDictUnificator.get(OrePrefixes.screw, Materials.Dilithium, 16), ItemList.NaquadriaSupersolid.get(4) }, diff --git a/src/main/java/tectech/loader/recipe/AssemblyLine.java b/src/main/java/tectech/loader/recipe/AssemblyLine.java index ec619df163b..3850025927b 100644 --- a/src/main/java/tectech/loader/recipe/AssemblyLine.java +++ b/src/main/java/tectech/loader/recipe/AssemblyLine.java @@ -114,7 +114,9 @@ public void run() { ItemList.Tool_DataOrb.get(1), ItemList.Cover_Screen.get(1), new ItemStack[] { GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUV, 8) }, - CustomItemList.DATApipe.get(8)) + CustomItemList.DATApipe.get(8), + new ItemStack[] { + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Polybenzimidazole, 2) }) .fluidInputs( Materials.UUMatter.getFluid(1000), Materials.Iridium.getMolten(1296), diff --git a/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java b/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java index 4ace69f1b3f..00f56a997b5 100644 --- a/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java +++ b/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java @@ -749,7 +749,7 @@ public void run() { new Object[] { OrePrefixes.circuit.get(Materials.UIV), 20L }, ItemList.Field_Generator_UEV.get(4), getModItem(EternalSingularity.ID, "eternal_singularity", 4L), GregtechItemList.Laser_Lens_Special.get(1), - GTOreDictUnificator.get(OrePrefixes.plate, Materials.Osmiridium, 64L), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Osmiridium, 4L), ItemList.Electric_Pump_UEV.get(4), ItemList.ZPM3.get(1), getModItem(IndustrialCraft2.ID, "blockMachine2", 1, 0) }, new FluidStack[] { new FluidStack(FluidRegistry.getFluid("oganesson"), 128000), @@ -991,7 +991,7 @@ public void run() { new Object[] { OrePrefixes.circuit.get(Materials.UEV), 1L }, new Object[] { OrePrefixes.circuit.get(Materials.UEV), 1L }, new Object[] { OrePrefixes.circuit.get(Materials.UEV), 1L }, - GTOreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 4), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Neutronium, 1), ItemList.Field_Generator_UHV.get(2), ItemList.Circuit_Wafer_QPIC.get(64), GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUHV, 32) }, new FluidStack[] { Materials.UUMatter.getFluid(50000), CINOBITE.getFluidStack(9216), @@ -1115,7 +1115,8 @@ public void run() { ItemList.Robot_Arm_UHV.get(4L), new Object[] { OrePrefixes.circuit.get(Materials.UHV), 4 }, ItemList.Gravistar.get(4, new Object() {}), getModItem(Thaumcraft.ID, "ItemEldritchObject", 1, 3), getModItem(BloodMagic.ID, "bloodMagicBaseItems", 8, 29), - getModItem(BloodMagic.ID, "bloodMagicBaseItems", 8, 28), }, + getModItem(BloodMagic.ID, "bloodMagicBaseItems", 8, 28), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, Materials.Void, 1) }, new FluidStack[] { new FluidStack(solderIndalloy, 2880), Materials.Void.getMolten(2880L), Materials.DraconiumAwakened.getMolten(1440), }, DraconicEvolutionFusionCrafter.get(1), @@ -3177,7 +3178,7 @@ private void addGodforgeRecipes() { 256, new Object[] { CustomItemList.Godforge_MagneticConfinementCasing.get(1), ItemRefer.Field_Restriction_Coil_T4.get(4), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Creon, 64), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Creon, 8), GTOreDictUnificator.get(OrePrefixes.gearGt, MaterialsUEVplus.Mellion, 64), GregtechItemList.SpaceTimeContinuumRipper.get(8), GregtechItemList.Battery_Gem_4.get(8), GregtechItemList.Laser_Lens_Special.get(8), ItemList.Emitter_UXV.get(4), @@ -3273,9 +3274,9 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUIV, 32), ItemList.Robot_Arm_UIV.get(16), ItemList.Conveyor_Module_UIV.get(32), ItemList.Electric_Pump_UIV.get(64), ItemList.Relativistic_Heat_Capacitor.get(8), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SixPhasedCopper, 16), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Creon, 8), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Mellion, 8), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SixPhasedCopper, 2), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Creon, 1), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Mellion, 1), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 32) }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(1024 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(2_048_000), MaterialsUEVplus.PhononMedium.getFluid(32000), @@ -3296,9 +3297,9 @@ private void addGodforgeRecipes() { ItemList.ZPM4.get(4), GTOreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUIV, 64), ItemList.Robot_Arm_UIV.get(16), ItemList.Conveyor_Module_UIV.get(32), ItemList.Electric_Pump_UIV.get(64), CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(8), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SixPhasedCopper, 32), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Creon, 16), - GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Mellion, 16), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SixPhasedCopper, 4), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Creon, 2), + GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Mellion, 2), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 64) }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(1024 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(2_048_000), MaterialsUEVplus.PhononMedium.getFluid(64000), From 19969443d87668d14f6e30a2304309604ea19007 Mon Sep 17 00:00:00 2001 From: lordIcocain <62835225+lordIcocain@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:36:16 +0300 Subject: [PATCH 31/38] Allow use high tier fluid regulators as cover. (#3398) Co-authored-by: Martin Robertz --- .../common/items/MetaGeneratedItem01.java | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/main/java/gregtech/common/items/MetaGeneratedItem01.java b/src/main/java/gregtech/common/items/MetaGeneratedItem01.java index 68eea152a62..da017f9ad79 100644 --- a/src/main/java/gregtech/common/items/MetaGeneratedItem01.java +++ b/src/main/java/gregtech/common/items/MetaGeneratedItem01.java @@ -2107,10 +2107,26 @@ public MetaGeneratedItem01() { FluidRegulator_UEV.ID, "Fluid Regulator (UEV)", FRText1 + GTUtility.formatNumbers(2097152 * 20) + FRText2)); - ItemList.FluidRegulator_UIV.set(addItem(FluidRegulator_UIV.ID, "Fluid Regulator (UIV)", PartNotCoverText)); - ItemList.FluidRegulator_UMV.set(addItem(FluidRegulator_UMV.ID, "Fluid Regulator (UMV)", PartNotCoverText)); - ItemList.FluidRegulator_UXV.set(addItem(FluidRegulator_UXV.ID, "Fluid Regulator (UXV)", PartNotCoverText)); - ItemList.Electric_Pump_MAX.set(addItem(FluidRegulator_MAX.ID, "Fluid Regulator (MAX)", PartNotCoverText)); + ItemList.FluidRegulator_UIV.set( + addItem( + FluidRegulator_UIV.ID, + "Fluid Regulator (UIV)", + FRText1 + GTUtility.formatNumbers(4194304 * 20) + FRText2)); + ItemList.FluidRegulator_UMV.set( + addItem( + FluidRegulator_UMV.ID, + "Fluid Regulator (UMV)", + FRText1 + GTUtility.formatNumbers(8388608 * 20) + FRText2)); + ItemList.FluidRegulator_UXV.set( + addItem( + FluidRegulator_UXV.ID, + "Fluid Regulator (UXV)", + FRText1 + GTUtility.formatNumbers(16777216 * 20) + FRText2)); + ItemList.FluidRegulator_MAX.set( + addItem( + FluidRegulator_MAX.ID, + "Fluid Regulator (MAX)", + FRText1 + GTUtility.formatNumbers(33554432 * 20) + FRText2)); ItemList.FluidFilter.set( addItem(FluidFilter.ID, "Fluid Filter Cover", "Set with Fluid Container to only accept one Fluid Type")); @@ -3740,6 +3756,22 @@ private void registerCovers() { ItemList.FluidRegulator_UEV.get(1L), TextureFactory.of(MACHINE_CASINGS[10][0], TextureFactory.of(OVERLAY_PUMP)), new CoverFluidRegulator(2097152, TextureFactory.of(OVERLAY_PUMP))); + GregTechAPI.registerCover( + ItemList.FluidRegulator_UIV.get(1L), + TextureFactory.of(MACHINE_CASINGS[11][0], TextureFactory.of(OVERLAY_PUMP)), + new CoverFluidRegulator(4194304, TextureFactory.of(OVERLAY_PUMP))); + GregTechAPI.registerCover( + ItemList.FluidRegulator_UMV.get(1L), + TextureFactory.of(MACHINE_CASINGS[12][0], TextureFactory.of(OVERLAY_PUMP)), + new CoverFluidRegulator(8388608, TextureFactory.of(OVERLAY_PUMP))); + GregTechAPI.registerCover( + ItemList.FluidRegulator_UXV.get(1L), + TextureFactory.of(MACHINE_CASINGS[12][0], TextureFactory.of(OVERLAY_PUMP)), + new CoverFluidRegulator(16777216, TextureFactory.of(OVERLAY_PUMP))); + GregTechAPI.registerCover( + ItemList.FluidRegulator_MAX.get(1L), + TextureFactory.of(MACHINE_CASINGS[13][0], TextureFactory.of(OVERLAY_PUMP)), + new CoverFluidRegulator(33554432, TextureFactory.of(OVERLAY_PUMP))); GregTechAPI.registerCover( ItemList.FluidFilter.get(1L), From b8b72dab4df313c3f64dc05ca1bd34cced326862 Mon Sep 17 00:00:00 2001 From: alphaomega21 <1471383+alphaomega21@users.noreply.github.com> Date: Tue, 22 Oct 2024 05:01:25 -0400 Subject: [PATCH 32/38] Fix missing circuit replacements in AL recipies (#3397) Co-authored-by: Martin Robertz --- .../goodgenerator/loader/RecipeLoader.java | 2 +- .../postload/chains/PurifiedWaterRecipes.java | 4 +- .../recipe/ResearchStationAssemblyLine.java | 65 +++++++++---------- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/main/java/goodgenerator/loader/RecipeLoader.java b/src/main/java/goodgenerator/loader/RecipeLoader.java index 2b4d79c3f0d..306c4c1de11 100644 --- a/src/main/java/goodgenerator/loader/RecipeLoader.java +++ b/src/main/java/goodgenerator/loader/RecipeLoader.java @@ -787,7 +787,7 @@ public static void RecipeLoad() { GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SpaceTime, 8), GTOreDictUnificator.get(OrePrefixes.pipeMedium, MaterialsUEVplus.SpaceTime, 16), ItemList.Circuit_Wafer_PPIC.get(64), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 1)) + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 1L }) .fluidInputs( GGMaterial.metastableOganesson.getMolten(1000), MaterialsUEVplus.TranscendentMetal.getMolten(9216), diff --git a/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java b/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java index bc3e7889ee0..d35645769af 100644 --- a/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java +++ b/src/main/java/gregtech/loaders/postload/chains/PurifiedWaterRecipes.java @@ -272,8 +272,8 @@ public static void run() { GTOreDictUnificator.get(OrePrefixes.wireFine, Materials.Infinity, 64), GTOreDictUnificator.get(OrePrefixes.wireFine, Materials.Tritanium, 64), GTOreDictUnificator.get(OrePrefixes.wireFine, Materials.CosmicNeutronium, 64), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UHV, 16), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UEV, 8), + new Object[] { OrePrefixes.circuit.get(Materials.UHV), 16 }, + new Object[] { OrePrefixes.circuit.get(Materials.UEV), 8 }, ItemList.Field_Generator_UEV.get(1)) .fluidInputs( Materials.Neutronium.getMolten(16 * 144), diff --git a/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java b/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java index 00f56a997b5..4688fb1a2b5 100644 --- a/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java +++ b/src/main/java/tectech/loader/recipe/ResearchStationAssemblyLine.java @@ -266,13 +266,13 @@ public void run() { 16, new Object[] { ItemList.Hull_UMV.get(1L), GTOreDictUnificator.get(OrePrefixes.wireGt04, Materials.SuperconductorUMV, 2L), - ItemList.Circuit_Chip_QPIC.get(4L), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UMV, 2), ItemList.UHV_Coil.get(16L), + ItemList.Circuit_Chip_QPIC.get(4L), new Object[] { OrePrefixes.circuit.get(Materials.UMV), 2L }, + ItemList.UHV_Coil.get(16L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Electric_Pump_UMV.get(1L) }, + ItemList.Electric_Pump_UMV.get(1L) }, new FluidStack[] { Materials.SuperCoolant.getFluid(32_000L), new FluidStack(solderUEV, 40 * 144), Materials.UUMatter.getFluid(32000L) }, ItemList.Hatch_Energy_UMV.get(1L), @@ -289,7 +289,7 @@ public void run() { new Object[] { ItemList.Hull_UXV.get(1L), GTOreDictUnificator.get(OrePrefixes.wireGt08, Materials.SuperconductorUMV, 4L), ItemList.Circuit_Chip_QPIC.get(16L), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 2), ItemList.UHV_Coil.get(32L), + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 2L }, ItemList.UHV_Coil.get(32L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), @@ -387,13 +387,13 @@ public void run() { 32, new Object[] { ItemList.Hull_UMV.get(1L), GTOreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 8L), - ItemList.Circuit_Chip_QPIC.get(4L), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UMV, 2), ItemList.UHV_Coil.get(16L), + ItemList.Circuit_Chip_QPIC.get(4L), new Object[] { OrePrefixes.circuit.get(Materials.UMV), 2L }, + ItemList.UHV_Coil.get(16L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), - ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Electric_Pump_UMV.get(1L) }, + ItemList.Electric_Pump_UMV.get(1L) }, new FluidStack[] { Materials.SuperCoolant.getFluid(32_000L), new FluidStack(solderUEV, 40 * 144), Materials.UUMatter.getFluid(32000L) }, ItemList.Hatch_Dynamo_UMV.get(1L), @@ -410,7 +410,7 @@ public void run() { new Object[] { ItemList.Hull_UXV.get(1L), GTOreDictUnificator.get(OrePrefixes.spring, Materials.SuperconductorUMVBase, 16L), ItemList.Circuit_Chip_QPIC.get(16L), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 2), ItemList.UHV_Coil.get(32L), + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 2L }, ItemList.UHV_Coil.get(32L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), ItemList.Reactor_Coolant_Sp_6.get(1L), @@ -636,7 +636,7 @@ public void run() { 32768, (int) TierEU.RECIPE_UXV, 64, - new ItemStack[] { + new Object[] { CustomItemList.Godforge_MagneticConfinementCasing.get(64), CustomItemList.StabilisationFieldGeneratorTier8.get(64), CustomItemList.Godforge_HarmonicPhononTransmissionConduit.get(32), @@ -645,7 +645,7 @@ public void run() { GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Universium, 8L), GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Eternity, 8L), GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SpaceTime, 8L), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 16L), + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 16L }, ItemList.Sensor_UXV.get(16L), ItemList.Emitter_UXV.get(16L), getModItem(EternalSingularity.ID, "combined_singularity", 64, 15), // chronic singularity @@ -669,7 +669,7 @@ public void run() { 32768, (int) TierEU.RECIPE_UXV, 64, - new ItemStack[] { + new Object[] { CustomItemList.EOH_Reinforced_Spatial_Casing.get(64), CustomItemList.EOH_Reinforced_Temporal_Casing.get(64), new ItemStack(BlockGodforgeGlass.INSTANCE, 64), @@ -685,7 +685,7 @@ public void run() { ItemList.Electric_Motor_UXV.get(64L), ItemList.Electric_Piston_UXV.get(64L), ItemList.Field_Generator_UXV.get(16L), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 32L) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 32L } }, new FluidStack[] { MaterialsUEVplus.QuarkGluonPlasma.getFluid(1_024_000L), MaterialsUEVplus.PhononMedium.getFluid(256_000L), @@ -2486,7 +2486,7 @@ private void addEOHRecipes() { getModItem(AvaritiaAddons.ID, "InfinityChest", absoluteTier + 1), // Cosmic fabric manipulator GregtechItemList.CosmicFabricManipulator.get(tier), ME_Singularity, plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier] }, CustomItemList.SpacetimeCompressionFieldGeneratorTier0.get(1), @@ -2510,7 +2510,7 @@ private void addEOHRecipes() { getModItem(AvaritiaAddons.ID, "InfinityChest", absoluteTier + 1), // Cosmic fabric manipulator GregtechItemList.CosmicFabricManipulator.get(tier), ME_Singularity, ME_Singularity, - plateList[absoluteTier], GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + plateList[absoluteTier], new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier] }, CustomItemList.SpacetimeCompressionFieldGeneratorTier1.get(1), @@ -2535,7 +2535,7 @@ private void addEOHRecipes() { // Cosmic fabric manipulator GregtechItemList.CosmicFabricManipulator.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier2.get(1), @@ -2563,7 +2563,7 @@ private void addEOHRecipes() { // Infinity infused manipulator GregtechItemList.InfinityInfusedManipulator.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier3.get(1), @@ -2588,7 +2588,7 @@ private void addEOHRecipes() { // Infinity infused manipulator GregtechItemList.InfinityInfusedManipulator.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier4.get(1), @@ -2613,7 +2613,7 @@ private void addEOHRecipes() { // Infinity infused manipulator GregtechItemList.InfinityInfusedManipulator.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier5.get(1), @@ -2641,7 +2641,7 @@ private void addEOHRecipes() { // Spacetime continuum ripper GregtechItemList.SpaceTimeContinuumRipper.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, - plateList[absoluteTier], GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + plateList[absoluteTier], new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier6.get(1), @@ -2666,7 +2666,7 @@ private void addEOHRecipes() { // Spacetime continuum ripper GregtechItemList.SpaceTimeContinuumRipper.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, - plateList[absoluteTier], GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + plateList[absoluteTier], new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier7.get(1), @@ -2692,7 +2692,7 @@ private void addEOHRecipes() { GregtechItemList.SpaceTimeContinuumRipper.get(tier), ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, ME_Singularity, plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, set) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), set } }, new FluidStack[] { new FluidStack(solderUEV, (int) (2_880 * pow(2L, absoluteTier))), MaterialsUEVplus.Space.getMolten(1_440 * (absoluteTier + 1)), specialFluid[absoluteTier], }, CustomItemList.SpacetimeCompressionFieldGeneratorTier8.get(1), @@ -2763,7 +2763,7 @@ private void addEOHRecipes() { // UV Solar panel getModItem(SuperSolarPanels.ID, "PhotonicSolarPanel", absoluteTier + 1, 0), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, absoluteTier + 1), + new Object[] { OrePrefixes.circuit.get(Materials.UXV), absoluteTier + 1 }, // Red Spectral Component spectralComponents[absoluteTier % spectralComponents.length], // Green Spectral Component @@ -2867,7 +2867,7 @@ private void addEOHRecipes() { getModItem(GraviSuite.ID, "itemSimpleItem", 64, 3), plateList[absoluteTier], - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 2 * (absoluteTier + 1)), + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 2 * (absoluteTier + 1) }, GTOreDictUnificator.get(OrePrefixes.gearGt, MaterialsUEVplus.SpaceTime, absoluteTier + 1), GTOreDictUnificator.get(OrePrefixes.gearGtSmall, MaterialsUEVplus.SpaceTime, absoluteTier + 1) @@ -3003,7 +3003,7 @@ private void addGodforgeRecipes() { .getItem(), 64), GTOreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUIV, 16), - ItemList.Sensor_UIV.get(32), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 64), + ItemList.Sensor_UIV.get(32), new Object[] { OrePrefixes.circuit.get(Materials.UIV), 64L }, CustomItemList.eM_energyTunnel7_UIV.get(1), ItemRegistry.energyDistributor[11] }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(2048 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(8_192_000), Materials.Thorium.getPlasma(256 * 144), @@ -3140,7 +3140,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.plate, MaterialsUEVplus.Creon, 16), GTOreDictUnificator.get(OrePrefixes.gearGtSmall, MaterialsUEVplus.Mellion, 8), GregtechItemList.Battery_Gem_4.get(2), GregtechItemList.Laser_Lens_Special.get(4), - ItemList.Emitter_UIV.get(4), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UEV, 16), + ItemList.Emitter_UIV.get(4), new Object[] { OrePrefixes.circuit.get(Materials.UEV), 16L }, GTOreDictUnificator.get(OrePrefixes.nanite, Materials.Silver, 2) }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(32 * 144), Materials.SuperconductorUIVBase.getMolten(32 * 144), Materials.Infinity.getMolten(32 * 144) }, @@ -3160,7 +3160,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Creon, 8), GTOreDictUnificator.get(OrePrefixes.gearGt, MaterialsUEVplus.Mellion, 4), GregtechItemList.Battery_Gem_4.get(4), GregtechItemList.Laser_Lens_Special.get(8), - ItemList.Emitter_UMV.get(4), GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UMV, 8), + ItemList.Emitter_UMV.get(4), new Object[] { OrePrefixes.circuit.get(Materials.UMV), 8L }, GTOreDictUnificator.get(OrePrefixes.nanite, Materials.Silver, 2), GTOreDictUnificator.get(OrePrefixes.nanite, Materials.Gold, 2) }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(64 * 144), @@ -3182,7 +3182,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.gearGt, MaterialsUEVplus.Mellion, 64), GregtechItemList.SpaceTimeContinuumRipper.get(8), GregtechItemList.Battery_Gem_4.get(8), GregtechItemList.Laser_Lens_Special.get(8), ItemList.Emitter_UXV.get(4), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 8), + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 8L }, GTOreDictUnificator.get(OrePrefixes.nanite, Materials.Silver, 8), GTOreDictUnificator.get(OrePrefixes.nanite, Materials.Gold, 8), GTOreDictUnificator.get(OrePrefixes.nanite, MaterialsUEVplus.SixPhasedCopper, 8), @@ -3231,7 +3231,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SixPhasedCopper, 16), GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Creon, 8), GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Mellion, 8), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 32) }, + new Object[] { OrePrefixes.circuit.get(Materials.UIV), 32L } }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(1024 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(2_048_000), Materials.Lead.getPlasma(256 * 144), MaterialsUEVplus.TranscendentMetal.getMolten(1024 * 144) }, @@ -3254,7 +3254,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.SixPhasedCopper, 16), GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Creon, 8), GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Mellion, 8), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 32) }, + new Object[] { OrePrefixes.circuit.get(Materials.UIV), 32L } }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(1024 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(2_048_000), MaterialsUEVplus.PhononMedium.getFluid(32000), MaterialsUEVplus.TranscendentMetal.getMolten(1024 * 144) }, @@ -3277,7 +3277,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SixPhasedCopper, 2), GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Creon, 1), GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Mellion, 1), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 32) }, + new Object[] { OrePrefixes.circuit.get(Materials.UIV), 32L } }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(1024 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(2_048_000), MaterialsUEVplus.PhononMedium.getFluid(32000), MaterialsUEVplus.TranscendentMetal.getMolten(1024 * 144) }, @@ -3300,7 +3300,7 @@ private void addGodforgeRecipes() { GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.SixPhasedCopper, 4), GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Creon, 2), GTOreDictUnificator.get(OrePrefixes.plateSuperdense, MaterialsUEVplus.Mellion, 2), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UIV, 64) }, + new Object[] { OrePrefixes.circuit.get(Materials.UIV), 64L } }, new FluidStack[] { MaterialMisc.MUTATED_LIVING_SOLDER.getFluidStack(1024 * 144), MaterialsUEVplus.ExcitedDTEC.getFluid(2_048_000), MaterialsUEVplus.PhononMedium.getFluid(64000), MaterialsUEVplus.TranscendentMetal.getMolten(1024 * 144) }, @@ -3540,8 +3540,7 @@ private void addWirelessEnergyRecipes() { GTOreDictUnificator.get(OrePrefixes.plateDense, MaterialsUEVplus.Eternity, 32), GTOreDictUnificator .get(OrePrefixes.plateDense, MaterialsUEVplus.MagnetohydrodynamicallyConstrainedStarMatter, 16), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.UXV, 16L), - ItemList.EnergisedTesseract.get(1) }, + new Object[] { OrePrefixes.circuit.get(Materials.UXV), 16L }, ItemList.EnergisedTesseract.get(1) }, new FluidStack[] { new FluidStack(solderUEV, 1_296 * 64 * 4), MaterialsUEVplus.ExcitedDTSC.getFluid(500L * 64) }, wirelessLasers[i], From abdd147222b44685abfa79a87e2f104dc699af67 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Tue, 22 Oct 2024 11:12:17 +0200 Subject: [PATCH 33/38] update --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index fcc6fbb8c6d..c1510e06f8b 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -36,13 +36,13 @@ dependencies { api("com.github.GTNewHorizons:StructureLib:1.3.4:dev") api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") - api("com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev") + api("com.github.GTNewHorizons:NotEnoughItems:2.6.44-GTNH:dev") api("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev") - api("com.github.GTNewHorizons:GTNHLib:0.5.16:dev") + api("com.github.GTNewHorizons:GTNHLib:0.5.17:dev") api("com.github.GTNewHorizons:ModularUI:1.2.11:dev") api("com.github.GTNewHorizons:ModularUI2:2.1.14-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") - api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-470-GTNH:dev") + api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-471-GTNH:dev") api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.41-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") From b587aa19b34d7cfab3f8886a359b84fc2229b74f Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:53:51 +0200 Subject: [PATCH 34/38] Fix NPE on IC2 recycler blacklist (#3403) --- .../java/gregtech/api/util/GTModHandler.java | 16 +++++++++++++++- src/main/java/gregtech/common/GTProxy.java | 13 +++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main/java/gregtech/api/util/GTModHandler.java b/src/main/java/gregtech/api/util/GTModHandler.java index 009cde64760..fa56ab9b34e 100644 --- a/src/main/java/gregtech/api/util/GTModHandler.java +++ b/src/main/java/gregtech/api/util/GTModHandler.java @@ -482,12 +482,26 @@ public static boolean addScrapboxDrop(float aChance, ItemStack aOutput) { return true; } + // temporary buffer list to fix NPE if you try to access the recyclerBlacklist too early + private static List tempRecyclerBlackList = new ArrayList<>(); + /** * Adds an Item to the Recycler Blacklist */ public static boolean addToRecyclerBlackList(ItemStack aRecycledStack) { if (aRecycledStack == null) return false; - Recipes.recyclerBlacklist.add(new RecipeInputItemStack(aRecycledStack)); + final RecipeInputItemStack iRecipeInput = new RecipeInputItemStack(aRecycledStack); + if (Recipes.recyclerBlacklist == null) { + tempRecyclerBlackList.add(iRecipeInput); + return true; + } + if (tempRecyclerBlackList != null) { + for (RecipeInputItemStack recipe : tempRecyclerBlackList) { + Recipes.recyclerBlacklist.add(recipe); + } + tempRecyclerBlackList = null; + } + Recipes.recyclerBlacklist.add(iRecipeInput); return true; } diff --git a/src/main/java/gregtech/common/GTProxy.java b/src/main/java/gregtech/common/GTProxy.java index e7cb627c91b..8b2c1535919 100644 --- a/src/main/java/gregtech/common/GTProxy.java +++ b/src/main/java/gregtech/common/GTProxy.java @@ -814,22 +814,15 @@ public GTProxy() { .getRegisteredFluidContainerData()) { onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData)); } - try { - for (String tOreName : OreDictionary.getOreNames()) { - ItemStack tOreStack; - for (Iterator i$ = OreDictionary.getOres(tOreName) - .iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) { - tOreStack = i$.next(); - } + for (String tOreName : OreDictionary.getOreNames()) { + for (ItemStack itemStack : OreDictionary.getOres(tOreName)) { + registerOre(new OreDictionary.OreRegisterEvent(tOreName, itemStack)); } - } catch (Throwable e) { - e.printStackTrace(GTLog.err); } } public void onPreLoad() { GTLog.out.println("GTMod: Preload-Phase started!"); - GTLog.ore.println("GTMod: Preload-Phase started!"); GregTechAPI.sPreloadStarted = true; this.mIgnoreTcon = OPStuff.ignoreTinkerConstruct; From 114293a39991e85a006ee8b888f831bcdba2e012 Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Tue, 22 Oct 2024 22:29:44 +0100 Subject: [PATCH 35/38] Use explicit internal name for Diphenylisophthalate (#3404) --- src/main/java/gregtech/loaders/materials/MaterialsInit1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gregtech/loaders/materials/MaterialsInit1.java b/src/main/java/gregtech/loaders/materials/MaterialsInit1.java index e76d4eda206..1947a2dec58 100644 --- a/src/main/java/gregtech/loaders/materials/MaterialsInit1.java +++ b/src/main/java/gregtech/loaders/materials/MaterialsInit1.java @@ -850,7 +850,7 @@ public static void load() { Materials.PhthalicAcid = new MaterialBuilder(595, TextureSet.SET_FLUID , "Phthalic Acid").setName("phtalicacid").addCell().addFluid().setRGB(54, 133, 71).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 8), new MaterialStack(Hydrogen, 6), new MaterialStack(Oxygen, 4)).constructMaterial(); Materials.Dichlorobenzidine = new MaterialBuilder(596, TextureSet.SET_FLUID , "3,3-Dichlorobenzidine").addCell().addFluid().setRGB(161, 222, 166).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 12),new MaterialStack(Hydrogen, 10), new MaterialStack(Nitrogen, 2), new MaterialStack(Chlorine, 2)).constructMaterial(); Materials.Diaminobenzidin = new MaterialBuilder(597, TextureSet.SET_FLUID , "3,3-Diaminobenzidine").addCell().addFluid().setRGB(51, 125, 89).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 12),new MaterialStack(Hydrogen, 14),new MaterialStack(Nitrogen, 4)).constructMaterial(); - Materials.Diphenylisophthalate = new MaterialBuilder(598, TextureSet.SET_FLUID , "Diphenyl Isophthalate").addCell().addFluid().setRGB(36, 110, 87).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 20),new MaterialStack(Hydrogen, 14),new MaterialStack(Oxygen, 4)).constructMaterial(); + Materials.Diphenylisophthalate = new MaterialBuilder(598, TextureSet.SET_FLUID,"Diphenyl Isophthalate").setName("DiphenylIsophtalate").addCell().addFluid().setRGB(36, 110, 87).setColor(Dyes.dyeOrange).setMaterialList(new MaterialStack(Carbon, 20),new MaterialStack(Hydrogen, 14),new MaterialStack(Oxygen, 4)).constructMaterial(); Materials.Polybenzimidazole = new Materials(599, TextureSet.SET_DULL ,3.0F, 64, 1, 1|2 |64|128 , 45, 45, 45, 0, "Polybenzimidazole" , "Polybenzimidazole" , 0, 0, 1450, 0, false, false, 1, 1, 1, Dyes.dyeBlack , 0, Arrays.asList(new MaterialStack(Carbon, 20), new MaterialStack(Nitrogen, 4), new MaterialStack(Hydrogen, 12)), Arrays.asList(new TCAspects.TC_AspectStack(TCAspects.ORDO, 2),new TCAspects.TC_AspectStack(TCAspects.VOLATUS, 1))); Materials.MTBEMixture = new MaterialBuilder(983, TextureSet.SET_FLUID , "MTBE Reaction Mixture (Butene)").addCell().addGas().setRGB(255, 255, 255).setColor(Dyes.dyeWhite).setMaterialList(new MaterialStack(Carbon, 5), new MaterialStack(Hydrogen, 12), new MaterialStack(Oxygen, 1)).constructMaterial(); From 447f530563b983144e18c904c33accae0f90c951 Mon Sep 17 00:00:00 2001 From: StaffiX <32968022+StaffiX@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:38:06 +0200 Subject: [PATCH 36/38] Fix ruby/sapphire juice mistake (#3407) Co-authored-by: Martin Robertz --- .../loaders/postload/chains/BauxiteRefineChain.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/loaders/postload/chains/BauxiteRefineChain.java b/src/main/java/gregtech/loaders/postload/chains/BauxiteRefineChain.java index 75d224c9ea3..1dc2b55e669 100644 --- a/src/main/java/gregtech/loaders/postload/chains/BauxiteRefineChain.java +++ b/src/main/java/gregtech/loaders/postload/chains/BauxiteRefineChain.java @@ -157,7 +157,7 @@ public static void run() { GTValues.RA.stdBuilder() .itemInputs(GTUtility.getIntegratedCircuit(1)) .itemOutputs( - Materials.Aluminiumhydroxide.getDust(1), + Materials.Aluminiumhydroxide.getDust(2), Materials.Iron.getDust(1), Materials.Vanadium.getDust(1), Materials.Magnesium.getDust(1)) @@ -171,7 +171,7 @@ public static void run() { GTValues.RA.stdBuilder() .itemInputs(GTUtility.getIntegratedCircuit(1)) .itemOutputs( - Materials.Aluminiumhydroxide.getDust(1), + Materials.Aluminiumhydroxide.getDust(2), Materials.Iron.getDust(1), Materials.Vanadium.getDust(1), Materials.Manganese.getDust(1), @@ -186,7 +186,7 @@ public static void run() { GTValues.RA.stdBuilder() .itemInputs(GTUtility.getIntegratedCircuit(1)) .itemOutputs( - Materials.Aluminiumhydroxide.getDust(1), + Materials.Aluminiumhydroxide.getDust(2), Materials.Chrome.getDust(1), Materials.Iron.getDust(1), Materials.Vanadium.getDust(1), From a5b7fb9cb6dd35db5177591ee65e4eb36d504f98 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Wed, 23 Oct 2024 05:53:05 -0400 Subject: [PATCH 37/38] Fix log 1:6 in cutting machine (#3406) Co-authored-by: chochem <40274384+chochem@users.noreply.github.com> --- .../loaders/oreprocessing/ProcessingLog.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java index e6946c804af..5432aeaf0b9 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingLog.java @@ -145,12 +145,10 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs(new ItemStack(aStack.getItem(), 1, i)) .itemOutputs( - GTUtility.copyAmount( - GTMod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, - tStack), - GTOreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) - .fluidInputs(Materials.Water.getFluid(Math.min(1000, 200 * 8 / 320))) - .duration(20 * SECONDS) + GTUtility.copyOrNull(tPlanks), + GTOreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L)) + .fluidInputs(Materials.Lubricant.getFluid(1L)) + .duration(10 * SECONDS) .eut(8) .addTo(cutterRecipes); GTValues.RA.stdBuilder() @@ -160,7 +158,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTMod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, tStack), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) - .fluidInputs(GTModHandler.getDistilledWater(3)) + .fluidInputs(Materials.Water.getFluid(Math.min(1000, 200 * 8 / 320))) .duration(20 * SECONDS) .eut(8) .addTo(cutterRecipes); @@ -171,8 +169,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTMod.gregtechproxy.mNerfedWoodPlank ? tStack.stackSize : tStack.stackSize * 5 / 4, tStack), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 2L)) - .fluidInputs(Materials.Lubricant.getFluid(1)) - .duration(10 * SECONDS) + .fluidInputs(GTModHandler.getDistilledWater(3)) + .duration(20 * SECONDS) .eut(8) .addTo(cutterRecipes); GTModHandler.removeRecipeDelayed(new ItemStack(aStack.getItem(), 1, i)); From 7752642b24d67d4426487bf0ce9557eeedf2c9f7 Mon Sep 17 00:00:00 2001 From: VinDevGH <65317011+VinDevGH@users.noreply.github.com> Date: Wed, 23 Oct 2024 05:00:12 -0500 Subject: [PATCH 38/38] Right clicking water purification units places blocks (#3405) Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Co-authored-by: Martin Robertz --- .../machines/multi/purification/MTEPurificationUnitBase.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java index 9584f865f27..b43421bd824 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/purification/MTEPurificationUnitBase.java @@ -616,9 +616,6 @@ private boolean tryLinkDataStick(EntityPlayer aPlayer) { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (!(aPlayer instanceof EntityPlayerMP)) { - return false; - } // Right-clicking could be a data stick linking action, so try this first. if (tryLinkDataStick(aPlayer)) {