aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-12-06 20:14:04 +0100
committerbartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>2019-12-06 20:14:04 +0100
commitf3ab586a9a553f03bfa8de3a95ada65622140846 (patch)
treef6f0016d0ecee1105e0048f0622c137e813da8db /src
parent05d33ad675adcad53cbca8480f4cc6402d49f9df (diff)
downloadGT5-Unofficial-f3ab586a9a553f03bfa8de3a95ada65622140846.tar.gz
GT5-Unofficial-f3ab586a9a553f03bfa8de3a95ada65622140846.tar.bz2
GT5-Unofficial-f3ab586a9a553f03bfa8de3a95ada65622140846.zip
code maintenance
+ completely disabled GT++ ASM due to the wish of the author + repaired Unification Enforcer for items + general readability fixes + WerkstoffLoaderAPI fixes Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> Former-commit-id: b02ed0bee600695b3be09abd8ce59552676289ce
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCore.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java14
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java4
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java12
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java20
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java57
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java22
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java37
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java74
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java21
11 files changed, 136 insertions, 129 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
index 7b25541cc3..e6143a98d2 100644
--- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java
@@ -64,7 +64,7 @@ public class BWCore extends DummyModContainer {
shouldTransform[3] = Loader.isModLoaded("Thaumcraft") && ConfigHandler.enabledPatches[3];
shouldTransform[4] = true;
shouldTransform[5] = Loader.isModLoaded("RWG") && ConfigHandler.enabledPatches[5];
- shouldTransform[6] = true;
+ //shouldTransform[6] = true;
BWCore.BWCORE_LOG.info("Extra Utilities found and ASM Patch enabled? " + shouldTransform[0]);
BWCore.BWCORE_LOG.info("Thaumcraft found and ASM Patch enabled? " + shouldTransform[3]);
BWCore.BWCORE_LOG.info("RWG found and ASM Patch enabled? " + shouldTransform[5]);
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java
index cb0f49c07b..f880ed0321 100644
--- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java
+++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java
@@ -40,7 +40,7 @@ public class BWCoreTransformer implements IClassTransformer {
"PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION",
"PLACING MY GLASS-BLOCK RUNNABLE INTO THE GT_API",
"DUCTTAPING RWG WORLDEN FAILS",
- "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER"
+ // "REMOVING 12% BONUS OUTPUTS FROM GT++ SIFTER"
};
public static final String[] CLASSESBEEINGTRANSFORMED = {
"com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime",
@@ -49,7 +49,7 @@ public class BWCoreTransformer implements IClassTransformer {
"thaumcraft.common.tiles.TileWandPedestal",
"gregtech.GT_Mod",
"rwg.world.ChunkGeneratorRealistic",
- "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter"
+ // "gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialSifter"
};
static boolean obfs;
@@ -286,11 +286,11 @@ public class BWCoreTransformer implements IClassTransformer {
}
}
}
- case 6: {
- BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]);
- ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000;
- break scase;
- }
+// case 6: {
+// BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]);
+// ((IntInsnNode) methods.get(11).instructions.get(10)).operand = 10000;
+// break scase;
+// }
default: {
BWCore.BWCORE_LOG.info("Could not find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]);
return basicClass;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 34a148d499..f9674b72c7 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -155,10 +155,10 @@ public final class MainMod {
public void init(FMLInitializationEvent init) {
if (FMLCommonHandler.instance().getSide().isClient() && ConfigHandler.tooltips)
MinecraftForge.EVENT_BUS.register(new TooltipEventHandler());
+ ServerEventHandler serverEventHandler = new ServerEventHandler();
if (FMLCommonHandler.instance().getSide().isServer()) {
- ServerEventHandler serverEventHandler = new ServerEventHandler();
MinecraftForge.EVENT_BUS.register(serverEventHandler);
-// FMLCommonHandler.instance().bus().register(serverEventHandler);
+ FMLCommonHandler.instance().bus().register(serverEventHandler);
}
if (ConfigHandler.BioLab)
new BioLabLoader().run();
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java
index 9543643c3c..9f830eeeda 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java
@@ -49,7 +49,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase
private static final byte MULTI_UPSTEP = 2;
private static final byte MULTI_DOWNSTEP = 3;
private byte mode;
- private final byte texid = 2;
+ private byte texid = 2;
private long mCoilWicks;
private boolean upstep = true;
@@ -93,9 +93,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase
return this.onRunningTickTabbedMode();
}
- boolean ret = this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null));
-
- return ret;
+ return this.drainEnergyInput(this.getInputTier() * 2 * this.mEnergyHatches.size()) && this.addEnergyOutput(this.getInputTier() * 2 * this.mEnergyHatches.size() * (long) this.mEfficiency / this.getMaxEfficiency(null));
}
public boolean onRunningTickTabbedMode() {
@@ -109,7 +107,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase
continue;
long vtp = E.getEUVar() + (vtt);
- long avt = vtp < E.maxEUStore() ? vtp : E.maxEUStore();
+ long avt = Math.min(vtp, E.maxEUStore());
E.setEUVar(avt);
I.setEUVar(I.getEUVar() - vtt);
ret = true;
@@ -142,7 +140,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase
this.upstep = (this.mode == 0 || this.mode == 2);
this.mProgresstime = 0;
this.mMaxProgresstime = 1;
- this.mEfficiency = this.mEfficiency > 100 ? this.mEfficiency : 100;
+ this.mEfficiency = Math.max(this.mEfficiency, 100);
return this.upstep ? this.getOutputTier() - this.getInputTier() == this.mCoilWicks : this.getInputTier() - this.getOutputTier() == this.mCoilWicks;
}
@@ -168,7 +166,6 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase
++this.mCoilWicks;
if (this.mCoilWicks % 8 == 0) {
++y;
- continue;
}
} else
break;
@@ -253,7 +250,6 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase
++this.mCoilWicks;
if (this.mCoilWicks % 8 == 0) {
++y;
- continue;
}
} else
break;
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java
index 3c5d02cbb7..0bf633dcf2 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java
@@ -31,6 +31,8 @@ import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_Ores;
import com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_SmallOres;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.oregen.BW_OreLayer;
+import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128b;
+import com.github.bartimaeusnek.bartworks.system.oregen.BW_WorldGenRoss128ba;
import com.github.bartimaeusnek.bartworks.util.ChatColorHelper;
import cpw.mods.fml.common.event.FMLInterModComms;
import gregtech.api.enums.OrePrefixes;
@@ -74,6 +76,10 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
HashSet<ItemStack> result = new HashSet<>();
Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.ore)));
result.forEach(this::loadCraftingRecipes);
+ result.clear();
+ Werkstoff.werkstoffHashSet.stream().filter(w -> w.getGenerationFeatures().hasOres()).forEach(w -> result.add(w.get(OrePrefixes.oreSmall)));
+ result.forEach(this::loadCraftingRecipes);
+ result.clear();
HashSet<TemplateRecipeHandler.CachedRecipe> hashSet = new HashSet<>(this.arecipes);
this.arecipes.clear();
this.arecipes.addAll(hashSet);
@@ -95,8 +101,6 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
GuiDraw.drawString(ChatColorHelper.BOLD + "Primary:", 0, 50, 0, false);
GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(0).item.getDisplayName(), 0, 60, 0, false);
-
-
if (!cachedOreRecipe.small) {
GuiDraw.drawString(ChatColorHelper.BOLD + "Secondary:", 0, 70, 0, false);
GuiDraw.drawString(this.arecipes.get(recipe).getOtherStacks().get(1).item.getDisplayName(), 0, 80, 0, false);
@@ -116,7 +120,13 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
public void loadCraftingRecipes(ItemStack result) {
Block ore = Block.getBlockFromItem(result.getItem());
if (ore instanceof BW_MetaGenerated_Ores) {
- BW_OreLayer.NEIMAP.get((short) result.getItemDamage()).forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres)));
+ BW_OreLayer.NEIMAP.get(
+ (short) result.getItemDamage())
+ .stream()
+ .filter(l -> !(ore instanceof BW_MetaGenerated_SmallOres) ||
+ !(l.getClass().equals(BW_WorldGenRoss128b.class) ||
+ l.getClass().equals(BW_WorldGenRoss128ba.class)))
+ .forEach(l -> this.arecipes.add(new CachedOreRecipe(l, result, ore instanceof BW_MetaGenerated_SmallOres)));
}
}
@@ -135,11 +145,11 @@ public class BW_NEI_OreHandler extends TemplateRecipeHandler {
public CachedOreRecipe(BW_OreLayer worldGen, ItemStack result, boolean smallOres) {
this.worldGen = worldGen;
this.stack = new PositionedStack(result, 0, 0);
- this.small=smallOres;
+ this.small = smallOres;
}
boolean small;
BW_OreLayer worldGen;
- PositionedStack stack ;
+ PositionedStack stack;
@Override
public PositionedStack getResult() {
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java
index 0b2822dae8..eeb8772b15 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java
@@ -25,15 +25,22 @@ package com.github.bartimaeusnek.bartworks.server.EventHandler;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.net.OreDictCachePacket;
import com.github.bartimaeusnek.bartworks.common.net.ServerJoinedPackage;
+import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.TickEvent;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_OreDictUnificator;
import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
+import net.minecraftforge.oredict.OreDictionary;
public class ServerEventHandler {
+ //MinecraftForge.EVENT_BUS
@SubscribeEvent(priority = EventPriority.LOWEST)
public void EntityJoinWorldEvent(EntityJoinWorldEvent event) {
if (event == null || !(event.entity instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer())
@@ -42,23 +49,35 @@ public class ServerEventHandler {
MainMod.BW_Network_instance.sendToPlayer(new ServerJoinedPackage(null),(EntityPlayerMP) event.entity);
}
-// @SubscribeEvent(priority = EventPriority.HIGHEST)
-// public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) {
-// if (!BWUnificationEnforcer.isEnabled() || event == null || !(event.player instanceof EntityPlayerMP) || !FMLCommonHandler.instance().getSide().isServer())
-// return;
-//
-// for (int i = 0; i < event.player.inventory.mainInventory.length; i++) {
-// ItemStack stack = event.player.inventory.mainInventory[i];
-// for (int id : OreDictionary.getOreIDs(stack))
-// if (BWUnificationEnforcer.getUnificationTargets().contains(OreDictionary.getOreName(id))){
-// ArrayList<ItemStack> stacks = OreDictionary.getOres(OreDictionary.getOreName(id));
-// for (int j = 0; j < stacks.size(); j++) {
-// GameRegistry.UniqueIdentifier UI = GameRegistry.findUniqueIdentifierFor(stacks.get(j).getItem());
-// if (UI.modId.equals(MainMod.MOD_ID)){
-// event.player.inventory.mainInventory[i] = stacks.get(j).copy().splitStack(stack.stackSize);
-// }
-// }
-// }
-// }
-// }
+ //FMLCommonHandler.instance().bus()
+ @SubscribeEvent(priority = EventPriority.HIGHEST)
+ public void onPlayerTickEventServer(TickEvent.PlayerTickEvent event) {
+ if (event == null || !(event.player instanceof EntityPlayerMP))
+ return;
+
+ boolean replace = false;
+ ItemStack toReplace = null;
+ for (int i = 0; i < event.player.inventory.mainInventory.length; i++) {
+ ItemStack stack = event.player.inventory.mainInventory[i];
+ if (stack == null)
+ continue;
+ int[] oreIDs = OreDictionary.getOreIDs(stack);
+ if (oreIDs.length > 0){
+ for (int oreID : oreIDs) {
+ String oreDictName = OreDictionary.getOreName(oreID);
+ for (Werkstoff e : Werkstoff.werkstoffHashSet) {
+ replace = e.getGenerationFeatures().enforceUnification;
+ if (replace && oreDictName.contains(e.getVarName())) {
+ String prefix = oreDictName.replace(e.getVarName(), "");
+ toReplace = GT_OreDictUnificator.get(OrePrefixes.getPrefix(prefix),e.getVarName(),stack.stackSize);
+ }
+ }
+ }
+ }
+ if (replace) {
+ event.player.inventory.setInventorySlotContents(i, toReplace);
+ replace = false;
+ }
+ }
+ }
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
index bb2e825bb9..b71cb43c24 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java
@@ -182,10 +182,19 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
this.texSet = texSet;
- if (this.mOreByProducts.isEmpty()) {
- this.mOreByProducts.add(this);
- this.mOreByProducts.add(this);
- this.mOreByProducts.add(this);
+ switch(this.mOreByProducts.size()) {
+ case 0 :
+ this.mOreByProducts.add(this);
+ this.mOreByProducts.add(this);
+ this.mOreByProducts.add(this);
+ break;
+ case 1:
+ this.mOreByProducts.add(this);
+ this.mOreByProducts.add(this);
+ break;
+ case 2:
+ this.mOreByProducts.add(this);
+ break;
}
Werkstoff.werkstoffHashSet.add(this);
@@ -368,7 +377,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return new FluidStack(Objects.requireNonNull(WerkstoffLoader.molten.get(this)),fluidAmount);
}
-
public ItemStack get(OrePrefixes prefixes, int amount) {
return WerkstoffLoader.getCorrespondingItemStack(prefixes, this, amount);
}
@@ -387,7 +395,6 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this.stats.durOverride > 0 ? this.stats.durOverride : (int) (this.stats.durMod * ((0.01f * (float) this.getStats().getMeltingPoint() * (float) this.getStats().getMass()) / (float) this.getContents().getKey()));
}
-
public enum Types {
MATERIAL, COMPOUND, MIXTURE, BIOLOGICAL, ELEMENT, ISOTOPE, UNDEFINED;
@@ -697,7 +704,8 @@ public class Werkstoff implements IColorModulationContainer, ISubTagContainer {
return this;
}
- public Werkstoff.Stats setmTC_AspectsVarArg(Pair<Object, Integer>... mTC_Aspects) {
+ @SafeVarargs
+ public final Werkstoff.Stats setmTC_AspectsVarArg(Pair<Object, Integer>... mTC_Aspects) {
this.mTC_Aspects = mTC_Aspects;
return this;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
index e2778cc0dc..15133368b4 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java
@@ -34,6 +34,7 @@ import com.github.bartimaeusnek.bartworks.system.oredict.OreDictAdder;
import com.github.bartimaeusnek.bartworks.system.oredict.OreDictHandler;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import com.github.bartimaeusnek.bartworks.util.BW_ColorUtil;
+import com.github.bartimaeusnek.bartworks.util.BW_Util;
import com.github.bartimaeusnek.bartworks.util.Pair;
import com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler;
import com.google.common.collect.HashBiMap;
@@ -76,6 +77,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.subscriptNumbers;
import static com.github.bartimaeusnek.bartworks.util.BW_Util.superscriptNumbers;
import static gregtech.api.enums.OrePrefixes.*;
+@SuppressWarnings({"unchecked", "unused", "deprecation"})
public class WerkstoffLoader implements Runnable {
private WerkstoffLoader() {}
@@ -117,7 +119,7 @@ public class WerkstoffLoader implements Runnable {
WerkstoffLoader.boltMold = Enum.valueOf(ItemList.class, "Shape_Mold_Bolt");
} catch (NullPointerException | IllegalArgumentException ignored){}
//add tiberium
- Element t = EnumHelper.addEnum(Element.class,"Tr",new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{123L, 203L, 0L, -1L, (String) null, "Tiberium", false});
+ Element t = BW_Util.createNewElement("Tr",123L, 203L, 0L, -1L, null, "Tiberium", false);
//add molten & regular capsuls
if (Loader.isModLoaded("Forestry")) {
capsuleMolten = EnumHelper.addEnum(OrePrefixes.class, "capsuleMolten", new Class[]{String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, int.class, long.class, int.class, int.class}, new Object[]{"Capsule of Molten stuff", "Molten ", " Capsule", true, true, true, true, false, false, false, true, false, false, 0b1000000, 3628800L, 64, -1});
@@ -127,8 +129,10 @@ public class WerkstoffLoader implements Runnable {
bottle.mDefaultStackSize = 1;
}
- //TODO: FREE ID RANGE: 91-32766
-
+ //TODO:
+ //FREE ID RANGE: 95-30000
+ //bartimaeusnek reserved 0-10000
+ //Tec & basdxz reserved range 30000-32767
public static final Werkstoff Bismutite = new Werkstoff(
new short[]{255, 233, 0, 0},
"Bismutite",
@@ -136,7 +140,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().addGems(),
1,
TextureSet.SET_FLINT,
- Arrays.asList(Materials.Bismuth),
+ Collections.singletonList(Materials.Bismuth),
new Pair<>(Materials.Bismuth, 2),
new Pair<>(Materials.Oxygen, 2),
new Pair<>(Materials.CarbonDioxide, 2)
@@ -171,7 +175,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().onlyDust().addGems().enforceUnification(),
4,
TextureSet.SET_DIAMOND,
- Arrays.asList(WerkstoffLoader.Zirconium),
+ Collections.singletonList(WerkstoffLoader.Zirconium),
new Pair<>(WerkstoffLoader.Zirconium, 1),
new Pair<>(Materials.Oxygen, 2)
);
@@ -357,7 +361,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures(),
18,
TextureSet.SET_METALLIC,
- Arrays.asList(Materials.Thorium),
+ Collections.singletonList(Materials.Thorium),
new Pair<>(Materials.Thorium, 1),
new Pair<>(Materials.Oxygen, 2)
);
@@ -395,7 +399,7 @@ public class WerkstoffLoader implements Runnable {
new Werkstoff.GenerationFeatures().disable().addGems().addSifterRecipes(),
21,
TextureSet.SET_FLINT,
- Arrays.asList(Materials.Spodumene),
+ Collections.singletonList(Materials.Spodumene),
new Pair<>(Materials.Spodumene, 1)
);
public static final Werkstoff RockSalt = new Werkstoff(
@@ -517,7 +521,7 @@ public class WerkstoffLoader implements Runnable {
superscriptNumbers("Th232"),
new Werkstoff.Stats().setRadioactive(true),
Werkstoff.Types.ISOTOPE,
- new Werkstoff.GenerationFeatures().disable().onlyDust(),
+ new Werkstoff.GenerationFeatures().disable().onlyDust().enforceUnification(),
30,
TextureSet.SET_METALLIC
//No Byproducts
@@ -1359,11 +1363,10 @@ public class WerkstoffLoader implements Runnable {
if (!this.registered) {
MainMod.LOGGER.info("Loading Processing Recipes for BW Materials");
long timepre = System.nanoTime();
- ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashMap.size()+1);
+ ProgressManager.ProgressBar progressBar = ProgressManager.push("Register BW Materials", Werkstoff.werkstoffHashSet.size()+1);
DebugLog.log("Loading Recipes"+(System.nanoTime()-timepre));
- for (short i = 0; i < Werkstoff.werkstoffHashMap.size(); i++) {
+ for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
long timepreone = System.nanoTime();
- Werkstoff werkstoff = Werkstoff.werkstoffHashMap.get(i);
DebugLog.log("Werkstoff is null or id < 0 ? "+ (werkstoff==null || werkstoff.getmID() < 0) + " " + (System.nanoTime()-timepreone));
if (werkstoff == null || werkstoff.getmID() < 0) {
progressBar.step("");
@@ -1448,7 +1451,7 @@ public class WerkstoffLoader implements Runnable {
Materials.RockSalt.mToolQuality = WerkstoffLoader.RockSalt.getToolQuality();
Materials.Calcium.mToolQuality = WerkstoffLoader.Calcium.getToolQuality();
- for (Werkstoff W : Werkstoff.werkstoffHashMap.values()) {
+ for (Werkstoff W : Werkstoff.werkstoffHashSet) {
for (Pair<ISubTagContainer, Integer> pair : W.getContents().getValue().toArray(new Pair[0])) {
if (pair.getKey() instanceof Materials && pair.getKey() == Materials.Neodymium) {
@@ -2279,16 +2282,16 @@ public class WerkstoffLoader implements Runnable {
// }
//Tank "Recipe"
- GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000),werkstoff.get(cell),Materials.Empty.getCells(1)));
+ GT_Utility.addFluidContainerData(new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000),werkstoff.get(cell),Materials.Empty.getCells(1)));
FluidContainerRegistry.registerFluidContainer(werkstoff.getFluidOrGas(1).getFluid(),werkstoff.get(cell),Materials.Empty.getCells(1));
- GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(fluids.get(werkstoff),1000), GT_Values.NF);
- GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(fluids.get(werkstoff),1000));
+ GT_Values.RA.addFluidCannerRecipe(Materials.Empty.getCells(1), werkstoff.get(cell), new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000), GT_Values.NF);
+ GT_Values.RA.addFluidCannerRecipe(werkstoff.get(cell), Materials.Empty.getCells(1), GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)),1000));
if (Loader.isModLoaded("Forestry")) {
- FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(WerkstoffLoader.fluids.get(werkstoff), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true);
+ FluidContainerRegistry.FluidContainerData emptyData = new FluidContainerRegistry.FluidContainerData(new FluidStack(Objects.requireNonNull(WerkstoffLoader.fluids.get(werkstoff)), 1000), werkstoff.get(capsule), GT_ModHandler.getModItem("Forestry", "waxCapsule", 1), true);
GT_Utility.addFluidContainerData(emptyData);
FluidContainerRegistry.registerFluidContainer(emptyData);
- GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(fluids.get(werkstoff), 1000));
+ GT_Values.RA.addFluidCannerRecipe(werkstoff.get(capsule), GT_Values.NI, GT_Values.NF, new FluidStack(Objects.requireNonNull(fluids.get(werkstoff)), 1000));
}
if ((werkstoff.getGenerationFeatures().toGenerate & 0b1) != 0){
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
index 16d306d05f..2e3e8cf698 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -336,56 +336,40 @@ public class BWRecipes {
}
public boolean addBioLabRecipe(ItemStack[] aInputs, ItemStack aOutput, ItemStack aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, aSpecialItems, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null;
}
public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack[] aFluidInputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, aFluidInputs, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null;
}
public boolean addBioLabRecipeIncubation(ItemStack aInput, BioCulture aOutput, int[] aChances, FluidStack aFluidInputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, new ItemStack[]{BioItemList.getPetriDish(null), aInput}, new ItemStack[]{BioItemList.getPetriDish(aOutput)}, null, aChances, new FluidStack[]{aFluidInputs}, new FluidStack[]{GT_Values.NF}, aDuration, aEUt, aSpecialValue)) != null;
}
@Deprecated
public boolean addBioLabRecipeDNAExtraction(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[0], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null;
}
@Deprecated
public boolean addBioLabRecipePCRThermoclycling(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[1], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null;
}
@Deprecated
public boolean addBioLabRecipePlasmidSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[2], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null;
}
@Deprecated
public boolean addBioLabRecipeTransformation(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[3], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null;
}
@Deprecated
public boolean addBioLabRecipeClonalCellularSynthesis(ItemStack[] aInputs, ItemStack aOutput, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
- if (sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null)
- return true;
- return false;
+ return sBiolab.addRecipe(new DynamicGTRecipe(true, aInputs, new ItemStack[]{aOutput}, BioItemList.mBioLabParts[4], aChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue)) != null;
}
@Deprecated
@@ -395,9 +379,7 @@ public class BWRecipes {
aSievert += calculateSv(material);
aSievert = aSievert << 6;
aSievert = aSievert | glasTier;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, @Nonnegative int aDuration, @Nonnegative int aEUt, @Nonnegative int aSv, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) {
@@ -411,9 +393,7 @@ public class BWRecipes {
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
aSievert = aSievert | gTier;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture aCulture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, @Nonnegative int glasTier, int aSpecialValue, boolean exactSv) {
@@ -427,9 +407,7 @@ public class BWRecipes {
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
aSievert = aSievert | gTier;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
@Deprecated
@@ -440,9 +418,7 @@ public class BWRecipes {
aSievert = aSievert << 1;
aSievert = aSievert | (exactSv ? 1 : 0);
aSievert = aSievert << 6;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, aOutputs, null, new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, Materials material, int aSpecialValue, boolean exactSv) {
@@ -454,9 +430,7 @@ public class BWRecipes {
aSievert = aSievert << 2;
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
/**
@@ -464,20 +438,15 @@ public class BWRecipes {
*/
public boolean addBacterialVatRecipe(ItemStack[] aInputs, BioCulture culture, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, byte glasTier) {
int aSievert = 0;
- aSievert = aSievert << 7;
aSievert = aSievert | glasTier;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
/**
* Adds a Vat recipe without Rad or Glas requirements
*/
public boolean addBacterialVatRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, BioCulture culture, FluidStack[] aFluidOutputs, int aDuration, int aEUt) {
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(false, aInputs, null, BioItemList.getPetriDish(culture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, 0)) != null;
}
@@ -492,9 +461,7 @@ public class BWRecipes {
aSievert = aSievert | specialToByte(aSpecialValue);
aSievert = aSievert << 4;
aSievert = aSievert | gTier;
- if (sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null)
- return true;
- return false;
+ return sBacteriaVat.addRecipe(new BacteriaVatRecipe(true, aInputs, null, BioItemList.getPetriDish(aCulture), new int[]{}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSievert)) != null;
}
public static class DynamicGTRecipe extends GT_Recipe implements Serializable {
@@ -538,7 +505,7 @@ public class BWRecipes {
protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
aRecipe.mHidden = aHidden;
aRecipe.mFakeRecipe = aFakeRecipe;
- GT_Recipe isthere = this.findRecipe((IHasWorldObjectAndCoords) null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs);
+ GT_Recipe isthere = this.findRecipe(null, false, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs);
if (aRecipe.mFluidInputs.length < this.mMinimalInputFluids && aRecipe.mInputs.length < this.mMinimalInputItems) {
return null;
@@ -562,7 +529,7 @@ public class BWRecipes {
nu1[nu1.length - 1] = GT_Utility.getIntegratedCircuit(9 + nu1.length);
aRecipe.mInputs = nu1;
}
- if (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) {
+ if (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null) {
ItemStack[] nu = Arrays.copyOf(aRecipe.mInputs, aRecipe.mInputs.length + 1);
int i = 9 + nu.length;
do {
@@ -574,7 +541,7 @@ public class BWRecipes {
if (i == 9 + nu.length)
return null;
}
- while (this.findRecipe((IHasWorldObjectAndCoords) null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null);
+ while (this.findRecipe(null, false, 9223372036854775807L, aRecipe.mFluidInputs, aRecipe.mInputs) != null);
}
return this.addRecipe(aRecipe, false, false, false);
}
@@ -621,7 +588,7 @@ public class BWRecipes {
}
// Unification happens here in case the Input isn't already unificated.
- if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object) aInputs);
// Check the Recipe which has been used last time in order to not have to search for it again, if possible.
if (aRecipe != null)
@@ -665,6 +632,7 @@ public class BWRecipes {
Map<Character, ItemStack> charToStackMap = new HashMap<>(9,1);
String[] shape;
+ @SuppressWarnings({"SuspiciousSystemArraycopy"})
public BWNBTDependantCraftingRecipe(ItemStack result, Object... recipe) {
this.result = result;
this.shape = new String[3];
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java
index 95af2d9738..2c01562b8a 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java
@@ -25,7 +25,7 @@ package com.github.bartimaeusnek.bartworks.util;
import gregtech.api.enums.Dyes;
import java.util.Arrays;
-
+@SuppressWarnings("unused")
public class BW_ColorUtil {
private BW_ColorUtil(){}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
index 1a34c11359..f9d803ef10 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java
@@ -24,6 +24,7 @@ package com.github.bartimaeusnek.bartworks.util;
import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
+import gregtech.api.enums.Element;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
@@ -38,17 +39,19 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.item.EnumRarity;
-import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import static gregtech.api.enums.GT_Values.V;
-
+@SuppressWarnings("unused")
public class BW_Util {
public static final int STANDART = 0;
@@ -201,9 +204,7 @@ public class BW_Util {
}
public static int calculateSv(Materials materials) {
- Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator();
- while (it.hasNext()) {
- BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next();
+ for (BioVatLogicAdder.MaterialSvPair pair : BioVatLogicAdder.RadioHatch.getMaSv()) {
if (pair.getMaterials().equals(materials))
return pair.getSievert();
}
@@ -344,10 +345,8 @@ public class BW_Util {
public static long getnominalVoltage(GT_MetaTileEntity_MultiBlockBase base) {
long rVoltage = 0L;
long rAmperage = 0L;
- Iterator var3 = base.mEnergyHatches.iterator();
- while (var3.hasNext()) {
- GT_MetaTileEntity_Hatch_Energy tHatch = (GT_MetaTileEntity_Hatch_Energy) var3.next();
+ for (GT_MetaTileEntity_Hatch_Energy tHatch : base.mEnergyHatches) {
if (GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity(tHatch)) {
if (rVoltage == 0 || rVoltage > tHatch.getBaseMetaTileEntity().getInputVoltage())
rVoltage = tHatch.getBaseMetaTileEntity().getInputVoltage();
@@ -374,6 +373,10 @@ public class BW_Util {
}
+ public static Element createNewElement(String variableName, long aProtons, long aNeutrons, long aAdditionalMass, long aHalfLifeSeconds, String aDecayTo, String aName, boolean aIsIsotope){
+ return EnumHelper.addEnum(Element.class,variableName,new Class[]{long.class, long.class, long.class, long.class, String.class, String.class, boolean.class}, new Object[]{aProtons, aNeutrons, aAdditionalMass, aHalfLifeSeconds, aDecayTo, aName, aIsIsotope});
+ }
+
public static EnumRarity getRarityFromByte(byte b) {
switch (b) {
case 1: