aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
authorBlueWeabo <76872108+BlueWeabo@users.noreply.github.com>2022-12-13 23:10:17 +0200
committerGitHub <noreply@github.com>2022-12-13 22:10:17 +0100
commit8a515c7a9f83ca0fe29098d50bc7cab30e137d35 (patch)
treef8d8ae0ef341bc629a7ef12ad46da3c21a19b011 /src/main/java/gregtech/api/util
parentc702937ba0bf2e3f6cc8e2c37a2d5a7453a74926 (diff)
downloadGT5-Unofficial-8a515c7a9f83ca0fe29098d50bc7cab30e137d35.tar.gz
GT5-Unofficial-8a515c7a9f83ca0fe29098d50bc7cab30e137d35.tar.bz2
GT5-Unofficial-8a515c7a9f83ca0fe29098d50bc7cab30e137d35.zip
Nanite material and circuit board multi for later tiers (#1513)
* Base work for ModularUI compat * Remove useless interface * Add almost all the widgets * Invert method * Refactor NEI stack placement positions * NEI handlers on ModularUI * Add some more docs * AdvDebugStructureWriter * Fix NEI progressbar not working * PrimitiveBlastFurnace * clean * derp * clean * spotlessApply * Boilers * Buffers * clean * N by N slots containers * Fix boilers not having bucket interaction Put opening UI to individual MetaTEs * Maintenance Hatch * clean * spotlessApply * Add dependency * IndustrialApiary * Adapt to ModularUI change * Base work for covers & fix crash with MP * Fix crash with server * Rewrite base work for covers * Send initial cover data on cover GUI open so that the time of showing incorrect data will be eliminated * Covers part 1 * Rename package: ModularUI -> modularui * Rename class: GT_UIInfo -> GT_UIInfos * Fix build * Covers part2 * Fix missing client check with tile UI & fix title overlap * CoverTabLine * Move cover window creators to inner class * Fix crash with null base TE * Close GUI when tile is broken * Color cover window with tile colorization * add nanites as a material * spotless * start the work on the nanites multi * spotless * Change signature of addUIWidgets * FluidFilter cover, FluidDisplaySlotWidget, BasicTank, BasicGenerator, Output Hatch, MicrowaveEnergyTransmitter, Teleporter, DigitalChest, DigitalTank * Add title tab * Move package: modularui -> modularui/widget * add controller recipe and new casing * add prefix and the casing and controller to the item list * add nano forge controller to its item * add nanites to PreLoad * Programmed circuit + IConfigurationCircuitSupport * clean * add nano forge multi - complete with some recipes * new nanite textures * Apply spotless * fix nanites not registering, remove recipe lock on the nano forge, other small fixed no clue why they didn't want to register in run2. * VolumetricFlask * Remove integrated circuit overlay from recipe input slots * Input Hatch & Quadruple Input Hatch * Multiblock * Deprecate old cover GUI * BasicMachines * Finish BasicMachine & NEI * Expand DTPF NEI to 9 slots * Fix ME input bus on MP * Move AESlotWidget to public class * Move GT_Recipe_Map constructors with mNEIUnificateOutput to setter method * Move SteamTexture.Variant to outer enum * Switch to remote repository * oops * Update MUI * Update MUI * Minor refactor for change amount buttons * the start of a new multi, tooltip WIP * Display items and fluids that exceed usual count * blah * use +=, why didn't I do this * add tier 2 and tier 3. add some more checks * Update MUI * Move ModularUI to Base (#1510) * Move ModularUI to Base * Move most of the ModularUI functionality to `BaseTileEntity` (and `CoverableTileEntity`) * `CommonMetaTileEntity` delegates ato the MetaTileEntity * Added several interfaces (with defaults) to indicate if a tile/metatile override/implement certain behaviors. * Moved `IConfigurationCircuitSupport` interface such that it will work with BaseTileEntity or a MetaTileEntity * Address reviews Co-authored-by: miozune <miozune@gmail.com> * Update MUI * make a single shape rotatable by 90 degrees * Minor changes to NEI * more shapes, more mechanics * Return :facepalm: * IGetTabIconSet override * Some more changes to NEI * Merge texture getter interfaces to new class GUITextureSet * Remove BBF structure picture as it's auto-buildable now * Make unified title tab style of texture angular * Expose some boiler texture getters for addon * Fix crash with cover GUI on pipe * small changes * Lower the number of recipe per page for DTPF & update MUI * Update MUI * Fix crash with middle-clicking slot on circuit selection GUI * Fix circuit selection window not syncing item from base machine * Merge GT_NEI_AssLineHandler into GT_NEI_DefaultHandler * Update MUI * Add in TecTech multi message * Allow changing the way of binding player inventory * Update MUI * Update MUI * Update MUI * Update MUI * Update MUI * Make MUI non-transitive to allow addons to use their own version * Force enable mixin * Format fluid amount tooltip * Add GUITextureSet.STEAM * Add guard against null ModularWindow creation * Add constructors for Muffler Hatch with inventory * Fix output slot on digital chest and tank allowing insertion * Don't log null ModularWindow * add a new material, add some recipes, continue the work on the PCB factory. The first recipe is in! * oops spotless * update bs * rename casings * make material generate plates * add recipes to the pcb factory * nei handling * do some more work on the multi * fixes to recipes. * Update build-and-test.yml * starter work on the PCBFactory GUI. recipe check fully working * finish gui work * spotless thank god drafts don't generate spotless PRs * final touches. tooltip tomorrow * fix typos. and finish PCB multi. * spotless * changes for requests * make consumed amount a constant * fix recipes oopsie * Remove unused textures * Add nanites * fixing recipes * Fix NEI not showing * Make nanites share texture * actually fix recipes and use 2 new lenses * finally circuits work in recipe * Add trans metal block * add default offsets * spotless * make parallels actually work * Downscale nanite texture to 64x64 * improve PCB Factory GUI * finish fixing gui, fix offsets on cooler, apply a new formula for duration * Clean up PCB Factory tooltip * Spotless * Fix typo in Naquadah * make sure the roughness multiplier actually slows down the recipe XD * add a smaller limit to the roughness multipler.... lets not allow for 10x board prodction oops * fix cooler tier 2 using wrong block in its center, fix controller texture on tier 3 * update mui and uodate the button texture * fix one button and prevent null arrays * remove some math. a small rework on recipes * fix and off by 1 * save the change? never heard of it * fix tier 3 not forming * Nano forge tooltip * hopefully fix nano forge. fix neutroni nanite wrong tier in recipe * try 2 to fix structure check * fix nano forge not forming * fix nano forge data stick. we need better error messages * do some fixes. * its 12am, typos.... * never coding at midnight again * try 2 to fix nano forge and pcb factory * fix nano and pcb factory not working. address some reviews * do syncing between client and server. fix recipes asking too much power with multiple upgrades Co-authored-by: miozune <miozune@gmail.com> Co-authored-by: Jason Mitchell <mitchej@gmail.com> Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Sampsa <sampo.vanninen@aalto.fi>
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_LanguageManager.java11
-rw-r--r--src/main/java/gregtech/api/util/GT_OreDictUnificator.java8
-rw-r--r--src/main/java/gregtech/api/util/GT_PCBFactoryManager.java22
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java42
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java5
5 files changed, 88 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java
index 1d6d794542..1b2d566fd0 100644
--- a/src/main/java/gregtech/api/util/GT_LanguageManager.java
+++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java
@@ -479,6 +479,17 @@ public class GT_LanguageManager {
addStringLocalization("Interaction_DESCRIPTION_Index_333", "OR Gate");
addStringLocalization("Interaction_DESCRIPTION_Index_334", "NOR Gate");
addStringLocalization("Interaction_DESCRIPTION_Index_335", "Gate Mode");
+ addStringLocalization("Interaction_DESCRIPTION_Index_336", "PCB Factory Tier: ");
+ addStringLocalization("Interaction_DESCRIPTION_Index_337", "Upgrade Required: ");
+ addStringLocalization("Interaction_DESCRIPTION_Index_338", "Bio");
+ addStringLocalization("Interaction_DESCRIPTION_Index_339", "Bio Upgrade Enabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_339.1", "Bio Upgrade Disabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_340", "Rotate Bio Upgrade 90 Degrees Enabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_340.1", "Rotate Bio Upgrade 90 Degrees Disabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_341", "OC Tier 1 Enabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_341.1", "OC Tier 1 Disabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_342", "OC Tier 2 Enabled");
+ addStringLocalization("Interaction_DESCRIPTION_Index_342.1", "OC Tier 2 Disabled");
addStringLocalization("Interaction_DESCRIPTION_Index_500", "Fitting: Loose - More Flow");
addStringLocalization("Interaction_DESCRIPTION_Index_501", "Fitting: Tight - More Efficiency");
addStringLocalization("Interaction_DESCRIPTION_Index_502", "Mining chunk loading enabled");
diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
index 75ca3a7141..bf554e57df 100644
--- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
+++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
@@ -118,6 +118,14 @@ public class GT_OreDictUnificator {
return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true);
}
+ public static ItemStack get(OrePrefixes aPrefix, Object aMaterial, long aAmount, boolean aNoInvalidAmounts) {
+ // if (Materials.mDefaultComponents.contains(aPrefix) && !aPrefix.mDynamicItems.contains((Materials)aMaterial))
+ // aPrefix.mDynamicItems.add((Materials) aMaterial);
+ if (OrePrefixes.mPreventableComponents.contains(aPrefix) && aPrefix.mDisabledItems.contains(aMaterial))
+ return null;
+ return get(aPrefix.get(aMaterial), null, aAmount, false, aNoInvalidAmounts);
+ }
+
public static ItemStack get(
Object aName,
ItemStack aReplacement,
diff --git a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java
new file mode 100644
index 0000000000..1543a9d2a6
--- /dev/null
+++ b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java
@@ -0,0 +1,22 @@
+package gregtech.api.util;
+
+import com.google.common.collect.HashBiMap;
+import gregtech.api.enums.Materials;
+
+public class GT_PCBFactoryManager {
+ private static final HashBiMap<Materials, Integer> mPlasticTiers = HashBiMap.create();
+ public static int mTiersOfPlastics = 0;
+
+ public static void addPlasticTier(Materials aMaterial, int aTier) {
+ mPlasticTiers.put(aMaterial, aTier);
+ mTiersOfPlastics++;
+ }
+
+ public static int getPlasticTier(Materials aMaterial) {
+ return mPlasticTiers.get(aMaterial);
+ }
+
+ public static Materials getPlasticMaterialFromTier(int aTier) {
+ return mPlasticTiers.inverse().get(aTier);
+ }
+}
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 09cc850ecd..b2506c63ad 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -2428,6 +2428,48 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
(GT_Recipe_Map_LargeBoilerFakeFuels) new GT_Recipe_Map_LargeBoilerFakeFuels()
.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ public static final GT_Recipe_Map sNanoForge = new GT_Recipe_Map(
+ new HashSet<>(10),
+ "gt.recipe.nanoforge",
+ "Nano Forge",
+ null,
+ RES_PATH_GUI + "basicmachines/LCRNEI",
+ 6,
+ 2,
+ 2,
+ 1,
+ 1,
+ "Tier: ",
+ 1,
+ "",
+ false,
+ true)
+ .useModularUI(true)
+ .setUsualFluidInputCount(1)
+ .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_LENS)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
+
+ public static final GT_Recipe_Map sPCBFactory = new GT_Recipe_Map(
+ new HashSet<>(10),
+ "gt.recipe.pcbfactory",
+ "PCB Factory",
+ null,
+ RES_PATH_GUI + "basicmachines/LCRNEI",
+ 6,
+ 9,
+ 3,
+ 1,
+ 1,
+ E,
+ 0,
+ E,
+ true,
+ true)
+ .useModularUI(true)
+ .setUsualFluidInputCount(3)
+ .setUsualFluidOutputCount(0)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
+
/**
* HashMap of Recipes based on their Items
*/
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index a4cea9ed2f..da98e97f8e 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -4301,6 +4301,11 @@ public class GT_Utility {
return signal;
}
+ public static ItemStack getNaniteAsCatalyst(Materials material) {
+ ItemStack aItem = material.getNanite(1);
+ return new ItemStack(aItem.getItem(), 0, aItem.getItemDamage());
+ }
+
@AutoValue
public abstract static class ItemId {
/** This method copies NBT, as it is mutable. */