aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/elisis/gtnhlanth/util
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2024-07-20 15:35:26 +0100
committerGitHub <noreply@github.com>2024-07-20 21:35:26 +0700
commit8b077c28bea7bcc046be1e4b8485d69b4c245a43 (patch)
tree8601728fda54a11c894fa0a5533672ca40023af8 /src/main/java/com/elisis/gtnhlanth/util
parenta33bca92fbf9ec0a1d7f42f5a1a08b807739007c (diff)
downloadGT5-Unofficial-8b077c28bea7bcc046be1e4b8485d69b4c245a43.tar.gz
GT5-Unofficial-8b077c28bea7bcc046be1e4b8485d69b4c245a43.tar.bz2
GT5-Unofficial-8b077c28bea7bcc046be1e4b8485d69b4c245a43.zip
Beamline (#2619)
* Beamline * Remove hardcoded dreamcraft items and spotless * Remove logs and fix auto structure check * Remove logs and fix auto structure check * Fix typo and synchrotron high MF scaling * sa (cherry picked from commit b2796d95538a1b683b4a98bf6cb0f8fe21404fbd) * Add multi textures, add structuredesc info, remove test TC input, add synchrotron/input/output recipes * Spotless * Prevent mob spawning on casings * Fix LINAC glass requirement, make synchrotron structure less ugly, add last recipe * Spotless * Add placeholder particle textures * Add some mask recipes I missed * Spotless apply for branch lanth-beamline for #2619 (#2630) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Add further error messages to LINAC and Synchrotron, fix MM & LaB6 recipes * Spotless apply for branch lanth-beamline for #2619 (#2648) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Minor changes, add more multi error messages & 9x U-238 SC recipe * Spotless apply for branch lanth-beamline for #2619 (#2651) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Missed a change * Spotless apply for branch lanth-beamline for #2619 (#2652) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Update beamline desc * Remove comments, move coolant fluid check to Util class * Spotless * Spotless apply for branch lanth-beamline for #2619 (#2666) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Fix Mu-Metal recipe output amount, tool stats for MM & LaB6 * Spotless * Fix multi hatch textures * Spotless apply for branch lanth-beamline for #2619 (#2676) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Increase Synchrotron output rate eut & antenna tier scaling, in general improve output rates, buff all TC recipes' processing time * Fix misleading BL tooltip * update * remove import * Buff higher-tier wafer recipes for each IC, from a 4x to 3x increase of recipe amount per two wafer tier increases * Remove RA1 calls in beamline (#2716) * Spotless apply for branch lanth-beamline for #2619 (#2717) spotlessApply Co-authored-by: GitHub GTNH Actions <> * fix * Spotless apply for branch lanth-beamline for #2619 (#2733) spotlessApply Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: unknown <gtandemmodding@gmail.com> Co-authored-by: Elisis <jarrad.thomson@gmail.com> Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/com/elisis/gtnhlanth/util')
-rw-r--r--src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java16
-rw-r--r--src/main/java/com/elisis/gtnhlanth/util/Util.java55
2 files changed, 64 insertions, 7 deletions
diff --git a/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java b/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java
index 28e63b2744..f0c5509d59 100644
--- a/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java
+++ b/src/main/java/com/elisis/gtnhlanth/util/DescTextLocalization.java
@@ -1,16 +1,12 @@
package com.elisis.gtnhlanth.util;
-import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
public class DescTextLocalization {
- public static final String BLUEPRINT_INFO = "Follow the" + EnumChatFormatting.BLUE
- + " Structure"
- + EnumChatFormatting.DARK_BLUE
- + "Lib"
- + EnumChatFormatting.GRAY
- + " hologram projector to build the main structure.";
+ public static final String BLUEPRINT_INFO = StatCollector.translateToLocal("gtnhlanth.tt.blueprint");
+
+ public static final String BEAMLINE_SCANNER_INFO = StatCollector.translateToLocal("gtnhlanth.tt.beaminfo");
public static String[] addText(String preFix, int length) {
String[] text = new String[length];
@@ -19,4 +15,10 @@ public class DescTextLocalization {
}
return text;
}
+
+ public static String addDotText(int dotNum) {
+
+ return StatCollector.translateToLocalFormatted("gtnhlanth.tt.hintdot", dotNum + "");
+
+ }
}
diff --git a/src/main/java/com/elisis/gtnhlanth/util/Util.java b/src/main/java/com/elisis/gtnhlanth/util/Util.java
new file mode 100644
index 0000000000..1a42396de0
--- /dev/null
+++ b/src/main/java/com/elisis/gtnhlanth/util/Util.java
@@ -0,0 +1,55 @@
+package com.elisis.gtnhlanth.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+
+public class Util {
+
+ public static void depleteDurabilityOfStack(ItemStack stack, int damage) {
+
+ if (stack == null) return;
+
+ if (stack.stackSize == 0) // Might happen, who knows
+ return;
+
+ if (damage + stack.getItemDamage() > stack.getMaxDamage()) {
+ stack.stackSize--;
+ } else {
+
+ stack.setItemDamage(stack.getItemDamage() + damage);
+
+ }
+
+ }
+
+ public static List<Pos2d> getGridPositions(int totalCount, int xOrigin, int yOrigin, int xDirMaxCount,
+ int yDirMaxCount, int distanceBetweenSlots) {
+ // 18 pixels to get to a new grid for placing an item tile since they are 16x16 and have 1 pixel buffers
+ // around them.
+
+ int distance = 18 + distanceBetweenSlots;
+
+ List<Pos2d> results = new ArrayList<>();
+ int count = 0;
+ loop: for (int j = 0; j < yDirMaxCount; j++) {
+ for (int i = 0; i < xDirMaxCount; i++) {
+ if (count >= totalCount) break loop;
+ results.add(new Pos2d(xOrigin + i * distance, yOrigin + j * distance));
+ count++;
+ }
+ }
+ return results;
+ }
+
+ public static boolean coolantFluidCheck(FluidStack inStack, int fluidToConsume) {
+ return (inStack.amount < fluidToConsume
+ || (!inStack.isFluidEqual(FluidRegistry.getFluidStack("ic2coolant", 1)) && inStack.getFluid()
+ .getTemperature() > 200));
+ }
+}