aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/ColorsMetadataSection.java11
-rw-r--r--src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java22
-rw-r--r--src/main/java/gregtech/api/util/GT_ApiaryModifier.java1
-rw-r--r--src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java31
-rw-r--r--src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java104
-rw-r--r--src/main/java/gregtech/api/util/GT_Assemblyline_Server.java439
-rw-r--r--src/main/java/gregtech/api/util/GT_BaseCrop.java120
-rw-r--r--src/main/java/gregtech/api/util/GT_BlockMap.java7
-rw-r--r--src/main/java/gregtech/api/util/GT_BlockSet.java1
-rw-r--r--src/main/java/gregtech/api/util/GT_CLS_Compat.java38
-rw-r--r--src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java95
-rw-r--r--src/main/java/gregtech/api/util/GT_CircuitryBehavior.java100
-rw-r--r--src/main/java/gregtech/api/util/GT_ClientPreference.java9
-rw-r--r--src/main/java/gregtech/api/util/GT_Config.java32
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehavior.java242
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java373
-rw-r--r--src/main/java/gregtech/api/util/GT_CreativeTab.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java37
-rw-r--r--src/main/java/gregtech/api/util/GT_FoodStat.java58
-rw-r--r--src/main/java/gregtech/api/util/GT_Forestry_Compat.java92
-rw-r--r--src/main/java/gregtech/api/util/GT_GC_Compat.java14
-rw-r--r--src/main/java/gregtech/api/util/GT_HatchElementBuilder.java210
-rw-r--r--src/main/java/gregtech/api/util/GT_IBoxableWrapper.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java1
-rw-r--r--src/main/java/gregtech/api/util/GT_LanguageManager.java58
-rw-r--r--src/main/java/gregtech/api/util/GT_Log.java5
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java1040
-rw-r--r--src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java219
-rw-r--r--src/main/java/gregtech/api/util/GT_OreDictUnificator.java112
-rw-r--r--src/main/java/gregtech/api/util/GT_OverclockCalculator.java46
-rw-r--r--src/main/java/gregtech/api/util/GT_PCBFactoryManager.java1
-rw-r--r--src/main/java/gregtech/api/util/GT_ParallelHelper.java53
-rw-r--r--src/main/java/gregtech/api/util/GT_PlayedSound.java4
-rw-r--r--src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java7
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java4722
-rw-r--r--src/main/java/gregtech/api/util/GT_RecipeRegistrator.java483
-rw-r--r--src/main/java/gregtech/api/util/GT_RenderingWorld.java17
-rw-r--r--src/main/java/gregtech/api/util/GT_Shaped_Recipe.java54
-rw-r--r--src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java84
-rw-r--r--src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java40
-rw-r--r--src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java21
-rw-r--r--src/main/java/gregtech/api/util/GT_SpawnEventHandler.java24
-rw-r--r--src/main/java/gregtech/api/util/GT_StructureUtility.java295
-rw-r--r--src/main/java/gregtech/api/util/GT_TooltipDataCache.java22
-rw-r--r--src/main/java/gregtech/api/util/GT_Util.java56
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java1781
-rw-r--r--src/main/java/gregtech/api/util/GT_UtilityClient.java21
-rw-r--r--src/main/java/gregtech/api/util/IGT_HatchAdder.java1
-rw-r--r--src/main/java/gregtech/api/util/ISerializableObject.java32
-rw-r--r--src/main/java/gregtech/api/util/LightingHelper.java504
-rw-r--r--src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java96
-rw-r--r--src/main/java/gregtech/api/util/extensions/ArrayExt.java1
-rw-r--r--src/main/java/gregtech/api/util/extensions/IteratorExt.java4
53 files changed, 5387 insertions, 6461 deletions
diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSection.java b/src/main/java/gregtech/api/util/ColorsMetadataSection.java
index c7ec2c8aa3..d8ce59f42c 100644
--- a/src/main/java/gregtech/api/util/ColorsMetadataSection.java
+++ b/src/main/java/gregtech/api/util/ColorsMetadataSection.java
@@ -1,21 +1,24 @@
package gregtech.api.util;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import java.util.HashMap;
import java.util.Map;
+
import net.minecraft.client.resources.data.IMetadataSection;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
@SideOnly(Side.CLIENT)
public class ColorsMetadataSection implements IMetadataSection {
+
private final Map<String, Integer> textColors;
private final Map<String, String> hexTextColors;
private final Map<String, Integer> guiTints;
private final Map<String, String> hexGuiTints;
private final boolean guiTintEnabled;
- public ColorsMetadataSection(
- Map<String, String> hexTextColorMap, Map<String, String> hexGuiTintMap, boolean guiTintEnabled) {
+ public ColorsMetadataSection(Map<String, String> hexTextColorMap, Map<String, String> hexGuiTintMap,
+ boolean guiTintEnabled) {
this.hexTextColors = hexTextColorMap;
this.textColors = convertHexMapToIntMap(hexTextColorMap);
diff --git a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java
index b58c00db88..cab41e0d3b 100644
--- a/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java
+++ b/src/main/java/gregtech/api/util/ColorsMetadataSectionSerializer.java
@@ -1,25 +1,29 @@
package gregtech.api.util;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+
+import net.minecraft.client.resources.data.BaseMetadataSectionSerializer;
+import net.minecraft.util.JsonUtils;
+
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.Dyes;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Map;
-import net.minecraft.client.resources.data.BaseMetadataSectionSerializer;
-import net.minecraft.util.JsonUtils;
@SideOnly(Side.CLIENT)
public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer {
- public ColorsMetadataSection deserialize(
- JsonElement metadataColors, Type type, JsonDeserializationContext context) {
+
+ public ColorsMetadataSection deserialize(JsonElement metadataColors, Type type,
+ JsonDeserializationContext context) {
// Default values
boolean enableGuiTint = GregTech_API.sColoredGUI;
Map<String, String> hexGuiTintMap = new HashMap<>();
@@ -39,8 +43,8 @@ public class ColorsMetadataSectionSerializer extends BaseMetadataSectionSerializ
if (jsonObject.has("guiTint")) {
JsonObject guiTints = JsonUtils.func_152754_s(jsonObject, "guiTint");
- enableGuiTint =
- JsonUtils.getJsonObjectBooleanFieldValueOrDefault(guiTints, "enableGuiTintWhenPainted", true);
+ enableGuiTint = JsonUtils
+ .getJsonObjectBooleanFieldValueOrDefault(guiTints, "enableGuiTintWhenPainted", true);
for (Dyes dye : Dyes.values()) {
hexGuiTintMap.put(dye.mName, GT_Util.toHexString(dye.getRGBA()));
diff --git a/src/main/java/gregtech/api/util/GT_ApiaryModifier.java b/src/main/java/gregtech/api/util/GT_ApiaryModifier.java
index eee97a4458..bb5c760556 100644
--- a/src/main/java/gregtech/api/util/GT_ApiaryModifier.java
+++ b/src/main/java/gregtech/api/util/GT_ApiaryModifier.java
@@ -3,6 +3,7 @@ package gregtech.api.util;
import net.minecraft.world.biome.BiomeGenBase;
public class GT_ApiaryModifier {
+
public float territory = 1f;
public float mutation = 1f;
public float lifespan = 1f;
diff --git a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java
index d4b00d99b2..b54697fdfc 100644
--- a/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java
+++ b/src/main/java/gregtech/api/util/GT_ApiaryUpgrade.java
@@ -1,14 +1,17 @@
package gregtech.api.util;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.common.items.GT_MetaGenerated_Item_03;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
+
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.common.items.GT_MetaGenerated_Item_03;
+
public enum GT_ApiaryUpgrade {
+
speed1(UNIQUE_INDEX.SPEED_UPGRADE, 32200, 1, (mods, n) -> mods.maxSpeed = 1),
speed2(UNIQUE_INDEX.SPEED_UPGRADE, 32201, 1, (mods, n) -> mods.maxSpeed = 2),
speed3(UNIQUE_INDEX.SPEED_UPGRADE, 32202, 1, (mods, n) -> mods.maxSpeed = 3),
@@ -105,10 +108,10 @@ public enum GT_ApiaryUpgrade {
sieve(UNIQUE_INDEX.SIEVE_UPGRADE, 32229, 1, (mods, n) -> {
mods.isCollectingPollen = true;
mods.energy *= 1.05f;
- }),
- ;
+ }),;
private enum UNIQUE_INDEX {
+
SPEED_UPGRADE,
PRODUCTION_UPGRADE,
PLAINS_UPGRADE,
@@ -130,16 +133,15 @@ public enum GT_ApiaryUpgrade {
OCEAN_UPGRADE,
SKY_UPGRADE,
HEATER_UPGRADE,
- SIEVE_UPGRADE,
- ;
+ SIEVE_UPGRADE,;
void apply(Consumer<GT_ApiaryUpgrade> fn) {
UNIQUE_UPGRADE_LIST.get(this).forEach(fn);
}
}
- private static final EnumMap<UNIQUE_INDEX, ArrayList<GT_ApiaryUpgrade>> UNIQUE_UPGRADE_LIST =
- new EnumMap<>(UNIQUE_INDEX.class);
+ private static final EnumMap<UNIQUE_INDEX, ArrayList<GT_ApiaryUpgrade>> UNIQUE_UPGRADE_LIST = new EnumMap<>(
+ UNIQUE_INDEX.class);
private int meta = 0;
private int maxnumber = 1;
@@ -150,8 +152,8 @@ public enum GT_ApiaryUpgrade {
private final HashSet<GT_Utility.ItemId> blacklistedUpgrades = new HashSet<>();
- GT_ApiaryUpgrade(
- UNIQUE_INDEX unique_index, int meta, int maxnumber, BiConsumer<GT_ApiaryModifier, Integer> applier) {
+ GT_ApiaryUpgrade(UNIQUE_INDEX unique_index, int meta, int maxnumber,
+ BiConsumer<GT_ApiaryModifier, Integer> applier) {
this.unique_index = unique_index;
this.meta = meta;
this.maxnumber = maxnumber;
@@ -162,11 +164,10 @@ public enum GT_ApiaryUpgrade {
private void setup_static_variables() {
quickLookup.put(this.meta, this);
ArrayList<GT_ApiaryUpgrade> un = UNIQUE_UPGRADE_LIST.get(this.unique_index);
- if (un != null)
- un.forEach((u) -> {
- u.blacklistedUpgrades.add(this.id);
- this.blacklistedUpgrades.add(u.id);
- });
+ if (un != null) un.forEach((u) -> {
+ u.blacklistedUpgrades.add(this.id);
+ this.blacklistedUpgrades.add(u.id);
+ });
else {
un = new ArrayList<>(1);
UNIQUE_UPGRADE_LIST.put(this.unique_index, un);
diff --git a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java
index f20a78d494..218e5bffdc 100644
--- a/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java
+++ b/src/main/java/gregtech/api/util/GT_AssemblyLineUtils.java
@@ -2,17 +2,14 @@ package gregtech.api.util;
import static gregtech.GT_Mod.GT_FML_LOGGER;
-import cpw.mods.fml.common.FMLCommonHandler;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
+
import javax.annotation.Nonnull;
+
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@@ -20,21 +17,26 @@ import net.minecraft.nbt.NBTTagString;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fluids.FluidStack;
+import cpw.mods.fml.common.FMLCommonHandler;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine;
+
public class GT_AssemblyLineUtils {
/**
* A cache of Recipes using the Output as Key.
*/
- private static HashMap<GT_ItemStack, GT_Recipe_AssemblyLine> sRecipeCacheByOutput =
- new HashMap<GT_ItemStack, GT_Recipe_AssemblyLine>();
+ private static HashMap<GT_ItemStack, GT_Recipe_AssemblyLine> sRecipeCacheByOutput = new HashMap<GT_ItemStack, GT_Recipe_AssemblyLine>();
/**
* A cache of Recipes using the Recipe Hash String as Key.
*/
- private static HashMap<String, GT_Recipe_AssemblyLine> sRecipeCacheByRecipeHash =
- new HashMap<String, GT_Recipe_AssemblyLine>();
+ private static HashMap<String, GT_Recipe_AssemblyLine> sRecipeCacheByRecipeHash = new HashMap<String, GT_Recipe_AssemblyLine>();
/**
* Checks the DataStick for deprecated/invalid recipes, updating them as required.
+ *
* @param aDataStick - The DataStick to process
* @return Is this DataStick now valid with a current recipe?
*/
@@ -55,6 +57,7 @@ public class GT_AssemblyLineUtils {
/**
* Finds an Assembly Line recipe from a DataStick.
+ *
* @param aDataStick - The DataStick to check.
* @return The GT_Recipe_AssemblyLine recipe contained on the DataStick, if any.
*/
@@ -64,8 +67,10 @@ public class GT_AssemblyLineUtils {
/**
* Finds an Assembly Line recipe from a DataStick.
- * @param aDataStick - The DataStick to check.
- * @param aReturnBuiltRecipe - Do we return a GT_Recipe_AssemblyLine built from the data on the Data Stick instead of searching the Recipe Map?
+ *
+ * @param aDataStick - The DataStick to check.
+ * @param aReturnBuiltRecipe - Do we return a GT_Recipe_AssemblyLine built from the data on the Data Stick instead
+ * of searching the Recipe Map?
* @return The GT_Recipe_AssemblyLine recipe contained on the DataStick, if any.
*/
@Nonnull
@@ -131,8 +136,7 @@ public class GT_AssemblyLineUtils {
GT_FML_LOGGER.info("Fluid " + i + " " + tLoaded.getUnlocalizedName());
}
}
- if (!aTag.hasKey("output")
- || !aTag.hasKey("time")
+ if (!aTag.hasKey("output") || !aTag.hasKey("time")
|| aTag.getInteger("time") <= 0
|| !aTag.hasKey("eu")
|| !GT_Utility.isStackValid(aOutput)) {
@@ -147,14 +151,15 @@ public class GT_AssemblyLineUtils {
// Try build a recipe instance
if (aReturnBuiltRecipe) {
- return LookupResultType.VALID_STACK_AND_VALID_HASH.getResult(new GT_Recipe_AssemblyLine(
- null,
- 0,
- aInputs.toArray(new ItemStack[0]),
- aFluidInputs.toArray(new FluidStack[0]),
- aOutput,
- aTime,
- aEU));
+ return LookupResultType.VALID_STACK_AND_VALID_HASH.getResult(
+ new GT_Recipe_AssemblyLine(
+ null,
+ 0,
+ aInputs.toArray(new ItemStack[0]),
+ aFluidInputs.toArray(new FluidStack[0]),
+ aOutput,
+ aTime,
+ aEU));
}
for (GT_Recipe_AssemblyLine aRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) {
@@ -186,13 +191,13 @@ public class GT_AssemblyLineUtils {
}
private static boolean areStacksEqual(ItemStack[] lhs, List<ItemStack> rhs) {
- return lhs == null
- ? rhs.isEmpty()
+ return lhs == null ? rhs.isEmpty()
: !rhs.isEmpty() && GT_Utility.areStackListsEqual(Arrays.asList(lhs), rhs, false, true);
}
/**
* Finds a GT_Recipe_AssemblyLine based on the expected output ItemStack.
+ *
* @param aOutput - The Output of a GT_Recipe_AssemblyLine.
* @return First found GT_Recipe_AssemblyLine with matching output.
*/
@@ -273,8 +278,7 @@ public class GT_AssemblyLineUtils {
* @return Does this Data Stick have a valid output ItemStack?
*/
public static boolean doesDataStickHaveOutput(ItemStack aDataStick) {
- if (isItemDataStick(aDataStick)
- && aDataStick.hasTagCompound()
+ if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound()
&& aDataStick.getTagCompound().hasKey("output")) {
return true;
}
@@ -306,8 +310,7 @@ public class GT_AssemblyLineUtils {
public static boolean doesDataStickHaveRecipeHash(ItemStack aDataStick) {
if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound()) {
NBTTagCompound aNBT = aDataStick.getTagCompound();
- if (aNBT.hasKey("Data.Recipe.Hash")
- && !aNBT.getString("Data.Recipe.Hash").equals("Hash.0")) {
+ if (aNBT.hasKey("Data.Recipe.Hash") && !aNBT.getString("Data.Recipe.Hash").equals("Hash.0")) {
return true;
}
}
@@ -316,6 +319,7 @@ public class GT_AssemblyLineUtils {
/**
* Get the Output ItemStack from a Data Stick.
+ *
* @param aDataStick - The Data Stick to check.
* @return Output ItemStack contained on the Data Stick.
*/
@@ -329,9 +333,11 @@ public class GT_AssemblyLineUtils {
/**
* @param aDataStick - The Data Stick to process.
- * @return The stored Recipe Hash String on the Data Stick, will return an invalid Hash if one is not found. <p>
- * The hash will be guaranteed to pass isValidHash(). <p>
- * Will not return Null.
+ * @return The stored Recipe Hash String on the Data Stick, will return an invalid Hash if one is not found.
+ * <p>
+ * The hash will be guaranteed to pass isValidHash().
+ * <p>
+ * Will not return Null.
*/
public static String getHashFromDataStack(ItemStack aDataStick) {
if (isItemDataStick(aDataStick) && aDataStick.hasTagCompound()) {
@@ -346,7 +352,7 @@ public class GT_AssemblyLineUtils {
/**
*
- * @param aDataStick - The Data Stick to update.
+ * @param aDataStick - The Data Stick to update.
* @param aRecipeHash - The Recipe Hash String to update with.
* @return Did we update the Recipe Hash String on the Data Stick?
*/
@@ -379,8 +385,12 @@ public class GT_AssemblyLineUtils {
String aHash = generateRecipeHash(aNewRecipe);
if (GT_Values.D1) {
GT_Recipe_AssemblyLine aOldRecipe = findAssemblyLineRecipeFromDataStick(aDataStick, true).recipe;
- GT_FML_LOGGER.info("Updating data stick: " + aDataStick.getDisplayName() + " | Old Recipe Hash: "
- + generateRecipeHash(aOldRecipe) + ", New Recipe Hash: " + aHash);
+ GT_FML_LOGGER.info(
+ "Updating data stick: " + aDataStick.getDisplayName()
+ + " | Old Recipe Hash: "
+ + generateRecipeHash(aOldRecipe)
+ + ", New Recipe Hash: "
+ + aHash);
}
String author = "Assembling Line Recipe Generator";
@@ -434,8 +444,15 @@ public class GT_AssemblyLineUtils {
s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mOutput.getDisplayName());
if (s == null) s = aNewRecipe.mOutput.getDisplayName();
}
- tNBTList.appendTag(new NBTTagString("Construction plan for " + aNewRecipe.mOutput.stackSize + " " + s
- + ". Needed EU/t: " + aNewRecipe.mEUt + " Production time: " + (aNewRecipe.mDuration / 20)));
+ tNBTList.appendTag(
+ new NBTTagString(
+ "Construction plan for " + aNewRecipe.mOutput.stackSize
+ + " "
+ + s
+ + ". Needed EU/t: "
+ + aNewRecipe.mEUt
+ + " Production time: "
+ + (aNewRecipe.mDuration / 20)));
for (int i = 0; i < aNewRecipe.mInputs.length; i++) {
if (aNewRecipe.mOreDictAlt[i] != null) {
int count = 0;
@@ -448,10 +465,7 @@ public class GT_AssemblyLineUtils {
if (s == null) s = tStack.getDisplayName();
}
- tBuilder.append(count == 0 ? "" : "\nOr ")
- .append(tStack.stackSize)
- .append(" ")
- .append(s);
+ tBuilder.append(count == 0 ? "" : "\nOr ").append(tStack.stackSize).append(" ").append(s);
count++;
}
}
@@ -462,8 +476,9 @@ public class GT_AssemblyLineUtils {
s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mInputs[i].getDisplayName());
if (s == null) s = aNewRecipe.mInputs[i].getDisplayName();
}
- tNBTList.appendTag(new NBTTagString(
- "Input Bus " + (i + 1) + ": " + aNewRecipe.mInputs[i].stackSize + " " + s));
+ tNBTList.appendTag(
+ new NBTTagString(
+ "Input Bus " + (i + 1) + ": " + aNewRecipe.mInputs[i].stackSize + " " + s));
}
}
for (int i = 0; i < aNewRecipe.mFluidInputs.length; i++) {
@@ -473,8 +488,9 @@ public class GT_AssemblyLineUtils {
s = GT_Assemblyline_Server.lServerNames.get(aNewRecipe.mFluidInputs[i].getLocalizedName());
if (s == null) s = aNewRecipe.mFluidInputs[i].getLocalizedName();
}
- tNBTList.appendTag(new NBTTagString(
- "Input Hatch " + (i + 1) + ": " + aNewRecipe.mFluidInputs[i].amount + "L " + s));
+ tNBTList.appendTag(
+ new NBTTagString(
+ "Input Hatch " + (i + 1) + ": " + aNewRecipe.mFluidInputs[i].amount + "L " + s));
}
}
tNBT.setTag("pages", tNBTList);
@@ -488,6 +504,7 @@ public class GT_AssemblyLineUtils {
}
public enum LookupResultType {
+
INVALID_STICK(true),
VALID_STACK_BUT_INVALID_RECIPE(true),
VALID_STACK_AND_VALID_RECIPE(false),
@@ -514,6 +531,7 @@ public class GT_AssemblyLineUtils {
}
public static class LookupResult {
+
private final GT_Recipe_AssemblyLine recipe;
private final LookupResultType type;
diff --git a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java b/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java
index 15d11cda63..a455fcf916 100644
--- a/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java
+++ b/src/main/java/gregtech/api/util/GT_Assemblyline_Server.java
@@ -1,30 +1,30 @@
package gregtech.api.util;
-import cpw.mods.fml.common.event.FMLPreInitializationEvent;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.MaterialsBotania;
import java.io.File;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
+
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.MaterialsBotania;
+
public class GT_Assemblyline_Server {
public static LinkedHashMap<String, String> lServerNames = new LinkedHashMap<String, String>();
private static LinkedHashMap<String, String> internal2 = new LinkedHashMap<String, String>(),
- internal3 = new LinkedHashMap<String, String>(),
- internal4 = new LinkedHashMap<String, String>();
+ internal3 = new LinkedHashMap<String, String>(), internal4 = new LinkedHashMap<String, String>();
private static HashMap<String, Property> internal = new HashMap<String, Property>();
public static void fillMap(FMLPreInitializationEvent aEvent) {
String s = new String(aEvent.getModConfigurationDirectory().getAbsolutePath());
- s = s.substring(
- 0, aEvent.getModConfigurationDirectory().getAbsolutePath().length() - 6);
+ s = s.substring(0, aEvent.getModConfigurationDirectory().getAbsolutePath().length() - 6);
s = s + "GregTech.lang";
File f = new File(s);
s = "";
@@ -40,131 +40,103 @@ public class GT_Assemblyline_Server {
else if (entry.getKey().contains("blockmachines") && s.contains("material"))
internal3.put(entry.getKey(), s);
else if ((entry.getKey().contains("blockores")
- || (entry.getKey().contains("blockmetal")
- || entry.getKey().contains("blockgem")))
- && s.contains("material")) internal4.put(entry.getKey(), s);
+ || (entry.getKey().contains("blockmetal") || entry.getKey().contains("blockgem")))
+ && s.contains("material"))
+ internal4.put(entry.getKey(), s);
else lServerNames.put(entry.getKey(), s);
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
for (Map.Entry<String, String> entry : internal2.entrySet()) {
try {
if (entry.getKey().contains("name")) {
- int i = Integer.parseInt(entry.getKey()
- .substring(
- "gt.metaitem.01.".length(), entry.getKey().length() - ".name".length()));
+ int i = Integer.parseInt(
+ entry.getKey()
+ .substring("gt.metaitem.01.".length(), entry.getKey().length() - ".name".length()));
i = i % 1000;
- if (GregTech_API.sGeneratedMaterials[i] != null)
- lServerNames.put(
- entry.getKey(),
- entry.getValue().replace("material", GregTech_API.sGeneratedMaterials[i].toString()));
+ if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace("material", GregTech_API.sGeneratedMaterials[i].toString()));
else lServerNames.put(entry.getKey(), null);
}
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
for (Map.Entry<String, String> entry : internal3.entrySet()) {
try {
- if (entry.getKey().contains("cable"))
- lServerNames.put(
- entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.cable.".length(),
- entry.getKey().length() - ".01.name".length())));
- else if (entry.getKey().contains("gt_frame_"))
- lServerNames.put(
- entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.gt_frame_".length(),
- entry.getKey().length() - ".name".length())));
+ if (entry.getKey().contains("cable")) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.cable.".length(),
+ entry.getKey().length() - ".01.name".length())));
+ else if (entry.getKey().contains("gt_frame_")) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.gt_frame_".length(),
+ entry.getKey().length() - ".name".length())));
else if (entry.getKey().contains("gt_pipe_")) {
- if (!entry.getKey().contains("_huge")
- && !entry.getKey().contains("_large")
+ if (!entry.getKey().contains("_huge") && !entry.getKey().contains("_large")
&& !entry.getKey().contains("_nonuple")
&& !entry.getKey().contains("_quadruple")
&& !entry.getKey().contains("_small")
&& !entry.getKey().contains("_tiny"))
lServerNames.put(
entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.gt_pipe_".length(),
- entry.getKey().length() - ".name".length())));
- else if (entry.getKey().contains("_huge") || entry.getKey().contains("_tiny"))
- lServerNames.put(
- entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.gt_pipe_".length(),
- entry.getKey().length() - "_tiny.name".length())));
- else if (entry.getKey().contains("_large") || entry.getKey().contains("_small"))
- lServerNames.put(
- entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.gt_pipe_".length(),
- entry.getKey().length() - "_large.name".length())));
- else if (entry.getKey().contains("_nonuple"))
- lServerNames.put(
- entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.gt_pipe_".length(),
- entry.getKey().length() - "_nonuple.name".length())));
- else if (entry.getKey().contains("_quadruple"))
- lServerNames.put(
- entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.gt_pipe_".length(),
- entry.getKey().length() - "_quadruple.name".length())));
- } else if (entry.getKey().contains("wire"))
- lServerNames.put(
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.gt_pipe_".length(),
+ entry.getKey().length() - ".name".length())));
+ else if (entry.getKey().contains("_huge") || entry.getKey().contains("_tiny")) lServerNames.put(
entry.getKey(),
- entry.getValue()
- .replace(
- "material",
- entry.getKey()
- .substring(
- "gt.blockmachines.wire.".length(),
- entry.getKey().length() - ".01.name".length())));
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.gt_pipe_".length(),
+ entry.getKey().length() - "_tiny.name".length())));
+ else if (entry.getKey().contains("_large") || entry.getKey().contains("_small")) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.gt_pipe_".length(),
+ entry.getKey().length() - "_large.name".length())));
+ else if (entry.getKey().contains("_nonuple")) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.gt_pipe_".length(),
+ entry.getKey().length() - "_nonuple.name".length())));
+ else if (entry.getKey().contains("_quadruple")) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.gt_pipe_".length(),
+ entry.getKey().length() - "_quadruple.name".length())));
+ } else if (entry.getKey().contains("wire")) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace(
+ "material",
+ entry.getKey().substring(
+ "gt.blockmachines.wire.".length(),
+ entry.getKey().length() - ".01.name".length())));
else lServerNames.put(entry.getKey(), entry.getValue());
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
for (Map.Entry<String, String> entry : internal4.entrySet()) {
try {
if (entry.getKey().contains("blockores")) {
- int i = Integer.parseInt(entry.getKey()
- .substring("gt.blockores.".length(), entry.getKey().length() - ".name".length()));
+ int i = Integer.parseInt(
+ entry.getKey()
+ .substring("gt.blockores.".length(), entry.getKey().length() - ".name".length()));
i = i % 1000;
- if (GregTech_API.sGeneratedMaterials[i] != null)
- lServerNames.put(
- entry.getKey(),
- entry.getValue().replace("material", GregTech_API.sGeneratedMaterials[i].toString()));
+ if (GregTech_API.sGeneratedMaterials[i] != null) lServerNames.put(
+ entry.getKey(),
+ entry.getValue().replace("material", GregTech_API.sGeneratedMaterials[i].toString()));
else lServerNames.put(entry.getKey(), null);
} else if (entry.getKey().contains("blockmetal")) {
Materials[] mMats = null;
@@ -173,168 +145,64 @@ public class GT_Assemblyline_Server {
int i = Integer.parseInt(t);
switch (i) {
case 1:
- mMats = new Materials[] {
- Materials.Adamantium,
- Materials.Aluminium,
- Materials.Americium,
- Materials.AnnealedCopper,
- Materials.Antimony,
- Materials.Arsenic,
- Materials.AstralSilver,
- Materials.BatteryAlloy,
- Materials.Beryllium,
- Materials.Bismuth,
- Materials.BismuthBronze,
- Materials.BlackBronze,
- Materials.BlackSteel,
- Materials.BlueAlloy,
- Materials.BlueSteel,
- Materials.Brass
- };
+ mMats = new Materials[] { Materials.Adamantium, Materials.Aluminium, Materials.Americium,
+ Materials.AnnealedCopper, Materials.Antimony, Materials.Arsenic,
+ Materials.AstralSilver, Materials.BatteryAlloy, Materials.Beryllium,
+ Materials.Bismuth, Materials.BismuthBronze, Materials.BlackBronze,
+ Materials.BlackSteel, Materials.BlueAlloy, Materials.BlueSteel, Materials.Brass };
break;
case 2:
- mMats = new Materials[] {
- Materials.Bronze,
- Materials.Caesium,
- Materials.Cerium,
- Materials.Chrome,
- Materials.ChromiumDioxide,
- Materials.Cobalt,
- Materials.CobaltBrass,
- Materials.Copper,
- Materials.Cupronickel,
- Materials.DamascusSteel,
- Materials.DarkIron,
- Materials.DeepIron,
- Materials.Desh,
- Materials.Duranium,
- Materials.Dysprosium,
- Materials.Electrum
- };
+ mMats = new Materials[] { Materials.Bronze, Materials.Caesium, Materials.Cerium,
+ Materials.Chrome, Materials.ChromiumDioxide, Materials.Cobalt,
+ Materials.CobaltBrass, Materials.Copper, Materials.Cupronickel,
+ Materials.DamascusSteel, Materials.DarkIron, Materials.DeepIron, Materials.Desh,
+ Materials.Duranium, Materials.Dysprosium, Materials.Electrum };
break;
case 3:
- mMats = new Materials[] {
- Materials.ElectrumFlux,
- Materials.Enderium,
- Materials.Erbium,
- Materials.Europium,
- Materials.FierySteel,
- Materials.Gadolinium,
- Materials.Gallium,
- Materials.Holmium,
- Materials.HSLA,
- Materials.Indium,
- Materials.InfusedGold,
- Materials.Invar,
- Materials.Iridium,
- Materials.IronMagnetic,
- Materials.IronWood,
- Materials.Kanthal
- };
+ mMats = new Materials[] { Materials.ElectrumFlux, Materials.Enderium, Materials.Erbium,
+ Materials.Europium, Materials.FierySteel, Materials.Gadolinium, Materials.Gallium,
+ Materials.Holmium, Materials.HSLA, Materials.Indium, Materials.InfusedGold,
+ Materials.Invar, Materials.Iridium, Materials.IronMagnetic, Materials.IronWood,
+ Materials.Kanthal };
break;
case 4:
- mMats = new Materials[] {
- Materials.Knightmetal,
- Materials.Lanthanum,
- Materials.Lead,
- Materials.Lutetium,
- Materials.Magnalium,
- Materials.Magnesium,
- Materials.Manganese,
- Materials.MeteoricIron,
- Materials.MeteoricSteel,
- Materials.Trinium,
- Materials.Mithril,
- Materials.Molybdenum,
- Materials.Naquadah,
- Materials.NaquadahAlloy,
- Materials.NaquadahEnriched,
- Materials.Naquadria
- };
+ mMats = new Materials[] { Materials.Knightmetal, Materials.Lanthanum, Materials.Lead,
+ Materials.Lutetium, Materials.Magnalium, Materials.Magnesium, Materials.Manganese,
+ Materials.MeteoricIron, Materials.MeteoricSteel, Materials.Trinium,
+ Materials.Mithril, Materials.Molybdenum, Materials.Naquadah,
+ Materials.NaquadahAlloy, Materials.NaquadahEnriched, Materials.Naquadria };
break;
case 5:
- mMats = new Materials[] {
- Materials.Neodymium,
- Materials.NeodymiumMagnetic,
- Materials.Neutronium,
- Materials.Nichrome,
- Materials.Nickel,
- Materials.Niobium,
- Materials.NiobiumNitride,
- Materials.NiobiumTitanium,
- Materials.Osmiridium,
- Materials.Osmium,
- Materials.Palladium,
- Materials.PigIron,
- Materials.Platinum,
- Materials.Plutonium,
- Materials.Plutonium241,
- Materials.Praseodymium
- };
+ mMats = new Materials[] { Materials.Neodymium, Materials.NeodymiumMagnetic,
+ Materials.Neutronium, Materials.Nichrome, Materials.Nickel, Materials.Niobium,
+ Materials.NiobiumNitride, Materials.NiobiumTitanium, Materials.Osmiridium,
+ Materials.Osmium, Materials.Palladium, Materials.PigIron, Materials.Platinum,
+ Materials.Plutonium, Materials.Plutonium241, Materials.Praseodymium };
break;
case 6:
- mMats = new Materials[] {
- Materials.Promethium,
- Materials.RedAlloy,
- Materials.RedSteel,
- Materials.RoseGold,
- Materials.Rubidium,
- Materials.Samarium,
- Materials.Scandium,
- Materials.ShadowIron,
- Materials.ShadowSteel,
- Materials.Silicon,
- Materials.Silver,
- Materials.SolderingAlloy,
- Materials.StainlessSteel,
- Materials.Steel,
- Materials.SteelMagnetic,
- Materials.SterlingSilver
- };
+ mMats = new Materials[] { Materials.Promethium, Materials.RedAlloy, Materials.RedSteel,
+ Materials.RoseGold, Materials.Rubidium, Materials.Samarium, Materials.Scandium,
+ Materials.ShadowIron, Materials.ShadowSteel, Materials.Silicon, Materials.Silver,
+ Materials.SolderingAlloy, Materials.StainlessSteel, Materials.Steel,
+ Materials.SteelMagnetic, Materials.SterlingSilver };
break;
case 7:
- mMats = new Materials[] {
- Materials.Sunnarium,
- Materials.Tantalum,
- Materials.Tellurium,
- Materials.Terbium,
- Materials.Thaumium,
- Materials.Thorium,
- Materials.Thulium,
- Materials.Tin,
- Materials.TinAlloy,
- Materials.Titanium,
- Materials.Tritanium,
- Materials.Tungsten,
- Materials.TungstenSteel,
- Materials.Ultimet,
- Materials.Uranium,
- Materials.Uranium235
- };
+ mMats = new Materials[] { Materials.Sunnarium, Materials.Tantalum, Materials.Tellurium,
+ Materials.Terbium, Materials.Thaumium, Materials.Thorium, Materials.Thulium,
+ Materials.Tin, Materials.TinAlloy, Materials.Titanium, Materials.Tritanium,
+ Materials.Tungsten, Materials.TungstenSteel, Materials.Ultimet, Materials.Uranium,
+ Materials.Uranium235 };
break;
case 8:
- mMats = new Materials[] {
- Materials.Vanadium,
- Materials.VanadiumGallium,
- Materials.WroughtIron,
- Materials.Ytterbium,
- Materials.Yttrium,
- Materials.YttriumBariumCuprate,
- Materials.Zinc,
- Materials.TungstenCarbide,
- Materials.VanadiumSteel,
- Materials.HSSG,
- Materials.HSSE,
- Materials.HSSS,
- Materials.Steeleaf,
- Materials.Ichorium,
- Materials.Firestone
- };
+ mMats = new Materials[] { Materials.Vanadium, Materials.VanadiumGallium,
+ Materials.WroughtIron, Materials.Ytterbium, Materials.Yttrium,
+ Materials.YttriumBariumCuprate, Materials.Zinc, Materials.TungstenCarbide,
+ Materials.VanadiumSteel, Materials.HSSG, Materials.HSSE, Materials.HSSS,
+ Materials.Steeleaf, Materials.Ichorium, Materials.Firestone };
break;
}
t = entry.getKey()
- .substring(
- "gt.blockmetal1.".length(), entry.getKey().length() - ".name".length());
+ .substring("gt.blockmetal1.".length(), entry.getKey().length() - ".name".length());
i = Integer.parseInt(t);
lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString());
mMats = null;
@@ -345,66 +213,31 @@ public class GT_Assemblyline_Server {
int i = Integer.parseInt(t);
switch (i) {
case 1:
- mMats = new Materials[] {
- Materials.InfusedAir,
- Materials.Amber,
- Materials.Amethyst,
- Materials.InfusedWater,
- Materials.BlueTopaz,
- Materials.CertusQuartz,
- Materials.Dilithium,
- Materials.EnderEye,
- Materials.EnderPearl,
- Materials.FoolsRuby,
- Materials.Force,
- Materials.Forcicium,
- Materials.Forcillium,
- Materials.GreenSapphire,
- Materials.InfusedFire,
- Materials.Jasper,
- MaterialsBotania.ManaDiamond,
- MaterialsBotania.BotaniaDragonstone
- };
+ mMats = new Materials[] { Materials.InfusedAir, Materials.Amber, Materials.Amethyst,
+ Materials.InfusedWater, Materials.BlueTopaz, Materials.CertusQuartz,
+ Materials.Dilithium, Materials.EnderEye, Materials.EnderPearl, Materials.FoolsRuby,
+ Materials.Force, Materials.Forcicium, Materials.Forcillium, Materials.GreenSapphire,
+ Materials.InfusedFire, Materials.Jasper, MaterialsBotania.ManaDiamond,
+ MaterialsBotania.BotaniaDragonstone };
break;
case 2:
- mMats = new Materials[] {
- Materials.Lazurite,
- Materials.Lignite,
- Materials.Monazite,
- Materials.Niter,
- Materials.Olivine,
- Materials.Opal,
- Materials.InfusedOrder,
- Materials.InfusedEntropy,
- Materials.Phosphorus,
- Materials.Quartzite,
- Materials.GarnetRed,
- Materials.Ruby,
- Materials.Sapphire,
- Materials.Sodalite,
- Materials.Tanzanite,
- Materials.InfusedEarth
- };
+ mMats = new Materials[] { Materials.Lazurite, Materials.Lignite, Materials.Monazite,
+ Materials.Niter, Materials.Olivine, Materials.Opal, Materials.InfusedOrder,
+ Materials.InfusedEntropy, Materials.Phosphorus, Materials.Quartzite,
+ Materials.GarnetRed, Materials.Ruby, Materials.Sapphire, Materials.Sodalite,
+ Materials.Tanzanite, Materials.InfusedEarth };
break;
case 3:
- mMats = new Materials[] {
- Materials.Topaz,
- Materials.Vinteum,
- Materials.GarnetYellow,
- Materials.NetherStar,
- Materials.Charcoal,
- Materials.Blaze
- };
+ mMats = new Materials[] { Materials.Topaz, Materials.Vinteum, Materials.GarnetYellow,
+ Materials.NetherStar, Materials.Charcoal, Materials.Blaze };
break;
}
- t = entry.getKey()
- .substring("gt.blockgem1.".length(), entry.getKey().length() - ".name".length());
+ t = entry.getKey().substring("gt.blockgem1.".length(), entry.getKey().length() - ".name".length());
i = Integer.parseInt(t);
lServerNames.put(entry.getKey(), "Block of " + mMats[i].toString());
mMats = null;
}
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
}
internal = null;
diff --git a/src/main/java/gregtech/api/util/GT_BaseCrop.java b/src/main/java/gregtech/api/util/GT_BaseCrop.java
index 930badfdba..65d2900176 100644
--- a/src/main/java/gregtech/api/util/GT_BaseCrop.java
+++ b/src/main/java/gregtech/api/util/GT_BaseCrop.java
@@ -2,6 +2,16 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+
+import speiger.src.crops.api.ICropCardInfo;
import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
@@ -14,23 +24,12 @@ import gregtech.common.blocks.GT_TileEntity_Ores;
import ic2.api.crops.CropCard;
import ic2.api.crops.Crops;
import ic2.api.crops.ICropTile;
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import speiger.src.crops.api.ICropCardInfo;
public class GT_BaseCrop extends CropCard implements ICropCardInfo {
+
public static ArrayList<GT_BaseCrop> sCropList = new ArrayList<GT_BaseCrop>();
private String mName = E, mDiscoveredBy = "Gregorius Techneticies", mAttributes[];
- private int mTier = 0,
- mMaxSize = 0,
- mAfterHarvestSize = 0,
- mHarvestSize = 0,
- mStats[] = new int[5],
+ private int mTier = 0, mMaxSize = 0, mAfterHarvestSize = 0, mHarvestSize = 0, mStats[] = new int[5],
mGrowthSpeed = 0;
private ItemStack mDrop = null, mSpecialDrops[] = null;
private Materials mBlock = null;
@@ -49,23 +48,9 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
* @param aGrowthSpeed how fast the Crop grows. if < 0 then its set to Tier*300
* @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size
*/
- public GT_BaseCrop(
- int aID,
- String aCropName,
- String aDiscoveredBy,
- ItemStack aBaseSeed,
- int aTier,
- int aMaxSize,
- int aGrowthSpeed,
- int aAfterHarvestSize,
- int aHarvestSize,
- int aStatChemical,
- int aStatFood,
- int aStatDefensive,
- int aStatColor,
- int aStatWeed,
- String[] aAttributes,
- ItemStack aDrop,
+ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize,
+ int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood,
+ int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, ItemStack aDrop,
ItemStack[] aSpecialDrops) {
new GT_BaseCrop(
aID,
@@ -102,24 +87,9 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
* @param aHarvestSize the size the Crop needs to be harvested. forced to be between 2 and max size
* @param aBlock the block below needed for crop to grow. If null no block needed
*/
- public GT_BaseCrop(
- int aID,
- String aCropName,
- String aDiscoveredBy,
- ItemStack aBaseSeed,
- int aTier,
- int aMaxSize,
- int aGrowthSpeed,
- int aAfterHarvestSize,
- int aHarvestSize,
- int aStatChemical,
- int aStatFood,
- int aStatDefensive,
- int aStatColor,
- int aStatWeed,
- String[] aAttributes,
- Materials aBlock,
- ItemStack aDrop,
+ public GT_BaseCrop(int aID, String aCropName, String aDiscoveredBy, ItemStack aBaseSeed, int aTier, int aMaxSize,
+ int aGrowthSpeed, int aAfterHarvestSize, int aHarvestSize, int aStatChemical, int aStatFood,
+ int aStatDefensive, int aStatColor, int aStatWeed, String[] aAttributes, Materials aBlock, ItemStack aDrop,
ItemStack[] aSpecialDrops) {
mName = aCropName;
aID = GT_Config.addIDConfig(ConfigCategories.IDs.crops, mName.replaceAll(" ", "_"), aID);
@@ -149,10 +119,7 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
try {
Class.forName("speiger.src.crops.api.CropPluginAPI")
.getMethod("registerCropInfo", Class.forName("speiger.src.crops.api.ICropCardInfo"))
- .invoke(
- Class.forName("speiger.src.crops.api.CropPluginAPI")
- .getField("instance"),
- this);
+ .invoke(Class.forName("speiger.src.crops.api.CropPluginAPI").getField("instance"), this);
} catch (IllegalAccessException ex) {
bIc2NeiLoaded = false;
} catch (IllegalArgumentException ex) {
@@ -267,12 +234,13 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
Block tBlock = aCrop.getWorld()
.getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ);
if ((tBlock instanceof GT_Block_Ores_Abstract)) {
- TileEntity tTileEntity = aCrop.getWorld()
- .getTileEntity(
- aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ);
+ TileEntity tTileEntity = aCrop.getWorld().getTileEntity(
+ aCrop.getLocation().posX,
+ aCrop.getLocation().posY - i,
+ aCrop.getLocation().posZ);
if ((tTileEntity instanceof GT_TileEntity_Ores)) {
- Materials tMaterial =
- GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)];
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData
+ % 1000)];
if ((tMaterial != null) && (tMaterial != Materials._NULL)) {
if (tMaterial == mBlock) {
return true;
@@ -282,33 +250,32 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
}
}
} else {
- int tMetaID = aCrop.getWorld()
- .getBlockMetadata(
- aCrop.getLocation().posX, aCrop.getLocation().posY - i, aCrop.getLocation().posZ);
+ int tMetaID = aCrop.getWorld().getBlockMetadata(
+ aCrop.getLocation().posX,
+ aCrop.getLocation().posY - i,
+ aCrop.getLocation().posZ);
ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID));
- if ((tAssotiation != null)
- && (tAssotiation.mPrefix.toString().startsWith("ore"))
+ if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))
&& (tAssotiation.mMaterial.mMaterial == mBlock)) {
return true;
}
- if ((tAssotiation != null)
- && (tAssotiation.mPrefix == OrePrefixes.block)
+ if ((tAssotiation != null) && (tAssotiation.mPrefix == OrePrefixes.block)
&& (tAssotiation.mMaterial.mMaterial == mBlock)) {
return true;
}
}
- // Block block = aCrop.getWorld().getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i,
+ // Block block = aCrop.getWorld().getBlock(aCrop.getLocation().posX, aCrop.getLocation().posY - i,
// aCrop.getLocation().posZ);
- // if (block.isAir(aCrop.getWorld(), aCrop.getLocation().posX, aCrop.getLocation().posY - i,
+ // if (block.isAir(aCrop.getWorld(), aCrop.getLocation().posX, aCrop.getLocation().posY - i,
// aCrop.getLocation().posZ)) {
- // return false;
- // }
- // if (block == mBlock) {
- // int tMeta = aCrop.getWorld().getBlockMetadata(aCrop.getLocation().posX, aCrop.getLocation().posY -
+ // return false;
+ // }
+ // if (block == mBlock) {
+ // int tMeta = aCrop.getWorld().getBlockMetadata(aCrop.getLocation().posX, aCrop.getLocation().posY -
// i, aCrop.getLocation().posZ);
- // if(mMeta < 0 || tMeta == mMeta){
- // return true;}
- // }
+ // if(mMeta < 0 || tMeta == mMeta){
+ // return true;}
+ // }
}
return false;
}
@@ -317,8 +284,11 @@ public class GT_BaseCrop extends CropCard implements ICropCardInfo {
public List<String> getCropInformation() {
if (mBlock != null) {
ArrayList<String> result = new ArrayList<String>(1);
- result.add(String.format(
- "Requires %s Ore or Block of %s as soil block to reach full growth.", mBlock.mName, mBlock.mName));
+ result.add(
+ String.format(
+ "Requires %s Ore or Block of %s as soil block to reach full growth.",
+ mBlock.mName,
+ mBlock.mName));
return result;
}
return null;
diff --git a/src/main/java/gregtech/api/util/GT_BlockMap.java b/src/main/java/gregtech/api/util/GT_BlockMap.java
index 9b71abbdc3..40e11e41a0 100644
--- a/src/main/java/gregtech/api/util/GT_BlockMap.java
+++ b/src/main/java/gregtech/api/util/GT_BlockMap.java
@@ -1,13 +1,16 @@
package gregtech.api.util;
-import gnu.trove.map.TByteObjectMap;
-import gnu.trove.map.hash.TByteObjectHashMap;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiFunction;
+
import net.minecraft.block.Block;
+import gnu.trove.map.TByteObjectMap;
+import gnu.trove.map.hash.TByteObjectHashMap;
+
public class GT_BlockMap<V> {
+
public static final byte WILDCARD = -1;
private final Map<Block, TByteObjectMap<V>> backing = new HashMap<>();
private int size = 0;
diff --git a/src/main/java/gregtech/api/util/GT_BlockSet.java b/src/main/java/gregtech/api/util/GT_BlockSet.java
index 94f3c3944a..1d13afd056 100644
--- a/src/main/java/gregtech/api/util/GT_BlockSet.java
+++ b/src/main/java/gregtech/api/util/GT_BlockSet.java
@@ -3,6 +3,7 @@ package gregtech.api.util;
import net.minecraft.block.Block;
public class GT_BlockSet {
+
private final GT_BlockMap<Object> backing = new GT_BlockMap<>();
public boolean add(Block block, byte meta) {
diff --git a/src/main/java/gregtech/api/util/GT_CLS_Compat.java b/src/main/java/gregtech/api/util/GT_CLS_Compat.java
index fd01ccd00e..7e3b7c424c 100644
--- a/src/main/java/gregtech/api/util/GT_CLS_Compat.java
+++ b/src/main/java/gregtech/api/util/GT_CLS_Compat.java
@@ -1,10 +1,5 @@
package gregtech.api.util;
-import cpw.mods.fml.common.ProgressManager;
-import gregtech.GT_Mod;
-import gregtech.api.enums.Materials;
-import gregtech.common.GT_Proxy;
-import gregtech.loaders.postload.GT_PostLoad;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -14,6 +9,12 @@ import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
+import cpw.mods.fml.common.ProgressManager;
+import gregtech.GT_Mod;
+import gregtech.api.enums.Materials;
+import gregtech.common.GT_Proxy;
+import gregtech.loaders.postload.GT_PostLoad;
+
@SuppressWarnings("rawtypes, unchecked, deprecation")
public class GT_CLS_Compat {
@@ -71,12 +72,8 @@ public class GT_CLS_Compat {
private GT_CLS_Compat() {}
- private static <T> void registerAndReportProgression(
- String materialsType,
- Collection<T> materials,
- ProgressManager.ProgressBar progressBar,
- Function<T, Object> getName,
- Consumer<T> action) {
+ private static <T> void registerAndReportProgression(String materialsType, Collection<T> materials,
+ ProgressManager.ProgressBar progressBar, Function<T, Object> getName, Consumer<T> action) {
int sizeStep = materials.size();
final long progressionReportsEvery = 100;
final long bakingMsgEvery = 1000;
@@ -109,8 +106,7 @@ public class GT_CLS_Compat {
}
action.accept(m);
currentStep += 1;
- }
- ;
+ } ;
GT_Mod.GT_FML_LOGGER.info(String.format("%s - Baking: Done", materialsType));
try {
progressBarStep.set(progressBar, currentStep);
@@ -119,23 +115,25 @@ public class GT_CLS_Compat {
}
}
- public static void stepMaterialsCLS(
- Collection<GT_Proxy.OreDictEventContainer> mEvents, ProgressManager.ProgressBar progressBar)
- throws IllegalAccessException, InvocationTargetException {
+ public static void stepMaterialsCLS(Collection<GT_Proxy.OreDictEventContainer> mEvents,
+ ProgressManager.ProgressBar progressBar) throws IllegalAccessException, InvocationTargetException {
try {
isRegisteringGTmaterials.set(null, true);
} catch (IllegalArgumentException | IllegalAccessException e) {
GT_Mod.GT_FML_LOGGER.catching(e);
}
registerAndReportProgression(
- "GregTech materials", mEvents, progressBar, m -> m.mMaterial, m -> GT_Proxy.registerRecipes(m));
+ "GregTech materials",
+ mEvents,
+ progressBar,
+ m -> m.mMaterial,
+ m -> GT_Proxy.registerRecipes(m));
ProgressManager.pop(progressBar);
isRegisteringGTmaterials.set(null, false);
}
- public static void doActualRegistrationCLS(
- ProgressManager.ProgressBar progressBar, Set<Materials> replacedVanillaItemsSet)
- throws InvocationTargetException, IllegalAccessException {
+ public static void doActualRegistrationCLS(ProgressManager.ProgressBar progressBar,
+ Set<Materials> replacedVanillaItemsSet) throws InvocationTargetException, IllegalAccessException {
try {
isReplacingVanillaMaterials.set(null, true);
} catch (IllegalArgumentException | IllegalAccessException e) {
diff --git a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java
index ac04ecfd46..ea1ac73621 100644
--- a/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java
+++ b/src/main/java/gregtech/api/util/GT_ChunkAssociatedData.java
@@ -1,8 +1,5 @@
package gregtech.api.util;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
@@ -30,19 +27,26 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+
import javax.annotation.ParametersAreNonnullByDefault;
+
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.WorldEvent;
+
import org.apache.commons.io.FileUtils;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
/**
* A utility to save all kinds of data that is a function of any chunk.
* <p>
- * GregTech takes care of saving and loading the data from disk, and an efficient mechanism to locate it.
- * Subclass only need to define the exact scheme of each element data (by overriding the three protected abstract method)
+ * GregTech takes care of saving and loading the data from disk, and an efficient mechanism to locate it. Subclass only
+ * need to define the exact scheme of each element data (by overriding the three protected abstract method)
* <p>
* Oh, there is no limit on how large your data is, though you'd not have the familiar NBT interface, but DataOutput
* should be reasonably common anyway.
@@ -58,9 +62,10 @@ import org.apache.commons.io.FileUtils;
*/
@ParametersAreNonnullByDefault
public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.IData> {
+
private static final Map<String, GT_ChunkAssociatedData<?>> instances = new ConcurrentHashMap<>();
- private static final int IO_PARALLELISM =
- Math.min(8, Math.max(1, Runtime.getRuntime().availableProcessors() * 2 / 3));
+ private static final int IO_PARALLELISM = Math
+ .min(8, Math.max(1, Runtime.getRuntime().availableProcessors() * 2 / 3));
private static final ExecutorService IO_WORKERS = Executors.newWorkStealingPool(IO_PARALLELISM);
private static final Pattern FILE_PATTERN = Pattern.compile("(.+)\\.(-?\\d+)\\.(-?\\d+)\\.dat");
@@ -75,9 +80,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
private final int version;
private final boolean saveDefaults;
/**
- * Data is stored as a `(world id -> (super region id -> super region data))` hash map.
- * where super region's size is determined by regionSize.
- * Here it is called super region, to not confuse with vanilla's regions.
+ * Data is stored as a `(world id -> (super region id -> super region data))` hash map. where super region's size is
+ * determined by regionSize. Here it is called super region, to not confuse with vanilla's regions.
*/
private final Map<Integer, Map<ChunkCoordIntPair, SuperRegion>> masterMap = new ConcurrentHashMap<>();
@@ -85,12 +89,14 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
* Initialize this instance.
*
* @param aId An arbitrary, but globally unique identifier for what this data is
- * @param elementType The class of this element type. Used to create arrays.
- * @param regionLength The length of one super region. Each super region will contain {@code regionLength * regionLength} chunks
- * @param version An integer marking the version of this data. Useful later when the data's serialized form changed.
+ * @param elementType The class of this element type. Used to create arrays.
+ * @param regionLength The length of one super region. Each super region will contain
+ * {@code regionLength * regionLength} chunks
+ * @param version An integer marking the version of this data. Useful later when the data's serialized form
+ * changed.
*/
- protected GT_ChunkAssociatedData(
- String aId, Class<T> elementType, int regionLength, byte version, boolean saveDefaults) {
+ protected GT_ChunkAssociatedData(String aId, Class<T> elementType, int regionLength, byte version,
+ boolean saveDefaults) {
if (regionLength * regionLength > Short.MAX_VALUE || regionLength <= 0)
throw new IllegalArgumentException("Region invalid: " + regionLength);
if (!IData.class.isAssignableFrom(elementType)) throw new IllegalArgumentException("Data type invalid");
@@ -109,8 +115,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
/**
- * Get a reference to data of the chunk that tile entity is in.
- * The returned reference should be mutable.
+ * Get a reference to data of the chunk that tile entity is in. The returned reference should be mutable.
*/
public final T get(IGregTechTileEntity tileEntity) {
return get(tileEntity.getWorld(), tileEntity.getXCoord() >> 4, tileEntity.getZCoord() >> 4);
@@ -125,15 +130,13 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
public final T get(World world, int chunkX, int chunkZ) {
- SuperRegion region = masterMap
- .computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>())
+ SuperRegion region = masterMap.computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>())
.computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c));
return region.get(Math.floorMod(chunkX, regionLength), Math.floorMod(chunkZ, regionLength));
}
protected final void set(World world, int chunkX, int chunkZ, T data) {
- SuperRegion region = masterMap
- .computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>())
+ SuperRegion region = masterMap.computeIfAbsent(world.provider.dimensionId, ignored -> new ConcurrentHashMap<>())
.computeIfAbsent(getRegionID(chunkX, chunkZ), c -> new SuperRegion(world, c));
region.set(Math.floorMod(chunkX, regionLength), Math.floorMod(chunkZ, regionLength), data);
}
@@ -150,13 +153,11 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
public void clear() {
if (GT_Values.debugWorldData) {
- long dirtyRegionCount = masterMap.values().stream()
- .flatMap(m -> m.values().stream())
- .filter(SuperRegion::isDirty)
- .count();
- if (dirtyRegionCount > 0)
- GT_Log.out.println("Clearing ChunkAssociatedData with " + dirtyRegionCount
- + " regions dirty. Data might have been lost!");
+ long dirtyRegionCount = masterMap.values().stream().flatMap(m -> m.values().stream())
+ .filter(SuperRegion::isDirty).count();
+ if (dirtyRegionCount > 0) GT_Log.out.println(
+ "Clearing ChunkAssociatedData with " + dirtyRegionCount
+ + " regions dirty. Data might have been lost!");
}
masterMap.clear();
}
@@ -171,11 +172,8 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
private void saveRegions(Stream<SuperRegion> stream) {
- stream.filter(r -> r.isDirty())
- .map(c -> (Runnable) c::save)
- .map(r -> CompletableFuture.runAsync(r, IO_WORKERS))
- .reduce(CompletableFuture::allOf)
- .ifPresent(f -> {
+ stream.filter(r -> r.isDirty()).map(c -> (Runnable) c::save).map(r -> CompletableFuture.runAsync(r, IO_WORKERS))
+ .reduce(CompletableFuture::allOf).ifPresent(f -> {
try {
f.get();
} catch (Exception e) {
@@ -208,26 +206,26 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
/**
- * Load data for all chunks for a given world.
- * Current data for that world will be discarded. If this is what you intended, call {@link #save(World)} beforehand.
+ * Load data for all chunks for a given world. Current data for that world will be discarded. If this is what you
+ * intended, call {@link #save(World)} beforehand.
* <p>
* Be aware of the memory consumption though.
*/
protected void loadAll(World w) {
- if (GT_Values.debugWorldData && masterMap.containsKey(w.provider.dimensionId))
- GT_Log.err.println("Reloading ChunkAssociatedData " + mId + " for world " + w.provider.dimensionId
- + " discards old data!");
+ if (GT_Values.debugWorldData && masterMap.containsKey(w.provider.dimensionId)) GT_Log.err.println(
+ "Reloading ChunkAssociatedData " + mId
+ + " for world "
+ + w.provider.dimensionId
+ + " discards old data!");
if (!getSaveDirectory(w).isDirectory())
// nothing to load...
return;
try (Stream<Path> stream = Files.list(getSaveDirectory(w).toPath())) {
Map<ChunkCoordIntPair, SuperRegion> worldData = stream.map(f -> {
- Matcher matcher = FILE_PATTERN.matcher(f.getFileName().toString());
- return matcher.matches() ? matcher : null;
- })
- .filter(Objects::nonNull)
- .filter(m -> mId.equals(m.group(1)))
- .map(m -> CompletableFuture.supplyAsync(
+ Matcher matcher = FILE_PATTERN.matcher(f.getFileName().toString());
+ return matcher.matches() ? matcher : null;
+ }).filter(Objects::nonNull).filter(m -> mId.equals(m.group(1))).map(
+ m -> CompletableFuture.supplyAsync(
() -> new SuperRegion(w, Integer.parseInt(m.group(2)), Integer.parseInt(m.group(3))),
IO_WORKERS))
.map(f -> {
@@ -238,9 +236,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
e.printStackTrace(GT_Log.err);
return null;
}
- })
- .filter(Objects::nonNull)
- .collect(Collectors.toMap(SuperRegion::getCoord, Function.identity()));
+ }).filter(Objects::nonNull).collect(Collectors.toMap(SuperRegion::getCoord, Function.identity()));
masterMap.put(w.provider.dimensionId, worldData);
} catch (IOException | UncheckedIOException e) {
GT_Log.err.println("Error loading all region");
@@ -256,6 +252,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
public interface IData {
+
/**
* @return Whether the data is different from chunk default
*/
@@ -263,6 +260,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
protected final class SuperRegion {
+
private final T[] data = createData();
private final File backingStorage;
private final WeakReference<World> world;
@@ -348,7 +346,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
private void save0() throws IOException {
- //noinspection ResultOfMethodCallIgnored
+ // noinspection ResultOfMethodCallIgnored
backingStorage.getParentFile().mkdirs();
File tmpFile = getTmpFile();
World world = Objects.requireNonNull(this.world.get(), "Attempting to save region of another world!");
@@ -445,6 +443,7 @@ public abstract class GT_ChunkAssociatedData<T extends GT_ChunkAssociatedData.ID
}
public static class EventHandler {
+
private EventHandler() {
MinecraftForge.EVENT_BUS.register(this);
}
diff --git a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java b/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java
index 2813df0973..809c66d5d0 100644
--- a/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java
+++ b/src/main/java/gregtech/api/util/GT_CircuitryBehavior.java
@@ -10,19 +10,20 @@ import gregtech.api.interfaces.IRedstoneCircuitBlock;
/**
* Redstone Circuit Control Code
* <p/>
- * This should make everything possible what a Redstone Computer or BuildCraft Gate could do.
- * It is intended to use this similar to BC-Gates (for acquiring Data) and RP Logic Gates.
- * You could write an extremely specified and complex Logic Gate, which works only for you Setup, like
- * with ComputerCraft, but you would have to write an extra Mod to add that, as it doesn't work Ingame.
+ * This should make everything possible what a Redstone Computer or BuildCraft Gate could do. It is intended to use this
+ * similar to BC-Gates (for acquiring Data) and RP Logic Gates. You could write an extremely specified and complex Logic
+ * Gate, which works only for you Setup, like with ComputerCraft, but you would have to write an extra Mod to add that,
+ * as it doesn't work Ingame.
* <p/>
- * One can make use of the fact, that ItemStacks can be stored as Integer, so that you can scan
- * Inventories for specific Items using that. Luckily the Buttons in the GUI enable Copy/Paste of
- * ItemID+MetaData to Integer, including the WildCard Damage Value when you use rightclick to place it.
- * You just need to use @GT_Utility.stackToInt(ItemStack aStack) to get it.
+ * One can make use of the fact, that ItemStacks can be stored as Integer, so that you can scan Inventories for specific
+ * Items using that. Luckily the Buttons in the GUI enable Copy/Paste of ItemID+MetaData to Integer, including the
+ * WildCard Damage Value when you use rightclick to place it. You just need to use @GT_Utility.stackToInt(ItemStack
+ * aStack) to get it.
* <p/>
* All Functions run usually in a seperate try/catch Block, so that failed Logic won't crash the TileEntity.
*/
public abstract class GT_CircuitryBehavior {
+
/**
* @param aIndex 0 - 1023 are my own Indices, so use other Numbers!
*/
@@ -36,13 +37,11 @@ public abstract class GT_CircuitryBehavior {
public static boolean getAnyRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) {
for (byte side : ALL_VALID_SIDES) {
if (side != aRedstoneCircuitBlock.getOutputFacing()
- && aRedstoneCircuitBlock
- .getCover(side)
- .letsRedstoneGoIn(
- side,
- aRedstoneCircuitBlock.getCoverID(side),
- aRedstoneCircuitBlock.getCoverVariable(side),
- aRedstoneCircuitBlock.getOwnTileEntity())) {
+ && aRedstoneCircuitBlock.getCover(side).letsRedstoneGoIn(
+ side,
+ aRedstoneCircuitBlock.getCoverID(side),
+ aRedstoneCircuitBlock.getCoverVariable(side),
+ aRedstoneCircuitBlock.getOwnTileEntity())) {
if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) {
return true;
}
@@ -57,13 +56,11 @@ public abstract class GT_CircuitryBehavior {
public static boolean getAllRedstone(IRedstoneCircuitBlock aRedstoneCircuitBlock) {
for (byte side : ALL_VALID_SIDES) {
if (side != aRedstoneCircuitBlock.getOutputFacing()
- && aRedstoneCircuitBlock
- .getCover(side)
- .letsRedstoneGoIn(
- side,
- aRedstoneCircuitBlock.getCoverID(side),
- aRedstoneCircuitBlock.getCoverVariable(side),
- aRedstoneCircuitBlock.getOwnTileEntity())) {
+ && aRedstoneCircuitBlock.getCover(side).letsRedstoneGoIn(
+ side,
+ aRedstoneCircuitBlock.getCoverID(side),
+ aRedstoneCircuitBlock.getCoverVariable(side),
+ aRedstoneCircuitBlock.getOwnTileEntity())) {
if (aRedstoneCircuitBlock.getInputRedstone(side) == 0) {
return false;
}
@@ -79,13 +76,11 @@ public abstract class GT_CircuitryBehavior {
int tRedstoneAmount = 0;
for (byte side : ALL_VALID_SIDES) {
if (side != aRedstoneCircuitBlock.getOutputFacing()
- && aRedstoneCircuitBlock
- .getCover(side)
- .letsRedstoneGoIn(
- side,
- aRedstoneCircuitBlock.getCoverID(side),
- aRedstoneCircuitBlock.getCoverVariable(side),
- aRedstoneCircuitBlock.getOwnTileEntity())) {
+ && aRedstoneCircuitBlock.getCover(side).letsRedstoneGoIn(
+ side,
+ aRedstoneCircuitBlock.getCoverID(side),
+ aRedstoneCircuitBlock.getCoverVariable(side),
+ aRedstoneCircuitBlock.getOwnTileEntity())) {
if (aRedstoneCircuitBlock.getInputRedstone(side) > 0) {
tRedstoneAmount++;
}
@@ -101,13 +96,11 @@ public abstract class GT_CircuitryBehavior {
byte tRedstoneAmount = 0;
for (byte side : ALL_VALID_SIDES) {
if (side != aRedstoneCircuitBlock.getOutputFacing()
- && aRedstoneCircuitBlock
- .getCover(side)
- .letsRedstoneGoIn(
- side,
- aRedstoneCircuitBlock.getCoverID(side),
- aRedstoneCircuitBlock.getCoverVariable(side),
- aRedstoneCircuitBlock.getOwnTileEntity())) {
+ && aRedstoneCircuitBlock.getCover(side).letsRedstoneGoIn(
+ side,
+ aRedstoneCircuitBlock.getCoverID(side),
+ aRedstoneCircuitBlock.getCoverVariable(side),
+ aRedstoneCircuitBlock.getOwnTileEntity())) {
tRedstoneAmount = (byte) Math.max(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side));
}
}
@@ -126,13 +119,11 @@ public abstract class GT_CircuitryBehavior {
byte tRedstoneAmount = 15;
for (byte side : ALL_VALID_SIDES) {
if (side != aRedstoneCircuitBlock.getOutputFacing()
- && aRedstoneCircuitBlock
- .getCover(side)
- .letsRedstoneGoIn(
- side,
- aRedstoneCircuitBlock.getCoverID(side),
- aRedstoneCircuitBlock.getCoverVariable(side),
- aRedstoneCircuitBlock.getOwnTileEntity())) {
+ && aRedstoneCircuitBlock.getCover(side).letsRedstoneGoIn(
+ side,
+ aRedstoneCircuitBlock.getCoverID(side),
+ aRedstoneCircuitBlock.getCoverVariable(side),
+ aRedstoneCircuitBlock.getOwnTileEntity())) {
if (aRedstoneCircuitBlock.getInputRedstone(side) > 0)
tRedstoneAmount = (byte) Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side));
}
@@ -148,13 +139,11 @@ public abstract class GT_CircuitryBehavior {
byte tRedstoneAmount = 15;
for (byte side : ALL_VALID_SIDES) {
if (side != aRedstoneCircuitBlock.getOutputFacing()
- && aRedstoneCircuitBlock
- .getCover(side)
- .letsRedstoneGoIn(
- side,
- aRedstoneCircuitBlock.getCoverID(side),
- aRedstoneCircuitBlock.getCoverVariable(side),
- aRedstoneCircuitBlock.getOwnTileEntity())) {
+ && aRedstoneCircuitBlock.getCover(side).letsRedstoneGoIn(
+ side,
+ aRedstoneCircuitBlock.getCoverID(side),
+ aRedstoneCircuitBlock.getCoverVariable(side),
+ aRedstoneCircuitBlock.getOwnTileEntity())) {
tRedstoneAmount = (byte) Math.min(tRedstoneAmount, aRedstoneCircuitBlock.getInputRedstone(side));
}
}
@@ -170,8 +159,8 @@ public abstract class GT_CircuitryBehavior {
public abstract void initParameters(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock);
/**
- * Validates the Parameters of this Circuit when a value has been changed by the GUI
- * Also called right after @initParameters and when the Chunk reloads
+ * Validates the Parameters of this Circuit when a value has been changed by the GUI Also called right
+ * after @initParameters and when the Chunk reloads
*
* @param aCircuitData, The Data Storage you can use (8 Slots and only the first 4 are User definable)
* @param aRedstoneCircuitBlock, The Circuit Block MetaTileEntity itself
@@ -193,8 +182,8 @@ public abstract class GT_CircuitryBehavior {
/**
* If the ItemStack should be displayed. Parameters are between 0 and 3.
*/
- public abstract boolean displayItemStack(
- int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock, int aIndex);
+ public abstract boolean displayItemStack(int[] aCircuitData, IRedstoneCircuitBlock aRedstoneCircuitBlock,
+ int aIndex);
/**
* The Name of the Gate for the GUI
@@ -215,8 +204,7 @@ public abstract class GT_CircuitryBehavior {
public abstract String getDataDescription(int[] aCircuitData, int aCircuitDataIndex);
/**
- * How the Integer should be displayed in the GUI.
- * null means, that it just displays as regular Number.
+ * How the Integer should be displayed in the GUI. null means, that it just displays as regular Number.
*/
@SideOnly(Side.CLIENT)
public String getDataDisplay(int[] aCircuitData, int aCircuitDataIndex) {
diff --git a/src/main/java/gregtech/api/util/GT_ClientPreference.java b/src/main/java/gregtech/api/util/GT_ClientPreference.java
index de3051fd37..34db521bd4 100644
--- a/src/main/java/gregtech/api/util/GT_ClientPreference.java
+++ b/src/main/java/gregtech/api/util/GT_ClientPreference.java
@@ -1,12 +1,13 @@
package gregtech.api.util;
public class GT_ClientPreference {
+
private final boolean mSingleBlockInitialFilter;
private final boolean mSingleBlockInitialMultiStack;
private final boolean mInputBusInitialFilter;
- public GT_ClientPreference(
- boolean mSingleBlockInitialFilter, boolean mSingleBlockInitialMultiStack, boolean mInputBusInitialFilter) {
+ public GT_ClientPreference(boolean mSingleBlockInitialFilter, boolean mSingleBlockInitialMultiStack,
+ boolean mInputBusInitialFilter) {
this.mSingleBlockInitialFilter = mSingleBlockInitialFilter;
this.mSingleBlockInitialMultiStack = mSingleBlockInitialMultiStack;
this.mInputBusInitialFilter = mInputBusInitialFilter;
@@ -14,8 +15,8 @@ public class GT_ClientPreference {
public GT_ClientPreference(GT_Config aClientDataFile) {
this.mSingleBlockInitialFilter = aClientDataFile.get("preference", "mSingleBlockInitialFilter", false);
- this.mSingleBlockInitialMultiStack =
- aClientDataFile.get("preference", "mSingleBlockInitialAllowMultiStack", false);
+ this.mSingleBlockInitialMultiStack = aClientDataFile
+ .get("preference", "mSingleBlockInitialAllowMultiStack", false);
this.mInputBusInitialFilter = aClientDataFile.get("preference", "mInputBusInitialFilter", true);
}
diff --git a/src/main/java/gregtech/api/util/GT_Config.java b/src/main/java/gregtech/api/util/GT_Config.java
index 362be0fe01..337b3b7f68 100644
--- a/src/main/java/gregtech/api/util/GT_Config.java
+++ b/src/main/java/gregtech/api/util/GT_Config.java
@@ -2,13 +2,15 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.GT_Values;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+
public class GT_Config implements Runnable {
+
public static boolean troll = false;
public static Configuration sConfigFileIDs;
@@ -30,8 +32,8 @@ public class GT_Config implements Runnable {
public static int addIDConfig(Object aCategory, String aName, int aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
- Property tProperty =
- sConfigFileIDs.get(aCategory.toString().replaceAll("\\|", "."), aName.replaceAll("\\|", "."), aDefault);
+ Property tProperty = sConfigFileIDs
+ .get(aCategory.toString().replaceAll("\\|", "."), aName.replaceAll("\\|", "."), aDefault);
int rResult = tProperty.getInt(aDefault);
if (!tProperty.wasRead() && shouldSave()) sConfigFileIDs.save();
return rResult;
@@ -44,7 +46,7 @@ public class GT_Config implements Runnable {
try {
if (GT_Utility.isStringValid(rName = aStack.getUnlocalizedName())) return rName.toString();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
String sName = aStack.getItem().toString();
String[] tmp = sName.split("@");
@@ -60,7 +62,9 @@ public class GT_Config implements Runnable {
public boolean get(Object aCategory, String aName, boolean aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
Property tProperty = mConfig.get(
- aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
+ aCategory.toString().replaceAll("\\|", "_"),
+ (aName + "_" + aDefault).replaceAll("\\|", "_"),
+ aDefault);
boolean rResult = tProperty.getBoolean(aDefault);
if (!tProperty.wasRead() && shouldSave()) mConfig.save();
return rResult;
@@ -73,7 +77,9 @@ public class GT_Config implements Runnable {
public int get(Object aCategory, String aName, int aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
Property tProperty = mConfig.get(
- aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
+ aCategory.toString().replaceAll("\\|", "_"),
+ (aName + "_" + aDefault).replaceAll("\\|", "_"),
+ aDefault);
int rResult = tProperty.getInt(aDefault);
if (!tProperty.wasRead() && shouldSave()) mConfig.save();
return rResult;
@@ -86,7 +92,9 @@ public class GT_Config implements Runnable {
public double get(Object aCategory, String aName, double aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
Property tProperty = mConfig.get(
- aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
+ aCategory.toString().replaceAll("\\|", "_"),
+ (aName + "_" + aDefault).replaceAll("\\|", "_"),
+ aDefault);
double rResult = tProperty.getDouble(aDefault);
if (!tProperty.wasRead() && shouldSave()) mConfig.save();
return rResult;
@@ -99,7 +107,9 @@ public class GT_Config implements Runnable {
public String get(Object aCategory, String aName, String aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
Property tProperty = mConfig.get(
- aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault);
+ aCategory.toString().replaceAll("\\|", "_"),
+ (aName + "_" + aDefault).replaceAll("\\|", "_"),
+ aDefault);
String rResult = tProperty.getString();
if (!tProperty.wasRead() && shouldSave()) mConfig.save();
return rResult;
@@ -111,8 +121,8 @@ public class GT_Config implements Runnable {
public String[] get(Object aCategory, String aName, String... aDefault) {
if (GT_Utility.isStringInvalid(aName)) return aDefault;
- Property tProperty =
- mConfig.get(aCategory.toString().replaceAll("\\|", "_"), aName.replaceAll("\\|", "_"), aDefault);
+ Property tProperty = mConfig
+ .get(aCategory.toString().replaceAll("\\|", "_"), aName.replaceAll("\\|", "_"), aDefault);
String[] rResult = tProperty.getStringList();
if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save();
return rResult;
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java
index f3b8f7a9fb..f12da42700 100644
--- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java
+++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java
@@ -2,17 +2,18 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.net.GT_Packet_TileEntityCoverGUI;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fluids.Fluid;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.gui.modularui.GT_UIInfos;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.net.GT_Packet_TileEntityCoverGUI;
+
/**
* For Covers with a special behavior. Has fixed storage format of 4 byte. Not very convenient...
*/
@@ -46,51 +47,30 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
}
@Override
- protected boolean isRedstoneSensitiveImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- long aTimer) {
+ protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) {
return isRedstoneSensitive(aSide, aCoverID, aCoverVariable.get(), aTileEntity, aTimer);
}
@Override
- protected ISerializableObject.LegacyCoverData doCoverThingsImpl(
- byte aSide,
- byte aInputRedstone,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- long aTimer) {
+ protected ISerializableObject.LegacyCoverData doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, long aTimer) {
if (aCoverVariable == null) aCoverVariable = new ISerializableObject.LegacyCoverData();
aCoverVariable.set(doCoverThings(aSide, aInputRedstone, aCoverID, aCoverVariable.get(), aTileEntity, aTimer));
return aCoverVariable;
}
@Override
- protected boolean onCoverRightClickImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ protected boolean onCoverRightClickImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX,
+ float aY, float aZ) {
return onCoverRightclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ);
}
@Override
- protected ISerializableObject.LegacyCoverData onCoverScrewdriverClickImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ protected ISerializableObject.LegacyCoverData onCoverScrewdriverClickImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX,
+ float aY, float aZ) {
if (aCoverVariable == null) aCoverVariable = new ISerializableObject.LegacyCoverData();
aCoverVariable.set(
onCoverScrewdriverclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ));
@@ -98,183 +78,150 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
}
@Override
- protected boolean onCoverShiftRightClickImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer) {
+ protected boolean onCoverShiftRightClickImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) {
return onCoverShiftRightclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer);
}
@Deprecated
@Override
- protected Object getClientGUIImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- World aWorld) {
+ protected Object getClientGUIImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) {
return getClientGUI(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean onCoverRemovalImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity,
- boolean aForced) {
+ protected boolean onCoverRemovalImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity, boolean aForced) {
return onCoverRemoval(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aForced);
}
@Override
- protected String getDescriptionImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected String getDescriptionImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return getDescription(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected float getBlastProofLevelImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected float getBlastProofLevelImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return getBlastProofLevel(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsRedstoneGoInImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean letsRedstoneGoInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return letsRedstoneGoIn(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsRedstoneGoOutImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean letsRedstoneGoOutImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
return letsRedstoneGoOut(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsFibreGoInImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean letsFibreGoInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return letsFibreGoIn(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsFibreGoOutImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean letsFibreGoOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return letsFibreGoOut(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsEnergyInImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean letsEnergyInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return letsEnergyIn(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsEnergyOutImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean letsEnergyOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return letsEnergyOut(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean letsFluidInImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- Fluid aFluid,
- ICoverable aTileEntity) {
+ protected boolean letsFluidInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ Fluid aFluid, ICoverable aTileEntity) {
return letsFluidIn(aSide, aCoverID, convert(aCoverVariable), aFluid, aTileEntity);
}
@Override
- protected boolean letsFluidOutImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- Fluid aFluid,
- ICoverable aTileEntity) {
+ protected boolean letsFluidOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ Fluid aFluid, ICoverable aTileEntity) {
return letsFluidOut(aSide, aCoverID, convert(aCoverVariable), aFluid, aTileEntity);
}
@Override
- protected boolean letsItemsInImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- int aSlot,
- ICoverable aTileEntity) {
+ protected boolean letsItemsInImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ int aSlot, ICoverable aTileEntity) {
return letsItemsIn(aSide, aCoverID, convert(aCoverVariable), aSlot, aTileEntity);
}
@Override
- protected boolean letsItemsOutImpl(
- byte aSide,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- int aSlot,
- ICoverable aTileEntity) {
+ protected boolean letsItemsOutImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ int aSlot, ICoverable aTileEntity) {
return letsItemsOut(aSide, aCoverID, convert(aCoverVariable), aSlot, aTileEntity);
}
@Override
- protected boolean isGUIClickableImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean isGUIClickableImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return isGUIClickable(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean manipulatesSidedRedstoneOutputImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
return manipulatesSidedRedstoneOutput(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected boolean alwaysLookConnectedImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected boolean alwaysLookConnectedImpl(byte aSide, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
return alwaysLookConnected(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected byte getRedstoneInputImpl(
- byte aSide,
- byte aInputRedstone,
- int aCoverID,
- ISerializableObject.LegacyCoverData aCoverVariable,
- ICoverable aTileEntity) {
+ protected byte getRedstoneInputImpl(byte aSide, byte aInputRedstone, int aCoverID,
+ ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
return getRedstoneInput(aSide, aInputRedstone, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected int getTickRateImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected int getTickRateImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return getTickRate(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected byte getLensColorImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected byte getLensColorImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return getLensColor(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
@Override
- protected ItemStack getDropImpl(
- byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable, ICoverable aTileEntity) {
+ protected ItemStack getDropImpl(byte aSide, int aCoverID, ISerializableObject.LegacyCoverData aCoverVariable,
+ ICoverable aTileEntity) {
return getDrop(aSide, aCoverID, convert(aCoverVariable), aTileEntity);
}
// endregion
- public boolean isRedstoneSensitive(
- byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ public boolean isRedstoneSensitive(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ long aTimer) {
return true;
}
/**
* Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time.
*/
- public int doCoverThings(
- byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ long aTimer) {
return aCoverVariable;
}
@@ -283,15 +230,8 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
* <p/>
* return true, if something actually happens.
*/
- public boolean onCoverRightclick(
- byte aSide,
- int aCoverID,
- int aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
return false;
}
@@ -300,23 +240,16 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
* <p/>
* return the new Value of the Cover Variable
*/
- public int onCoverScrewdriverclick(
- byte aSide,
- int aCoverID,
- int aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
return aCoverVariable;
}
/**
* Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case.
*/
- public boolean onCoverShiftRightclick(
- byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) {
+ public boolean onCoverShiftRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer) {
if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) {
lastPlayer = aPlayer;
mPlayerNotified = false;
@@ -325,7 +258,11 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
} else {
GT_Values.NW.sendToPlayer(
new GT_Packet_TileEntityCoverGUI(
- aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer),
+ aSide,
+ aCoverID,
+ aCoverVariable,
+ aTileEntity,
+ (EntityPlayerMP) aPlayer),
(EntityPlayerMP) aPlayer);
}
return true;
@@ -339,11 +276,11 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
}
/**
- * Removes the Cover if this returns true, or if aForced is true.
- * Doesn't get called when the Machine Block is getting broken, only if you break the Cover away from the Machine.
+ * Removes the Cover if this returns true, or if aForced is true. Doesn't get called when the Machine Block is
+ * getting broken, only if you break the Cover away from the Machine.
*/
- public boolean onCoverRemoval(
- byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) {
+ public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ boolean aForced) {
return true;
}
@@ -422,14 +359,18 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
}
/**
- * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each Slot).
+ * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no
+ * Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each
+ * Slot).
*/
public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
return false;
}
/**
- * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each Slot).
+ * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no
+ * Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each
+ * Slot).
*/
public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
return false;
@@ -445,8 +386,8 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
/**
* Needs to return true for Covers, which have a Redstone Output on their Facing.
*/
- public boolean manipulatesSidedRedstoneOutput(
- byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable,
+ ICoverable aTileEntity) {
return false;
}
@@ -458,12 +399,11 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
}
/**
- * Called to determine the incoming Redstone Signal of a Machine.
- * Returns the original Redstone per default.
- * The Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0.
+ * Called to determine the incoming Redstone Signal of a Machine. Returns the original Redstone per default. The
+ * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0.
*/
- public byte getRedstoneInput(
- byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable,
+ ICoverable aTileEntity) {
return letsRedstoneGoIn(aSide, aCoverID, aCoverVariable, aTileEntity) ? aInputRedstone : 0;
}
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
index 12505dff31..fed28825f3 100644
--- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
+++ b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
@@ -2,11 +2,25 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
+import java.util.function.Supplier;
+
+import javax.annotation.Nullable;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.nbt.NBTTagInt;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.Fluid;
+
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.drawable.ItemDrawable;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
import gregtech.api.gui.GT_GUIColorOverride;
@@ -16,16 +30,6 @@ import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.net.GT_Packet_TileEntityCoverGUI;
import gregtech.api.objects.GT_ItemStack;
-import java.util.function.Supplier;
-import javax.annotation.Nullable;
-import net.minecraft.block.Block;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTBase;
-import net.minecraft.nbt.NBTTagInt;
-import net.minecraft.world.World;
-import net.minecraftforge.fluids.Fluid;
/**
* For Covers with a special behavior.
@@ -85,20 +89,22 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
/**
* Get target facade block. Does not affect rendering of **this** block. It is only used as a hint for other block
* in case of CTM
+ *
* @return null if none, otherwise return facade target block
*/
- public final Block getFacadeBlock(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final Block getFacadeBlock(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getFacadeBlockImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* Get target facade block. Does not affect rendering of **this** block. It is only used as a hint for other block
* in case of CTM
+ *
* @return 0 if none, otherwise return facade target meta
*/
- public final int getFacadeMeta(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final int getFacadeMeta(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getFacadeMetaImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
@@ -110,11 +116,12 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
/**
- * Get the special foreground cover texture associated with this cover. Return null if one should use the texture passed to
- * {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its overloads.
+ * Get the special foreground cover texture associated with this cover. Return null if one should use the texture
+ * passed to {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its
+ * overloads.
*/
- public final ITexture getSpecialCoverFGTexture(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final ITexture getSpecialCoverFGTexture(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getSpecialCoverFGTextureImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
@@ -122,42 +129,42 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* Get the special cover texture associated with this cover. Return null if one should use the texture passed to
* {@link gregtech.api.GregTech_API#registerCover(ItemStack, ITexture, GT_CoverBehaviorBase)} or its overloads.
*/
- public final ITexture getSpecialCoverTexture(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final ITexture getSpecialCoverTexture(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getSpecialCoverTextureImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* Return whether cover data needs to be synced to client upon tile entity creation or cover placement.
*
- * Note if you want to sync the data afterwards you will have to manually do it by calling {@link ICoverable#issueCoverUpdate(byte)}
- * This option only affects the initial sync.
+ * Note if you want to sync the data afterwards you will have to manually do it by calling
+ * {@link ICoverable#issueCoverUpdate(byte)} This option only affects the initial sync.
*/
- public final boolean isDataNeededOnClient(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean isDataNeededOnClient(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return isDataNeededOnClientImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* Called upon receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side.
*/
- public final void onDataChanged(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final void onDataChanged(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
onDataChangedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* Called before receiving data from network. Use {@link ICoverable#isClientSide()} to determine the side.
*/
- public final void preDataChanged(
- byte aSide,
- int aCoverID,
- int aNewCoverId,
- ISerializableObject aCoverVariable,
- ISerializableObject aNewCoverVariable,
- ICoverable aTileEntity) {
+ public final void preDataChanged(byte aSide, int aCoverID, int aNewCoverId, ISerializableObject aCoverVariable,
+ ISerializableObject aNewCoverVariable, ICoverable aTileEntity) {
preDataChangedImpl(
- aSide, aCoverID, aNewCoverId, forceCast(aCoverVariable), forceCast(aNewCoverVariable), aTileEntity);
+ aSide,
+ aCoverID,
+ aNewCoverId,
+ forceCast(aCoverVariable),
+ forceCast(aNewCoverVariable),
+ aTileEntity);
}
/**
@@ -167,21 +174,16 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
onDroppedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
- public final boolean isRedstoneSensitive(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ public final boolean isRedstoneSensitive(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, long aTimer) {
return isRedstoneSensitiveImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aTimer);
}
/**
* Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time.
*/
- public final T doCoverThings(
- byte aSide,
- byte aInputRedstone,
- int aCoverID,
- ISerializableObject aCoverVariable,
- ICoverable aTileEntity,
- long aTimer) {
+ public final T doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, long aTimer) {
return doCoverThingsImpl(aSide, aInputRedstone, aCoverID, forceCast(aCoverVariable), aTileEntity, aTimer);
}
@@ -190,15 +192,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* return true, if something actually happens.
*/
- public final boolean onCoverRightClick(
- byte aSide,
- int aCoverID,
- ISerializableObject aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ public final boolean onCoverRightClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
return onCoverRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ);
}
@@ -207,73 +202,64 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* return the new Value of the Cover Variable
*/
- public final T onCoverScrewdriverClick(
- byte aSide,
- int aCoverID,
- ISerializableObject aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ public final T onCoverScrewdriverClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
return onCoverScrewdriverClickImpl(
- aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aX, aY, aZ);
+ aSide,
+ aCoverID,
+ forceCast(aCoverVariable),
+ aTileEntity,
+ aPlayer,
+ aX,
+ aY,
+ aZ);
}
/**
* Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case.
*/
- public final boolean onCoverShiftRightClick(
- byte aSide,
- int aCoverID,
- ISerializableObject aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer) {
+ public final boolean onCoverShiftRightClick(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, EntityPlayer aPlayer) {
return onCoverShiftRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer);
}
@Deprecated
- public final Object getClientGUI(
- byte aSide,
- int aCoverID,
- ISerializableObject aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- World aWorld) {
+ public final Object getClientGUI(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) {
return getClientGUIImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer, aWorld);
}
/**
- * Removes the Cover if this returns true, or if aForced is true.
- * Doesn't get called when the Machine Block is getting broken, only if you break the Cover away from the Machine.
+ * Removes the Cover if this returns true, or if aForced is true. Doesn't get called when the Machine Block is
+ * getting broken, only if you break the Cover away from the Machine.
*/
- public final boolean onCoverRemoval(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity, boolean aForced) {
+ public final boolean onCoverRemoval(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity, boolean aForced) {
return onCoverRemovalImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aForced);
}
/**
- * Called upon Base TE being destroyed (once getDrops is called),
- * thus getting called only when destroyed in survival.
+ * Called upon Base TE being destroyed (once getDrops is called), thus getting called only when destroyed in
+ * survival.
*/
- public final void onBaseTEDestroyed(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final void onBaseTEDestroyed(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
onBaseTEDestroyedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* Gives a small Text for the status of the Cover.
*/
- public final String getDescription(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final String getDescription(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getDescriptionImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* How Blast Proof the Cover is. 30 is normal.
*/
- public final float getBlastProofLevel(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final float getBlastProofLevel(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getBlastProofLevelImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
@@ -282,16 +268,16 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* This is just Informative so that Machines know if their Redstone Input is blocked or not
*/
- public final boolean letsRedstoneGoIn(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean letsRedstoneGoIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return letsRedstoneGoInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* If it lets RS-Signals out of the Block
*/
- public final boolean letsRedstoneGoOut(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean letsRedstoneGoOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return letsRedstoneGoOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
@@ -300,98 +286,101 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* This is just Informative so that Machines know if their Redstone Input is blocked or not
*/
- public final boolean letsFibreGoIn(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean letsFibreGoIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return letsFibreGoInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* If it lets Fibre-Signals out of the Block
*/
- public final boolean letsFibreGoOut(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean letsFibreGoOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return letsFibreGoOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* If it lets Energy into the Block
*/
- public final boolean letsEnergyIn(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean letsEnergyIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return letsEnergyInImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* If it lets Energy out of the Block
*/
- public final boolean letsEnergyOut(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean letsEnergyOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return letsEnergyOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not.
*/
- public final boolean letsFluidIn(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ public final boolean letsFluidIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid,
+ ICoverable aTileEntity) {
return letsFluidInImpl(aSide, aCoverID, forceCast(aCoverVariable), aFluid, aTileEntity);
}
/**
* If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not.
*/
- public final boolean letsFluidOut(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ public final boolean letsFluidOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, Fluid aFluid,
+ ICoverable aTileEntity) {
return letsFluidOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aFluid, aTileEntity);
}
/**
- * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no reaction at all), aSlot = -2 means if it would accept for all Slots Impl(return true to skip the Checks for each Slot).
+ * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no
+ * reaction at all), aSlot = -2 means if it would accept for all Slots Impl(return true to skip the Checks for each
+ * Slot).
*/
- public final boolean letsItemsIn(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ public final boolean letsItemsIn(byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot,
+ ICoverable aTileEntity) {
return letsItemsInImpl(aSide, aCoverID, forceCast(aCoverVariable), aSlot, aTileEntity);
}
/**
- * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no reaction at all), aSlot = -2 means if it would accept for all Slots Impl(return true to skip the Checks for each Slot).
+ * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no
+ * reaction at all), aSlot = -2 means if it would accept for all Slots Impl(return true to skip the Checks for each
+ * Slot).
*/
- public final boolean letsItemsOut(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot, ICoverable aTileEntity) {
+ public final boolean letsItemsOut(byte aSide, int aCoverID, ISerializableObject aCoverVariable, int aSlot,
+ ICoverable aTileEntity) {
return letsItemsOutImpl(aSide, aCoverID, forceCast(aCoverVariable), aSlot, aTileEntity);
}
/**
* If it lets you rightclick the Machine normally
*/
- public final boolean isGUIClickable(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean isGUIClickable(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return isGUIClickableImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* Needs to return true for Covers, which have a Redstone Output on their Facing.
*/
- public final boolean manipulatesSidedRedstoneOutput(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return manipulatesSidedRedstoneOutputImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* if this Cover should let Pipe Connections look connected even if it is not the case.
*/
- public final boolean alwaysLookConnected(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final boolean alwaysLookConnected(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return alwaysLookConnectedImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
- * Called to determine the incoming Redstone Signal of a Machine.
- * Returns the original Redstone per default.
- * The Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0.
+ * Called to determine the incoming Redstone Signal of a Machine. Returns the original Redstone per default. The
+ * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0.
*/
- public final byte getRedstoneInput(
- byte aSide, byte aInputRedstone, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID,
+ ISerializableObject aCoverVariable, ICoverable aTileEntity) {
return getRedstoneInputImpl(aSide, aInputRedstone, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
@@ -407,16 +396,16 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
/**
* The MC Color of this Lens. -1 for no Color (meaning this isn't a Lens then).
*/
- public final byte getLensColor(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final byte getLensColor(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getLensColorImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
/**
* @return the ItemStack dropped by this Cover
*/
- public final ItemStack getDrop(
- byte aSide, int aCoverID, ISerializableObject aCoverVariable, ICoverable aTileEntity) {
+ public final ItemStack getDrop(byte aSide, int aCoverID, ISerializableObject aCoverVariable,
+ ICoverable aTileEntity) {
return getDropImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity);
}
// endregion
@@ -439,9 +428,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
/**
- * Creates {@link ModularWindow} for this cover.
- * This is separated from base class, as attaching the same covers in different sides of the same tile
- * needs different UI with different context.
+ * Creates {@link ModularWindow} for this cover. This is separated from base class, as attaching the same covers in
+ * different sides of the same tile needs different UI with different context.
*/
protected class UIFactory {
@@ -481,9 +469,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
@Nullable
public T getCoverData() {
if (isCoverValid()) {
- return forceCast(getUIBuildContext()
- .getTile()
- .getComplexCoverDataAtSide(getUIBuildContext().getCoverSide()));
+ return forceCast(
+ getUIBuildContext().getTile().getComplexCoverDataAtSide(getUIBuildContext().getCoverSide()));
} else {
return null;
}
@@ -491,15 +478,13 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
public boolean setCoverData(T data) {
if (isCoverValid()) {
- getUIBuildContext()
- .getTile()
- .receiveCoverData(
- getUIBuildContext().getCoverSide(),
- getUIBuildContext().getCoverID(),
- data,
- getUIBuildContext().getPlayer() instanceof EntityPlayerMP
- ? (EntityPlayerMP) getUIBuildContext().getPlayer()
- : null);
+ getUIBuildContext().getTile().receiveCoverData(
+ getUIBuildContext().getCoverSide(),
+ getUIBuildContext().getCoverID(),
+ data,
+ getUIBuildContext().getPlayer() instanceof EntityPlayerMP
+ ? (EntityPlayerMP) getUIBuildContext().getPlayer()
+ : null);
return true;
} else {
return false;
@@ -508,23 +493,15 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
public boolean isCoverValid() {
return !getUIBuildContext().getTile().isDead()
- && getUIBuildContext()
- .getTile()
- .getCoverBehaviorAtSideNew(
- getUIBuildContext().getCoverSide())
+ && getUIBuildContext().getTile().getCoverBehaviorAtSideNew(getUIBuildContext().getCoverSide())
!= GregTech_API.sNoBehavior;
}
protected void addTitleToUI(ModularWindow.Builder builder) {
ItemStack coverItem = GT_Utility.intToStack(getUIBuildContext().getCoverID());
if (coverItem != null) {
- builder.widget(new ItemDrawable(coverItem)
- .asWidget()
- .setPos(5, 5)
- .setSize(16, 16))
- .widget(new TextWidget(coverItem.getDisplayName())
- .setDefaultColor(COLOR_TITLE.get())
- .setPos(25, 9));
+ builder.widget(new ItemDrawable(coverItem).asWidget().setPos(5, 5).setSize(16, 16)).widget(
+ new TextWidget(coverItem.getDisplayName()).setDefaultColor(COLOR_TITLE.get()).setPos(25, 9));
}
}
@@ -565,8 +542,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
return GT_Utility.intToStack(aCoverID);
}
- protected ITexture getSpecialCoverFGTextureImpl(
- byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {
+ protected ITexture getSpecialCoverFGTextureImpl(byte aSide, int aCoverID, T aCoverVariable,
+ ICoverable aTileEntity) {
return coverFGTexture;
}
@@ -580,23 +557,23 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
protected void onDataChangedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {}
- protected void preDataChangedImpl(
- byte aSide, int aCoverID, int aNewCoverId, T aCoverVariable, T aNewCoverVariable, ICoverable aTileEntity) {}
+ protected void preDataChangedImpl(byte aSide, int aCoverID, int aNewCoverId, T aCoverVariable, T aNewCoverVariable,
+ ICoverable aTileEntity) {}
protected void onDroppedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {}
protected void onBaseTEDestroyedImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {}
- protected boolean isRedstoneSensitiveImpl(
- byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ protected boolean isRedstoneSensitiveImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity,
+ long aTimer) {
return false;
}
/**
* Called by updateEntity inside the covered TileEntity. aCoverVariable is the Value you returned last time.
*/
- protected T doCoverThingsImpl(
- byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable, ICoverable aTileEntity, long aTimer) {
+ protected T doCoverThingsImpl(byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable,
+ ICoverable aTileEntity, long aTimer) {
return aCoverVariable;
}
@@ -605,15 +582,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* return true, if something actually happens.
*/
- protected boolean onCoverRightClickImpl(
- byte aSide,
- int aCoverID,
- T aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ protected boolean onCoverRightClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
return false;
}
@@ -622,23 +592,16 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* return the new Value of the Cover Variable
*/
- protected T onCoverScrewdriverClickImpl(
- byte aSide,
- int aCoverID,
- T aCoverVariable,
- ICoverable aTileEntity,
- EntityPlayer aPlayer,
- float aX,
- float aY,
- float aZ) {
+ protected T onCoverScrewdriverClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
return aCoverVariable;
}
/**
* Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case.
*/
- protected boolean onCoverShiftRightClickImpl(
- byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) {
+ protected boolean onCoverShiftRightClickImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer) {
if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) {
lastPlayer = aPlayer;
if (useModularUI()) {
@@ -646,7 +609,11 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
} else {
GT_Values.NW.sendToPlayer(
new GT_Packet_TileEntityCoverGUI(
- aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer),
+ aSide,
+ aCoverID,
+ aCoverVariable,
+ aTileEntity,
+ (EntityPlayerMP) aPlayer),
(EntityPlayerMP) aPlayer);
}
return true;
@@ -655,17 +622,17 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
@Deprecated
- protected Object getClientGUIImpl(
- byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) {
+ protected Object getClientGUIImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, World aWorld) {
return null;
}
/**
- * Removes the Cover if this returns true, or if aForced is true.
- * Doesn't get called when the Machine Block is getting broken, only if you break the Cover away from the Machine.
+ * Removes the Cover if this returns true, or if aForced is true. Doesn't get called when the Machine Block is
+ * getting broken, only if you break the Cover away from the Machine.
*/
- protected boolean onCoverRemovalImpl(
- byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, boolean aForced) {
+ protected boolean onCoverRemovalImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity,
+ boolean aForced) {
return true;
}
@@ -732,28 +699,32 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
/**
* If it lets Liquids into the Block, aFluid can be null meaning if this is generally allowing Fluids or not.
*/
- protected boolean letsFluidInImpl(
- byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ protected boolean letsFluidInImpl(byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid,
+ ICoverable aTileEntity) {
return false;
}
/**
* If it lets Liquids out of the Block, aFluid can be null meaning if this is generally allowing Fluids or not.
*/
- protected boolean letsFluidOutImpl(
- byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
+ protected boolean letsFluidOutImpl(byte aSide, int aCoverID, T aCoverVariable, Fluid aFluid,
+ ICoverable aTileEntity) {
return false;
}
/**
- * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each Slot).
+ * If it lets Items into the Block, aSlot = -1 means if it is generally accepting Items (return false for no
+ * Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each
+ * Slot).
*/
protected boolean letsItemsInImpl(byte aSide, int aCoverID, T aCoverVariable, int aSlot, ICoverable aTileEntity) {
return false;
}
/**
- * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each Slot).
+ * If it lets Items out of the Block, aSlot = -1 means if it is generally accepting Items (return false for no
+ * Interaction at all), aSlot = -2 means if it would accept for all Slots (return true to skip the Checks for each
+ * Slot).
*/
protected boolean letsItemsOutImpl(byte aSide, int aCoverID, T aCoverVariable, int aSlot, ICoverable aTileEntity) {
return false;
@@ -769,8 +740,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
/**
* Needs to return true for Covers, which have a Redstone Output on their Facing.
*/
- protected boolean manipulatesSidedRedstoneOutputImpl(
- byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {
+ protected boolean manipulatesSidedRedstoneOutputImpl(byte aSide, int aCoverID, T aCoverVariable,
+ ICoverable aTileEntity) {
return false;
}
@@ -782,12 +753,11 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
/**
- * Called to determine the incoming Redstone Signal of a Machine.
- * Returns the original Redstone per default.
- * The Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0.
+ * Called to determine the incoming Redstone Signal of a Machine. Returns the original Redstone per default. The
+ * Cover should @letsRedstoneGoIn or the aInputRedstone Parameter is always 0.
*/
- protected byte getRedstoneInputImpl(
- byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {
+ protected byte getRedstoneInputImpl(byte aSide, byte aInputRedstone, int aCoverID, T aCoverVariable,
+ ICoverable aTileEntity) {
return letsRedstoneGoIn(aSide, aCoverID, aCoverVariable, aTileEntity) ? aInputRedstone : 0;
}
@@ -826,7 +796,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
/**
- * Checks if the Cover can be placed on this. You will probably want to call {@link #isCoverPlaceable(byte, ItemStack, ICoverable)} instead.
+ * Checks if the Cover can be placed on this. You will probably want to call
+ * {@link #isCoverPlaceable(byte, ItemStack, ICoverable)} instead.
*/
@Deprecated
public boolean isCoverPlaceable(byte aSide, GT_ItemStack aStack, ICoverable aTileEntity) {
@@ -842,8 +813,8 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
* <p/>
* return true, if something actually happens.
*/
- public boolean onCoverRightclickClient(
- byte aSide, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public boolean onCoverRightclickClient(byte aSide, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY,
+ float aZ) {
return false;
}
diff --git a/src/main/java/gregtech/api/util/GT_CreativeTab.java b/src/main/java/gregtech/api/util/GT_CreativeTab.java
index ccebd9d4a9..1049f40278 100644
--- a/src/main/java/gregtech/api/util/GT_CreativeTab.java
+++ b/src/main/java/gregtech/api/util/GT_CreativeTab.java
@@ -1,12 +1,14 @@
package gregtech.api.util;
-import gregtech.api.enums.ItemList;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import gregtech.api.enums.ItemList;
+
public class GT_CreativeTab extends CreativeTabs {
+
public GT_CreativeTab(String aName, String aLocalName) {
super("GregTech." + aName);
GT_LanguageManager.addStringLocalization("itemGroup.GregTech." + aName, aLocalName);
diff --git a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java
index 3f57cf758b..90430c9bcb 100644
--- a/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java
+++ b/src/main/java/gregtech/api/util/GT_ExoticEnergyInputHelper.java
@@ -2,14 +2,16 @@ package gregtech.api.util;
import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.isValidMetaTileEntity;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+
public class GT_ExoticEnergyInputHelper {
+
/**
* The Valid Types of TecTech Hatch List.
*/
@@ -21,9 +23,8 @@ public class GT_ExoticEnergyInputHelper {
}
public static void register(Class<? extends GT_MetaTileEntity_Hatch> clazz) {
- if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz))
- throw new IllegalArgumentException(
- clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName());
+ if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException(
+ clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName());
sExoticEnergyHatchType.add(clazz);
}
@@ -35,9 +36,8 @@ public class GT_ExoticEnergyInputHelper {
} catch (ClassNotFoundException e) {
return;
}
- if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz))
- throw new IllegalArgumentException(
- clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName());
+ if (!GT_MetaTileEntity_Hatch.class.isAssignableFrom(clazz)) throw new IllegalArgumentException(
+ clazz.getName() + " is not a subclass of " + GT_MetaTileEntity_Hatch.class.getName());
sExoticEnergyHatchType.add((Class<? extends GT_MetaTileEntity_Hatch>) clazz);
}
@@ -59,17 +59,15 @@ public class GT_ExoticEnergyInputHelper {
public static long getTotalEuMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) {
long rEU = 0L;
- for (GT_MetaTileEntity_Hatch tHatch : hatches)
- if (isValidMetaTileEntity(tHatch))
- rEU += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.maxWorkingAmperesIn();
+ for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch))
+ rEU += tHatch.getBaseMetaTileEntity().getInputVoltage() * tHatch.maxWorkingAmperesIn();
return rEU;
}
public static long getMaxInputVoltageMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) {
long rVoltage = 0;
for (GT_MetaTileEntity_Hatch tHatch : hatches)
- if (isValidMetaTileEntity(tHatch))
- rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
return rVoltage;
}
@@ -79,25 +77,22 @@ public class GT_ExoticEnergyInputHelper {
return rVoltage;
}
for (GT_MetaTileEntity_Hatch tHatch : hatches)
- if (isValidMetaTileEntity(tHatch))
- rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
+ if (isValidMetaTileEntity(tHatch)) rVoltage += tHatch.getBaseMetaTileEntity().getInputVoltage();
return rVoltage / hatches.size();
}
public static long getMaxInputAmpsMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) {
long rAmp = 0;
for (GT_MetaTileEntity_Hatch tHatch : hatches)
- if (isValidMetaTileEntity(tHatch))
- rAmp += tHatch.getBaseMetaTileEntity().getInputAmperage();
+ if (isValidMetaTileEntity(tHatch)) rAmp += tHatch.getBaseMetaTileEntity().getInputAmperage();
return rAmp;
}
public static long getMaxWorkingInputAmpsMulti(Collection<? extends GT_MetaTileEntity_Hatch> hatches) {
long rAmp = 0;
- for (GT_MetaTileEntity_Hatch tHatch : hatches)
- if (isValidMetaTileEntity(tHatch)) {
- rAmp += tHatch.maxWorkingAmperesIn();
- }
+ for (GT_MetaTileEntity_Hatch tHatch : hatches) if (isValidMetaTileEntity(tHatch)) {
+ rAmp += tHatch.maxWorkingAmperesIn();
+ }
return rAmp;
}
diff --git a/src/main/java/gregtech/api/util/GT_FoodStat.java b/src/main/java/gregtech/api/util/GT_FoodStat.java
index f9a0f50c5f..cc1616f866 100644
--- a/src/main/java/gregtech/api/util/GT_FoodStat.java
+++ b/src/main/java/gregtech/api/util/GT_FoodStat.java
@@ -1,16 +1,18 @@
package gregtech.api.util;
-import gregtech.api.damagesources.GT_DamageSources;
-import gregtech.api.enums.SoundResource;
-import gregtech.api.interfaces.IFoodStat;
-import gregtech.api.items.GT_MetaBase_Item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
+import gregtech.api.damagesources.GT_DamageSources;
+import gregtech.api.enums.SoundResource;
+import gregtech.api.interfaces.IFoodStat;
+import gregtech.api.items.GT_MetaBase_Item;
+
public class GT_FoodStat implements IFoodStat {
+
private final int mFoodLevel;
private final int[] mPotionEffects;
private final float mSaturation;
@@ -26,21 +28,12 @@ public class GT_FoodStat implements IFoodStat {
* @param aEmptyContainer An empty Container (Optional)
* @param aAlwaysEdible If this Item is always edible, like Golden Apples or Potions
* @param aInvisibleParticles If the Particles of the Potion Effects are invisible
- * @param aPotionEffects An Array of Potion Effects with %4==0 Elements as follows
- * ID of a Potion Effect. 0 for none
- * Duration of the Potion in Ticks
- * Level of the Effect. [0, 1, 2] are for [I, II, III]
- * The likelihood that this Potion Effect takes place upon being eaten [1 - 100]
+ * @param aPotionEffects An Array of Potion Effects with %4==0 Elements as follows ID of a Potion Effect. 0 for
+ * none Duration of the Potion in Ticks Level of the Effect. [0, 1, 2] are for [I, II,
+ * III] The likelihood that this Potion Effect takes place upon being eaten [1 - 100]
*/
- public GT_FoodStat(
- int aFoodLevel,
- float aSaturation,
- EnumAction aAction,
- ItemStack aEmptyContainer,
- boolean aAlwaysEdible,
- boolean aInvisibleParticles,
- boolean aIsRotten,
- int... aPotionEffects) {
+ public GT_FoodStat(int aFoodLevel, float aSaturation, EnumAction aAction, ItemStack aEmptyContainer,
+ boolean aAlwaysEdible, boolean aInvisibleParticles, boolean aIsRotten, int... aPotionEffects) {
mFoodLevel = aFoodLevel;
mSaturation = aSaturation;
mAction = aAction == null ? EnumAction.eat : aAction;
@@ -78,13 +71,9 @@ public class GT_FoodStat implements IFoodStat {
if (tStack != null && !aPlayer.inventory.addItemStackToInventory(tStack))
aPlayer.dropPlayerItemWithRandomChoice(tStack, true);
- new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder()
- .setIdentifier(SoundResource.RANDOM_BURP)
- .setVolume(0.5F)
- .setPitch(aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F)
- .setEntity(aPlayer)
- .setWorld(aPlayer.worldObj)
- .run();
+ new WorldSpawnedEventBuilder.SoundAtEntityEventBuilder().setIdentifier(SoundResource.RANDOM_BURP)
+ .setVolume(0.5F).setPitch(aPlayer.worldObj.rand.nextFloat() * 0.1F + 0.9F).setEntity(aPlayer)
+ .setWorld(aPlayer.worldObj).run();
if (!aPlayer.worldObj.isRemote) {
if (mMilk) {
@@ -92,19 +81,18 @@ public class GT_FoodStat implements IFoodStat {
}
for (int i = 3; i < mPotionEffects.length; i += 4) {
if (aPlayer.worldObj.rand.nextInt(100) < mPotionEffects[i]) {
- aPlayer.addPotionEffect(new PotionEffect(
- mPotionEffects[i - 3], mPotionEffects[i - 2], mPotionEffects[i - 1], mInvisibleParticles));
+ aPlayer.addPotionEffect(
+ new PotionEffect(
+ mPotionEffects[i - 3],
+ mPotionEffects[i - 2],
+ mPotionEffects[i - 1],
+ mInvisibleParticles));
}
}
if (mExplosive) {
- new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder()
- .setSmoking(true)
- .setFlaming(true)
- .setStrength(4f)
- .setPosition(aPlayer.posX, aPlayer.posY, aPlayer.posZ)
- .setEntity(aPlayer)
- .setWorld(aPlayer.worldObj)
- .run();
+ new WorldSpawnedEventBuilder.ExplosionEffectEventBuilder().setSmoking(true).setFlaming(true)
+ .setStrength(4f).setPosition(aPlayer.posX, aPlayer.posY, aPlayer.posZ).setEntity(aPlayer)
+ .setWorld(aPlayer.worldObj).run();
aPlayer.attackEntityFrom(GT_DamageSources.getExplodingDamage(), Float.MAX_VALUE);
}
}
diff --git a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java
index 1edfd836f3..68c20f7fa1 100644
--- a/src/main/java/gregtech/api/util/GT_Forestry_Compat.java
+++ b/src/main/java/gregtech/api/util/GT_Forestry_Compat.java
@@ -1,14 +1,16 @@
package gregtech.api.util;
+import java.util.Map;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
import forestry.api.recipes.ICentrifugeRecipe;
import forestry.api.recipes.ISqueezerRecipe;
import forestry.api.recipes.RecipeManagers;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
-import java.util.Map;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
public class GT_Forestry_Compat {
@@ -16,10 +18,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Bee_Drone.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Bee_Drone.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone")},
+ new ItemStack[] { ItemList.FR_Bee_Drone.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Bee_Drone.getWithName(1L, "Scanned Drone") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -28,10 +30,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Bee_Princess.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Bee_Princess.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess")},
+ new ItemStack[] { ItemList.FR_Bee_Princess.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Bee_Princess.getWithName(1L, "Scanned Princess") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -40,10 +42,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Bee_Queen.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Bee_Queen.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen")},
+ new ItemStack[] { ItemList.FR_Bee_Queen.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Bee_Queen.getWithName(1L, "Scanned Queen") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -52,10 +54,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Tree_Sapling.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Tree_Sapling.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling")},
+ new ItemStack[] { ItemList.FR_Tree_Sapling.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Tree_Sapling.getWithName(1L, "Scanned Sapling") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -64,10 +66,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Butterfly.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Butterfly.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly")},
+ new ItemStack[] { ItemList.FR_Butterfly.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Butterfly.getWithName(1L, "Scanned Butterfly") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -76,10 +78,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Larvae.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Larvae.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae")},
+ new ItemStack[] { ItemList.FR_Larvae.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Larvae.getWithName(1L, "Scanned Larvae") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -88,10 +90,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Serum.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Serum.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Serum.getWithName(1L, "Scanned Serum")},
+ new ItemStack[] { ItemList.FR_Serum.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Serum.getWithName(1L, "Scanned Serum") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -100,10 +102,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_Caterpillar.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_Caterpillar.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar")},
+ new ItemStack[] { ItemList.FR_Caterpillar.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_Caterpillar.getWithName(1L, "Scanned Caterpillar") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -112,10 +114,10 @@ public class GT_Forestry_Compat {
if (ItemList.FR_PollenFertile.get(1L) != null) {
GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe(
false,
- new ItemStack[] {ItemList.FR_PollenFertile.getWildcard(1L)},
- new ItemStack[] {ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen")},
+ new ItemStack[] { ItemList.FR_PollenFertile.getWildcard(1L) },
+ new ItemStack[] { ItemList.FR_PollenFertile.getWithName(1L, "Scanned Pollen") },
null,
- new FluidStack[] {Materials.Honey.getFluid(100L)},
+ new FluidStack[] { Materials.Honey.getFluid(100L) },
null,
500,
2,
@@ -136,9 +138,27 @@ public class GT_Forestry_Compat {
i++;
}
GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(
- true, new ItemStack[] {tRecipe.getInput()}, tOutputs, null, tChances, null, null, 128, 5, 0);
+ true,
+ new ItemStack[] { tRecipe.getInput() },
+ tOutputs,
+ null,
+ tChances,
+ null,
+ null,
+ 128,
+ 5,
+ 0);
GT_Recipe.GT_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(
- true, new ItemStack[] {tRecipe.getInput()}, tOutputs, null, tChances, null, null, 128, 5, 0);
+ true,
+ new ItemStack[] { tRecipe.getInput() },
+ tOutputs,
+ null,
+ tChances,
+ null,
+ null,
+ 128,
+ 5,
+ 0);
}
} catch (Throwable e) {
if (GT_Values.D1) {
@@ -153,12 +173,12 @@ public class GT_Forestry_Compat {
if ((tRecipe.getResources().length == 1) && (tRecipe.getFluidOutput() != null)) {
GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(
true,
- new ItemStack[] {tRecipe.getResources()[0]},
- new ItemStack[] {tRecipe.getRemnants()},
+ new ItemStack[] { tRecipe.getResources()[0] },
+ new ItemStack[] { tRecipe.getRemnants() },
null,
- new int[] {(int) (tRecipe.getRemnantsChance() * 10000)},
+ new int[] { (int) (tRecipe.getRemnantsChance() * 10000) },
null,
- new FluidStack[] {tRecipe.getFluidOutput()},
+ new FluidStack[] { tRecipe.getFluidOutput() },
32,
8,
0);
diff --git a/src/main/java/gregtech/api/util/GT_GC_Compat.java b/src/main/java/gregtech/api/util/GT_GC_Compat.java
index 60e0e2649d..93c7f35746 100644
--- a/src/main/java/gregtech/api/util/GT_GC_Compat.java
+++ b/src/main/java/gregtech/api/util/GT_GC_Compat.java
@@ -1,15 +1,17 @@
package gregtech.api.util;
-import gregtech.api.GregTech_API;
import micdoodle8.mods.galacticraft.api.power.EnergySource;
import micdoodle8.mods.galacticraft.api.power.EnergySource.EnergySourceAdjacent;
import micdoodle8.mods.galacticraft.api.power.IEnergyHandlerGC;
import micdoodle8.mods.galacticraft.api.transmission.NetworkType;
import micdoodle8.mods.galacticraft.api.transmission.tile.IConnector;
import micdoodle8.mods.galacticraft.core.energy.EnergyConfigHandler;
+
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
+import gregtech.api.GregTech_API;
+
public class GT_GC_Compat {
public static long insertEnergyInto(TileEntity tTileEntity, long aVoltage, ForgeDirection tDirection) {
@@ -27,8 +29,8 @@ public class GT_GC_Compat {
if (tReceived > 0) {
tSizeToReceive -= tReceived;
while (tSizeToReceive > 0) {
- tReceived =
- ((IEnergyHandlerGC) tTileEntity).receiveEnergyGC(eSource, tSizeToReceive, false);
+ tReceived = ((IEnergyHandlerGC) tTileEntity)
+ .receiveEnergyGC(eSource, tSizeToReceive, false);
if (tReceived < 1) break;
tSizeToReceive -= tReceived;
}
@@ -43,10 +45,10 @@ public class GT_GC_Compat {
public static boolean canConnect(TileEntity tTileEntity, ForgeDirection tDirection) {
// GC Compat
- if (GregTech_API.mGalacticraft
- && tTileEntity instanceof IEnergyHandlerGC
+ if (GregTech_API.mGalacticraft && tTileEntity instanceof IEnergyHandlerGC
&& (!(tTileEntity instanceof IConnector)
- || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER))) return true;
+ || ((IConnector) tTileEntity).canConnect(tDirection, NetworkType.POWER)))
+ return true;
return false;
}
}
diff --git a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java b/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java
index d8e9289f54..96e721e9be 100644
--- a/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java
+++ b/src/main/java/gregtech/api/util/GT_HatchElementBuilder.java
@@ -2,19 +2,10 @@ package gregtech.api.util;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
-import com.gtnewhorizon.structurelib.StructureLibAPI;
-import com.gtnewhorizon.structurelib.structure.*;
-import com.gtnewhorizon.structurelib.util.ItemStackPredicate;
-import gnu.trove.TIntCollection;
-import gnu.trove.list.array.TIntArrayList;
-import gnu.trove.set.hash.TIntHashSet;
-import gregtech.api.interfaces.IHatchElement;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.common.blocks.GT_Item_Machines;
import java.util.*;
import java.util.function.*;
import java.util.stream.Collectors;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -24,8 +15,22 @@ import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.structure.*;
+import com.gtnewhorizon.structurelib.util.ItemStackPredicate;
+
+import gnu.trove.TIntCollection;
+import gnu.trove.list.array.TIntArrayList;
+import gnu.trove.set.hash.TIntHashSet;
+import gregtech.api.interfaces.IHatchElement;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.common.blocks.GT_Item_Machines;
+
public class GT_HatchElementBuilder<T> {
- private interface Builtin {}
+
+ private interface Builtin {
+ }
private IGT_HatchAdder<? super T> mAdder;
private int mCasingIndex = -1;
@@ -47,80 +52,72 @@ public class GT_HatchElementBuilder<T> {
// region composite
/**
- * Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip.
- * TODO add doc
+ * Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip. TODO add doc
*/
@SafeVarargs
public final GT_HatchElementBuilder<T> anyOf(IHatchElement<? super T>... elements) {
if (elements == null || elements.length == 0) throw new IllegalArgumentException();
- return adder(Arrays.stream(elements)
- .map(e -> e.adder().rebrand())
- .reduce(IGT_HatchAdder::orElse)
- .get())
- .hatchClasses(Arrays.stream(elements)
- .map(IHatchElement::mteClasses)
- .flatMap(Collection::stream)
- .collect(Collectors.toList()))
- .cacheHint(() -> Arrays.stream(elements)
- .map(IHatchElement::name)
- .sorted()
- .collect(Collectors.joining(" or ", "of type ", "")));
+ return adder(Arrays.stream(elements).map(e -> e.adder().rebrand()).reduce(IGT_HatchAdder::orElse).get())
+ .hatchClasses(
+ Arrays.stream(elements).map(IHatchElement::mteClasses).flatMap(Collection::stream)
+ .collect(Collectors.toList()))
+ .cacheHint(
+ () -> Arrays.stream(elements).map(IHatchElement::name).sorted()
+ .collect(Collectors.joining(" or ", "of type ", "")));
}
/**
* Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip.
* <p>
- * Will rotate through all elements
- * TODO add doc
+ * Will rotate through all elements TODO add doc
*/
@SafeVarargs
public final GT_HatchElementBuilder<T> atLeast(IHatchElement<? super T>... elements) {
if (elements == null || elements.length == 0) throw new IllegalArgumentException();
- return atLeast(Arrays.stream(elements)
- .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting())));
+ return atLeast(
+ Arrays.stream(elements).collect(
+ Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting())));
}
/**
* Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip.
* <p>
- * Will rotate through all elements
- * TODO add doc
+ * Will rotate through all elements TODO add doc
*/
public final GT_HatchElementBuilder<T> atLeastList(List<IHatchElement<? super T>> elements) {
if (elements == null || elements.isEmpty()) throw new IllegalArgumentException();
- return atLeast(elements.stream()
- .collect(Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting())));
+ return atLeast(
+ elements.stream().collect(
+ Collectors.groupingBy(Function.identity(), LinkedHashMap::new, Collectors.counting())));
}
/**
- * Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip.
- * TODO add doc
+ * Set all of adder, hint and hatchItemFilter. Provide a reasonable default for shouldSkip. TODO add doc
*/
public final GT_HatchElementBuilder<T> atLeast(Map<IHatchElement<? super T>, ? extends Number> elements) {
if (elements == null || elements.isEmpty() || elements.containsKey(null) || elements.containsValue(null))
throw new IllegalArgumentException();
- List<Class<? extends IMetaTileEntity>> list = elements.keySet().stream()
- .map(IHatchElement::mteClasses)
- .flatMap(Collection::stream)
- .collect(Collectors.toList());
+ List<Class<? extends IMetaTileEntity>> list = elements.keySet().stream().map(IHatchElement::mteClasses)
+ .flatMap(Collection::stream).collect(Collectors.toList());
// map cannot be null or empty, so assert Optional isPresent
- return adder(elements.keySet().stream()
- .map(e -> e.adder().rebrand())
- .reduce(IGT_HatchAdder::orElse)
- .orElseThrow(AssertionError::new))
- .hatchItemFilter(obj -> GT_StructureUtility.filterByMTEClass(elements.entrySet().stream()
- .filter(entry ->
- entry.getKey().count(obj) < entry.getValue().longValue())
- .flatMap(entry -> entry.getKey().mteClasses().stream())
- .collect(Collectors.toList())))
- .shouldReject(obj -> elements.entrySet().stream()
- .allMatch(e -> e.getKey().count(obj) >= e.getValue().longValue()))
- .shouldSkip((BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin)
- (c, t) -> t != null && list.stream().anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity())))
- .cacheHint(() -> elements.keySet().stream()
- .map(IHatchElement::name)
- .sorted()
- .collect(Collectors.joining(" or ", "of type ", "")));
+ return adder(
+ elements.keySet().stream().map(e -> e.adder().rebrand()).reduce(IGT_HatchAdder::orElse)
+ .orElseThrow(AssertionError::new)).hatchItemFilter(
+ obj -> GT_StructureUtility.filterByMTEClass(
+ elements.entrySet().stream().filter(
+ entry -> entry.getKey().count(obj) < entry.getValue().longValue())
+ .flatMap(entry -> entry.getKey().mteClasses().stream())
+ .collect(Collectors.toList())))
+ .shouldReject(
+ obj -> elements.entrySet().stream()
+ .allMatch(e -> e.getKey().count(obj) >= e.getValue().longValue()))
+ .shouldSkip(
+ (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c,
+ t) -> t != null && list.stream()
+ .anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity())))
+ .cacheHint(
+ () -> elements.keySet().stream().map(IHatchElement::name).sorted()
+ .collect(Collectors.joining(" or ", "of type ", "")));
}
// endregion
@@ -228,6 +225,7 @@ public class GT_HatchElementBuilder<T> {
* This will clear the sides set by previous call to this or {@link #allowOnly(ForgeDirection...)}
* <p>
* Usually mandatory for multis with multiple slices, and otherwise not needed if it contains a single slice only.
+ *
* @param facings disallowed direction in ABC coordinate system
*/
public GT_HatchElementBuilder<T> disallowOnly(ForgeDirection... facings) {
@@ -243,6 +241,7 @@ public class GT_HatchElementBuilder<T> {
* This will clear the sides set by previous call to this or {@link #disallowOnly(ForgeDirection...)}
* <p>
* Usually mandatory for multis with multiple slices, and otherwise not needed if it contains a single slice only.
+ *
* @param facings allowed direction in ABC coordinate system
*/
public GT_HatchElementBuilder<T> allowOnly(ForgeDirection... facings) {
@@ -256,9 +255,9 @@ public class GT_HatchElementBuilder<T> {
// region intermediate
public GT_HatchElementBuilder<T> hatchClass(Class<? extends IMetaTileEntity> clazz) {
return hatchItemFilter(c -> is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)))
- .cacheHint(() -> "of class " + clazz.getSimpleName())
- .shouldSkip((BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin)
- (c, t) -> clazz.isInstance(t.getMetaTileEntity()));
+ .cacheHint(() -> "of class " + clazz.getSimpleName()).shouldSkip(
+ (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> clazz
+ .isInstance(t.getMetaTileEntity()));
}
@SafeVarargs
@@ -269,36 +268,35 @@ public class GT_HatchElementBuilder<T> {
public final GT_HatchElementBuilder<T> hatchClasses(List<? extends Class<? extends IMetaTileEntity>> classes) {
List<? extends Class<? extends IMetaTileEntity>> list = new ArrayList<>(classes);
return hatchItemFilter(obj -> GT_StructureUtility.filterByMTEClass(list))
- .cacheHint(() -> list.stream()
- .map(Class::getSimpleName)
- .sorted()
- .collect(Collectors.joining(" or ", "of class ", "")))
- .shouldSkip((BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) ->
- t != null && list.stream().anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity())));
+ .cacheHint(
+ () -> list.stream().map(Class::getSimpleName).sorted()
+ .collect(Collectors.joining(" or ", "of class ", "")))
+ .shouldSkip(
+ (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null
+ && list.stream().anyMatch(clazz -> clazz.isInstance(t.getMetaTileEntity())));
}
public GT_HatchElementBuilder<T> hatchId(int aId) {
- return hatchItemFilter(c -> is -> GT_Utility.isStackValid(is)
- && is.getItem() instanceof GT_Item_Machines
- && is.getItemDamage() == aId)
- .cacheHint(() -> "of id " + aId)
- .shouldSkip((BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin)
- (c, t) -> t != null && t.getMetaTileID() == aId);
+ return hatchItemFilter(
+ c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines
+ && is.getItemDamage() == aId).cacheHint(() -> "of id " + aId).shouldSkip(
+ (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c, t) -> t != null
+ && t.getMetaTileID() == aId);
}
public GT_HatchElementBuilder<T> hatchIds(int... aIds) {
if (aIds == null || aIds.length == 0) throw new IllegalArgumentException();
if (aIds.length == 1) return hatchId(aIds[0]);
TIntCollection coll = aIds.length < 16 ? new TIntArrayList(aIds) : new TIntHashSet(aIds);
- return hatchItemFilter(c -> is -> GT_Utility.isStackValid(is)
- && is.getItem() instanceof GT_Item_Machines
+ return hatchItemFilter(
+ c -> is -> GT_Utility.isStackValid(is) && is.getItem() instanceof GT_Item_Machines
&& coll.contains(is.getItemDamage()))
- .cacheHint(() -> Arrays.stream(coll.toArray())
- .sorted()
- .mapToObj(String::valueOf)
- .collect(Collectors.joining(" or ", "of id ", "")))
- .shouldSkip((BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin)
- (c, t) -> t != null && coll.contains(t.getMetaTileID()));
+ .cacheHint(
+ () -> Arrays.stream(coll.toArray()).sorted().mapToObj(String::valueOf)
+ .collect(Collectors.joining(" or ", "of id ", "")))
+ .shouldSkip(
+ (BiPredicate<? super T, ? super IGregTechTileEntity> & Builtin) (c,
+ t) -> t != null && coll.contains(t.getMetaTileID()));
}
// endregion
@@ -324,6 +322,7 @@ public class GT_HatchElementBuilder<T> {
if (mHatchItemFilter == null) {
// no item filter -> no placement
return new IStructureElementNoPlacement<T>() {
+
@Override
public boolean check(T t, World world, int x, int y, int z) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
@@ -339,6 +338,7 @@ public class GT_HatchElementBuilder<T> {
};
}
return new IStructureElement<T>() {
+
private String mHint = mHatchItemType == null ? "unspecified GT hatch" : mHatchItemType.get();
@Override
@@ -376,34 +376,33 @@ public class GT_HatchElementBuilder<T> {
}
@Override
- public BlocksToPlace getBlocksToPlace(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
return BlocksToPlace.create(mHatchItemFilter.apply(t, trigger));
}
@Deprecated
@Override
- public PlaceResult survivalPlaceBlock(
- T t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- IItemSource s,
- EntityPlayerMP actor,
- Consumer<IChatComponent> chatter) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
return survivalPlaceBlock(
- t, world, x, y, z, trigger, AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
+ t,
+ world,
+ x,
+ y,
+ z,
+ trigger,
+ AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
if (mShouldSkip != null) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IGregTechTileEntity
- && mShouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return PlaceResult.SKIP;
+ && mShouldSkip.test(t, (IGregTechTileEntity) tileEntity))
+ return PlaceResult.SKIP;
}
if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor()))
return PlaceResult.REJECT;
@@ -415,17 +414,16 @@ public class GT_HatchElementBuilder<T> {
return PlaceResult.REJECT;
}
if (StructureUtility.survivalPlaceBlock(
- taken,
- ItemStackPredicate.NBTMode.IGNORE,
- null,
- true,
- world,
- x,
- y,
- z,
- env.getSource(),
- env.getActor())
- != PlaceResult.ACCEPT) {
+ taken,
+ ItemStackPredicate.NBTMode.IGNORE,
+ null,
+ true,
+ world,
+ x,
+ y,
+ z,
+ env.getSource(),
+ env.getActor()) != PlaceResult.ACCEPT) {
return PlaceResult.REJECT;
}
// try to infer facing
diff --git a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java b/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java
index 747ca15249..796699c261 100644
--- a/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java
+++ b/src/main/java/gregtech/api/util/GT_IBoxableWrapper.java
@@ -1,9 +1,11 @@
package gregtech.api.util;
-import ic2.api.item.IBoxable;
import net.minecraft.item.ItemStack;
+import ic2.api.item.IBoxable;
+
public class GT_IBoxableWrapper implements IBoxable {
+
@Override
public boolean canBeStoredInToolbox(ItemStack itemstack) {
return GT_Utility.isStackInList(itemstack, GT_ModHandler.sBoxableItems);
diff --git a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java
index 174b4618e8..7097e877bd 100644
--- a/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java
+++ b/src/main/java/gregtech/api/util/GT_ItsNotMyFaultException.java
@@ -1,6 +1,7 @@
package gregtech.api.util;
public class GT_ItsNotMyFaultException extends RuntimeException {
+
private static final long serialVersionUID = -8752778866486460495L;
private String mError;
diff --git a/src/main/java/gregtech/api/util/GT_LanguageManager.java b/src/main/java/gregtech/api/util/GT_LanguageManager.java
index a40f154035..ab077ff946 100644
--- a/src/main/java/gregtech/api/util/GT_LanguageManager.java
+++ b/src/main/java/gregtech/api/util/GT_LanguageManager.java
@@ -2,50 +2,47 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.ReflectionHelper;
-import gregtech.api.GregTech_API;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
+
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.ReflectionHelper;
+import gregtech.api.GregTech_API;
+
public class GT_LanguageManager {
- public static final HashMap<String, String> TEMPMAP = new HashMap<>(),
- BUFFERMAP = new HashMap<>(),
+
+ public static final HashMap<String, String> TEMPMAP = new HashMap<>(), BUFFERMAP = new HashMap<>(),
LANGMAP = new HashMap<>();
public static Configuration sEnglishFile;
public static String sLanguage = "en_US";
public static boolean sUseEnglishFile = false;
public static boolean i18nPlaceholder = true;
- public static String FACE_ANY = "gt.lang.face.any",
- FACE_BOTTOM = "gt.lang.face.bottom",
- FACE_TOP = "gt.lang.face.top",
- FACE_LEFT = "gt.lang.face.left",
- FACE_FRONT = "gt.lang.face.front",
- FACE_RIGHT = "gt.lang.face.right",
- FACE_BACK = "gt.lang.face.back",
- FACE_NONE = "gt.lang.face.none";
+ public static String FACE_ANY = "gt.lang.face.any", FACE_BOTTOM = "gt.lang.face.bottom",
+ FACE_TOP = "gt.lang.face.top", FACE_LEFT = "gt.lang.face.left", FACE_FRONT = "gt.lang.face.front",
+ FACE_RIGHT = "gt.lang.face.right", FACE_BACK = "gt.lang.face.back", FACE_NONE = "gt.lang.face.none";
- public static String[] FACES = {FACE_BOTTOM, FACE_TOP, FACE_LEFT, FACE_FRONT, FACE_RIGHT, FACE_BACK, FACE_NONE};
+ public static String[] FACES = { FACE_BOTTOM, FACE_TOP, FACE_LEFT, FACE_FRONT, FACE_RIGHT, FACE_BACK, FACE_NONE };
private static Map<String, String> stringTranslateLanguageList = null;
static {
try {
- Field fieldStringTranslateLanguageList = ReflectionHelper.findField(
- net.minecraft.util.StringTranslate.class, "languageList", "field_74816_c");
- Field fieldStringTranslateInstance =
- ReflectionHelper.findField(net.minecraft.util.StringTranslate.class, "instance", "field_74817_a");
- //noinspection unchecked
- stringTranslateLanguageList =
- (Map<String, String>) fieldStringTranslateLanguageList.get(fieldStringTranslateInstance.get(null));
+ Field fieldStringTranslateLanguageList = ReflectionHelper
+ .findField(net.minecraft.util.StringTranslate.class, "languageList", "field_74816_c");
+ Field fieldStringTranslateInstance = ReflectionHelper
+ .findField(net.minecraft.util.StringTranslate.class, "instance", "field_74817_a");
+ // noinspection unchecked
+ stringTranslateLanguageList = (Map<String, String>) fieldStringTranslateLanguageList
+ .get(fieldStringTranslateInstance.get(null));
} catch (Exception e) {
e.printStackTrace();
}
@@ -92,9 +89,7 @@ public class GT_LanguageManager {
}
Property tProperty = sEnglishFile.get("LanguageFile", aKey.trim(), aEnglish);
if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sEnglishFile.save();
- if (sEnglishFile
- .get("EnableLangFile", "UseThisFileAsLanguageFile", false)
- .getBoolean(false)) {
+ if (sEnglishFile.get("EnableLangFile", "UseThisFileAsLanguageFile", false).getBoolean(false)) {
aEnglish = tProperty.getString();
sUseEnglishFile = true;
}
@@ -216,11 +211,13 @@ public class GT_LanguageManager {
addStringLocalization("Interaction_DESCRIPTION_Index_065", "Emit if 5 Maintenance Needed(inverted)");
addStringLocalization("Interaction_DESCRIPTION_Index_066", "Emit if rotor needs maintenance low accuracy mod");
addStringLocalization(
- "Interaction_DESCRIPTION_Index_067", "Emit if rotor needs maintenance low accuracy mod(inverted)");
+ "Interaction_DESCRIPTION_Index_067",
+ "Emit if rotor needs maintenance low accuracy mod(inverted)");
addStringLocalization("Interaction_DESCRIPTION_Index_068", "Emit if rotor needs maintenance high accuracy mod");
addStringLocalization("Interaction_DESCRIPTION_Index_068.1", "Emit if any Player is close");
addStringLocalization(
- "Interaction_DESCRIPTION_Index_069", "Emit if rotor needs maintenance high accuracy mod(inverted)");
+ "Interaction_DESCRIPTION_Index_069",
+ "Emit if rotor needs maintenance high accuracy mod(inverted)");
addStringLocalization("Interaction_DESCRIPTION_Index_069.1", "Emit if other Player is close");
addStringLocalization("Interaction_DESCRIPTION_Index_070", "Emit if you are close");
addStringLocalization("Interaction_DESCRIPTION_Index_071", "Conducts strongest Input");
@@ -368,7 +365,8 @@ public class GT_LanguageManager {
addStringLocalization("Interaction_DESCRIPTION_Index_204", "No Pollution in Chunk! HAYO!");
addStringLocalization("Interaction_DESCRIPTION_Index_206", "Scan for Assembly Line");
addStringLocalization(
- "Interaction_DESCRIPTION_Index_207", "Pump speed: %dL every %d ticks, %.2f L/sec on average");
+ "Interaction_DESCRIPTION_Index_207",
+ "Pump speed: %dL every %d ticks, %.2f L/sec on average");
addStringLocalization("Interaction_DESCRIPTION_Index_208", " L");
addStringLocalization("Interaction_DESCRIPTION_Index_209", " ticks");
addStringLocalization("Interaction_DESCRIPTION_Index_209.1", " tick");
@@ -385,7 +383,8 @@ public class GT_LanguageManager {
addStringLocalization("Interaction_DESCRIPTION_Index_222", "Fluid threshold");
addStringLocalization("Interaction_DESCRIPTION_Index_222.1", "Energy threshold");
addStringLocalization(
- "Interaction_DESCRIPTION_Index_223", "Single recipe locking enabled. Will lock to next recipe.");
+ "Interaction_DESCRIPTION_Index_223",
+ "Single recipe locking enabled. Will lock to next recipe.");
addStringLocalization("Interaction_DESCRIPTION_Index_224", "Always On");
addStringLocalization("Interaction_DESCRIPTION_Index_225", "Active with Redstone Signal");
addStringLocalization("Interaction_DESCRIPTION_Index_226", "Inactive with Redstone Signal");
@@ -429,7 +428,8 @@ public class GT_LanguageManager {
addStringLocalization("Interaction_DESCRIPTION_Index_262", "Fluid Auto Output Disabled");
addStringLocalization("Interaction_DESCRIPTION_Index_263", "Fluid Auto Output Enabled");
addStringLocalization(
- "Interaction_DESCRIPTION_Index_264", "currently none, will be locked to the next that is put in");
+ "Interaction_DESCRIPTION_Index_264",
+ "currently none, will be locked to the next that is put in");
addStringLocalization("Interaction_DESCRIPTION_Index_265", "1 specific Fluid");
addStringLocalization("Interaction_DESCRIPTION_Index_266", "Lock Fluid Mode Disabled");
addStringLocalization("Interaction_DESCRIPTION_Index_267", "Overflow Voiding Mode Disabled");
diff --git a/src/main/java/gregtech/api/util/GT_Log.java b/src/main/java/gregtech/api/util/GT_Log.java
index 49f44b968b..db7edf7779 100644
--- a/src/main/java/gregtech/api/util/GT_Log.java
+++ b/src/main/java/gregtech/api/util/GT_Log.java
@@ -12,6 +12,7 @@ import java.util.List;
* Just a simple Logging Function. If on Server, then this will point to System.out and System.err
*/
public class GT_Log {
+
public static PrintStream out = System.out;
public static PrintStream err = System.err;
public static PrintStream ore = new LogBuffer();
@@ -23,13 +24,15 @@ public class GT_Log {
public static File mExplosionLog;
public static class LogBuffer extends PrintStream {
+
public final List<String> mBufferedOreDictLog = new ArrayList<String>();
public LogBuffer() {
super(new OutputStream() {
+
@Override
public void write(int arg0) {
- /*Do nothing*/
+ /* Do nothing */
}
});
}
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index f7bfb13cb2..c5060ff93f 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -10,28 +10,6 @@ import static gregtech.api.enums.GT_Values.RA;
import static gregtech.api.enums.GT_Values.V;
import static gregtech.api.enums.GT_Values.W;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.ConfigCategories;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.enums.ItemList;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OreDictNames;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.ToolDictNames;
-import gregtech.api.interfaces.IDamagableItem;
-import gregtech.api.interfaces.IItemContainer;
-import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
-import gregtech.api.objects.GT_HashSet;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.ItemData;
-import ic2.api.item.IBoxable;
-import ic2.api.item.IC2Items;
-import ic2.api.item.IElectricItem;
-import ic2.api.reactor.IReactorComponent;
-import ic2.api.recipe.IRecipeInput;
-import ic2.api.recipe.RecipeInputItemStack;
-import ic2.api.recipe.RecipeOutput;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -44,6 +22,7 @@ import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.EntityLivingBase;
@@ -69,6 +48,29 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.ToolDictNames;
+import gregtech.api.interfaces.IDamagableItem;
+import gregtech.api.interfaces.IItemContainer;
+import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
+import gregtech.api.objects.GT_HashSet;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.ItemData;
+import ic2.api.item.IBoxable;
+import ic2.api.item.IC2Items;
+import ic2.api.item.IElectricItem;
+import ic2.api.reactor.IReactorComponent;
+import ic2.api.recipe.IRecipeInput;
+import ic2.api.recipe.RecipeInputItemStack;
+import ic2.api.recipe.RecipeOutput;
+
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
@@ -77,6 +79,7 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
* Due to the many imports, this File can cause compile Problems if not all the APIs are installed
*/
public class GT_ModHandler {
+
public static final List<IRecipe> sSingleNonBlockDamagableRecipeList = new ArrayList<>(1000);
private static final Map<String, ItemStack> sIC2ItemMap = new HashMap<>();
@@ -103,51 +106,50 @@ public class GT_ModHandler {
private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0);
private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R";
private static final ItemStack[][] sShapes1 = new ItemStack[][] {
- {sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null},
- {sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1},
- {null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1},
- {sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null},
- {sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1},
- {sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1},
- {null, null, null, sMt1, null, sMt1, sMt1, null, sMt1},
- {null, sMt1, null, null, sMt1, null, null, sMt2, null},
- {sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null},
- {null, sMt1, null, null, sMt2, null, null, sMt2, null},
- {sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null},
- {null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null},
- {sMt1, sMt1, null, null, sMt2, null, null, sMt2, null},
- {null, sMt1, sMt1, null, sMt2, null, null, sMt2, null},
- {null, sMt1, null, sMt1, null, null, null, sMt1, sMt2},
- {null, sMt1, null, null, null, sMt1, sMt2, sMt1, null},
- {null, sMt1, null, sMt1, null, sMt1, null, null, sMt2},
- {null, sMt1, null, sMt1, null, sMt1, sMt2, null, null},
- {null, sMt2, null, null, sMt1, null, null, sMt1, null},
- {null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1},
- {null, sMt2, null, null, sMt2, null, null, sMt1, null},
- {null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null},
- {null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1},
- {null, sMt2, null, null, sMt2, null, sMt1, sMt1, null},
- {sMt1, null, null, null, sMt2, null, null, null, sMt2},
- {null, null, sMt1, null, sMt2, null, sMt2, null, null},
- {sMt1, null, null, null, sMt2, null, null, null, null},
- {null, null, sMt1, null, sMt2, null, null, null, null},
- {sMt1, sMt2, null, null, null, null, null, null, null},
- {sMt2, sMt1, null, null, null, null, null, null, null},
- {sMt1, null, null, sMt2, null, null, null, null, null},
- {sMt2, null, null, sMt1, null, null, null, null, null},
- {sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null},
- {sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null},
- {null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1},
- {null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1},
- {sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null},
- {sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null},
- {null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1},
- {null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1},
- {sMt1, null, null, null, sMt1, null, null, null, null},
- {null, sMt1, null, sMt1, null, null, null, null, null},
- {sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null},
- {null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2}
- };
+ { sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null },
+ { sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1 },
+ { null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1 },
+ { sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null },
+ { sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 },
+ { sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1 },
+ { null, null, null, sMt1, null, sMt1, sMt1, null, sMt1 },
+ { null, sMt1, null, null, sMt1, null, null, sMt2, null },
+ { sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null },
+ { null, sMt1, null, null, sMt2, null, null, sMt2, null },
+ { sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null },
+ { null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null },
+ { sMt1, sMt1, null, null, sMt2, null, null, sMt2, null },
+ { null, sMt1, sMt1, null, sMt2, null, null, sMt2, null },
+ { null, sMt1, null, sMt1, null, null, null, sMt1, sMt2 },
+ { null, sMt1, null, null, null, sMt1, sMt2, sMt1, null },
+ { null, sMt1, null, sMt1, null, sMt1, null, null, sMt2 },
+ { null, sMt1, null, sMt1, null, sMt1, sMt2, null, null },
+ { null, sMt2, null, null, sMt1, null, null, sMt1, null },
+ { null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1 },
+ { null, sMt2, null, null, sMt2, null, null, sMt1, null },
+ { null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null },
+ { null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1 },
+ { null, sMt2, null, null, sMt2, null, sMt1, sMt1, null },
+ { sMt1, null, null, null, sMt2, null, null, null, sMt2 },
+ { null, null, sMt1, null, sMt2, null, sMt2, null, null },
+ { sMt1, null, null, null, sMt2, null, null, null, null },
+ { null, null, sMt1, null, sMt2, null, null, null, null },
+ { sMt1, sMt2, null, null, null, null, null, null, null },
+ { sMt2, sMt1, null, null, null, null, null, null, null },
+ { sMt1, null, null, sMt2, null, null, null, null, null },
+ { sMt2, null, null, sMt1, null, null, null, null, null },
+ { sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null },
+ { sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null },
+ { null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1 },
+ { null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 },
+ { sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null },
+ { sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null },
+ { null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1 },
+ { null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1 },
+ { sMt1, null, null, null, sMt1, null, null, null, null },
+ { null, sMt1, null, sMt1, null, null, null, null, null },
+ { sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null },
+ { null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2 } };
public static List<Integer> sSingleNonBlockDamagableRecipeList_validsShapes1 = new ArrayList<>(44);
public static boolean sSingleNonBlockDamagableRecipeList_validsShapes1_update = false;
public static List<Integer> sSingleNonBlockDamagableRecipeList_warntOutput = new ArrayList<>(50);
@@ -304,7 +306,9 @@ public class GT_ModHandler {
}
/**
- * @param aValue the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid Mojang...
+ * @param aValue the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767
+ * (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it
+ * properly, stupid Mojang...
*/
public static ItemStack setFuelValue(ItemStack aStack, short aValue) {
aStack.setTagCompound(GT_Utility.getNBTContainingShort(aStack.getTagCompound(), "GT.ItemFuelValue", aValue));
@@ -312,7 +316,9 @@ public class GT_ModHandler {
}
/**
- * @return the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid Mojang...
+ * @return the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that
+ * is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid
+ * Mojang...
*/
public static int getFuelValue(ItemStack aStack) {
return TileEntityFurnace.getItemBurnTime(aStack);
@@ -341,19 +347,19 @@ public class GT_ModHandler {
public static ItemStack getIC2Item(String aItem, long aAmount, ItemStack aReplacement) {
if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) return null;
// if (D1) GT_Log.out.println("Requested the Item '" + aItem + "' from the IC2-API");
- if (!sIC2ItemMap.containsKey(aItem))
- try {
- ItemStack tStack = IC2Items.getItem(aItem);
- sIC2ItemMap.put(aItem, tStack);
- if (tStack == null && D1) GT_Log.err.println(aItem + " is not found in the IC2 Items!");
- } catch (Throwable e) {
- /*Do nothing*/
- }
+ if (!sIC2ItemMap.containsKey(aItem)) try {
+ ItemStack tStack = IC2Items.getItem(aItem);
+ sIC2ItemMap.put(aItem, tStack);
+ if (tStack == null && D1) GT_Log.err.println(aItem + " is not found in the IC2 Items!");
+ } catch (Throwable e) {
+ /* Do nothing */
+ }
return GT_Utility.copyAmount(aAmount, sIC2ItemMap.get(aItem), aReplacement);
}
/**
- * Gets an Item from IndustrialCraft, but the Damage Value can be specified, and returns a Replacement Item with the same Damage if not possible
+ * Gets an Item from IndustrialCraft, but the Damage Value can be specified, and returns a Replacement Item with the
+ * same Damage if not possible
*/
public static ItemStack getIC2Item(String aItem, long aAmount, int aMeta, ItemStack aReplacement) {
ItemStack rStack = getIC2Item(aItem, aAmount, aReplacement);
@@ -402,7 +408,8 @@ public class GT_ModHandler {
}
/**
- * Gets an Item from the specified mod, but the Damage Value can be specified, and returns a Replacement Item with the same Damage if not possible
+ * Gets an Item from the specified mod, but the Damage Value can be specified, and returns a Replacement Item with
+ * the same Damage if not possible
*/
public static ItemStack getModItem(String aModID, String aItem, long aAmount, int aMeta, ItemStack aReplacement) {
ItemStack rStack = getModItem(aModID, aItem, aAmount, aReplacement);
@@ -438,11 +445,10 @@ public class GT_ModHandler {
public static boolean addValuableOre(Block aBlock, int aMeta, int aValue) {
if (aValue <= 0) return false;
try {
- Class.forName("ic2.core.IC2")
- .getMethod("addValuableOre", IRecipeInput.class, int.class)
+ Class.forName("ic2.core.IC2").getMethod("addValuableOre", IRecipeInput.class, int.class)
.invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return true;
}
@@ -475,7 +481,7 @@ public class GT_ModHandler {
GT_Utility.copyOrNull(aOutput),
aChance);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return true;
}
@@ -488,7 +494,7 @@ public class GT_ModHandler {
try {
ic2.api.recipe.Recipes.recyclerBlacklist.add(new RecipeInputItemStack(aRecycledStack));
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return true;
}
@@ -513,10 +519,8 @@ public class GT_ModHandler {
if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = true;
return (RA.addAlloySmelterRecipe(
aInput,
- OrePrefixes.ingot.contains(aOutput)
- ? ItemList.Shape_Mold_Ingot.get(0)
- : OrePrefixes.block.contains(aOutput)
- ? ItemList.Shape_Mold_Block.get(0)
+ OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0)
+ : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0)
: OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null,
aOutput,
130,
@@ -527,24 +531,24 @@ public class GT_ModHandler {
/**
* LiquidTransposer Recipe for both directions
*/
- public static boolean addLiquidTransposerRecipe(
- ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) {
+ public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid,
+ ItemStack aFullContainer, int aMJ) {
return true;
}
/**
* LiquidTransposer Recipe for filling Containers
*/
- public static boolean addLiquidTransposerFillRecipe(
- ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) {
+ public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid,
+ ItemStack aFullContainer, int aMJ) {
return true;
}
/**
* LiquidTransposer Recipe for emptying Containers
*/
- public static boolean addLiquidTransposerEmptyRecipe(
- ItemStack aFullContainer, FluidStack aLiquid, ItemStack aEmptyContainer, int aMJ) {
+ public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid,
+ ItemStack aEmptyContainer, int aMJ) {
return true;
}
@@ -575,8 +579,8 @@ public class GT_ModHandler {
return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, false);
}
- public static boolean addPulverisationRecipe(
- ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance) {
+ public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
+ int aChance) {
return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false);
}
@@ -584,27 +588,21 @@ public class GT_ModHandler {
return addPulverisationRecipe(aInput, aOutput1, null, 0, aOverwrite);
}
- public static boolean addPulverisationRecipe(
- ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, boolean aOverwrite) {
+ public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
+ boolean aOverwrite) {
return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite);
}
- public static boolean addPulverisationRecipe(
- ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, boolean aOverwrite) {
+ public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance,
+ boolean aOverwrite) {
return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite);
}
/**
* Adds Several Pulverizer-Type Recipes.
*/
- public static boolean addPulverisationRecipe(
- ItemStack aInput,
- ItemStack aOutput1,
- ItemStack aOutput2,
- int aChance2,
- ItemStack aOutput3,
- int aChance3,
- boolean aOverwrite) {
+ public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2,
+ ItemStack aOutput3, int aChance3, boolean aOverwrite) {
aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
aOutput2 = GT_OreDictUnificator.get(true, aOutput2);
if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false;
@@ -612,16 +610,16 @@ public class GT_ModHandler {
if (GT_Utility.getContainerItem(aInput, false) == null) {
RA.addPulveriserRecipe(
aInput,
- new ItemStack[] {aOutput1, aOutput2, aOutput3},
- new int[] {10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3},
+ new ItemStack[] { aOutput1, aOutput2, aOutput3 },
+ new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 },
400,
2);
}
return true;
}
- public static boolean addPulverisationRecipe(
- ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray, int aEUt, int aRecipeDurationInTicks) {
+ public static boolean addPulverisationRecipe(ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray,
+ int aEUt, int aRecipeDurationInTicks) {
ItemStack[] aUnifiedOutputArray = new ItemStack[aOutputArray.length];
int counter = 0;
@@ -636,13 +634,13 @@ public class GT_ModHandler {
return true;
}
- public static boolean addImmersiveEngineeringRecipe(
- ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, ItemStack aOutput3, int aChance3) {
+ public static boolean addImmersiveEngineeringRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2,
+ int aChance2, ItemStack aOutput3, int aChance3) {
return true;
}
- public static boolean addMagneticraftRecipe(
- ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, ItemStack aOutput3, int aChance3) {
+ public static boolean addMagneticraftRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2,
+ ItemStack aOutput3, int aChance3) {
return true;
}
@@ -656,13 +654,8 @@ public class GT_ModHandler {
/**
* Induction Smelter Recipes and Alloy Smelter Recipes
*/
- public static boolean addAlloySmelterRecipe(
- ItemStack aInput1,
- ItemStack aInput2,
- ItemStack aOutput1,
- int aDuration,
- int aEUt,
- boolean aAllowSecondaryInputEmpty) {
+ public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration,
+ int aEUt, boolean aAllowSecondaryInputEmpty) {
if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false;
aOutput1 = GT_OreDictUnificator.get(true, aOutput1);
return RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt);
@@ -671,8 +664,8 @@ public class GT_ModHandler {
/**
* Induction Smelter Recipes for TE
*/
- public static boolean addInductionSmelterRecipe(
- ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aEnergy, int aChance) {
+ public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1,
+ ItemStack aOutput2, int aEnergy, int aChance) {
return true;
}
@@ -689,11 +682,8 @@ public class GT_ModHandler {
/**
* Adds GT versions of the IC2 recipes from the supplied IC2RecipeList.
*/
- public static void addIC2RecipesToGT(
- Map<IRecipeInput, RecipeOutput> aIC2RecipeList,
- GT_Recipe.GT_Recipe_Map aGTRecipeMap,
- boolean aAddGTRecipe,
- boolean aRemoveIC2Recipe,
+ public static void addIC2RecipesToGT(Map<IRecipeInput, RecipeOutput> aIC2RecipeList,
+ GT_Recipe.GT_Recipe_Map aGTRecipeMap, boolean aAddGTRecipe, boolean aRemoveIC2Recipe,
boolean aExcludeGTIC2Items) {
Map<ItemStack, ItemStack> aRecipesToRemove = new HashMap<>();
for (Entry<IRecipeInput, RecipeOutput> iRecipeInputRecipeOutputEntry : aIC2RecipeList.entrySet()) {
@@ -703,11 +693,10 @@ public class GT_ModHandler {
if (aAddGTRecipe
&& (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) {
try {
- if (aExcludeGTIC2Items
- && ((tStack.getUnlocalizedName().contains("gt.metaitem.01")
- || tStack.getUnlocalizedName().contains("gt.blockores")
- || tStack.getUnlocalizedName().contains("ic2.itemCrushed")
- || tStack.getUnlocalizedName().contains("ic2.itemPurifiedCrushed"))))
+ if (aExcludeGTIC2Items && ((tStack.getUnlocalizedName().contains("gt.metaitem.01")
+ || tStack.getUnlocalizedName().contains("gt.blockores")
+ || tStack.getUnlocalizedName().contains("ic2.itemCrushed")
+ || tStack.getUnlocalizedName().contains("ic2.itemPurifiedCrushed"))))
continue;
switch (aGTRecipeMap.mUnlocalizedName) {
case "gt.recipe.macerator":
@@ -715,16 +704,10 @@ public class GT_ModHandler {
case "gt.recipe.compressor":
aGTRecipeMap.addRecipe(
true,
- new ItemStack[] {
- GT_Utility.copyAmount(
- iRecipeInputRecipeOutputEntry
- .getKey()
- .getAmount(),
- tStack)
- },
- iRecipeInputRecipeOutputEntry
- .getValue()
- .items
+ new ItemStack[] { GT_Utility.copyAmount(
+ iRecipeInputRecipeOutputEntry.getKey().getAmount(),
+ tStack) },
+ iRecipeInputRecipeOutputEntry.getValue().items
.toArray(new ItemStack[0]),
null,
null,
@@ -737,16 +720,10 @@ public class GT_ModHandler {
case "gt.recipe.thermalcentrifuge":
aGTRecipeMap.addRecipe(
true,
- new ItemStack[] {
- GT_Utility.copyAmount(
- iRecipeInputRecipeOutputEntry
- .getKey()
- .getAmount(),
- tStack)
- },
- iRecipeInputRecipeOutputEntry
- .getValue()
- .items
+ new ItemStack[] { GT_Utility.copyAmount(
+ iRecipeInputRecipeOutputEntry.getKey().getAmount(),
+ tStack) },
+ iRecipeInputRecipeOutputEntry.getValue().items
.toArray(new ItemStack[0]),
null,
null,
@@ -762,12 +739,7 @@ public class GT_ModHandler {
}
}
if (aRemoveIC2Recipe)
- aRecipesToRemove.put(
- tStack,
- iRecipeInputRecipeOutputEntry
- .getValue()
- .items
- .get(0));
+ aRecipesToRemove.put(tStack, iRecipeInputRecipeOutputEntry.getValue().items.get(0));
}
}
}
@@ -779,7 +751,7 @@ public class GT_ModHandler {
try {
return ic2.api.recipe.Recipes.extractor.getRecipes();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return sExtractorRecipes;
}
@@ -788,7 +760,7 @@ public class GT_ModHandler {
try {
return ic2.api.recipe.Recipes.compressor.getRecipes();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return sCompressorRecipes;
}
@@ -797,7 +769,7 @@ public class GT_ModHandler {
try {
return ic2.api.recipe.Recipes.macerator.getRecipes();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return sMaceratorRecipes;
}
@@ -806,7 +778,7 @@ public class GT_ModHandler {
try {
return ic2.api.recipe.Recipes.centrifuge.getRecipes();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return sThermalCentrifugeRecipes;
}
@@ -815,7 +787,7 @@ public class GT_ModHandler {
try {
return ic2.api.recipe.Recipes.oreWashing.getRecipes();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return sOreWashingRecipes;
}
@@ -824,7 +796,7 @@ public class GT_ModHandler {
try {
return ic2.api.recipe.Recipes.matterAmplifier.getRecipes();
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return sMassfabRecipes;
}
@@ -936,9 +908,15 @@ public class GT_ModHandler {
NBTTagCompound tNBT = new NBTTagCompound();
tNBT.setInteger("amplification", aValue);
GT_Utility.callMethod(
- ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT);
+ ic2.api.recipe.Recipes.matterAmplifier,
+ "addRecipe",
+ false,
+ false,
+ false,
+ aAmplifier,
+ tNBT);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return true;
}
@@ -950,8 +928,7 @@ public class GT_ModHandler {
aResult = GT_OreDictUnificator.get(true, aResult);
if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false;
try {
- mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine
- .getRecipeList()
+ mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList()
.add(new ShapedOreRecipe(GT_Utility.copyOrNull(aResult), aRecipe));
} catch (Throwable e) {
return addCraftingRecipe(GT_Utility.copyOrNull(aResult), aRecipe);
@@ -974,8 +951,8 @@ public class GT_ModHandler {
/**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/
- public static boolean addCraftingRecipe(
- ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) {
+ public static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded,
+ int[] aEnchantmentLevelsAdded, Object[] aRecipe) {
return addCraftingRecipe(
aResult,
aEnchantmentsAdded,
@@ -999,25 +976,19 @@ public class GT_ModHandler {
/**
* Regular Crafting Recipes. Deletes conflicting Recipes too.
* <p/>
- * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" on them.
+ * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)"
+ * on them.
* <p/>
* Enums are automatically getting their "name()"-Method called in order to deliver an OreDict String.
* <p/>
* Lowercase Letters are reserved for Tools. They are as follows:
* <p/>
- * 'b' ToolDictNames.craftingToolBlade
- * 'c' ToolDictNames.craftingToolCrowbar,
- * 'd' ToolDictNames.craftingToolScrewdriver,
- * 'f' ToolDictNames.craftingToolFile,
- * 'h' ToolDictNames.craftingToolHardHammer,
- * 'i' ToolDictNames.craftingToolSolderingIron,
- * 'j' ToolDictNames.craftingToolSolderingMetal,
- * 'k' ToolDictNames.craftingToolKnive
- * 'm' ToolDictNames.craftingToolMortar,
- * 'p' ToolDictNames.craftingToolDrawplate,
- * 'r' ToolDictNames.craftingToolSoftHammer,
- * 's' ToolDictNames.craftingToolSaw,
- * 'w' ToolDictNames.craftingToolWrench,
+ * 'b' ToolDictNames.craftingToolBlade 'c' ToolDictNames.craftingToolCrowbar, 'd'
+ * ToolDictNames.craftingToolScrewdriver, 'f' ToolDictNames.craftingToolFile, 'h'
+ * ToolDictNames.craftingToolHardHammer, 'i' ToolDictNames.craftingToolSolderingIron, 'j'
+ * ToolDictNames.craftingToolSolderingMetal, 'k' ToolDictNames.craftingToolKnive 'm'
+ * ToolDictNames.craftingToolMortar, 'p' ToolDictNames.craftingToolDrawplate, 'r'
+ * ToolDictNames.craftingToolSoftHammer, 's' ToolDictNames.craftingToolSaw, 'w' ToolDictNames.craftingToolWrench,
* 'x' ToolDictNames.craftingToolWireCutter,
*/
public static boolean addCraftingRecipe(ItemStack aResult, Object[] aRecipe) {
@@ -1027,25 +998,19 @@ public class GT_ModHandler {
/**
* Regular Crafting Recipes. Deletes conflicting Recipes too.
* <p/>
- * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" on them.
+ * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)"
+ * on them.
* <p/>
* Enums are automatically getting their "name()"-Method called in order to deliver an OreDict String.
* <p/>
* Lowercase Letters are reserved for Tools. They are as follows:
* <p/>
- * 'b' ToolDictNames.craftingToolBlade
- * 'c' ToolDictNames.craftingToolCrowbar,
- * 'd' ToolDictNames.craftingToolScrewdriver,
- * 'f' ToolDictNames.craftingToolFile,
- * 'h' ToolDictNames.craftingToolHardHammer,
- * 'i' ToolDictNames.craftingToolSolderingIron,
- * 'j' ToolDictNames.craftingToolSolderingMetal,
- * 'k' ToolDictNames.craftingToolKnive
- * 'm' ToolDictNames.craftingToolMortar,
- * 'p' ToolDictNames.craftingToolDrawplate,
- * 'r' ToolDictNames.craftingToolSoftHammer,
- * 's' ToolDictNames.craftingToolSaw,
- * 'w' ToolDictNames.craftingToolWrench,
+ * 'b' ToolDictNames.craftingToolBlade 'c' ToolDictNames.craftingToolCrowbar, 'd'
+ * ToolDictNames.craftingToolScrewdriver, 'f' ToolDictNames.craftingToolFile, 'h'
+ * ToolDictNames.craftingToolHardHammer, 'i' ToolDictNames.craftingToolSolderingIron, 'j'
+ * ToolDictNames.craftingToolSolderingMetal, 'k' ToolDictNames.craftingToolKnive 'm'
+ * ToolDictNames.craftingToolMortar, 'p' ToolDictNames.craftingToolDrawplate, 'r'
+ * ToolDictNames.craftingToolSoftHammer, 's' ToolDictNames.craftingToolSaw, 'w' ToolDictNames.craftingToolWrench,
* 'x' ToolDictNames.craftingToolWireCutter,
*/
public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) {
@@ -1072,24 +1037,12 @@ public class GT_ModHandler {
/**
* Internal realisation of the Crafting Recipe adding Process.
*/
- private static boolean addCraftingRecipe(
- ItemStack aResult,
- Enchantment[] aEnchantmentsAdded,
- int[] aEnchantmentLevelsAdded,
- boolean aMirrored,
- boolean aBuffered,
- boolean aKeepNBT,
- boolean aDismantleable,
- boolean aRemovable,
- boolean aReversible,
- boolean aRemoveAllOthersWithSameOutput,
- boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT,
- boolean aRemoveAllOtherShapedsWithSameOutput,
- boolean aRemoveAllOtherNativeRecipes,
- boolean aCheckForCollisions,
- boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis,
- boolean aOnlyAddIfResultIsNotNull,
- Object[] aRecipe) {
+ private static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded,
+ int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT,
+ boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput,
+ boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput,
+ boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions,
+ boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) {
aResult = GT_OreDictUnificator.get(true, aResult);
if (aOnlyAddIfResultIsNotNull && aResult == null) return false;
if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0);
@@ -1101,11 +1054,11 @@ public class GT_ModHandler {
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1);
else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name();
- else if (!(aRecipe[i] == null
- || aRecipe[i] instanceof ItemStack
+ else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack
|| aRecipe[i] instanceof ItemData
|| aRecipe[i] instanceof String
- || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString();
+ || aRecipe[i] instanceof Character))
+ aRecipe[i] = aRecipe[i].toString();
}
try {
@@ -1199,8 +1152,9 @@ public class GT_ModHandler {
for (; idx < aRecipe.length; idx += 2) {
if (aRecipe[idx] == null || aRecipe[idx + 1] == null) {
if (D1) {
- GT_Log.err.println("WARNING: Missing Item for shaped Recipe: "
- + (aResult == null ? "null" : aResult.getDisplayName()));
+ GT_Log.err.println(
+ "WARNING: Missing Item for shaped Recipe: "
+ + (aResult == null ? "null" : aResult.getDisplayName()));
for (Object tContent : aRecipe) GT_Log.err.println(tContent);
}
return false;
@@ -1281,23 +1235,19 @@ public class GT_ModHandler {
if (aResult == null || aResult.stackSize <= 0) return false;
- if (aRemoveAllOthersWithSameOutput
- || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT
+ if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT
|| aRemoveAllOtherShapedsWithSameOutput
|| aRemoveAllOtherNativeRecipes) {
- if (tDoWeCareIfThereWasARecipe || !aBuffered)
- tThereWasARecipe = removeRecipeByOutput(
- aResult,
- !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT,
- aRemoveAllOtherShapedsWithSameOutput,
- aRemoveAllOtherNativeRecipes)
- || tThereWasARecipe;
+ if (tDoWeCareIfThereWasARecipe || !aBuffered) tThereWasARecipe = removeRecipeByOutput(
+ aResult,
+ !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT,
+ aRemoveAllOtherShapedsWithSameOutput,
+ aRemoveAllOtherNativeRecipes) || tThereWasARecipe;
else removeRecipeByOutputDelayed(aResult);
}
if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tDoWeCareIfThereWasARecipe && !tThereWasARecipe) {
- ArrayList<IRecipe> tList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
int tList_sS = tList.size();
for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) {
IRecipe tRecipe = tList.get(i);
@@ -1316,26 +1266,24 @@ public class GT_ModHandler {
GT_Utility.updateItemStack(aResult);
if (tThereWasARecipe || !aOnlyAddIfThereIsAnyRecipeOutputtingThis) {
- if (sBufferCraftingRecipes && aBuffered)
- sBufferRecipeList.add(new GT_Shaped_Recipe(
- GT_Utility.copyOrNull(aResult),
- aDismantleable,
- aRemovable,
- aKeepNBT,
- aEnchantmentsAdded,
- aEnchantmentLevelsAdded,
- aRecipe)
- .setMirrored(aMirrored));
- else
- GameRegistry.addRecipe(new GT_Shaped_Recipe(
- GT_Utility.copyOrNull(aResult),
- aDismantleable,
- aRemovable,
- aKeepNBT,
- aEnchantmentsAdded,
- aEnchantmentLevelsAdded,
- aRecipe)
- .setMirrored(aMirrored));
+ if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add(
+ new GT_Shaped_Recipe(
+ GT_Utility.copyOrNull(aResult),
+ aDismantleable,
+ aRemovable,
+ aKeepNBT,
+ aEnchantmentsAdded,
+ aEnchantmentLevelsAdded,
+ aRecipe).setMirrored(aMirrored));
+ else GameRegistry.addRecipe(
+ new GT_Shaped_Recipe(
+ GT_Utility.copyOrNull(aResult),
+ aDismantleable,
+ aRemovable,
+ aKeepNBT,
+ aEnchantmentsAdded,
+ aEnchantmentLevelsAdded,
+ aRecipe).setMirrored(aMirrored));
}
return true;
}
@@ -1343,10 +1291,17 @@ public class GT_ModHandler {
/**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/
- public static boolean addShapelessEnchantingRecipe(
- ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) {
+ public static boolean addShapelessEnchantingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded,
+ int[] aEnchantmentLevelsAdded, Object[] aRecipe) {
return addShapelessCraftingRecipe(
- aResult, aEnchantmentsAdded, aEnchantmentLevelsAdded, true, false, false, false, aRecipe);
+ aResult,
+ aEnchantmentsAdded,
+ aEnchantmentLevelsAdded,
+ true,
+ false,
+ false,
+ false,
+ aRecipe);
}
/**
@@ -1354,7 +1309,9 @@ public class GT_ModHandler {
*/
public static boolean addShapelessCraftingRecipe(ItemStack aResult, Object[] aRecipe) {
return addShapelessCraftingRecipe(
- aResult, RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, aRecipe);
+ aResult,
+ RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED,
+ aRecipe);
}
/**
@@ -1375,33 +1332,27 @@ public class GT_ModHandler {
/**
* Shapeless Crafting Recipes. Deletes conflicting Recipes too.
*/
- private static boolean addShapelessCraftingRecipe(
- ItemStack aResult,
- Enchantment[] aEnchantmentsAdded,
- int[] aEnchantmentLevelsAdded,
- boolean aBuffered,
- boolean aKeepNBT,
- boolean aDismantleable,
- boolean aRemovable,
- Object[] aRecipe) {
+ private static boolean addShapelessCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded,
+ int[] aEnchantmentLevelsAdded, boolean aBuffered, boolean aKeepNBT, boolean aDismantleable,
+ boolean aRemovable, Object[] aRecipe) {
aResult = GT_OreDictUnificator.get(true, aResult);
if (aRecipe == null || aRecipe.length <= 0) return false;
for (byte i = 0; i < aRecipe.length; i++) {
if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1);
else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name();
- else if (!(aRecipe[i] == null
- || aRecipe[i] instanceof ItemStack
+ else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack
|| aRecipe[i] instanceof String
- || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString();
+ || aRecipe[i] instanceof Character))
+ aRecipe[i] = aRecipe[i].toString();
}
try {
ItemStack[] tRecipe = new ItemStack[9];
int i = 0;
for (Object tObject : aRecipe) {
if (tObject == null) {
- if (D1)
- GT_Log.err.println("WARNING: Missing Item for shapeless Recipe: "
- + (aResult == null ? "null" : aResult.getDisplayName()));
+ if (D1) GT_Log.err.println(
+ "WARNING: Missing Item for shapeless Recipe: "
+ + (aResult == null ? "null" : aResult.getDisplayName()));
for (Object tContent : aRecipe) GT_Log.err.println(tContent);
return false;
}
@@ -1426,24 +1377,24 @@ public class GT_ModHandler {
GT_Utility.updateItemStack(aResult);
- if (sBufferCraftingRecipes && aBuffered)
- sBufferRecipeList.add(new GT_Shapeless_Recipe(
- GT_Utility.copyOrNull(aResult),
- aDismantleable,
- aRemovable,
- aKeepNBT,
- aEnchantmentsAdded,
- aEnchantmentLevelsAdded,
- aRecipe));
- else
- GameRegistry.addRecipe(new GT_Shapeless_Recipe(
- GT_Utility.copyOrNull(aResult),
- aDismantleable,
- aRemovable,
- aKeepNBT,
- aEnchantmentsAdded,
- aEnchantmentLevelsAdded,
- aRecipe));
+ if (sBufferCraftingRecipes && aBuffered) sBufferRecipeList.add(
+ new GT_Shapeless_Recipe(
+ GT_Utility.copyOrNull(aResult),
+ aDismantleable,
+ aRemovable,
+ aKeepNBT,
+ aEnchantmentsAdded,
+ aEnchantmentLevelsAdded,
+ aRecipe));
+ else GameRegistry.addRecipe(
+ new GT_Shapeless_Recipe(
+ GT_Utility.copyOrNull(aResult),
+ aDismantleable,
+ aRemovable,
+ aKeepNBT,
+ aEnchantmentsAdded,
+ aEnchantmentLevelsAdded,
+ aRecipe));
return true;
}
@@ -1467,10 +1418,8 @@ public class GT_ModHandler {
*/
public static boolean removeFurnaceSmeltingByOutput(ItemStack aOutput) {
if (aOutput != null) {
- return FurnaceRecipes.smelting()
- .getSmeltingList()
- .values()
- .removeIf(tOutput -> GT_Utility.isStackValid(tOutput)
+ return FurnaceRecipes.smelting().getSmeltingList().values().removeIf(
+ tOutput -> GT_Utility.isStackValid(tOutput)
&& GT_Utility.areStacksEqual(aOutput, (ItemStack) tOutput, true));
}
return false;
@@ -1487,24 +1436,21 @@ public class GT_ModHandler {
if (Arrays.stream(aRecipe).noneMatch(Objects::nonNull)) return null;
ItemStack rReturn = null;
- InventoryCrafting aCrafting = new InventoryCrafting(
- new Container() {
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return false;
- }
- },
- 3,
- 3);
+ InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return false;
+ }
+ }, 3, 3);
for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
- ArrayList<IRecipe> tList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
int tList_sS = tList.size();
try {
for (int i = 0; i < tList_sS; i++) {
for (; i < tList_sS; i++) {
if ((!(tList.get(i) instanceof IGT_CraftingRecipe)
- || ((IGT_CraftingRecipe) tList.get(i)).isRemovable())
+ || ((IGT_CraftingRecipe) tList.get(i)).isRemovable())
&& tList.get(i).matches(aCrafting, DW)) {
rReturn = tList.get(i).getCraftingResult(aCrafting);
if (rReturn != null) tList.remove(i--);
@@ -1527,32 +1473,26 @@ public class GT_ModHandler {
if (aRecipe == null) return;
if (Arrays.stream(aRecipe).noneMatch(Objects::nonNull)) return;
- InventoryCrafting aCrafting = new InventoryCrafting(
- new Container() {
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return false;
- }
- },
- 3,
- 3);
+ InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return false;
+ }
+ }, 3, 3);
for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
delayedRemovalByRecipe.add(aCrafting);
}
@SuppressWarnings("unchecked")
public static void bulkRemoveByRecipe(List<InventoryCrafting> toRemove) {
- ArrayList<IRecipe> tList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
GT_FML_LOGGER.info("BulkRemoveByRecipe: tList: " + tList.size() + " toRemove: " + toRemove.size());
- Set<IRecipe> tListToRemove = tList.parallelStream()
- .filter(tRecipe -> {
- if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable())
- return false;
- return toRemove.stream().anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW));
- })
- .collect(Collectors.toSet());
+ Set<IRecipe> tListToRemove = tList.parallelStream().filter(tRecipe -> {
+ if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) return false;
+ return toRemove.stream().anyMatch(aCrafting -> tRecipe.matches(aCrafting, DW));
+ }).collect(Collectors.toSet());
tList.removeIf(tListToRemove::contains);
}
@@ -1562,11 +1502,8 @@ public class GT_ModHandler {
else return removeRecipeByOutput(aOutput);
}
- public static boolean removeRecipeByOutputDelayed(
- ItemStack aOutput,
- boolean aIgnoreNBT,
- boolean aNotRemoveShapelessRecipes,
- boolean aOnlyRemoveNativeHandlers) {
+ public static boolean removeRecipeByOutputDelayed(ItemStack aOutput, boolean aIgnoreNBT,
+ boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) {
if (sBufferCraftingRecipes && (aIgnoreNBT && !aNotRemoveShapelessRecipes && !aOnlyRemoveNativeHandlers))
// Too lazy to handle deferred versions of the parameters that aren't used very often
return delayedRemovalByOutput.add(aOutput);
@@ -1583,21 +1520,18 @@ public class GT_ModHandler {
* @param aOutput The output of the Recipe.
* @return if it has removed at least one Recipe.
*/
- public static boolean removeRecipeByOutput(
- ItemStack aOutput,
- boolean aIgnoreNBT,
- boolean aNotRemoveShapelessRecipes,
- boolean aOnlyRemoveNativeHandlers) {
+ public static boolean removeRecipeByOutput(ItemStack aOutput, boolean aIgnoreNBT,
+ boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers) {
if (aOutput == null) return false;
boolean rReturn = false;
- ArrayList<IRecipe> tList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
aOutput = GT_OreDictUnificator.get(aOutput);
int tList_sS = tList.size();
for (int i = 0; i < tList_sS; i++) {
IRecipe tRecipe = tList.get(i);
if (aNotRemoveShapelessRecipes
- && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) continue;
+ && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe))
+ continue;
if (aOnlyRemoveNativeHandlers) {
if (!sNativeRecipeClasses.contains(tRecipe.getClass().getName())) continue;
} else {
@@ -1615,31 +1549,26 @@ public class GT_ModHandler {
}
public static boolean bulkRemoveRecipeByOutput(List<ItemStack> toRemove) {
- ArrayList<IRecipe> tList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
- Set<ItemStack> setToRemove =
- toRemove.parallelStream().map(GT_OreDictUnificator::get_nocopy).collect(Collectors.toSet());
+ Set<ItemStack> setToRemove = toRemove.parallelStream().map(GT_OreDictUnificator::get_nocopy)
+ .collect(Collectors.toSet());
GT_FML_LOGGER.info("BulkRemoveRecipeByOutput: tList: " + tList.size() + " setToRemove: " + setToRemove.size());
- Set<IRecipe> tListToRemove = tList.parallelStream()
- .filter(tRecipe -> {
- if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable())
- return false;
- if (sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) return false;
- final ItemStack tStack = GT_OreDictUnificator.get_nocopy(tRecipe.getRecipeOutput());
- return setToRemove.stream().anyMatch(aOutput -> GT_Utility.areStacksEqual(tStack, aOutput, true));
- })
- .collect(Collectors.toSet());
+ Set<IRecipe> tListToRemove = tList.parallelStream().filter(tRecipe -> {
+ if ((tRecipe instanceof IGT_CraftingRecipe) && !((IGT_CraftingRecipe) tRecipe).isRemovable()) return false;
+ if (sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) return false;
+ final ItemStack tStack = GT_OreDictUnificator.get_nocopy(tRecipe.getRecipeOutput());
+ return setToRemove.stream().anyMatch(aOutput -> GT_Utility.areStacksEqual(tStack, aOutput, true));
+ }).collect(Collectors.toSet());
tList.removeIf(tListToRemove::contains);
return true;
}
/**
- * Checks all Crafting Handlers for Recipe Output
- * Used for the Autocrafting Table
+ * Checks all Crafting Handlers for Recipe Output Used for the Autocrafting Table
*/
public static ItemStack getAllRecipeOutput(World aWorld, ItemStack... aRecipe) {
if (aRecipe == null || aRecipe.length == 0) return null;
@@ -1654,15 +1583,13 @@ public class GT_ModHandler {
}
}
if (!temp) return null;
- InventoryCrafting aCrafting = new InventoryCrafting(
- new Container() {
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return false;
- }
- },
- 3,
- 3);
+ InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return false;
+ }
+ }, 3, 3);
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
List<IRecipe> tList = CraftingManager.getInstance().getRecipeList();
synchronized (sAllRecipeList) {
@@ -1695,12 +1622,10 @@ public class GT_ModHandler {
if (tIndex == 2) {
assert tStack1 != null && tStack2 != null;
- if (tStack1.getItem() == tStack2.getItem()
- && tStack1.stackSize == 1
+ if (tStack1.getItem() == tStack2.getItem() && tStack1.stackSize == 1
&& tStack2.stackSize == 1
&& tStack1.getItem().isRepairable()) {
- int tNewDamage = tStack1.getMaxDamage()
- + tStack1.getItemDamage()
+ int tNewDamage = tStack1.getMaxDamage() + tStack1.getItemDamage()
- tStack2.getItemDamage()
+ tStack1.getMaxDamage() / 20;
return new ItemStack(tStack1.getItem(), 1, tNewDamage < 0 ? 0 : tNewDamage);
@@ -1711,8 +1636,7 @@ public class GT_ModHandler {
}
/**
- * Gives you a copy of the Output from a Crafting Recipe
- * Used for Recipe Detection.
+ * Gives you a copy of the Output from a Crafting Recipe Used for Recipe Detection.
*/
public static ItemStack getRecipeOutput(ItemStack... aRecipe) {
return getRecipeOutput(false, true, aRecipe);
@@ -1727,25 +1651,21 @@ public class GT_ModHandler {
}
/**
- * Gives you a copy of the Output from a Crafting Recipe
- * Used for Recipe Detection.
+ * Gives you a copy of the Output from a Crafting Recipe Used for Recipe Detection.
*/
@SuppressWarnings("unchecked")
public static ItemStack getRecipeOutput(boolean aUncopiedStack, boolean allowOreDict, ItemStack... aRecipe) {
if (aRecipe == null || Arrays.stream(aRecipe).noneMatch(Objects::nonNull)) return null;
- InventoryCrafting aCrafting = new InventoryCrafting(
- new Container() {
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return false;
- }
- },
- 3,
- 3);
+ InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return false;
+ }
+ }, 3, 3);
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
- ArrayList<IRecipe> tList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
boolean found = false;
for (IRecipe iRecipe : tList) {
@@ -1761,9 +1681,8 @@ public class GT_ModHandler {
ItemStack tOutput = aUncopiedStack ? iRecipe.getRecipeOutput() : iRecipe.getCraftingResult(aCrafting);
if (tOutput == null || tOutput.stackSize <= 0) {
// Seriously, who would ever do that shit?
- if (!GregTech_API.sPostloadFinished)
- throw new GT_ItsNotMyFaultException(
- "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
+ if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException(
+ "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
} else {
if (aUncopiedStack) return tOutput;
return GT_Utility.copyOrNull(tOutput);
@@ -1774,19 +1693,16 @@ public class GT_ModHandler {
}
/**
- * Gives you a list of the Outputs from a Crafting Recipe
- * If you have multiple Mods, which add Bronze Armor for example
- * This also removes old Recipes from the List.
+ * Gives you a list of the Outputs from a Crafting Recipe If you have multiple Mods, which add Bronze Armor for
+ * example This also removes old Recipes from the List.
*/
public static List<ItemStack> getVanillyToolRecipeOutputs(ItemStack... aRecipe) {
if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished)
sSingleNonBlockDamagableRecipeList.clear();
if (sSingleNonBlockDamagableRecipeList.isEmpty()) {
- for (IRecipe tRecipe :
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
+ for (IRecipe tRecipe : (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
ItemStack tStack = tRecipe.getRecipeOutput();
- if (GT_Utility.isStackValid(tStack)
- && tStack.getMaxStackSize() == 1
+ if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1
&& tStack.getMaxDamage() > 0
&& !(tStack.getItem() instanceof ItemBlock)
&& !(tStack.getItem() instanceof IReactorComponent)
@@ -1795,30 +1711,26 @@ public class GT_ModHandler {
if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) {
if (tRecipe instanceof ShapedOreRecipe) {
boolean temp = true;
- for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
- if (tObject != null) {
- if (tObject instanceof ItemStack
- && (((ItemStack) tObject).getItem() == null
- || ((ItemStack) tObject).getMaxStackSize() < 2
- || ((ItemStack) tObject).getMaxDamage() > 0
- || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
- temp = false;
- break;
- }
- if (tObject instanceof List && ((List) tObject).isEmpty()) {
- temp = false;
- break;
- }
+ for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput()) if (tObject != null) {
+ if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null
+ || ((ItemStack) tObject).getMaxStackSize() < 2
+ || ((ItemStack) tObject).getMaxDamage() > 0
+ || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
+ temp = false;
+ break;
+ }
+ if (tObject instanceof List && ((List) tObject).isEmpty()) {
+ temp = false;
+ break;
}
+ }
if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
} else if (tRecipe instanceof ShapedRecipes) {
boolean temp = true;
for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
- if (tObject != null
- && (tObject.getItem() == null
- || tObject.getMaxStackSize() < 2
- || tObject.getMaxDamage() > 0
- || tObject.getItem() instanceof ItemBlock)) {
+ if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2
+ || tObject.getMaxDamage() > 0
+ || tObject.getItem() instanceof ItemBlock)) {
temp = false;
break;
}
@@ -1830,11 +1742,12 @@ public class GT_ModHandler {
}
}
}
- GT_Log.out.println("GT_Mod: Created a List of Tool Recipes containing "
- + sSingleNonBlockDamagableRecipeList.size() + " Recipes for recycling."
- + (sSingleNonBlockDamagableRecipeList.size() > 1024
- ? " Scanning all these Recipes is the reason for the startup Lag you receive right now."
- : E));
+ GT_Log.out.println(
+ "GT_Mod: Created a List of Tool Recipes containing " + sSingleNonBlockDamagableRecipeList.size()
+ + " Recipes for recycling."
+ + (sSingleNonBlockDamagableRecipeList.size() > 1024
+ ? " Scanning all these Recipes is the reason for the startup Lag you receive right now."
+ : E));
}
List<ItemStack> rList = getRecipeOutputs(sSingleNonBlockDamagableRecipeList, true, aRecipe);
if (!GregTech_API.sPostloadStarted || GregTech_API.sPostloadFinished)
@@ -1843,8 +1756,8 @@ public class GT_ModHandler {
}
/**
- * Gives you a list of the Outputs from a Crafting Recipe
- * If you have multiple Mods, which add Bronze Armor for example
+ * Gives you a list of the Outputs from a Crafting Recipe If you have multiple Mods, which add Bronze Armor for
+ * example
*/
public static List<ItemStack> getRecipeOutputs(ItemStack... aRecipe) {
return getRecipeOutputs(CraftingManager.getInstance().getRecipeList(), false, aRecipe);
@@ -1853,99 +1766,87 @@ public class GT_ModHandler {
private static List<IRecipe> bufferedRecipes = null;
/**
- * Gives you a list of the Outputs from a Crafting Recipe
- * If you have multiple Mods, which add Bronze Armor for example
- * Buffers a List which only has armor-alike crafting in it
+ * Gives you a list of the Outputs from a Crafting Recipe If you have multiple Mods, which add Bronze Armor for
+ * example Buffers a List which only has armor-alike crafting in it
*/
public static List<ItemStack> getRecipeOutputsBuffered(ItemStack... aRecipe) {
- if (bufferedRecipes == null)
- bufferedRecipes = (List<IRecipe>) CraftingManager.getInstance().getRecipeList().stream()
- .filter(tRecipe -> !(tRecipe instanceof ShapelessRecipes)
- && !(tRecipe instanceof ShapelessOreRecipe)
- && !(tRecipe instanceof IGT_CraftingRecipe))
- .filter(tRecipe -> {
- try {
- ItemStack tOutput = ((IRecipe) tRecipe).getRecipeOutput();
- if (tOutput.stackSize == 1
- && tOutput.getMaxDamage() > 0
- && tOutput.getMaxStackSize() == 1) {
- return true;
- }
- } catch (Exception ignored) {
+ if (bufferedRecipes == null) bufferedRecipes = (List<IRecipe>) CraftingManager.getInstance().getRecipeList()
+ .stream()
+ .filter(
+ tRecipe -> !(tRecipe instanceof ShapelessRecipes) && !(tRecipe instanceof ShapelessOreRecipe)
+ && !(tRecipe instanceof IGT_CraftingRecipe))
+ .filter(tRecipe -> {
+ try {
+ ItemStack tOutput = ((IRecipe) tRecipe).getRecipeOutput();
+ if (tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1) {
+ return true;
}
- return false;
- })
- .collect(Collectors.toList());
+ } catch (Exception ignored) {}
+ return false;
+ }).collect(Collectors.toList());
return getRecipeOutputs(bufferedRecipes, false, aRecipe);
}
/**
- * Gives you a list of the Outputs from a Crafting Recipe
- * If you have multiple Mods, which add Bronze Armor for example
+ * Gives you a list of the Outputs from a Crafting Recipe If you have multiple Mods, which add Bronze Armor for
+ * example
*/
public static List<ItemStack> getRecipeOutputs(List<IRecipe> aList, boolean aDeleteFromList, ItemStack... aRecipe) {
List<ItemStack> rList = new ArrayList<>();
if (aRecipe == null || Arrays.stream(aRecipe).noneMatch(Objects::nonNull)) return rList;
- InventoryCrafting aCrafting = new InventoryCrafting(
- new Container() {
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return false;
- }
- },
- 3,
- 3);
+ InventoryCrafting aCrafting = new InventoryCrafting(new Container() {
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return false;
+ }
+ }, 3, 3);
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
if (!aDeleteFromList) {
HashSet<ItemStack> stacks = new HashSet<>();
- aList.stream()
- .filter(tRecipe -> {
- if (tRecipe instanceof ShapelessRecipes
- || tRecipe instanceof ShapelessOreRecipe
- || tRecipe instanceof IGT_CraftingRecipe) return false;
- try {
- return tRecipe.matches(aCrafting, DW);
- } catch (Throwable e) {
- e.printStackTrace(GT_Log.err);
- return false;
- }
- })
- .forEach(tRecipe -> stacks.add(tRecipe.getCraftingResult(aCrafting)));
- rList = stacks.stream()
- .filter(tOutput ->
- tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1)
- .collect(Collectors.toList());
- } else
- for (Iterator<IRecipe> iterator = aList.iterator(); iterator.hasNext(); ) {
- IRecipe tRecipe = iterator.next();
- boolean matched = false;
-
+ aList.stream().filter(tRecipe -> {
+ if (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe
+ || tRecipe instanceof IGT_CraftingRecipe)
+ return false;
try {
- matched = tRecipe.matches(aCrafting, DW);
+ return tRecipe.matches(aCrafting, DW);
} catch (Throwable e) {
e.printStackTrace(GT_Log.err);
+ return false;
}
- if (matched) {
- ItemStack tOutput = tRecipe.getCraftingResult(aCrafting);
-
- if (tOutput == null || tOutput.stackSize <= 0) {
- // Seriously, who would ever do that shit?
- if (!GregTech_API.sPostloadFinished)
- throw new GT_ItsNotMyFaultException(
- "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
- continue;
- }
- if (tOutput.stackSize != 1) continue;
- if (tOutput.getMaxDamage() <= 0) continue;
- if (tOutput.getMaxStackSize() != 1) continue;
- if (tRecipe instanceof ShapelessRecipes) continue;
- if (tRecipe instanceof ShapelessOreRecipe) continue;
- if (tRecipe instanceof IGT_CraftingRecipe) continue;
- rList.add(GT_Utility.copyOrNull(tOutput));
- iterator.remove();
+ }).forEach(tRecipe -> stacks.add(tRecipe.getCraftingResult(aCrafting)));
+ rList = stacks.stream().filter(
+ tOutput -> tOutput.stackSize == 1 && tOutput.getMaxDamage() > 0 && tOutput.getMaxStackSize() == 1)
+ .collect(Collectors.toList());
+ } else for (Iterator<IRecipe> iterator = aList.iterator(); iterator.hasNext();) {
+ IRecipe tRecipe = iterator.next();
+ boolean matched = false;
+
+ try {
+ matched = tRecipe.matches(aCrafting, DW);
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ if (matched) {
+ ItemStack tOutput = tRecipe.getCraftingResult(aCrafting);
+
+ if (tOutput == null || tOutput.stackSize <= 0) {
+ // Seriously, who would ever do that shit?
+ if (!GregTech_API.sPostloadFinished) throw new GT_ItsNotMyFaultException(
+ "Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
+ continue;
}
+ if (tOutput.stackSize != 1) continue;
+ if (tOutput.getMaxDamage() <= 0) continue;
+ if (tOutput.getMaxStackSize() != 1) continue;
+ if (tRecipe instanceof ShapelessRecipes) continue;
+ if (tRecipe instanceof ShapelessOreRecipe) continue;
+ if (tRecipe instanceof IGT_CraftingRecipe) continue;
+ rList.add(GT_Utility.copyOrNull(tOutput));
+ iterator.remove();
}
+ }
return rList;
}
@@ -1972,8 +1873,13 @@ public class GT_ModHandler {
*/
@Deprecated
public static ItemStack getCompressorOutput(ItemStack aInput, boolean aRemoveInput, ItemStack aOutputSlot) {
- return GT_Utility.copyOrNull(getMachineOutput(
- aInput, getCompressorRecipeList(), aRemoveInput, new NBTTagCompound(), aOutputSlot)[0]);
+ return GT_Utility.copyOrNull(
+ getMachineOutput(
+ aInput,
+ getCompressorRecipeList(),
+ aRemoveInput,
+ new NBTTagCompound(),
+ aOutputSlot)[0]);
}
/**
@@ -1983,10 +1889,8 @@ public class GT_ModHandler {
if (aInput == null || aInput.stackSize < 1) return null;
ItemStack rStack = GT_OreDictUnificator.get(FurnaceRecipes.smelting().getSmeltingResult(aInput));
- if (rStack != null
- && (aOutputSlot == null
- || (GT_Utility.areStacksEqual(rStack, aOutputSlot)
- && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) {
+ if (rStack != null && (aOutputSlot == null || (GT_Utility.areStacksEqual(rStack, aOutputSlot)
+ && rStack.stackSize + aOutputSlot.stackSize <= aOutputSlot.getMaxStackSize()))) {
if (aRemoveInput) aInput.stackSize--;
return rStack;
}
@@ -1998,12 +1902,8 @@ public class GT_ModHandler {
* <p/>
* Checks also if there is enough Space in the Output Slots.
*/
- public static ItemStack[] getMachineOutput(
- ItemStack aInput,
- Map<IRecipeInput, RecipeOutput> aRecipeList,
- boolean aRemoveInput,
- NBTTagCompound rRecipeMetaData,
- ItemStack... aOutputSlots) {
+ public static ItemStack[] getMachineOutput(ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList,
+ boolean aRemoveInput, NBTTagCompound rRecipeMetaData, ItemStack... aOutputSlots) {
if (aOutputSlots == null || aOutputSlots.length <= 0) return new ItemStack[0];
if (aInput == null) return new ItemStack[aOutputSlots.length];
try {
@@ -2016,10 +1916,9 @@ public class GT_ModHandler {
rRecipeMetaData.setTag("return", tEntry.getValue().metadata);
for (byte i = 0; i < aOutputSlots.length && i < tList.length; i++) {
if (tList[i] != null) {
- if (aOutputSlots[i] == null
- || (GT_Utility.areStacksEqual(tList[i], aOutputSlots[i])
- && tList[i].stackSize + aOutputSlots[i].stackSize
- <= aOutputSlots[i].getMaxStackSize())) {
+ if (aOutputSlots[i] == null || (GT_Utility.areStacksEqual(tList[i], aOutputSlots[i])
+ && tList[i].stackSize + aOutputSlots[i].stackSize
+ <= aOutputSlots[i].getMaxStackSize())) {
rList[i] = GT_Utility.copyOrNull(tList[i]);
} else {
return new ItemStack[aOutputSlots.length];
@@ -2042,8 +1941,8 @@ public class GT_ModHandler {
/**
* Used in my own Recycler.
* <p/>
- * Only produces Scrap if aScrapChance == 0. aScrapChance is usually the random Number I give to the Function
- * If you directly insert 0 as aScrapChance then you can check if its Recycler-Blacklisted or similar
+ * Only produces Scrap if aScrapChance == 0. aScrapChance is usually the random Number I give to the Function If you
+ * directly insert 0 as aScrapChance then you can check if its Recycler-Blacklisted or similar
*/
public static ItemStack getRecyclerOutput(ItemStack aInput, int aScrapChance) {
if (aInput == null || aScrapChance != 0) return null;
@@ -2052,12 +1951,12 @@ public class GT_ModHandler {
return ic2.api.recipe.Recipes.recyclerBlacklist.contains(aInput) ? null : ItemList.IC2_Scrap.get(1);
return ic2.api.recipe.Recipes.recyclerWhitelist.contains(aInput) ? ItemList.IC2_Scrap.get(1) : null;
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
try {
return ic2.api.recipe.Recipes.recyclerBlacklist.contains(aInput) ? null : ItemList.IC2_Scrap.get(1);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return null;
}
@@ -2070,14 +1969,14 @@ public class GT_ModHandler {
}
/**
- * Charges an Electric Item. Only if it's a valid Electric Item of course.
- * This forces the Usage of proper Voltages (so not the transfer limits defined by the Items) unless you ignore the Transfer Limit.
- * If aTier is Integer.MAX_VALUE it will ignore Tier based Limitations.
+ * Charges an Electric Item. Only if it's a valid Electric Item of course. This forces the Usage of proper Voltages
+ * (so not the transfer limits defined by the Items) unless you ignore the Transfer Limit. If aTier is
+ * Integer.MAX_VALUE it will ignore Tier based Limitations.
*
* @return the actually used Energy.
*/
- public static int chargeElectricItem(
- ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit, boolean aSimulate) {
+ public static int chargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit,
+ boolean aSimulate) {
try {
if (isElectricItem(aStack)) {
int tTier = ((ic2.api.item.IElectricItem) aStack.getItem()).getTier(aStack);
@@ -2086,44 +1985,39 @@ public class GT_ModHandler {
aCharge = (int) Math.min(aCharge, V[Math.max(0, Math.min(V.length - 1, tTier))]);
if (aCharge > 0) {
int rCharge = (int) Math.max(
- 0.0, ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, true, aSimulate));
+ 0.0,
+ ic2.api.item.ElectricItem.manager.charge(aStack, aCharge, tTier, true, aSimulate));
return rCharge + (rCharge * 4 > aTier ? aTier : 0);
}
}
}
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return 0;
}
/**
- * Discharges an Electric Item. Only if it's a valid Electric Item for that of course.
- * This forces the Usage of proper Voltages (so not the transfer limits defined by the Items) unless you ignore the Transfer Limit.
- * If aTier is Integer.MAX_VALUE it will ignore Tier based Limitations.
+ * Discharges an Electric Item. Only if it's a valid Electric Item for that of course. This forces the Usage of
+ * proper Voltages (so not the transfer limits defined by the Items) unless you ignore the Transfer Limit. If aTier
+ * is Integer.MAX_VALUE it will ignore Tier based Limitations.
*
* @return the Energy got from the Item.
*/
- public static int dischargeElectricItem(
- ItemStack aStack,
- int aCharge,
- int aTier,
- boolean aIgnoreLimit,
- boolean aSimulate,
- boolean aIgnoreDischargability) {
+ public static int dischargeElectricItem(ItemStack aStack, int aCharge, int aTier, boolean aIgnoreLimit,
+ boolean aSimulate, boolean aIgnoreDischargability) {
try {
- // if (isElectricItem(aStack) && (aIgnoreDischargability ||
+ // if (isElectricItem(aStack) && (aIgnoreDischargability ||
// ((ic2.api.item.IElectricItem)aStack.getItem()).canProvideEnergy(aStack))) {
if (isElectricItem(aStack)) {
int tTier = ((ic2.api.item.IElectricItem) aStack.getItem()).getTier(aStack);
if (tTier < 0 || tTier == aTier || aTier == Integer.MAX_VALUE) {
- if (!aIgnoreLimit && tTier >= 0)
- aCharge = (int) Math.min(
- aCharge,
- V[Math.max(0, Math.min(V.length - 1, tTier))]
- + B[Math.max(0, Math.min(V.length - 1, tTier))]);
+ if (!aIgnoreLimit && tTier >= 0) aCharge = (int) Math.min(
+ aCharge,
+ V[Math.max(0, Math.min(V.length - 1, tTier))]
+ + B[Math.max(0, Math.min(V.length - 1, tTier))]);
if (aCharge > 0) {
- // int rCharge = Math.max(0, ic2.api.item.ElectricItem.manager.discharge(aStack, aCharge +
+ // int rCharge = Math.max(0, ic2.api.item.ElectricItem.manager.discharge(aStack, aCharge +
// (aCharge * 4 > aTier ? aTier : 0), tTier, T, aSimulate));
int rCharge = (int) Math.max(
0,
@@ -2139,7 +2033,7 @@ public class GT_ModHandler {
}
}
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return 0;
}
@@ -2155,7 +2049,7 @@ public class GT_ModHandler {
return ic2.api.item.ElectricItem.manager.canUse(aStack, aCharge);
}
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return false;
}
@@ -2174,7 +2068,7 @@ public class GT_ModHandler {
}
}
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return false;
}
@@ -2233,8 +2127,9 @@ public class GT_ModHandler {
return GT_ModHandler.useElectricItem(aStack, 10000, (EntityPlayer) aPlayer);
}
GT_ModHandler.useElectricItem(
- aStack, (int) ic2.api.item.ElectricItem.manager.getCharge(aStack), (EntityPlayer)
- aPlayer);
+ aStack,
+ (int) ic2.api.item.ElectricItem.manager.getCharge(aStack),
+ (EntityPlayer) aPlayer);
return false;
}
}
@@ -2291,7 +2186,7 @@ public class GT_ModHandler {
return ((ic2.api.item.IElectricItem) aStack.getItem()).canProvideEnergy(aStack);
}
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return false;
}
@@ -2301,22 +2196,20 @@ public class GT_ModHandler {
*/
public static boolean isElectricItem(ItemStack aStack) {
try {
- return aStack != null
- && aStack.getItem() instanceof ic2.api.item.IElectricItem
+ return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem
&& ((IElectricItem) aStack.getItem()).getTier(aStack) < Integer.MAX_VALUE;
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return false;
}
public static boolean isElectricItem(ItemStack aStack, byte aTier) {
try {
- return aStack != null
- && aStack.getItem() instanceof ic2.api.item.IElectricItem
+ return aStack != null && aStack.getItem() instanceof ic2.api.item.IElectricItem
&& ((IElectricItem) aStack.getItem()).getTier(aStack) == aTier;
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return false;
}
@@ -2329,7 +2222,7 @@ public class GT_ModHandler {
try {
ic2.api.item.ItemWrapper.registerBoxable(aStack.getItem(), (IBoxable) sBoxableWrapper);
} catch (Throwable ignored) {
- /*Do nothing*/
+ /* Do nothing */
}
sBoxableItems.add(new GT_ItemStack(aStack));
}
@@ -2368,6 +2261,7 @@ public class GT_ModHandler {
}
public static class RecipeBits {
+
/**
* Mirrors the Recipe
*/
@@ -2393,7 +2287,8 @@ public class GT_ModHandler {
*/
public static long REVERSIBLE = B[5];
/**
- * Removes all Recipes with the same Output Item regardless of NBT, unless another Recipe Deletion Bit is added too.
+ * Removes all Recipes with the same Output Item regardless of NBT, unless another Recipe Deletion Bit is added
+ * too.
*/
public static long DELETE_ALL_OTHER_RECIPES = B[6];
/**
@@ -2427,54 +2322,47 @@ public class GT_ModHandler {
}
/**
- * Copy of the original Helper Class of Thermal Expansion, just to make sure it works even when other Mods include TE-APIs
+ * Copy of the original Helper Class of Thermal Expansion, just to make sure it works even when other Mods include
+ * TE-APIs
*/
public static class ThermalExpansion {
+
public static void addFurnaceRecipe(int energy, ItemStack input, ItemStack output) {}
public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput) {}
- public static void addPulverizerRecipe(
- int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput) {}
+ public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput,
+ ItemStack secondaryOutput) {}
- public static void addPulverizerRecipe(
- int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {}
+ public static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput,
+ ItemStack secondaryOutput, int secondaryChance) {}
public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput) {}
- public static void addSawmillRecipe(
- int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput) {}
+ public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput,
+ ItemStack secondaryOutput) {}
- public static void addSawmillRecipe(
- int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {}
+ public static void addSawmillRecipe(int energy, ItemStack input, ItemStack primaryOutput,
+ ItemStack secondaryOutput, int secondaryChance) {}
- public static void addSmelterRecipe(
- int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput) {}
+ public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput,
+ ItemStack primaryOutput) {}
- public static void addSmelterRecipe(
- int energy,
- ItemStack primaryInput,
- ItemStack secondaryInput,
- ItemStack primaryOutput,
- ItemStack secondaryOutput) {}
+ public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput,
+ ItemStack primaryOutput, ItemStack secondaryOutput) {}
- public static void addSmelterRecipe(
- int energy,
- ItemStack primaryInput,
- ItemStack secondaryInput,
- ItemStack primaryOutput,
- ItemStack secondaryOutput,
- int secondaryChance) {}
+ public static void addSmelterRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput,
+ ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance) {}
public static void addSmelterBlastOre(Materials aMaterial) {}
public static void addCrucibleRecipe(int energy, ItemStack input, FluidStack output) {}
- public static void addTransposerFill(
- int energy, ItemStack input, ItemStack output, FluidStack fluid, boolean reversible) {}
+ public static void addTransposerFill(int energy, ItemStack input, ItemStack output, FluidStack fluid,
+ boolean reversible) {}
- public static void addTransposerExtract(
- int energy, ItemStack input, ItemStack output, FluidStack fluid, int chance, boolean reversible) {}
+ public static void addTransposerExtract(int energy, ItemStack input, ItemStack output, FluidStack fluid,
+ int chance, boolean reversible) {}
public static void addMagmaticFuel(String fluidName, int energy) {}
diff --git a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java
index bd69f33a8a..e428c10c70 100644
--- a/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java
+++ b/src/main/java/gregtech/api/util/GT_Multiblock_Tooltip_Builder.java
@@ -1,17 +1,19 @@
package gregtech.api.util;
-import com.google.common.collect.Multimaps;
-import com.google.common.collect.SetMultimap;
-import com.gtnewhorizon.structurelib.StructureLibAPI;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.IntStream;
import java.util.stream.Stream;
+
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+
/**
* This makes it easier to build multi tooltips, with a standardized format. <br>
* Info section order should be:<br>
@@ -29,13 +31,13 @@ import net.minecraft.util.StatCollector;
* addMaintenanceHatch<br>
* addMufflerHatch<br>
* addInputBus/addInputHatch/addOutputBus/addOutputHatch, in that order<br>
- * Use addStructureInfo for any comments on nonstandard structure info wherever needed
- * <br>
+ * Use addStructureInfo for any comments on nonstandard structure info wherever needed <br>
* toolTipFinisher goes at the very end<br>
* <br>
* Originally created by kekzdealer
*/
public class GT_Multiblock_Tooltip_Builder {
+
private static final String TAB = " ";
private static final String COLON = ": ";
private static final String SEPARATOR = ", ";
@@ -87,8 +89,7 @@ public class GT_Multiblock_Tooltip_Builder {
* Add a line telling you what the machine type is. Usually, this will be the name of a SB version.<br>
* Machine Type: machine
*
- * @param machine
- * Name of the machine type
+ * @param machine Name of the machine type
*
* @return Instance this method was called on.
*/
@@ -100,8 +101,7 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a basic line of information about this structure
*
- * @param info
- * The line to be added.
+ * @param info The line to be added.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addInfo(String info) {
@@ -123,29 +123,29 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line telling how much this machine pollutes.
*
- * @param pollution
- * Amount of pollution per second when active
+ * @param pollution Amount of pollution per second when active
*
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addPollutionAmount(int pollution) {
- iLines.add(TT_causes + COLON + EnumChatFormatting.DARK_PURPLE + pollution + " " + EnumChatFormatting.GRAY
- + TT_pps);
+ iLines.add(
+ TT_causes + COLON
+ + EnumChatFormatting.DARK_PURPLE
+ + pollution
+ + " "
+ + EnumChatFormatting.GRAY
+ + TT_pps);
return this;
}
/**
- * Begin adding structural information by adding a line about the structure's dimensions
- * and then inserting a "Structure:" line.
+ * Begin adding structural information by adding a line about the structure's dimensions and then inserting a
+ * "Structure:" line.
*
- * @param w
- * Structure width.
- * @param h
- * Structure height.
- * @param l
- * Structure depth/length.
- * @param hollow
- * T/F, adds a (hollow) comment if true
+ * @param w Structure width.
+ * @param h Structure height.
+ * @param l Structure depth/length.
+ * @param hollow T/F, adds a (hollow) comment if true
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder beginStructureBlock(int w, int h, int l, boolean hollow) {
@@ -162,30 +162,48 @@ public class GT_Multiblock_Tooltip_Builder {
* Begin adding structural information by adding a line about the structure's dimensions<br>
* and then inserting a "Structure:" line. Variable version displays min and max
*
- * @param wmin
- * Structure min width.
- * @param wmax
- * Structure max width.
- * @param hmin
- * Structure min height.
- * @param hmax
- * Structure max height.
- * @param lmin
- * Structure min depth/length.
- * @param lmax
- * Structure max depth/length.
- * @param hollow
- * T/F, adds a (hollow) comment if true
+ * @param wmin Structure min width.
+ * @param wmax Structure max width.
+ * @param hmin Structure min height.
+ * @param hmax Structure max height.
+ * @param lmin Structure min depth/length.
+ * @param lmax Structure max depth/length.
+ * @param hollow T/F, adds a (hollow) comment if true
* @return Instance this method was called on.
*/
- public GT_Multiblock_Tooltip_Builder beginVariableStructureBlock(
- int wmin, int wmax, int hmin, int hmax, int lmin, int lmax, boolean hollow) {
+ public GT_Multiblock_Tooltip_Builder beginVariableStructureBlock(int wmin, int wmax, int hmin, int hmax, int lmin,
+ int lmax, boolean hollow) {
if (hollow) {
- sLines.add(TT_dimensions + COLON + wmin + "-" + wmax + "x" + hmin + "-" + hmax + "x" + lmin + "-" + lmax
- + " (WxHxL) " + TT_hollow);
+ sLines.add(
+ TT_dimensions + COLON
+ + wmin
+ + "-"
+ + wmax
+ + "x"
+ + hmin
+ + "-"
+ + hmax
+ + "x"
+ + lmin
+ + "-"
+ + lmax
+ + " (WxHxL) "
+ + TT_hollow);
} else {
- sLines.add(TT_dimensions + COLON + wmin + "-" + wmax + "x" + hmin + "-" + hmax + "x" + lmin + "-" + lmax
- + " (WxHxL)");
+ sLines.add(
+ TT_dimensions + COLON
+ + wmin
+ + "-"
+ + wmax
+ + "x"
+ + hmin
+ + "-"
+ + hmax
+ + "x"
+ + lmin
+ + "-"
+ + lmax
+ + " (WxHxL)");
}
sLines.add(TT_structure + COLON);
return this;
@@ -193,9 +211,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Controller: info
- * @param info
- * Positional information.
+ * (indent)Controller: info
+ *
+ * @param info Positional information.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addController(String info) {
@@ -205,11 +223,10 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)minCountx casingName (minimum)
- * @param casingName
- * Name of the Casing.
- * @param minCount
- * Minimum needed for valid structure check.
+ * (indent)minCountx casingName (minimum)
+ *
+ * @param casingName Name of the Casing.
+ * @param minCount Minimum needed for valid structure check.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addCasingInfo(String casingName, int minCount) {
@@ -220,10 +237,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Use this method to add a structural part that isn't covered by the other methods.<br>
* (indent)name: info
- * @param name
- * Name of the hatch or other component.
- * @param info
- * Positional information.
+ *
+ * @param name Name of the hatch or other component.
+ * @param info Positional information.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info) {
@@ -233,9 +249,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Maintenance Hatch: info
- * @param info
- * Positional information.
+ * (indent)Maintenance Hatch: info
+ *
+ * @param info Positional information.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addMaintenanceHatch(String info) {
@@ -245,9 +261,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Muffler Hatch: info
- * @param info
- * Location where the hatch goes
+ * (indent)Muffler Hatch: info
+ *
+ * @param info Location where the hatch goes
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addMufflerHatch(String info) {
@@ -257,9 +273,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Energy Hatch: info
- * @param info
- * Positional information.
+ * (indent)Energy Hatch: info
+ *
+ * @param info Positional information.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addEnergyHatch(String info) {
@@ -269,9 +285,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Dynamo Hatch: info
- * @param info
- * Positional information.
+ * (indent)Dynamo Hatch: info
+ *
+ * @param info Positional information.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addDynamoHatch(String info) {
@@ -281,9 +297,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Input Bus: info
- * @param info
- * Location where the bus goes
+ * (indent)Input Bus: info
+ *
+ * @param info Location where the bus goes
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addInputBus(String info) {
@@ -293,9 +309,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Input Hatch: info
- * @param info
- * Location where the hatch goes
+ * (indent)Input Hatch: info
+ *
+ * @param info Location where the hatch goes
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addInputHatch(String info) {
@@ -305,9 +321,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Output Bus: info
- * @param info
- * Location where the bus goes
+ * (indent)Output Bus: info
+ *
+ * @param info Location where the bus goes
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addOutputBus(String info) {
@@ -317,9 +333,9 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Add a line of information about the structure:<br>
- * (indent)Output Hatch: info
- * @param info
- * Location where the bus goes
+ * (indent)Output Hatch: info
+ *
+ * @param info Location where the bus goes
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addOutputHatch(String info) {
@@ -330,12 +346,10 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Use this method to add a structural part that isn't covered by the other methods.<br>
* (indent)name: info
- * @param name
- * Name of the hatch or other component.
- * @param info
- * Positional information.
- * @param dots
- * The valid locations for this part when asked to display hints
+ *
+ * @param name Name of the hatch or other component.
+ * @param info Positional information.
+ * @param dots The valid locations for this part when asked to display hints
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addOtherStructurePart(String name, String info, int... dots) {
@@ -459,8 +473,8 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Use this method to add non-standard structural info.<br>
* (indent)info
- * @param info
- * The line to be added.
+ *
+ * @param info The line to be added.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addStructureInfo(String info) {
@@ -471,6 +485,7 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Use this method to add non-standard structural info.<br>
* (indent)info
+ *
* @param channel the name of subchannel
* @param purpose the purpose of subchannel
* @return Instance this method was called on.
@@ -482,8 +497,8 @@ public class GT_Multiblock_Tooltip_Builder {
/**
* Use this method to add non-standard structural hint. This info will appear before the standard structural hint.
- * @param info
- * The line to be added. This should be an entry into minecraft's localization system.
+ *
+ * @param info The line to be added. This should be an entry into minecraft's localization system.
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addStructureHint(String info) {
@@ -492,11 +507,11 @@ public class GT_Multiblock_Tooltip_Builder {
}
/**
- * Use this method to add an entry to standard structural hint without creating a corresponding line in structure information
- * @param name
- * The name of block This should be an entry into minecraft's localization system.
- * @param dots
- * Possible locations of this block
+ * Use this method to add an entry to standard structural hint without creating a corresponding line in structure
+ * information
+ *
+ * @param name The name of block This should be an entry into minecraft's localization system.
+ * @param dots Possible locations of this block
* @return Instance this method was called on.
*/
public GT_Multiblock_Tooltip_Builder addStructureHint(String name, int... dots) {
@@ -509,18 +524,24 @@ public class GT_Multiblock_Tooltip_Builder {
* Adds a final line with the mod name and information on how to display the structure guidelines.<br>
* Ends the building process.
*
- * @param mod
- * Name of the mod that adds this multiblock machine
+ * @param mod Name of the mod that adds this multiblock machine
*/
public void toolTipFinisher(String mod) {
- iLines.add(TT_hold + " " + EnumChatFormatting.BOLD + "[LSHIFT]" + EnumChatFormatting.RESET
- + EnumChatFormatting.GRAY + " " + TT_todisplay);
+ iLines.add(
+ TT_hold + " "
+ + EnumChatFormatting.BOLD
+ + "[LSHIFT]"
+ + EnumChatFormatting.RESET
+ + EnumChatFormatting.GRAY
+ + " "
+ + TT_todisplay);
iLines.add(TT_mod + COLON + EnumChatFormatting.GREEN + mod + EnumChatFormatting.GRAY);
hLines.add(TT_structurehint);
iArray = iLines.toArray(new String[0]);
sArray = sLines.toArray(new String[0]);
// e.getKey() - 1 because 1 dot is meta 0.
- hArray = Stream.concat(
+ hArray = Stream
+ .concat(
hLines.stream(),
hBlocks.asMap().entrySet().stream()
.map(e -> TT_dots[e.getKey() - 1] + COLON + String.join(SEPARATOR, e.getValue())))
diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
index 959707c18f..7719b52fed 100644
--- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
+++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
@@ -4,15 +4,6 @@ import static gregtech.api.enums.GT_Values.E;
import static gregtech.api.enums.GT_Values.M;
import static gregtech.api.enums.GT_Values.W;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.Dyes;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.enums.SubTag;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_ItemStack2;
-import gregtech.api.objects.ItemData;
-import gregtech.api.objects.MaterialStack;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -21,11 +12,23 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+
import javax.annotation.Nullable;
+
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_ItemStack2;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
@@ -36,6 +39,7 @@ import net.minecraftforge.oredict.OreDictionary;
* P.S. It is intended to be named "Unificator" and not "Unifier", because that sounds more awesome.
*/
public class GT_OreDictUnificator {
+
private static final Map<String, ItemStack> sName2StackMap = new HashMap<>();
private static final Map<GT_ItemStack2, ItemData> sItemStack2DataMap = new HashMap<>();
private static final Map<GT_ItemStack2, List<ItemStack>> sUnificationTable = new HashMap<>();
@@ -50,8 +54,8 @@ public class GT_OreDictUnificator {
}
/**
- * The Blacklist just prevents the Item from being unificated into something else.
- * Useful if you have things like the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes.
+ * The Blacklist just prevents the Item from being unificated into something else. Useful if you have things like
+ * the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes.
*/
public static void addToBlacklist(ItemStack aStack) {
if (GT_Utility.isStackValid(aStack) && !GT_Utility.isStackInList(aStack, sNoUnificationList))
@@ -70,23 +74,17 @@ public class GT_OreDictUnificator {
set(aPrefix, aMaterial, aStack, true, false);
}
- public static void set(
- OrePrefixes aPrefix,
- Materials aMaterial,
- ItemStack aStack,
- boolean aOverwrite,
+ public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aOverwrite,
boolean aAlreadyRegistered) {
- if (aMaterial == null
- || aPrefix == null
+ if (aMaterial == null || aPrefix == null
|| GT_Utility.isStackInvalid(aStack)
- || Items.feather.getDamage(aStack) == W) return;
+ || Items.feather.getDamage(aStack) == W)
+ return;
isAddingOre++;
aStack = GT_Utility.copyAmount(1, aStack);
if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack);
addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack));
- if (aOverwrite
- || GT_Utility.isStackInvalid(
- sName2StackMap.get(aPrefix.get(aMaterial).toString())))
+ if (aOverwrite || GT_Utility.isStackInvalid(sName2StackMap.get(aPrefix.get(aMaterial).toString())))
sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack);
isAddingOre--;
}
@@ -126,11 +124,7 @@ public class GT_OreDictUnificator {
return get(aPrefix.get(aMaterial), null, aAmount, false, aNoInvalidAmounts);
}
- public static ItemStack get(
- Object aName,
- ItemStack aReplacement,
- long aAmount,
- boolean aMentionPossibleTypos,
+ public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos,
boolean aNoInvalidAmounts) {
if (aNoInvalidAmounts && aAmount < 1) return null;
final ItemStack stackFromName = sName2StackMap.get(aName.toString());
@@ -182,9 +176,9 @@ public class GT_OreDictUnificator {
public static ItemStack get(boolean aUseBlackList, ItemStack aStack, boolean unsafe) {
if (GT_Utility.isStackInvalid(aStack)) return null;
ItemData tPrefixMaterial = getAssociation(aStack);
- if (tPrefixMaterial == null
- || !tPrefixMaterial.hasValidPrefixMaterialData()
- || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copyOrNull(aStack);
+ if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData()
+ || (aUseBlackList && tPrefixMaterial.mBlackListed))
+ return GT_Utility.copyOrNull(aStack);
if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) {
tPrefixMaterial.mBlackListed = true;
return GT_Utility.copyOrNull(aStack);
@@ -201,21 +195,25 @@ public class GT_OreDictUnificator {
}
}
- /** Doesn't copy the returned stack or set quantity. Be careful and do not mutate it;
- * intended only to optimize comparisons */
+ /**
+ * Doesn't copy the returned stack or set quantity. Be careful and do not mutate it; intended only to optimize
+ * comparisons
+ */
public static ItemStack get_nocopy(ItemStack aStack) {
return get_nocopy(true, aStack);
}
- /** Doesn't copy the returned stack or set quantity. Be careful and do not mutate it;
- * intended only to optimize comparisons */
+ /**
+ * Doesn't copy the returned stack or set quantity. Be careful and do not mutate it; intended only to optimize
+ * comparisons
+ */
static ItemStack get_nocopy(boolean aUseBlackList, ItemStack aStack) {
if (GT_Utility.isStackInvalid(aStack)) return null;
ItemData tPrefixMaterial = getAssociation(aStack);
ItemStack rStack = null;
- if (tPrefixMaterial == null
- || !tPrefixMaterial.hasValidPrefixMaterialData()
- || (aUseBlackList && tPrefixMaterial.mBlackListed)) return aStack;
+ if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData()
+ || (aUseBlackList && tPrefixMaterial.mBlackListed))
+ return aStack;
if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) {
tPrefixMaterial.mBlackListed = true;
return aStack;
@@ -229,8 +227,10 @@ public class GT_OreDictUnificator {
return rStack;
}
- /** Compares the first argument against an already-unificated second argument as if
- * aUseBlackList was both true and false. */
+ /**
+ * Compares the first argument against an already-unificated second argument as if aUseBlackList was both true and
+ * false.
+ */
public static boolean isInputStackEqual(ItemStack aStack, ItemStack unified_tStack) {
boolean alreadyCompared = false;
if (GT_Utility.isStackInvalid(aStack)) return false;
@@ -277,7 +277,7 @@ public class GT_OreDictUnificator {
}
}
ItemStack[] aStacks = {};
- if (obj instanceof ItemStack) aStacks = new ItemStack[] {(ItemStack) obj};
+ if (obj instanceof ItemStack) aStacks = new ItemStack[] { (ItemStack) obj };
else if (obj instanceof ItemStack[]) aStacks = (ItemStack[]) obj;
else if (obj instanceof List) aStacks = (ItemStack[]) ((List) obj).toArray(new ItemStack[0]);
List<ItemStack> rList = new ArrayList<>();
@@ -303,9 +303,8 @@ public class GT_OreDictUnificator {
if (GT_Utility.isStackInvalid(aStack) || aData == null) return;
ItemData tData = getItemData(aStack);
if (tData == null || !tData.hasValidPrefixMaterialData()) {
- if (tData != null)
- for (Object tObject : tData.mExtraData)
- if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject);
+ if (tData != null) for (Object tObject : tData.mExtraData)
+ if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject);
if (aStack.stackSize > 1) {
if (aData.mMaterial != null) aData.mMaterial.mAmount /= aStack.stackSize;
for (MaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize;
@@ -313,12 +312,10 @@ public class GT_OreDictUnificator {
}
sItemStack2DataMap.put(new GT_ItemStack2(aStack), aData);
if (aData.hasValidMaterialData()) {
- long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING)
- ? 0
+ long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0
: aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M;
for (MaterialStack tMaterial : aData.mByProducts)
- tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING)
- ? 0
+ tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0
: tMaterial.mAmount >= 0 ? tMaterial.mAmount : M;
if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack);
}
@@ -327,8 +324,8 @@ public class GT_OreDictUnificator {
mRunThroughTheList = false;
for (Entry<GT_ItemStack2, ItemData> tEntry : sItemStack2DataMap.entrySet())
if (!tEntry.getValue().hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling)
- GT_RecipeRegistrator.registerMaterialRecycling(
- tEntry.getKey().toStack(), tEntry.getValue());
+ GT_RecipeRegistrator
+ .registerMaterialRecycling(tEntry.getKey().toStack(), tEntry.getValue());
}
} else {
if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling)
@@ -340,13 +337,11 @@ public class GT_OreDictUnificator {
}
}
- public static void addAssociation(
- OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aBlackListed) {
+ public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack,
+ boolean aBlackListed) {
if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return;
- if (Items.feather.getDamage(aStack) == W)
- for (byte i = 0; i < 16; i++)
- setItemData(
- GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed));
+ if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++)
+ setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed));
setItemData(aStack, new ItemData(aPrefix, aMaterial, aBlackListed));
}
@@ -513,14 +508,13 @@ public class GT_OreDictUnificator {
}
/**
- * Fast version of {@link #getOres(Object)},
- * which doesn't call {@link System#arraycopy(Object, int, Object, int, int)} in {@link ArrayList#addAll}
+ * Fast version of {@link #getOres(Object)}, which doesn't call
+ * {@link System#arraycopy(Object, int, Object, int, int)} in {@link ArrayList#addAll}
*/
public static List<ItemStack> getOresImmutable(@Nullable Object aOreName) {
String aName = aOreName == null ? E : aOreName.toString();
- return GT_Utility.isStringValid(aName)
- ? Collections.unmodifiableList(OreDictionary.getOres(aName))
+ return GT_Utility.isStringValid(aName) ? Collections.unmodifiableList(OreDictionary.getOres(aName))
: Collections.emptyList();
}
}
diff --git a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java
index 6ea873e6b4..e19c8c904b 100644
--- a/src/main/java/gregtech/api/util/GT_OverclockCalculator.java
+++ b/src/main/java/gregtech/api/util/GT_OverclockCalculator.java
@@ -1,6 +1,7 @@
package gregtech.api.util;
public class GT_OverclockCalculator {
+
/**
* @mAmps - Amperage of the multiblock
* @mEUt - Voltage of the multiblock
@@ -10,26 +11,25 @@ public class GT_OverclockCalculator {
private long mAmps = 1, mEUt = 0, mRecipeEUt = 0, mRecipeAmps = 1;
/**
* @mEUtDiscount - Discount for EUt at the beginning of calculating overclocks, like GT++ machines
- * @mSpeedBoost - Speeding/Slowing up/down the duration of a recipe at the beginning of calculating overclocks, like GT++ machines
+ * @mSpeedBoost - Speeding/Slowing up/down the duration of a recipe at the beginning of calculating overclocks, like
+ * GT++ machines
* @mHeatDiscountAmont - The value used for discount final eut per 900 heat
*/
private float mEUtDiscount = 1, mSpeedBoost = 1, mHeatDiscountAmount = 0.95f;
/**
- * @mEUtIncreasePerOC - How much the bits should be moved to the left when it is overclocking (Going up, 2 meaning it is multiplied with 4x)
- * @mDurationDecreasePerOC - How much the bits should be moved to the right when its overclocking (Going down, 1 meaning it is halved)
+ * @mEUtIncreasePerOC - How much the bits should be moved to the left when it is overclocking (Going up, 2 meaning
+ * it is multiplied with 4x)
+ * @mDurationDecreasePerOC - How much the bits should be moved to the right when its overclocking (Going down, 1
+ * meaning it is halved)
* @mDuration - Duration of the recipe
* @mParallel - The parallel the multi has when trying to overclock
* @mRecipeHeat - The min heat required for the recipe
* @mMultiHeat - The heat the multi has when starting the recipe
- * @mHeatPerfectOC - How much the bits should be moved to the right for each 1800 above recipe heat (Used for duration)
+ * @mHeatPerfectOC - How much the bits should be moved to the right for each 1800 above recipe heat (Used for
+ * duration)
*/
- private int mEUtIncreasePerOC = 2,
- mDurationDecreasePerOC = 1,
- mDuration = 0,
- mParallel = 1,
- mRecipeHeat = 0,
- mMultiHeat = 0,
- mHeatPerfectOC = 2;
+ private int mEUtIncreasePerOC = 2, mDurationDecreasePerOC = 1, mDuration = 0, mParallel = 1, mRecipeHeat = 0,
+ mMultiHeat = 0, mHeatPerfectOC = 2;
/**
* @mHeatOC - Whether to enable overclocking with heat like the EBF every 1800 heat difference
* @mOneTickDiscount - Whether to give EUt Discount when the duration goes below one tick
@@ -40,6 +40,7 @@ public class GT_OverclockCalculator {
private static final int HEAT_DISCOUNT_THRESHOLD = 900;
private static final int HEAT_PERFECT_OVERCLOCK_THRESHOLD = 1800;
+
/**
* An Overclock helper for calculating overclocks in many different situations
*/
@@ -150,8 +151,8 @@ public class GT_OverclockCalculator {
}
/**
- * Sets the heat discount during OC calculation if HeatOC is used. Default: 0.95 = 5% discount
- * Used like a EU/t Discount
+ * Sets the heat discount during OC calculation if HeatOC is used. Default: 0.95 = 5% discount Used like a EU/t
+ * Discount
*/
public GT_OverclockCalculator setHeatDiscount(float aHeatDiscount) {
mHeatDiscountAmount = aHeatDiscount;
@@ -159,7 +160,8 @@ public class GT_OverclockCalculator {
}
/**
- * Sets the Overclock that should be calculated when one. This uses BitShifting! Default is 2, which is a 4x decrease
+ * Sets the Overclock that should be calculated when one. This uses BitShifting! Default is 2, which is a 4x
+ * decrease
*/
public GT_OverclockCalculator setHeatPerfectOC(int aHeatPerfectOC) {
mHeatPerfectOC = aHeatPerfectOC;
@@ -167,7 +169,7 @@ public class GT_OverclockCalculator {
}
/**
- * Sets the amount that the EUt increases per overclock. This uses BitShifting! Default is 2, which is a 4x increase
+ * Sets the amount that the EUt increases per overclock. This uses BitShifting! Default is 2, which is a 4x increase
*/
public GT_OverclockCalculator setEUtIncreasePerOC(int aEUtIncreasePerOC) {
mEUtIncreasePerOC = aEUtIncreasePerOC;
@@ -175,7 +177,8 @@ public class GT_OverclockCalculator {
}
/**
- * Sets the amount that the duration decreases per overclock. This uses BitShifting! Default is 1, which halves the duration
+ * Sets the amount that the duration decreases per overclock. This uses BitShifting! Default is 1, which halves the
+ * duration
*/
public GT_OverclockCalculator setDurationDecreasePerOC(int aDurationDecreasePerOC) {
mDurationDecreasePerOC = aDurationDecreasePerOC;
@@ -183,7 +186,8 @@ public class GT_OverclockCalculator {
}
/**
- * Enables One Tick Discount on EUt based on Duration Decrease Per Overclock. This functions the same as single blocks.
+ * Enables One Tick Discount on EUt based on Duration Decrease Per Overclock. This functions the same as single
+ * blocks.
*/
public GT_OverclockCalculator enableOneTickDiscount() {
mOneTickDiscount = true;
@@ -223,8 +227,8 @@ public class GT_OverclockCalculator {
if (tRecipeTier == 0) {
int tTier = GT_Utility.getTier(mEUt);
int tTierDifference = tTier - 1;
- long tNextConsumption =
- ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount)) << mEUtIncreasePerOC;
+ long tNextConsumption = ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount))
+ << mEUtIncreasePerOC;
while (tTierDifference > 0 && tNextConsumption < mEUt * mAmps) {
mRecipeEUt <<= mEUtIncreasePerOC;
mDuration >>= mDurationDecreasePerOC;
@@ -232,8 +236,8 @@ public class GT_OverclockCalculator {
tTierDifference--;
}
} else {
- long tNextConsumption =
- ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount)) << mEUtIncreasePerOC;
+ long tNextConsumption = ((long) Math.ceil(mRecipeEUt * mParallel * mRecipeAmps * mEUtDiscount))
+ << mEUtIncreasePerOC;
while (tNextConsumption < mEUt * mAmps) {
if (mDuration <= 1) {
break;
diff --git a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java
index 1543a9d2a6..dfc2af49ff 100644
--- a/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java
+++ b/src/main/java/gregtech/api/util/GT_PCBFactoryManager.java
@@ -4,6 +4,7 @@ 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;
diff --git a/src/main/java/gregtech/api/util/GT_ParallelHelper.java b/src/main/java/gregtech/api/util/GT_ParallelHelper.java
index 7f32d95d1e..c493184424 100644
--- a/src/main/java/gregtech/api/util/GT_ParallelHelper.java
+++ b/src/main/java/gregtech/api/util/GT_ParallelHelper.java
@@ -1,25 +1,30 @@
package gregtech.api.util;
-import com.gtnewhorizon.gtnhlib.util.map.ItemStackMap;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.multitileentity.multiblock.base.MultiBlockController;
-import gregtech.api.objects.XSTR;
-import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME;
-import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
+
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
+
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.MutableTriple;
+import com.gtnewhorizon.gtnhlib.util.map.ItemStackMap;
+
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.multitileentity.multiblock.base.MultiBlockController;
+import gregtech.api.objects.XSTR;
+import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_OutputBus_ME;
+import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_Output_ME;
+
public class GT_ParallelHelper {
+
/**
* @mMachineMeta a MetaTileEntity Controller
*/
@@ -39,7 +44,8 @@ public class GT_ParallelHelper {
/**
* @mCurrentParallel The current parallel possible for the multiblock
* @mMaxParallel The maximum possible parallel possible for the multiblock
- * @mBatchModifier The Batch Modifier applied when batch mode is enabled. 1 does nothing. 2 doubles max possible parallel, but also duration
+ * @mBatchModifier The Batch Modifier applied when batch mode is enabled. 1 does nothing. 2 doubles max possible
+ * parallel, but also duration
*/
private int mCurrentParallel = 0, mMaxParallel = 1, mBatchModifier = 1;
/**
@@ -56,7 +62,8 @@ public class GT_ParallelHelper {
* @mVoidProtection Does the multi have void protection enabled
* @mConsume Should the Parallel Helper automatically consume for the multi
* @mBatchMode Is batch mode turned on?
- * @mCalculateOutputs Should the Parallel Helper automatically calculate the outputs of the recipe with current parallel
+ * @mCalculateOutputs Should the Parallel Helper automatically calculate the outputs of the recipe with current
+ * parallel
* @mBuilt Has the Parallel Helper been built?
*/
private boolean mVoidProtection, mConsume, mBatchMode, mCalculateOutputs, mBuilt;
@@ -143,8 +150,8 @@ public class GT_ParallelHelper {
}
/**
- * Enables Batch mode. Can do up to an additional processed recipes of mCurrentParallel * mBatchModifier
- * A batch modifier of 1 does nothing
+ * Enables Batch mode. Can do up to an additional processed recipes of mCurrentParallel * mBatchModifier A batch
+ * modifier of 1 does nothing
*/
public GT_ParallelHelper enableBatchMode(int aBatchModifier) {
mBatchMode = true;
@@ -153,7 +160,8 @@ public class GT_ParallelHelper {
}
/**
- * Enables the outputs to be calculated with its current Parallels, useful if one isn't doing anything special with outputs
+ * Enables the outputs to be calculated with its current Parallels, useful if one isn't doing anything special with
+ * outputs
*/
public GT_ParallelHelper enableOutputCalculation() {
mCalculateOutputs = true;
@@ -278,9 +286,8 @@ public class GT_ParallelHelper {
float tRecipeEUt = mRecipe.mEUt * mEUtModifier;
// Consume inputs to determine normal parallel
- for (;
- mCurrentParallel < mMaxParallel / mBatchModifier && tCurrentUsage < (mAvailableEUt - tRecipeEUt);
- mCurrentParallel++) {
+ for (; mCurrentParallel < mMaxParallel / mBatchModifier
+ && tCurrentUsage < (mAvailableEUt - tRecipeEUt); mCurrentParallel++) {
if (mRecipe.isRecipeInputEqual(true, false, tFluidInputs, tItemInputs)) {
tCurrentUsage += tRecipeEUt;
} else {
@@ -373,10 +380,8 @@ public class GT_ParallelHelper {
if (!tHatch.outputsLiquids()) {
continue;
}
- if (tHatch.isFluidLocked()
- && tLockedFluidName != null
- && !tLockedFluidName.equals(
- tFluidOutput.getFluid().getName())) {
+ if (tHatch.isFluidLocked() && tLockedFluidName != null
+ && !tLockedFluidName.equals(tFluidOutput.getFluid().getName())) {
continue;
}
}
@@ -391,8 +396,8 @@ public class GT_ParallelHelper {
}
// now that all partial/restricted hatches have been counted, create a priority queue for our outputs
// the lowest priority fluid is the number of complete parallel crafts we can support
- PriorityQueue<MutableTriple<Integer, Integer, FluidStack>> aParallelQueue =
- new PriorityQueue<>(Comparator.comparing(MutableTriple::getLeft));
+ PriorityQueue<MutableTriple<Integer, Integer, FluidStack>> aParallelQueue = new PriorityQueue<>(
+ Comparator.comparing(MutableTriple::getLeft));
for (Entry<FluidStack, MutablePair<Integer, Integer>> entry : tParallels.entrySet()) {
aParallelQueue.add(new MutableTriple<>(entry.getValue().left, entry.getValue().right, entry.getKey()));
}
@@ -470,8 +475,8 @@ public class GT_ParallelHelper {
}
// now that all partial stacks have been counted, create a priority queue for our outputs
// the lowest priority item is the number of complete parallel crafts we can support
- PriorityQueue<MutableTriple<Integer, Integer, ItemStack>> aParallelQueue =
- new PriorityQueue<>(Comparator.comparing(MutableTriple::getLeft));
+ PriorityQueue<MutableTriple<Integer, Integer, ItemStack>> aParallelQueue = new PriorityQueue<>(
+ Comparator.comparing(MutableTriple::getLeft));
for (Entry<ItemStack, MutablePair<Integer, Integer>> entry : tParallels.entrySet()) {
aParallelQueue.add(new MutableTriple<>(entry.getValue().left, entry.getValue().right, entry.getKey()));
}
diff --git a/src/main/java/gregtech/api/util/GT_PlayedSound.java b/src/main/java/gregtech/api/util/GT_PlayedSound.java
index 87743517d0..cdafc010d7 100644
--- a/src/main/java/gregtech/api/util/GT_PlayedSound.java
+++ b/src/main/java/gregtech/api/util/GT_PlayedSound.java
@@ -5,6 +5,7 @@ import static gregtech.api.enums.GT_Values.E;
import net.minecraft.util.ResourceLocation;
public class GT_PlayedSound {
+
public final String mSoundName;
public final int mX, mY, mZ;
@@ -27,8 +28,7 @@ public class GT_PlayedSound {
@Override
public boolean equals(Object aObject) {
if (aObject instanceof GT_PlayedSound) {
- return ((GT_PlayedSound) aObject).mX == mX
- && ((GT_PlayedSound) aObject).mY == mY
+ return ((GT_PlayedSound) aObject).mX == mX && ((GT_PlayedSound) aObject).mY == mY
&& ((GT_PlayedSound) aObject).mZ == mZ
&& ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName);
}
diff --git a/src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java b/src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java
index 548795cc49..923402c5d9 100644
--- a/src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java
+++ b/src/main/java/gregtech/api/util/GT_ProcessingArray_Manager.java
@@ -1,18 +1,21 @@
package gregtech.api.util;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import java.util.HashMap;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+
public class GT_ProcessingArray_Manager {
private static final HashMap<String, GT_Recipe_Map> mRecipeSaves = new HashMap<String, GT_Recipe_Map>();
+
// Adds recipe Maps to the PA using the machines unlocalized name.
- // Example: basicmachine.electrolyzer, with its recipe map will add the electrolyzer's recipe map to the PA
+ // Example: basicmachine.electrolyzer, with its recipe map will add the electrolyzer's recipe map to the PA
public static void addRecipeMapToPA(String aMachineName, GT_Recipe_Map aMap) {
if (aMachineName != null) {
mRecipeSaves.put(aMachineName, aMap);
}
}
+
// Allows the PA to extract the recipe map for the machine inside it.
public static GT_Recipe_Map giveRecipeMap(String aMachineName) {
if (aMachineName != null) {
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index c538028770..895dbf5ac3 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -3,7 +3,33 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.*;
import static net.minecraft.util.EnumChatFormatting.GRAY;
+import java.awt.*;
+import java.util.*;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
+
+import javax.annotation.Nullable;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntityFurnace;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidContainerItem;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+
import codechicken.nei.PositionedStack;
+
import com.gtnewhorizons.modularui.api.GlStateManager;
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.drawable.FallbackableUITexture;
@@ -17,6 +43,7 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.ProgressBar;
import com.gtnewhorizons.modularui.common.widget.SlotWidget;
+
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import gnu.trove.map.TByteObjectMap;
@@ -47,53 +74,40 @@ import gregtech.nei.HeatingCoilSpecialValueFormatter;
import gregtech.nei.INEISpecialInfoFormatter;
import gregtech.nei.NEIRecipeInfo;
import ic2.core.Ic2Items;
-import java.awt.*;
-import java.util.*;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Supplier;
-import javax.annotation.Nullable;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntityFurnace;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidContainerRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidContainerItem;
-import org.apache.commons.lang3.tuple.ImmutablePair;
-import org.apache.commons.lang3.tuple.Pair;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
- * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
- * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
+ * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it
+ * ruins compatibility This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you
+ * can access this File. Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the
+ * correct Functions for these Constructors.
* <p/>
- * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
+ * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then
+ * remove said erroreous Functions.
*/
public class GT_Recipe implements Comparable<GT_Recipe> {
+
public static volatile int VERSION = 509;
/**
- * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs,
+ * please add a new Recipe, because of the HashMaps.
*/
public ItemStack[] mInputs, mOutputs;
/**
- * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs,
+ * please add a new Recipe, because of the HashMaps.
*/
public FluidStack[] mFluidInputs, mFluidOutputs;
/**
- * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
+ * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or
+ * equal to the Output Array. A chance of 10000 equals 100%
*/
public int[] mChances;
/**
- * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
+ * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only
+ * useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists
+ * are also possible.
*/
public Object mSpecialItems;
@@ -107,11 +121,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
*/
public boolean mHidden = false;
/**
- * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
+ * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps,
+ * so that containsInput does return T on those fake Inputs)
*/
public boolean mFakeRecipe = false;
/**
- * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
+ * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the
+ * previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes,
+ * you have to set this to F.
*/
public boolean mCanBeBuffered = true;
/**
@@ -150,17 +167,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
reloadOwner();
}
- public GT_Recipe(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecialItems,
- int[] aChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances,
+ FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
if (aInputs == null) aInputs = new ItemStack[0];
if (aOutputs == null) aOutputs = new ItemStack[0];
if (aFluidInputs == null) aFluidInputs = new FluidStack[0];
@@ -183,17 +191,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
for (int i = 0; i < aFluidOutputs.length; i++) aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]);
for (ItemStack aInput : aInputs)
- if (aInput != null && Items.feather.getDamage(aInput) != W)
- for (int j = 0; j < aOutputs.length; j++) {
- if (GT_Utility.areStacksEqual(aInput, aOutputs[j]) && aChances[j] >= 10000) {
- if (aInput.stackSize >= aOutputs[j].stackSize) {
- aInput.stackSize -= aOutputs[j].stackSize;
- aOutputs[j] = null;
- } else {
- aOutputs[j].stackSize -= aInput.stackSize;
- }
+ if (aInput != null && Items.feather.getDamage(aInput) != W) for (int j = 0; j < aOutputs.length; j++) {
+ if (GT_Utility.areStacksEqual(aInput, aOutputs[j]) && aChances[j] >= 10000) {
+ if (aInput.stackSize >= aOutputs[j].stackSize) {
+ aInput.stackSize -= aOutputs[j].stackSize;
+ aOutputs[j] = null;
+ } else {
+ aOutputs[j].stackSize -= aInput.stackSize;
}
}
+ }
if (aOptimize && aDuration >= 32) {
ArrayList<ItemStack> tList = new ArrayList<>();
@@ -201,33 +208,27 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
tList.addAll(Arrays.asList(aOutputs));
for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--);
- for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--)
- if (aDuration / i >= 16) {
- boolean temp = true;
- for (ItemStack stack : tList)
- if (stack.stackSize % i != 0) {
- temp = false;
- break;
- }
- if (temp)
- for (FluidStack aFluidInput : aFluidInputs)
- if (aFluidInput.amount % i != 0) {
- temp = false;
- break;
- }
- if (temp)
- for (FluidStack aFluidOutput : aFluidOutputs)
- if (aFluidOutput.amount % i != 0) {
- temp = false;
- break;
- }
- if (temp) {
- for (ItemStack itemStack : tList) itemStack.stackSize /= i;
- for (FluidStack aFluidInput : aFluidInputs) aFluidInput.amount /= i;
- for (FluidStack aFluidOutput : aFluidOutputs) aFluidOutput.amount /= i;
- aDuration /= i;
- }
+ for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--) if (aDuration / i >= 16) {
+ boolean temp = true;
+ for (ItemStack stack : tList) if (stack.stackSize % i != 0) {
+ temp = false;
+ break;
+ }
+ if (temp) for (FluidStack aFluidInput : aFluidInputs) if (aFluidInput.amount % i != 0) {
+ temp = false;
+ break;
+ }
+ if (temp) for (FluidStack aFluidOutput : aFluidOutputs) if (aFluidOutput.amount % i != 0) {
+ temp = false;
+ break;
+ }
+ if (temp) {
+ for (ItemStack itemStack : tList) itemStack.stackSize /= i;
+ for (FluidStack aFluidInput : aFluidInputs) aFluidInput.amount /= i;
+ for (FluidStack aFluidOutput : aFluidOutputs) aFluidOutput.amount /= i;
+ aDuration /= i;
}
+ }
}
mInputs = aInputs;
@@ -239,7 +240,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
mDuration = aDuration;
mSpecialValue = aSpecialValue;
mEUt = aEUt;
- // checkCellBalance();
+ // checkCellBalance();
reloadOwner();
}
@@ -249,22 +250,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
private static FluidStack[] tryGetFluidInputsFromCells(ItemStack aInput) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true);
- return tFluid == null ? null : new FluidStack[] {tFluid};
+ return tFluid == null ? null : new FluidStack[] { tFluid };
}
// aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
- public GT_Recipe(
- ItemStack aInput1,
- ItemStack aOutput1,
- ItemStack aOutput2,
- ItemStack aOutput3,
- ItemStack aOutput4,
- int aSpecialValue,
- int aType) {
+ public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4,
+ int aSpecialValue, int aType) {
this(
true,
- new ItemStack[] {aInput1},
- new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4},
+ new ItemStack[] { aInput1 },
+ new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 },
null,
null,
null,
@@ -275,28 +270,28 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (mInputs.length > 0 && aSpecialValue > 0) {
switch (aType) {
- // Diesel Generator
+ // Diesel Generator
case 0:
GT_Recipe_Map.sDieselFuels.addRecipe(this);
GT_Recipe_Map.sLargeBoilerFakeFuels.addDieselRecipe(this);
break;
- // Gas Turbine
+ // Gas Turbine
case 1:
GT_Recipe_Map.sTurbineFuels.addRecipe(this);
break;
- // Thermal Generator
+ // Thermal Generator
case 2:
GT_Recipe_Map.sHotFuels.addRecipe(this);
break;
- // Plasma Generator
+ // Plasma Generator
case 4:
GT_Recipe_Map.sPlasmaFuels.addRecipe(this);
break;
- // Magic Generator
+ // Magic Generator
case 5:
GT_Recipe_Map.sMagicFuels.addRecipe(this);
break;
- // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
+ // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
default:
GT_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
GT_Recipe_Map.sLargeBoilerFakeFuels.addDenseLiquidRecipe(this);
@@ -305,16 +300,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
- public GT_Recipe(
- FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt, int aSpecialValue) {
+ public GT_Recipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt,
+ int aSpecialValue) {
this(
true,
null,
null,
null,
null,
- new FluidStack[] {aInput1, aInput2},
- new FluidStack[] {aOutput1},
+ new FluidStack[] { aInput1, aInput2 },
+ new FluidStack[] { aOutput1 },
Math.max(aDuration, 1),
aEUt,
Math.max(Math.min(aSpecialValue, 160000000), 0));
@@ -326,8 +321,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt) {
this(
true,
- new ItemStack[] {aInput1},
- new ItemStack[] {aOutput1, aOutput2},
+ new ItemStack[] { aInput1 },
+ new ItemStack[] { aOutput1, aOutput2 },
null,
null,
null,
@@ -340,21 +335,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
- public GT_Recipe(
- ItemStack aInput1,
- int aCellAmount,
- ItemStack aOutput1,
- ItemStack aOutput2,
- ItemStack aOutput3,
- ItemStack aOutput4,
- int aDuration,
- int aEUt) {
+ public GT_Recipe(ItemStack aInput1, int aCellAmount, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3,
+ ItemStack aOutput4, int aDuration, int aEUt) {
this(
true,
- new ItemStack[] {
- aInput1, aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null
- },
- new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4},
+ new ItemStack[] { aInput1,
+ aCellAmount > 0 ? ItemList.Cell_Empty.get(Math.min(64, Math.max(1, aCellAmount))) : null },
+ new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 },
null,
null,
null,
@@ -370,14 +357,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe(ItemStack aInput1, int aInput2, ItemStack aOutput1, ItemStack aOutput2) {
this(
true,
- new ItemStack[] {
- aInput1,
- GT_ModHandler.getIC2Item(
- "industrialTnt",
- aInput2 > 0 ? Math.min(aInput2, 64) : 1,
- new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1))
- },
- new ItemStack[] {aOutput1, aOutput2},
+ new ItemStack[] { aInput1,
+ GT_ModHandler.getIC2Item(
+ "industrialTnt",
+ aInput2 > 0 ? Math.min(aInput2, 64) : 1,
+ new ItemStack(Blocks.tnt, aInput2 > 0 ? Math.min(aInput2, 64) : 1)) },
+ new ItemStack[] { aOutput1, aOutput2 },
null,
null,
null,
@@ -393,8 +378,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe(int aEUt, int aDuration, ItemStack aInput1, ItemStack aOutput1) {
this(
true,
- new ItemStack[] {aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize)},
- new ItemStack[] {aOutput1},
+ new ItemStack[] { aInput1, ItemList.Circuit_Integrated.getWithDamage(0, aInput1.stackSize) },
+ new ItemStack[] { aOutput1 },
null,
null,
null,
@@ -410,8 +395,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe(ItemStack aInput1, ItemStack aInput2, int aEUt, int aDuration, ItemStack aOutput1) {
this(
true,
- aInput2 == null ? new ItemStack[] {aInput1} : new ItemStack[] {aInput1, aInput2},
- new ItemStack[] {aOutput1},
+ aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 },
+ new ItemStack[] { aOutput1 },
null,
null,
null,
@@ -424,12 +409,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
- public GT_Recipe(
- ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1, ItemStack aOutput2) {
+ public GT_Recipe(ItemStack aInput1, int aEUt, ItemStack aInput2, int aDuration, ItemStack aOutput1,
+ ItemStack aOutput2) {
this(
true,
- aInput2 == null ? new ItemStack[] {aInput1} : new ItemStack[] {aInput1, aInput2},
- new ItemStack[] {aOutput1, aOutput2},
+ aInput2 == null ? new ItemStack[] { aInput1 } : new ItemStack[] { aInput1, aInput2 },
+ new ItemStack[] { aOutput1, aOutput2 },
null,
null,
null,
@@ -445,8 +430,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration) {
this(
true,
- new ItemStack[] {aInput1},
- new ItemStack[] {aOutput1},
+ new ItemStack[] { aInput1 },
+ new ItemStack[] { aOutput1 },
null,
null,
null,
@@ -462,8 +447,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt, int VACUUM) {
this(
true,
- new ItemStack[] {aInput1},
- new ItemStack[] {aOutput1},
+ new ItemStack[] { aInput1 },
+ new ItemStack[] { aOutput1 },
null,
null,
null,
@@ -483,8 +468,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
null,
null,
null,
- new FluidStack[] {aInput1},
- new FluidStack[] {aOutput1},
+ new FluidStack[] { aInput1 },
+ new FluidStack[] { aOutput1 },
Math.max(aDuration, 1),
aEUt,
0);
@@ -494,16 +479,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
// Dummy GT_Recipe maker...
- public GT_Recipe(
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecialItems,
- int[] aChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe(ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances,
+ FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
this(
true,
aInputs,
@@ -575,45 +552,40 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return new GT_Recipe(this);
}
- public boolean isRecipeInputEqual(
- boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs,
+ ItemStack... aInputs) {
return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, 1, aFluidInputs, aInputs);
}
// For non-multiplied recipe amount values
- public boolean isRecipeInputEqual(
- boolean aDecreaseStacksizeBySuccess,
- boolean aDontCheckStackSizes,
- FluidStack[] aFluidInputs,
- ItemStack... aInputs) {
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes,
+ FluidStack[] aFluidInputs, ItemStack... aInputs) {
return isRecipeInputEqual(aDecreaseStacksizeBySuccess, aDontCheckStackSizes, 1, aFluidInputs, aInputs);
}
/**
* Okay, did some code archeology to figure out what's going on here.
*
- * <p>This variable was added in
- * <a href=https://github.com/GTNewHorizons/GT5-Unofficial/commit/9959ab7443982a19ad329bca424ab515493432e9>this commit,</a>
- * in order to fix the issues mentioned in
- * <a href=https://github.com/GTNewHorizons/GT5-Unofficial/pull/183>the PR</a>.
+ * <p>
+ * This variable was added in <a
+ * href=https://github.com/GTNewHorizons/GT5-Unofficial/commit/9959ab7443982a19ad329bca424ab515493432e9>this
+ * commit,</a> in order to fix the issues mentioned in <a
+ * href=https://github.com/GTNewHorizons/GT5-Unofficial/pull/183>the PR</a>.
*
- * <p>It looks like it controls checking NBT. At this point, since we are still using universal
- * fluid cells which store their fluids in NBT, it probably will not be safe to disable the NBT
- * checks in the near future. Data sticks may be another case. Anyway, we probably can't get rid
- * of this without some significant changes to clean up recipe inputs.
+ * <p>
+ * It looks like it controls checking NBT. At this point, since we are still using universal fluid cells which store
+ * their fluids in NBT, it probably will not be safe to disable the NBT checks in the near future. Data sticks may
+ * be another case. Anyway, we probably can't get rid of this without some significant changes to clean up recipe
+ * inputs.
*/
public static boolean GTppRecipeHelper;
/**
- * WARNING: Do not call this method with both {@code aDecreaseStacksizeBySuccess} and {@code aDontCheckStackSizes} set to {@code true}!
- * You'll get weird behavior.
+ * WARNING: Do not call this method with both {@code aDecreaseStacksizeBySuccess} and {@code aDontCheckStackSizes}
+ * set to {@code true}! You'll get weird behavior.
*/
- public boolean isRecipeInputEqual(
- boolean aDecreaseStacksizeBySuccess,
- boolean aDontCheckStackSizes,
- int amountMultiplier,
- FluidStack[] aFluidInputs,
- ItemStack... aInputs) {
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes,
+ int amountMultiplier, FluidStack[] aFluidInputs, ItemStack... aInputs) {
if (mInputs.length > 0 && aInputs == null) return false;
if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
@@ -676,10 +648,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (GT_OreDictUnificator.isInputStackEqual(providedItem, unifiedItemCost)) {
if (GTppRecipeHelper) { // Please see JavaDoc on GTppRecipeHelper for why this is here.
if (GT_Utility.areStacksEqual(providedItem, Ic2Items.FluidCell.copy(), true)
- || GT_Utility.areStacksEqual(
- providedItem, ItemList.Tool_DataStick.get(1L), true)
- || GT_Utility.areStacksEqual(
- providedItem, ItemList.Tool_DataOrb.get(1L), true)) {
+ || GT_Utility
+ .areStacksEqual(providedItem, ItemList.Tool_DataStick.get(1L), true)
+ || GT_Utility
+ .areStacksEqual(providedItem, ItemList.Tool_DataOrb.get(1L), true)) {
if (!GT_Utility.areStacksEqual(providedItem, recipeItemCost, false)) continue;
}
}
@@ -756,16 +728,17 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Sets description shown on NEI.
- * <br>If you have a large number of recipes for the recipemap,
- * this is not efficient memory wise, so use {@link GT_Recipe_Map#setNEISpecialInfoFormatter} instead.
+ * Sets description shown on NEI. <br>
+ * If you have a large number of recipes for the recipemap, this is not efficient memory wise, so use
+ * {@link GT_Recipe_Map#setNEISpecialInfoFormatter} instead.
*/
protected void setNeiDesc(String... neiDesc) {
this.neiDesc = neiDesc;
}
/**
- * Use {@link GT_Recipe_Map#getItemInputPositions} or {@link GT_Recipe_Map#getSpecialItemPosition} or {@link GT_Recipe_Map#getFluidInputPositions} instead
+ * Use {@link GT_Recipe_Map#getItemInputPositions} or {@link GT_Recipe_Map#getSpecialItemPosition} or
+ * {@link GT_Recipe_Map#getFluidInputPositions} instead
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
@@ -793,8 +766,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace) {
List<StackTraceElement> toAdd = new ArrayList<>();
for (StackTraceElement stackTrace : Thread.currentThread().getStackTrace()) {
- if (excludedClasses.stream()
- .noneMatch(c -> stackTrace.getClassName().equals(c))) {
+ if (excludedClasses.stream().noneMatch(c -> stackTrace.getClassName().equals(c))) {
toAdd.add(stackTrace);
}
}
@@ -822,8 +794,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
public static class GT_Recipe_AssemblyLine {
- public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes =
- new ArrayList<GT_Recipe_AssemblyLine>();
+
+ public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes = new ArrayList<GT_Recipe_AssemblyLine>();
static {
if (!Boolean.getBoolean("com.gtnh.gt5u.ignore-invalid-assline-recipe"))
@@ -840,9 +812,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
GT_Log.err.printf("Invalid recipe: %s%n", recipe);
}
}
- if (invalidCount > 0)
- throw new RuntimeException("There are " + invalidCount
- + " invalid assembly line recipe(s)! Check GregTech.log for details!");
+ if (invalidCount > 0) throw new RuntimeException(
+ "There are " + invalidCount + " invalid assembly line recipe(s)! Check GregTech.log for details!");
}
public ItemStack mResearchItem;
@@ -860,14 +831,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
*
* if you set one yourself, it will give you one of the RunetimeExceptions!
*/
- public GT_Recipe_AssemblyLine(
- ItemStack aResearchItem,
- int aResearchTime,
- ItemStack[] aInputs,
- FluidStack[] aFluidInputs,
- ItemStack aOutput,
- int aDuration,
- int aEUt) {
+ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs,
+ FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) {
this(
aResearchItem,
aResearchTime,
@@ -895,15 +860,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
*
* if you don't set one yourself, it will break a lot of stuff!
*/
- public GT_Recipe_AssemblyLine(
- ItemStack aResearchItem,
- int aResearchTime,
- ItemStack[] aInputs,
- FluidStack[] aFluidInputs,
- ItemStack aOutput,
- int aDuration,
- int aEUt,
- ItemStack[][] aAlt) {
+ public GT_Recipe_AssemblyLine(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs,
+ FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt, ItemStack[][] aAlt) {
mResearchItem = aResearchItem;
mResearchTime = aResearchTime;
mInputs = aInputs;
@@ -929,7 +887,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
GT_ItemStack thisOutput = new GT_ItemStack(mOutput);
GT_ItemStack thisResearch = new GT_ItemStack(mResearchItem);
int miscRecipeDataHash = Arrays.deepHashCode(
- new Object[] {totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime});
+ new Object[] { totalInputStackSize, mDuration, mEUt, thisOutput, thisResearch, mResearchTime });
result = prime * result + inputFluidHash;
result = prime * result + inputHash;
result = prime * result + miscRecipeDataHash;
@@ -982,8 +940,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
- return this.mDuration == other.mDuration
- && this.mEUt == other.mEUt
+ return this.mDuration == other.mDuration && this.mEUt == other.mEUt
&& this.mResearchTime == other.mResearchTime;
}
@@ -996,19 +953,28 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public String toString() {
return "GT_Recipe_AssemblyLine{" + "mResearchItem="
- + mResearchItem + ", mResearchTime="
- + mResearchTime + ", mInputs="
- + Arrays.toString(mInputs) + ", mFluidInputs="
- + Arrays.toString(mFluidInputs) + ", mOutput="
- + mOutput + ", mDuration="
- + mDuration + ", mEUt="
- + mEUt + ", mOreDictAlt="
- + Arrays.toString(mOreDictAlt) + '}';
+ + mResearchItem
+ + ", mResearchTime="
+ + mResearchTime
+ + ", mInputs="
+ + Arrays.toString(mInputs)
+ + ", mFluidInputs="
+ + Arrays.toString(mFluidInputs)
+ + ", mOutput="
+ + mOutput
+ + ", mDuration="
+ + mDuration
+ + ", mEUt="
+ + mEUt
+ + ", mOreDictAlt="
+ + Arrays.toString(mOreDictAlt)
+ + '}';
}
/**
- * @param aPersistentHash the persistent hash. it should reflect the exact input used to generate this recipe
- * If 0 is passed in, the actual persistent hash will be automatically remapped to 1 instead.
+ * @param aPersistentHash the persistent hash. it should reflect the exact input used to generate this recipe If
+ * 0 is passed in, the actual persistent hash will be automatically remapped to 1
+ * instead.
* @throws IllegalStateException if the persistent hash has been set already
*/
public void setPersistentHash(int aPersistentHash) {
@@ -1020,6 +986,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@SuppressWarnings("StaticInitializerReferencesSubClass")
public static class GT_Recipe_Map {
+
/**
* Contains all Recipe Maps
*/
@@ -1030,139 +997,132 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static final Map<String, GT_Recipe_Map> sIndexedMappings = new HashMap<>();
public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map(
- new HashSet<>(500),
- "gt.recipe.orewasher",
- "Ore Washing Plant",
- null,
- RES_PATH_GUI + "basicmachines/OreWasher",
- 1,
- 3,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW);
+ new HashSet<>(500),
+ "gt.recipe.orewasher",
+ "Ore Washing Plant",
+ null,
+ RES_PATH_GUI + "basicmachines/OreWasher",
+ 1,
+ 3,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW);
public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map(
- new HashSet<>(1000),
- "gt.recipe.thermalcentrifuge",
- "Thermal Centrifuge",
- null,
- RES_PATH_GUI + "basicmachines/ThermalCentrifuge",
- 1,
- 3,
- 1,
- 0,
- 2,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1000),
+ "gt.recipe.thermalcentrifuge",
+ "Thermal Centrifuge",
+ null,
+ RES_PATH_GUI + "basicmachines/ThermalCentrifuge",
+ 1,
+ 3,
+ 1,
+ 0,
+ 2,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map(
- new HashSet<>(750),
- "gt.recipe.compressor",
- "Compressor",
- null,
- RES_PATH_GUI + "basicmachines/Compressor",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR)
- .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT)
- .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM)
- .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM);
+ new HashSet<>(750),
+ "gt.recipe.compressor",
+ "Compressor",
+ null,
+ RES_PATH_GUI + "basicmachines/Compressor",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM);
public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map(
- new HashSet<>(250),
- "gt.recipe.extractor",
- "Extractor",
- null,
- RES_PATH_GUI + "basicmachines/Extractor",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT)
- .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM)
- .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM);
+ new HashSet<>(250),
+ "gt.recipe.extractor",
+ "Extractor",
+ null,
+ RES_PATH_GUI + "basicmachines/Extractor",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM);
public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler(
- new HashSet<>(0),
- "ic.recipe.recycler",
- "Recycler",
- "ic2.recycler",
- RES_PATH_GUI + "basicmachines/Recycler",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW);
+ new HashSet<>(0),
+ "ic.recipe.recycler",
+ "Recycler",
+ "ic2.recycler",
+ RES_PATH_GUI + "basicmachines/Recycler",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW);
public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace(
- new HashSet<>(0),
- "mc.recipe.furnace",
- "Furnace",
- "smelting",
- RES_PATH_GUI + "basicmachines/E_Furnace",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM)
- .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM);
+ new HashSet<>(0),
+ "mc.recipe.furnace",
+ "Furnace",
+ "smelting",
+ RES_PATH_GUI + "basicmachines/E_Furnace",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM);
public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave(
- new HashSet<>(0),
- "gt.recipe.microwave",
- "Microwave",
- "smelting",
- RES_PATH_GUI + "basicmachines/E_Furnace",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(0),
+ "gt.recipe.microwave",
+ "Microwave",
+ "smelting",
+ RES_PATH_GUI + "basicmachines/E_Furnace",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
/** Set {@code aSpecialValue = -100} to bypass the disassembler tier check and default recipe duration. */
public static final GT_Recipe_Map sDisassemblerRecipes = new GT_Recipe_Map(
@@ -1181,6 +1141,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
E,
true,
false) {
+
@Override
public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) {
if (isOutput) {
@@ -1200,697 +1161,654 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
.setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map(
- new HashSet<>(300),
- "gt.recipe.scanner",
- "Scanner",
- null,
- RES_PATH_GUI + "basicmachines/Scanner",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE)
- .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(300),
+ "gt.recipe.scanner",
+ "Scanner",
+ null,
+ RES_PATH_GUI + "basicmachines/Scanner",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE)
+ .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map(
- new HashSet<>(200),
- "gt.recipe.rockbreaker",
- "Rock Breaker",
- null,
- RES_PATH_GUI + "basicmachines/RockBreaker",
- 2,
- 1,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(200),
+ "gt.recipe.rockbreaker",
+ "Rock Breaker",
+ null,
+ RES_PATH_GUI + "basicmachines/RockBreaker",
+ 2,
+ 1,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map(
- new HashSet<>(1000),
- "gt.recipe.byproductlist",
- "Ore Byproduct List",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 6,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1000),
+ "gt.recipe.byproductlist",
+ "Ore Byproduct List",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 6,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sReplicatorFakeRecipes = new ReplicatorFakeMap(
- new HashSet<>(100),
- "gt.recipe.replicator",
- "Replicator",
- null,
- RES_PATH_GUI + "basicmachines/Replicator",
- 0,
- 1,
- 0,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM)
- .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(100),
+ "gt.recipe.replicator",
+ "Replicator",
+ null,
+ RES_PATH_GUI + "basicmachines/Replicator",
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM)
+ .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
// public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet<>(30),
// "gt.recipe.scanner", "Scanner", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 1, 0, 1, E, 1, E, true,
// true);
public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map_AssemblyLineFake(
- new HashSet<>(110),
- "gt.recipe.fakeAssemblylineProcess",
- "Assemblyline Process",
- null,
- RES_PATH_GUI + "FakeAssemblyline",
- 16,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
- .setUsualFluidInputCount(4);
+ new HashSet<>(110),
+ "gt.recipe.fakeAssemblylineProcess",
+ "Assemblyline Process",
+ null,
+ RES_PATH_GUI + "FakeAssemblyline",
+ 16,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
+ .setUsualFluidInputCount(4);
public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map(
- new HashSet<>(20000),
- "gt.recipe.plasmaarcfurnace",
- "Plasma Arc Furnace",
- null,
- RES_PATH_GUI + "basicmachines/PlasmaArcFurnace",
- 1,
- 4,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(20000),
+ "gt.recipe.plasmaarcfurnace",
+ "Plasma Arc Furnace",
+ null,
+ RES_PATH_GUI + "basicmachines/PlasmaArcFurnace",
+ 1,
+ 4,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map(
- new HashSet<>(20000),
- "gt.recipe.arcfurnace",
- "Arc Furnace",
- null,
- RES_PATH_GUI + "basicmachines/ArcFurnace",
- 1,
- 4,
- 1,
- 1,
- 3,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(20000),
+ "gt.recipe.arcfurnace",
+ "Arc Furnace",
+ null,
+ RES_PATH_GUI + "basicmachines/ArcFurnace",
+ 1,
+ 4,
+ 1,
+ 1,
+ 3,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sPrinterRecipes = new GT_Recipe_Map_Printer(
- new HashSet<>(5),
- "gt.recipe.printer",
- "Printer",
- null,
- RES_PATH_GUI + "basicmachines/Printer",
- 1,
- 1,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_PAGE_BLANK)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED)
- .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_STICK)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(5),
+ "gt.recipe.printer",
+ "Printer",
+ null,
+ RES_PATH_GUI + "basicmachines/Printer",
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_PAGE_BLANK)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PAGE_PRINTED)
+ .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_STICK)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sSifterRecipes = new GT_Recipe_Map(
- new HashSet<>(105),
- "gt.recipe.sifter",
- "Sifter",
- null,
- RES_PATH_GUI + "basicmachines/Sifter",
- 1,
- 9,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN);
+ new HashSet<>(105),
+ "gt.recipe.sifter",
+ "Sifter",
+ null,
+ RES_PATH_GUI + "basicmachines/Sifter",
+ 1,
+ 9,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN);
public static final GT_Recipe_Map sPressRecipes = new GT_Recipe_Map_FormingPress(
- new HashSet<>(300),
- "gt.recipe.press",
- "Forming Press",
- null,
- RES_PATH_GUI + "basicmachines/Press3",
- 6,
- 1,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_PRESS_1)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_PRESS_2)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PRESS_3)
- .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT);
+ new HashSet<>(300),
+ "gt.recipe.press",
+ "Forming Press",
+ null,
+ RES_PATH_GUI + "basicmachines/Press3",
+ 6,
+ 1,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_PRESS_1)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_PRESS_2)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_PRESS_3)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sLaserEngraverRecipes = new GT_Recipe_Map(
- new HashSet<>(810),
- "gt.recipe.laserengraver",
- "Precision Laser Engraver",
- null,
- RES_PATH_GUI + "basicmachines/LaserEngraver2",
- 4,
- 4,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_LENS)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(2)
- .setUsualFluidOutputCount(2);
+ new HashSet<>(810),
+ "gt.recipe.laserengraver",
+ "Precision Laser Engraver",
+ null,
+ RES_PATH_GUI + "basicmachines/LaserEngraver2",
+ 4,
+ 4,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_LENS)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setUsualFluidInputCount(2).setUsualFluidOutputCount(2);
public static final GT_Recipe_Map sMixerRecipes = new GT_Recipe_Map(
- new HashSet<>(900),
- "gt.recipe.mixer",
- "Mixer",
- null,
- RES_PATH_GUI + "basicmachines/Mixer6",
- 9,
- 4,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW);
+ new HashSet<>(900),
+ "gt.recipe.mixer",
+ "Mixer",
+ null,
+ RES_PATH_GUI + "basicmachines/Mixer6",
+ 9,
+ 4,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW);
public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map(
- new HashSet<>(300),
- "gt.recipe.autoclave",
- "Autoclave",
- null,
- RES_PATH_GUI + "basicmachines/Autoclave4",
- 2,
- 4,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
- .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_GEM)
- .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(300),
+ "gt.recipe.autoclave",
+ "Autoclave",
+ null,
+ RES_PATH_GUI + "basicmachines/Autoclave4",
+ 2,
+ 4,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_GEM)
+ .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map(
- new HashSet<>(50),
- "gt.recipe.electromagneticseparator",
- "Electromagnetic Separator",
- null,
- RES_PATH_GUI + "basicmachines/ElectromagneticSeparator",
- 1,
- 3,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT);
+ new HashSet<>(50),
+ "gt.recipe.electromagneticseparator",
+ "Electromagnetic Separator",
+ null,
+ RES_PATH_GUI + "basicmachines/ElectromagneticSeparator",
+ 1,
+ 3,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map(
- new HashSet<>(300),
- "gt.recipe.polarizer",
- "Electromagnetic Polarizer",
- null,
- RES_PATH_GUI + "basicmachines/Polarizer",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT);
+ new HashSet<>(300),
+ "gt.recipe.polarizer",
+ "Electromagnetic Polarizer",
+ null,
+ RES_PATH_GUI + "basicmachines/Polarizer",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_MAGNET, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator(
- new HashSet<>(16600),
- "gt.recipe.macerator",
- "Pulverization",
- null,
- RES_PATH_GUI + "basicmachines/Macerator4",
- 1,
- 4,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT)
- .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM)
- .setSlotOverlaySteam(true, GT_UITextures.OVERLAY_SLOT_DUST_STEAM)
- .setProgressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM);
+ new HashSet<>(16600),
+ "gt.recipe.macerator",
+ "Pulverization",
+ null,
+ RES_PATH_GUI + "basicmachines/Macerator4",
+ 1,
+ 4,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE_STEAM)
+ .setSlotOverlaySteam(true, GT_UITextures.OVERLAY_SLOT_DUST_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_MACERATE_STEAM);
public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(
- new HashSet<>(2550),
- "gt.recipe.chemicalbath",
- "Chemical Bath",
- null,
- RES_PATH_GUI + "basicmachines/ChemicalBath",
- 1,
- 3,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW);
+ new HashSet<>(2550),
+ "gt.recipe.chemicalbath",
+ "Chemical Bath",
+ null,
+ RES_PATH_GUI + "basicmachines/ChemicalBath",
+ 1,
+ 3,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW);
public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner(
- new HashSet<>(2100),
- "gt.recipe.fluidcanner",
- "Fluid Canning Machine",
- null,
- RES_PATH_GUI + "basicmachines/FluidCanner",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CANISTER)
- .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT);
+ new HashSet<>(2100),
+ "gt.recipe.fluidcanner",
+ "Fluid Canning Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/FluidCanner",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map(
- new HashSet<>(450),
- "gt.recipe.brewer",
- "Brewing Machine",
- null,
- RES_PATH_GUI + "basicmachines/PotionBrewer",
- 1,
- 0,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(450),
+ "gt.recipe.brewer",
+ "Brewing Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/PotionBrewer",
+ 1,
+ 0,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sFluidHeaterRecipes = new GT_Recipe_Map(
- new HashSet<>(10),
- "gt.recipe.fluidheater",
- "Fluid Heater",
- null,
- RES_PATH_GUI + "basicmachines/FluidHeater",
- 1,
- 0,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_HEATER_1)
- .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_HEATER_2)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(10),
+ "gt.recipe.fluidheater",
+ "Fluid Heater",
+ null,
+ RES_PATH_GUI + "basicmachines/FluidHeater",
+ 1,
+ 0,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_HEATER_1)
+ .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_HEATER_2)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sDistilleryRecipes = new GT_Recipe_Map(
- new HashSet<>(400),
- "gt.recipe.distillery",
- "Distillery",
- null,
- RES_PATH_GUI + "basicmachines/Distillery",
- 1,
- 1,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_BEAKER_1)
- .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_BEAKER_2)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(400),
+ "gt.recipe.distillery",
+ "Distillery",
+ null,
+ RES_PATH_GUI + "basicmachines/Distillery",
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_BEAKER_1)
+ .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_BEAKER_2)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sFermentingRecipes = new GT_Recipe_Map(
- new HashSet<>(50),
- "gt.recipe.fermenter",
- "Fermenter",
- null,
- RES_PATH_GUI + "basicmachines/Fermenter",
- 0,
- 0,
- 0,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(50),
+ "gt.recipe.fermenter",
+ "Fermenter",
+ null,
+ RES_PATH_GUI + "basicmachines/Fermenter",
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sFluidSolidficationRecipes = new GT_Recipe_Map(
- new HashSet<>(35000),
- "gt.recipe.fluidsolidifier",
- "Fluid Solidifier",
- null,
- RES_PATH_GUI + "basicmachines/FluidSolidifier",
- 1,
- 1,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLD)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(35000),
+ "gt.recipe.fluidsolidifier",
+ "Fluid Solidifier",
+ null,
+ RES_PATH_GUI + "basicmachines/FluidSolidifier",
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLD)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sFluidExtractionRecipes = new GT_Recipe_Map(
- new HashSet<>(15000),
- "gt.recipe.fluidextractor",
- "Fluid Extractor",
- null,
- RES_PATH_GUI + "basicmachines/FluidExtractor",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
+ new HashSet<>(15000),
+ "gt.recipe.fluidextractor",
+ "Fluid Extractor",
+ null,
+ RES_PATH_GUI + "basicmachines/FluidExtractor",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sBoxinatorRecipes = new GT_Recipe_Map(
- new HashSet<>(2500),
- "gt.recipe.packager",
- "Packager",
- null,
- RES_PATH_GUI + "basicmachines/Packager",
- 2,
- 1,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_BOX)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_BOXED)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(2500),
+ "gt.recipe.packager",
+ "Packager",
+ null,
+ RES_PATH_GUI + "basicmachines/Packager",
+ 2,
+ 1,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_BOX)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_BOXED)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sUnboxinatorRecipes = new GT_Recipe_Map_Unboxinator(
- new HashSet<>(2500),
- "gt.recipe.unpackager",
- "Unpackager",
- null,
- RES_PATH_GUI + "basicmachines/Unpackager",
- 1,
- 2,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOXED)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(2500),
+ "gt.recipe.unpackager",
+ "Unpackager",
+ null,
+ RES_PATH_GUI + "basicmachines/Unpackager",
+ 1,
+ 2,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOXED)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sFusionRecipes = new GT_Recipe_Map_FluidOnly(
- new HashSet<>(50),
- "gt.recipe.fusionreactor",
- "Fusion Reactor",
- null,
- RES_PATH_GUI + "basicmachines/FusionReactor",
- 0,
- 0,
- 0,
- 2,
- 1,
- "Start: ",
- 1,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(2)
- .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE);
+ new HashSet<>(50),
+ "gt.recipe.fusionreactor",
+ "Fusion Reactor",
+ null,
+ RES_PATH_GUI + "basicmachines/FusionReactor",
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ "Start: ",
+ 1,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setUsualFluidInputCount(2).setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE);
public static final GT_Recipe_Map sComplexFusionRecipes = new GT_Recipe_Map_ComplexFusion(
- new HashSet<>(50),
- "gt.recipe.complexfusionreactor",
- "Complex Fusion Reactor",
- null,
- RES_PATH_GUI + "basicmachines/ComplexFusionReactor",
- 3,
- 0,
- 0,
- 2,
- 1,
- "Start: ",
- 1,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(16)
- .setUsualFluidOutputCount(16)
- .setNEITransferRect(new Rectangle(79, 34, 18, 18))
- .setLogoPos(80, 61)
- .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE);
+ new HashSet<>(50),
+ "gt.recipe.complexfusionreactor",
+ "Complex Fusion Reactor",
+ null,
+ RES_PATH_GUI + "basicmachines/ComplexFusionReactor",
+ 3,
+ 0,
+ 0,
+ 2,
+ 1,
+ "Start: ",
+ 1,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setUsualFluidInputCount(16).setUsualFluidOutputCount(16)
+ .setNEITransferRect(new Rectangle(79, 34, 18, 18)).setLogoPos(80, 61)
+ .setNEISpecialInfoFormatter(FusionSpecialValueFormatter.INSTANCE);
public static final GT_Recipe_Map sCentrifugeRecipes = new GT_Recipe_Map(
- new HashSet<>(1200),
- "gt.recipe.centrifuge",
- "Centrifuge",
- null,
- RES_PATH_GUI + "basicmachines/Centrifuge",
- 2,
- 6,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID)
- .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1200),
+ "gt.recipe.centrifuge",
+ "Centrifuge",
+ null,
+ RES_PATH_GUI + "basicmachines/Centrifuge",
+ 2,
+ 6,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_FLUID)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sElectrolyzerRecipes = new GT_Recipe_Map(
- new HashSet<>(300),
- "gt.recipe.electrolyzer",
- "Electrolyzer",
- null,
- RES_PATH_GUI + "basicmachines/Electrolyzer",
- 2,
- 6,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CHARGER)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID)
- .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
+ new HashSet<>(300),
+ "gt.recipe.electrolyzer",
+ "Electrolyzer",
+ null,
+ RES_PATH_GUI + "basicmachines/Electrolyzer",
+ 2,
+ 6,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CHARGER)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_CHARGER_FLUID)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sBlastRecipes = new GT_Recipe_Map(
- new HashSet<>(800),
- "gt.recipe.blastfurnace",
- "Blast Furnace",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 6,
- 6,
- 1,
- 0,
- 1,
- "Heat Capacity: ",
- 1,
- " K",
- false,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE);
+ new HashSet<>(800),
+ "gt.recipe.blastfurnace",
+ "Blast Furnace",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 6,
+ 6,
+ 1,
+ 0,
+ 1,
+ "Heat Capacity: ",
+ 1,
+ " K",
+ false,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE);
public static final GT_Recipe_Map sPlasmaForgeRecipes = new GT_Recipe_Map_LargeNEI(
- new HashSet<>(20),
- "gt.recipe.plasmaforge",
- "DTPF",
- null,
- RES_PATH_GUI + "basicmachines/PlasmaForge",
- 9,
- 9,
- 0,
- 0,
- 1,
- "Heat Capacity: ",
- 1,
- " K",
- false,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(9)
- .setUsualFluidOutputCount(9)
- .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE);
+ new HashSet<>(20),
+ "gt.recipe.plasmaforge",
+ "DTPF",
+ null,
+ RES_PATH_GUI + "basicmachines/PlasmaForge",
+ 9,
+ 9,
+ 0,
+ 0,
+ 1,
+ "Heat Capacity: ",
+ 1,
+ " K",
+ false,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setUsualFluidInputCount(9).setUsualFluidOutputCount(9)
+ .setNEISpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE);
public static final GT_Recipe_Map sPrimitiveBlastRecipes = new GT_Recipe_Map(
- new HashSet<>(200),
- "gt.recipe.primitiveblastfurnace",
- "Primitive Blast Furnace",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 3,
- 3,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- false,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(200),
+ "gt.recipe.primitiveblastfurnace",
+ "Primitive Blast Furnace",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 3,
+ 3,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ false,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sImplosionRecipes = new GT_Recipe_Map(
- new HashSet<>(900),
- "gt.recipe.implosioncompressor",
- "Implosion Compressor",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 2,
- 2,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_IMPLOSION)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXPLOSIVE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT);
+ new HashSet<>(900),
+ "gt.recipe.implosioncompressor",
+ "Implosion Compressor",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 2,
+ 2,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_IMPLOSION)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXPLOSIVE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sVacuumRecipes = new GT_Recipe_Map(
- new HashSet<>(305),
- "gt.recipe.vacuumfreezer",
- "Vacuum Freezer",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- false,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(2);
+ new HashSet<>(305),
+ "gt.recipe.vacuumfreezer",
+ "Vacuum Freezer",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ false,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setUsualFluidInputCount(2);
public static final GT_Recipe_Map sChemicalRecipes = new GT_Recipe_Map(
- new HashSet<>(1170),
- "gt.recipe.chemicalreactor",
- "Chemical Reactor",
- null,
- RES_PATH_GUI + "basicmachines/ChemicalReactor",
- 2,
- 2,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_2)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1)
- .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1170),
+ "gt.recipe.chemicalreactor",
+ "Chemical Reactor",
+ null,
+ RES_PATH_GUI + "basicmachines/ChemicalReactor",
+ 2,
+ 2,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_2)
+ .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1)
+ .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sMultiblockChemicalRecipes = new GT_Recipe_Map_LargeChemicalReactor()
.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(6)
- .setUsualFluidOutputCount(6);
+ .setUsualFluidInputCount(6).setUsualFluidOutputCount(6);
public static final GT_Recipe_Map sDistillationRecipes = new GT_Recipe_Map_DistillationTower()
.setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT)
.setUsualFluidOutputCount(11);
- public static final GT_Recipe_Map_OilCracker sCrackingRecipes =
- (GT_Recipe_Map_OilCracker) new GT_Recipe_Map_OilCracker()
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT)
- .setUsualFluidInputCount(2);
+ public static final GT_Recipe_Map_OilCracker sCrackingRecipes = (GT_Recipe_Map_OilCracker) new GT_Recipe_Map_OilCracker()
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, ProgressBar.Direction.RIGHT)
+ .setUsualFluidInputCount(2);
/**
* Use sCrackingRecipes instead
*/
@@ -1898,344 +1816,325 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static final GT_Recipe_Map sCrakingRecipes = sCrackingRecipes;
public static final GT_Recipe_Map sPyrolyseRecipes = new GT_Recipe_Map(
- new HashSet<>(150),
- "gt.recipe.pyro",
- "Pyrolyse Oven",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 2,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(150),
+ "gt.recipe.pyro",
+ "Pyrolyse Oven",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 2,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sWiremillRecipes = new GT_Recipe_Map(
- new HashSet<>(450),
- "gt.recipe.wiremill",
- "Wiremill",
- null,
- RES_PATH_GUI + "basicmachines/Wiremill",
- 2,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WIREMILL)
- .setProgressBar(GT_UITextures.PROGRESSBAR_WIREMILL, ProgressBar.Direction.RIGHT);
+ new HashSet<>(450),
+ "gt.recipe.wiremill",
+ "Wiremill",
+ null,
+ RES_PATH_GUI + "basicmachines/Wiremill",
+ 2,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WIREMILL)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_WIREMILL, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sBenderRecipes = new GT_Recipe_Map(
- new HashSet<>(5000),
- "gt.recipe.metalbender",
- "Bending Machine",
- null,
- RES_PATH_GUI + "basicmachines/Bender",
- 2,
- 1,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BENDER)
- .setProgressBar(GT_UITextures.PROGRESSBAR_BENDING, ProgressBar.Direction.RIGHT);
+ new HashSet<>(5000),
+ "gt.recipe.metalbender",
+ "Bending Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/Bender",
+ 2,
+ 1,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BENDER)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_BENDING, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sAlloySmelterRecipes = new GT_Recipe_Map(
- new HashSet<>(12000),
- "gt.recipe.alloysmelter",
- "Alloy Smelter",
- null,
- RES_PATH_GUI + "basicmachines/AlloySmelter",
- 2,
- 1,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
- .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM)
- .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM);
+ new HashSet<>(12000),
+ "gt.recipe.alloysmelter",
+ "Alloy Smelter",
+ null,
+ RES_PATH_GUI + "basicmachines/AlloySmelter",
+ 2,
+ 1,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM);
public static final GT_Recipe_Map sAssemblerRecipes = new GT_Recipe_Map_Assembler(
- new HashSet<>(8200),
- "gt.recipe.assembler",
- "Assembler",
- null,
- RES_PATH_GUI + "basicmachines/Assembler2",
- 9,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(8200),
+ "gt.recipe.assembler",
+ "Assembler",
+ null,
+ RES_PATH_GUI + "basicmachines/Assembler2",
+ 9,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sCircuitAssemblerRecipes = new GT_Recipe_Map_Assembler(
- new HashSet<>(605),
- "gt.recipe.circuitassembler",
- "Circuit Assembler",
- null,
- RES_PATH_GUI + "basicmachines/CircuitAssembler",
- 6,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setNEIUnificateOutput(!Loader.isModLoaded("neicustomdiagram"))
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT)
- .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER, ProgressBar.Direction.RIGHT);
+ new HashSet<>(605),
+ "gt.recipe.circuitassembler",
+ "Circuit Assembler",
+ null,
+ RES_PATH_GUI + "basicmachines/CircuitAssembler",
+ 6,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setNEIUnificateOutput(!Loader.isModLoaded("neicustomdiagram"))
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CIRCUIT)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_CIRCUIT_ASSEMBLER, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sCannerRecipes = new GT_Recipe_Map(
- new HashSet<>(900),
- "gt.recipe.canner",
- "Canning Machine",
- null,
- RES_PATH_GUI + "basicmachines/Canner",
- 2,
- 2,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CANNER)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
- .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT);
+ new HashSet<>(900),
+ "gt.recipe.canner",
+ "Canning Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/Canner",
+ 2,
+ 2,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_CANNER)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_CANNER, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sCNCRecipes = new GT_Recipe_Map(
- new HashSet<>(100),
- "gt.recipe.cncmachine",
- "CNC Machine",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 2,
- 1,
- 2,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(100),
+ "gt.recipe.cncmachine",
+ "CNC Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 2,
+ 1,
+ 2,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sLatheRecipes = new GT_Recipe_Map(
- new HashSet<>(1150),
- "gt.recipe.lathe",
- "Lathe",
- null,
- RES_PATH_GUI + "basicmachines/Lathe",
- 1,
- 2,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_ROD_1)
- .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_ROD_2)
- .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_LATHE, ProgressBar.Direction.RIGHT)
- .addSpecialTexture(5, 18, 98, 24, GT_UITextures.PROGRESSBAR_LATHE_BASE);
+ new HashSet<>(1150),
+ "gt.recipe.lathe",
+ "Lathe",
+ null,
+ RES_PATH_GUI + "basicmachines/Lathe",
+ 1,
+ 2,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_ROD_1)
+ .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_ROD_2)
+ .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_LATHE, ProgressBar.Direction.RIGHT)
+ .addSpecialTexture(5, 18, 98, 24, GT_UITextures.PROGRESSBAR_LATHE_BASE);
public static final GT_Recipe_Map sCutterRecipes = new GT_Recipe_Map(
- new HashSet<>(5125),
- "gt.recipe.cuttingsaw",
- "Cutting Machine",
- null,
- RES_PATH_GUI + "basicmachines/Cutter4",
- 2,
- 4,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOX)
- .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED)
- .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST)
- .setProgressBar(GT_UITextures.PROGRESSBAR_CUT, ProgressBar.Direction.RIGHT);
+ new HashSet<>(5125),
+ "gt.recipe.cuttingsaw",
+ "Cutting Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/Cutter4",
+ 2,
+ 4,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_BOX)
+ .setSlotOverlay(false, true, true, GT_UITextures.OVERLAY_SLOT_CUTTER_SLICED)
+ .setSlotOverlay(false, true, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_CUT, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sSlicerRecipes = new GT_Recipe_Map(
- new HashSet<>(20),
- "gt.recipe.slicer",
- "Slicing Machine",
- null,
- RES_PATH_GUI + "basicmachines/Slicer",
- 2,
- 1,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_SQUARE)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE)
- .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_SLICER_SLICED)
- .setProgressBar(GT_UITextures.PROGRESSBAR_SLICE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(20),
+ "gt.recipe.slicer",
+ "Slicing Machine",
+ null,
+ RES_PATH_GUI + "basicmachines/Slicer",
+ 2,
+ 1,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_SQUARE)
+ .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_SLICE_SHAPE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_SLICER_SLICED)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_SLICE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sExtruderRecipes = new GT_Recipe_Map(
- new HashSet<>(13000),
- "gt.recipe.extruder",
- "Extruder",
- null,
- RES_PATH_GUI + "basicmachines/Extruder",
- 2,
- 1,
- 2,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE)
- .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRUDE, ProgressBar.Direction.RIGHT);
+ new HashSet<>(13000),
+ "gt.recipe.extruder",
+ "Extruder",
+ null,
+ RES_PATH_GUI + "basicmachines/Extruder",
+ 2,
+ 1,
+ 2,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, false, GT_UITextures.OVERLAY_SLOT_EXTRUDER_SHAPE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRUDE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sHammerRecipes = new GT_Recipe_Map(
- new HashSet<>(3800),
- "gt.recipe.hammer",
- "Forge Hammer",
- null,
- RES_PATH_GUI + "basicmachines/Hammer",
- 2,
- 2,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setUsualFluidInputCount(2)
- .setUsualFluidOutputCount(2)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_HAMMER)
- .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN)
- .addSpecialTexture(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE)
- .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM)
- .setProgressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM)
- .addSpecialTextureSteam(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM);
+ new HashSet<>(3800),
+ "gt.recipe.hammer",
+ "Forge Hammer",
+ null,
+ RES_PATH_GUI + "basicmachines/Hammer",
+ 2,
+ 2,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setUsualFluidInputCount(2).setUsualFluidOutputCount(2)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_HAMMER)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_HAMMER, ProgressBar.Direction.DOWN)
+ .addSpecialTexture(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_HAMMER_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_HAMMER_STEAM)
+ .addSpecialTextureSteam(20, 6, 78, 42, GT_UITextures.PROGRESSBAR_HAMMER_BASE_STEAM);
public static final GT_Recipe_Map sAmplifiers = new GT_Recipe_Map(
- new HashSet<>(2),
- "gt.recipe.uuamplifier",
- "Amplifabricator",
- null,
- RES_PATH_GUI + "basicmachines/Amplifabricator",
- 1,
- 0,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
- .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUA)
- .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
+ new HashSet<>(2),
+ "gt.recipe.uuamplifier",
+ "Amplifabricator",
+ null,
+ RES_PATH_GUI + "basicmachines/Amplifabricator",
+ 1,
+ 0,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
+ .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUA)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sMassFabFakeRecipes = new GT_Recipe_Map(
- new HashSet<>(2),
- "gt.recipe.massfab",
- "Mass Fabrication",
- null,
- RES_PATH_GUI + "basicmachines/Massfabricator",
- 1,
- 0,
- 1,
- 0,
- 8,
- E,
- 1,
- E,
- true,
- true)
- .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUA)
- .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUM)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(2),
+ "gt.recipe.massfab",
+ "Mass Fabrication",
+ null,
+ RES_PATH_GUI + "basicmachines/Massfabricator",
+ 1,
+ 0,
+ 1,
+ 0,
+ 8,
+ E,
+ 1,
+ E,
+ true,
+ true).setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUA)
+ .setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_UUM)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sDieselFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(20),
- "gt.recipe.dieselgeneratorfuel",
- "Combustion Generator Fuels",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(20),
+ "gt.recipe.dieselgeneratorfuel",
+ "Combustion Generator Fuels",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sExtremeDieselFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(20),
- "gt.recipe.extremedieselgeneratorfuel",
- "Extreme Diesel Engine Fuel",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(20),
+ "gt.recipe.extremedieselgeneratorfuel",
+ "Extreme Diesel Engine Fuel",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sTurbineFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(25),
- "gt.recipe.gasturbinefuel",
- "Gas Turbine Fuel",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(25),
+ "gt.recipe.gasturbinefuel",
+ "Gas Turbine Fuel",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sHotFuels = new GT_Recipe_Map_Fuel(
new HashSet<>(10),
"gt.recipe.thermalgeneratorfuel",
@@ -2253,160 +2152,149 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
true,
false);
public static final GT_Recipe_Map_Fuel sDenseLiquidFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(15),
- "gt.recipe.semifluidboilerfuels",
- "Semifluid Boiler Fuels",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(15),
+ "gt.recipe.semifluidboilerfuels",
+ "Semifluid Boiler Fuels",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sPlasmaFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(100),
- "gt.recipe.plasmageneratorfuels",
- "Plasma Generator Fuels",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(100),
+ "gt.recipe.plasmageneratorfuels",
+ "Plasma Generator Fuels",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sMagicFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(100),
- "gt.recipe.magicfuels",
- "Magic Energy Absorber Fuels",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(100),
+ "gt.recipe.magicfuels",
+ "Magic Energy Absorber Fuels",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sSmallNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(1),
- "gt.recipe.smallnaquadahreactor",
- "Naquadah Reactor MkI",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1),
+ "gt.recipe.smallnaquadahreactor",
+ "Naquadah Reactor MkI",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sLargeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(1),
- "gt.recipe.largenaquadahreactor",
- "Naquadah Reactor MkII",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1),
+ "gt.recipe.largenaquadahreactor",
+ "Naquadah Reactor MkII",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(1),
- "gt.recipe.fluidnaquadahreactor",
- "Naquadah Reactor MkIII",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
- public static final GT_Recipe_Map_Fuel sExtremeNaquadahReactorFuels =
- (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(1),
- "gt.recipe.hugenaquadahreactor",
- "Naquadah Reactor MkIV",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
- public static final GT_Recipe_Map_Fuel sUltraHugeNaquadahReactorFuels =
- (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(1),
- "gt.recipe.extrahugenaquadahreactor",
- "Naquadah Reactor MkV",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1),
+ "gt.recipe.fluidnaquadahreactor",
+ "Naquadah Reactor MkIII",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ public static final GT_Recipe_Map_Fuel sExtremeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
+ new HashSet<>(1),
+ "gt.recipe.hugenaquadahreactor",
+ "Naquadah Reactor MkIV",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ public static final GT_Recipe_Map_Fuel sUltraHugeNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
+ new HashSet<>(1),
+ "gt.recipe.extrahugenaquadahreactor",
+ "Naquadah Reactor MkV",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map_Fuel sFluidNaquadahReactorFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel(
- new HashSet<>(1),
- "gt.recipe.fluidfuelnaquadahreactor",
- "Fluid Naquadah Reactor",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 1,
- 0,
- 0,
- 1,
- "Fuel Value: ",
- 1000,
- " EU",
- true,
- true)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ new HashSet<>(1),
+ "gt.recipe.fluidfuelnaquadahreactor",
+ "Fluid Naquadah Reactor",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 1,
+ 0,
+ 0,
+ 1,
+ "Fuel Value: ",
+ 1000,
+ " EU",
+ true,
+ true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sMultiblockElectrolyzerRecipes = new GT_Recipe_Map(
new HashSet<>(300),
"gt.recipe.largeelectrolyzer",
@@ -2455,77 +2343,72 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
"",
true,
false);
- public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels =
- (GT_Recipe_Map_LargeBoilerFakeFuels) new GT_Recipe_Map_LargeBoilerFakeFuels()
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
+ public static final GT_Recipe_Map_LargeBoilerFakeFuels sLargeBoilerFakeFuels = (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(3)
- .setSlotOverlay(false, false, true, GT_UITextures.OVERLAY_SLOT_LENS)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
+ 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(3)
+ .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)
- .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> {
- List<String> result = new ArrayList<>();
- int bitmap = recipeInfo.recipe.mSpecialValue;
- if ((bitmap & 0b1) > 0) {
- result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 1);
- } else if ((bitmap & 0b10) > 0) {
- result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 2);
- } else if ((bitmap & 0b100) > 0) {
- result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 3);
- }
- if ((bitmap & 0b1000) > 0) {
- result.add(GT_Utility.trans("337", "Upgrade Required: ") + GT_Utility.trans("338", "Bio"));
- }
- return result;
- });
+ 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)
+ .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> {
+ List<String> result = new ArrayList<>();
+ int bitmap = recipeInfo.recipe.mSpecialValue;
+ if ((bitmap & 0b1) > 0) {
+ result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 1);
+ } else if ((bitmap & 0b10) > 0) {
+ result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 2);
+ } else if ((bitmap & 0b100) > 0) {
+ result.add(GT_Utility.trans("336", "PCB Factory Tier: ") + 3);
+ }
+ if ((bitmap & 0b1000) > 0) {
+ result.add(
+ GT_Utility.trans("337", "Upgrade Required: ") + GT_Utility.trans("338", "Bio"));
+ }
+ return result;
+ });
public static final GT_Recipe_Map_IC2NuclearFake sIC2NuclearFakeRecipe = new GT_Recipe_Map_IC2NuclearFake();
/**
* HashMap of Recipes based on their Items
*/
- public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new /*Concurrent*/ HashMap<>();
+ public final Map<GT_ItemStack, Collection<GT_Recipe>> mRecipeItemMap = new /* Concurrent */ HashMap<>();
/**
* HashMap of Recipes based on their Fluids
*/
- public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new /*Concurrent*/ HashMap<>();
+ public final Map<Fluid, Collection<GT_Recipe>> mRecipeFluidMap = new /* Concurrent */ HashMap<>();
public final HashSet<String> mRecipeFluidNameMap = new HashSet<>();
/**
@@ -2546,12 +2429,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public final String mNEIGUIPath;
public final String mNEISpecialValuePre, mNEISpecialValuePost;
- public final int mUsualInputCount,
- mUsualOutputCount,
- mNEISpecialValueMultiplier,
- mMinimalInputItems,
- mMinimalInputFluids,
- mAmperage;
+ public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems,
+ mMinimalInputFluids, mAmperage;
public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
/**
@@ -2560,8 +2439,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public boolean mNEIUnificateOutput = true;
/**
- * Unique identifier for this recipe map. Generated from aUnlocalizedName and a few other parameters.
- * See constructor for details.
+ * Unique identifier for this recipe map. Generated from aUnlocalizedName and a few other parameters. See
+ * constructor for details.
*/
public final String mUniqueIdentifier;
@@ -2576,14 +2455,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
private boolean mUsesSpecialSlot = false;
/**
- * How many fluid inputs does this recipemap has at most. Currently used only for NEI slot placements
- * and does not actually restrict number of fluids used in the recipe.
+ * How many fluid inputs does this recipemap has at most. Currently used only for NEI slot placements and does
+ * not actually restrict number of fluids used in the recipe.
*/
private int usualFluidInputCount;
/**
- * How many fluid outputs does this recipemap has at most. Currently used only for NEI slot placements
- * and does not actually restrict number of fluids used in the recipe.
+ * How many fluid outputs does this recipemap has at most. Currently used only for NEI slot placements and does
+ * not actually restrict number of fluids used in the recipe.
*/
private int usualFluidOutputCount;
@@ -2593,36 +2472,28 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public boolean useModularUI = false;
/**
- * Overlays used for GUI.
- * 1 = If it's fluid slot.
- * 2 = If it's output slot.
- * 4 = If it's first slot in the same section, e.g. first slot in the item output slots
- * 8 = If it's special item slot.
+ * Overlays used for GUI. 1 = If it's fluid slot. 2 = If it's output slot. 4 = If it's first slot in the same
+ * section, e.g. first slot in the item output slots 8 = If it's special item slot.
*/
private final TByteObjectMap<IDrawable> slotOverlays = new TByteObjectHashMap<>();
/**
- * Overlays used for GUI on steam machine.
- * 1 = If it's fluid slot.
- * 2 = If it's output slot.
- * 4 = If it's first slot in the same section, e.g. first slot in the item output slots
- * 8 = If it's special item slot.
+ * Overlays used for GUI on steam machine. 1 = If it's fluid slot. 2 = If it's output slot. 4 = If it's first
+ * slot in the same section, e.g. first slot in the item output slots 8 = If it's special item slot.
*/
private final TByteObjectMap<SteamTexture> slotOverlaysSteam = new TByteObjectHashMap<>();
/**
- * Progressbar used for BasicMachine GUI and/or NEI.
- * Unless specified, size should be (20, 36), consisting of two parts;
- * First is (20, 18) size of "empty" image at the top,
- * Second is (20, 18) size of "filled" image at the bottom.
+ * Progressbar used for BasicMachine GUI and/or NEI. Unless specified, size should be (20, 36), consisting of
+ * two parts; First is (20, 18) size of "empty" image at the top, Second is (20, 18) size of "filled" image at
+ * the bottom.
*/
private FallbackableUITexture progressBarTexture;
/**
- * Progressbar used for steam machine GUI and/or NEI.
- * Unless specified, size should be (20, 36), consisting of two parts;
- * First is (20, 18) size of "empty" image at the top,
- * Second is (20, 18) size of "filled" image at the bottom.
+ * Progressbar used for steam machine GUI and/or NEI. Unless specified, size should be (20, 36), consisting of
+ * two parts; First is (20, 18) size of "empty" image at the top, Second is (20, 18) size of "filled" image at
+ * the bottom.
*/
private FallbackableSteamTexture progressBarTextureSteam;
@@ -2633,7 +2504,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public Pos2d progressBarPos = new Pos2d(78, 24);
public Rectangle neiTransferRect = new Rectangle(
- progressBarPos.x - (16 / 2), progressBarPos.y, progressBarSize.width + 16, progressBarSize.height);
+ progressBarPos.x - (16 / 2),
+ progressBarPos.y,
+ progressBarSize.width + 16,
+ progressBarSize.height);
/**
* Image size in direction of progress. Used for non-smooth rendering.
@@ -2668,10 +2542,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
/**
* Initialises a new type of Recipe Handler.
*
- * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
+ * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a
+ * pre-initialised Size.
* @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
* @param aLocalName the displayed Name inside the NEI Recipe GUI.
- * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
+ * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png"
+ * if forgotten.
* @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
* @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
* @param aNEISpecialValuePre the String in front of the Special Value in NEI.
@@ -2679,21 +2555,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
* @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
*/
- public GT_Recipe_Map(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
sMappings.add(this);
mNEIAllowed = aNEIAllowed;
@@ -2729,23 +2594,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Deprecated
- public GT_Recipe_Map(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
- boolean aNEIAllowed,
- boolean aNEIUnificateOutput) {
+ public GT_Recipe_Map(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
+ boolean aNEIAllowed, boolean aNEIUnificateOutput) {
this(
aRecipeList,
aUnlocalizedName,
@@ -2775,8 +2628,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return this;
}
- public GT_Recipe_Map setSlotOverlay(
- boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial, IDrawable slotOverlay) {
+ public GT_Recipe_Map setSlotOverlay(boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial,
+ IDrawable slotOverlay) {
useModularUI(true);
this.slotOverlays.put(
(byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)),
@@ -2793,8 +2646,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
.setSlotOverlay(isFluid, isOutput, false, slotOverlay);
}
- public GT_Recipe_Map setSlotOverlaySteam(
- boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial, SteamTexture slotOverlay) {
+ public GT_Recipe_Map setSlotOverlaySteam(boolean isFluid, boolean isOutput, boolean isFirst, boolean isSpecial,
+ SteamTexture slotOverlay) {
useModularUI(true);
this.slotOverlaysSteam.put(
(byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (isFirst ? 4 : 0) + (isSpecial ? 8 : 0)),
@@ -2814,7 +2667,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe_Map setProgressBar(UITexture progressBarTexture, ProgressBar.Direction progressBarDirection) {
return setProgressBarWithFallback(
new FallbackableUITexture(
- UITexture.fullImage("gregtech", "gui/progressbar/" + mUnlocalizedName), progressBarTexture),
+ UITexture.fullImage("gregtech", "gui/progressbar/" + mUnlocalizedName),
+ progressBarTexture),
progressBarDirection);
}
@@ -2823,12 +2677,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Some resource packs want to use custom progress bar textures even for plain arrow.
- * This method allows them to add unique textures, yet other packs don't need to make textures
- * for every recipemap.
+ * Some resource packs want to use custom progress bar textures even for plain arrow. This method allows them to
+ * add unique textures, yet other packs don't need to make textures for every recipemap.
*/
- public GT_Recipe_Map setProgressBarWithFallback(
- FallbackableUITexture progressBarTexture, ProgressBar.Direction progressBarDirection) {
+ public GT_Recipe_Map setProgressBarWithFallback(FallbackableUITexture progressBarTexture,
+ ProgressBar.Direction progressBarDirection) {
useModularUI(true);
this.progressBarTexture = progressBarTexture;
this.progressBarDirection = progressBarDirection;
@@ -2836,9 +2689,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
public GT_Recipe_Map setProgressBarSteam(SteamTexture progressBarTexture) {
- return setProgressBarSteamWithFallback(new FallbackableSteamTexture(
- SteamTexture.fullImage("gregtech", "gui/progressbar/" + mUnlocalizedName + "_%s"),
- progressBarTexture));
+ return setProgressBarSteamWithFallback(
+ new FallbackableSteamTexture(
+ SteamTexture.fullImage("gregtech", "gui/progressbar/" + mUnlocalizedName + "_%s"),
+ progressBarTexture));
}
public GT_Recipe_Map setProgressBarSteamWithFallback(FallbackableSteamTexture progressBarTexture) {
@@ -2872,15 +2726,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe_Map addSpecialTexture(int width, int height, int x, int y, IDrawable texture) {
useModularUI(true);
- specialTextures.add(
- new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y))));
+ specialTextures
+ .add(new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y))));
return this;
}
public GT_Recipe_Map addSpecialTextureSteam(int width, int height, int x, int y, SteamTexture texture) {
useModularUI(true);
- specialTexturesSteam.add(
- new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y))));
+ specialTexturesSteam
+ .add(new ImmutablePair<>(texture, new ImmutablePair<>(new Size(width, height), new Pos2d(x, y))));
return this;
}
@@ -2931,37 +2785,25 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return this;
}
- public GT_Recipe addRecipe(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
+ int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
int aSpecialValue) {
- return addRecipe(new GT_Recipe(
- aOptimize,
- aInputs,
- aOutputs,
- aSpecial,
- aOutputChances,
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUt,
- aSpecialValue));
+ return addRecipe(
+ new GT_Recipe(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ aOutputChances,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
}
- public GT_Recipe addRecipe(
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ int aDuration, int aEUt, int aSpecialValue) {
return addRecipe(
new GT_Recipe(
false,
@@ -2979,35 +2821,28 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
false);
}
- public GT_Recipe addRecipe(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
- return addRecipe(new GT_Recipe(
- aOptimize,
- aInputs,
- aOutputs,
- aSpecial,
- null,
- aFluidInputs,
- aFluidOutputs,
- aDuration,
- aEUt,
- aSpecialValue));
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
+ FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(
+ new GT_Recipe(
+ aOptimize,
+ aInputs,
+ aOutputs,
+ aSpecial,
+ null,
+ aFluidInputs,
+ aFluidOutputs,
+ aDuration,
+ aEUt,
+ aSpecialValue));
}
public GT_Recipe addRecipe(GT_Recipe aRecipe) {
return addRecipe(aRecipe, true, false, false);
}
- protected GT_Recipe addRecipe(
- GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ protected GT_Recipe addRecipe(GT_Recipe aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe,
+ boolean aHidden) {
aRecipe.mHidden = aHidden;
aRecipe.mFakeRecipe = aFakeRecipe;
if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems)
@@ -3019,19 +2854,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes!
+ * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
*/
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ int aDuration, int aEUt, int aSpecialValue) {
return addFakeRecipe(
aCheckForCollisions,
new GT_Recipe(
@@ -3048,17 +2876,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes!
+ * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
*/
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
int aSpecialValue) {
return addFakeRecipe(
aCheckForCollisions,
@@ -3075,17 +2897,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
aSpecialValue));
}
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue,
- boolean hidden) {
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
+ int aSpecialValue, boolean hidden) {
return addFakeRecipe(
aCheckForCollisions,
new GT_Recipe(
@@ -3102,18 +2916,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
hidden);
}
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue,
- ItemStack[][] aAlt,
- boolean hidden) {
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
+ int aSpecialValue, ItemStack[][] aAlt, boolean hidden) {
return addFakeRecipe(
aCheckForCollisions,
new GT_Recipe_WithAlt(
@@ -3132,7 +2937,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes!
+ * findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
*/
public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, GT_Recipe aRecipe) {
return addRecipe(aRecipe, aCheckForCollisions, true, false);
@@ -3146,8 +2952,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
mRecipeList.add(aRecipe);
for (FluidStack aFluid : aRecipe.mFluidInputs) {
if (aFluid != null) {
- Collection<GT_Recipe> tList =
- mRecipeFluidMap.computeIfAbsent(aFluid.getFluid(), k -> new HashSet<>(1));
+ Collection<GT_Recipe> tList = mRecipeFluidMap
+ .computeIfAbsent(aFluid.getFluid(), k -> new HashSet<>(1));
tList.add(aRecipe);
mRecipeFluidNameMap.add(aFluid.getFluid().getName());
}
@@ -3174,9 +2980,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* @return if this Item is a valid Input for any for the Recipes
*/
public boolean containsInput(ItemStack aStack) {
- return aStack != null
- && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack))
- || mRecipeItemMap.containsKey(new GT_ItemStack(aStack, true)));
+ return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack))
+ || mRecipeItemMap.containsKey(new GT_ItemStack(aStack, true)));
}
/**
@@ -3193,79 +2998,66 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return aFluid != null && mRecipeFluidNameMap.contains(aFluid.getName());
}
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage,
+ FluidStack[] aFluids, ItemStack... aInputs) {
return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
}
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- boolean aNotUnificated,
- boolean aDontCheckStackSizes,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated,
+ boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
return findRecipe(
- aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs);
+ aTileEntity,
+ null,
+ aNotUnificated,
+ aDontCheckStackSizes,
+ aVoltage,
+ aFluids,
+ null,
+ aInputs);
}
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
}
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- boolean aDontCheckStackSizes,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
return findRecipe(
- aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, null, aInputs);
+ aTileEntity,
+ aRecipe,
+ aNotUnificated,
+ aDontCheckStackSizes,
+ aVoltage,
+ aFluids,
+ null,
+ aInputs);
}
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
return findRecipe(aTileEntity, aRecipe, aNotUnificated, false, aVoltage, aFluids, aSpecialSlot, aInputs);
}
+
/**
* finds a Recipe matching the aFluid and ItemStack Inputs.
*
- * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
- * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
- * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
- * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input
- * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
- * @param aFluids the Fluid Inputs
- * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
- * @param aInputs the Item Inputs
+ * @param aTileEntity an Object representing the current coordinates of the executing
+ * Block/Entity/Whatever. This may be null, especially during Startup.
+ * @param aRecipe in case this is != null it will try to use this Recipe first when looking things
+ * up.
+ * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
+ * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with
+ * the provided input
+ * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
+ * @param aFluids the Fluid Inputs
+ * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with
+ * this, but some custom ones do.
+ * @param aInputs the Item Inputs
* @return the Recipe it has found or null for no matching Recipe
*/
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- boolean aDontCheckStackSizes,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot,
ItemStack... aInputs) {
// No Recipes? Well, nothing to be found then.
if (mRecipeList.isEmpty()) return null;
@@ -3293,54 +3085,41 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
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)
- if (!aRecipe.mFakeRecipe
- && aRecipe.mCanBeBuffered
- && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+ if (aRecipe != null) if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered
+ && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
// Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
- if (mUsualInputCount > 0 && aInputs != null)
- for (ItemStack tStack : aInputs)
- if (tStack != null) {
- Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
- if (tRecipes != null)
- for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack, true));
- if (tRecipes != null)
- for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) {
+ Collection<GT_Recipe> tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack, true));
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
// If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that
// Map too.
- if (mMinimalInputItems == 0 && aFluids != null)
- for (FluidStack aFluid : aFluids)
- if (aFluid != null) {
- Collection<GT_Recipe> tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
- if (tRecipes != null)
- for (GT_Recipe tRecipe : tRecipes)
- if (!tRecipe.mFakeRecipe
- && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
- return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
- }
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) if (aFluid != null) {
+ Collection<GT_Recipe> tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) if (!tRecipe.mFakeRecipe
+ && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
// And nothing has been found.
return null;
}
protected GT_Recipe addToItemMap(GT_Recipe aRecipe) {
- for (ItemStack aStack : aRecipe.mInputs)
- if (aStack != null) {
- GT_ItemStack tStack = new GT_ItemStack(aStack);
- Collection<GT_Recipe> tList = mRecipeItemMap.computeIfAbsent(tStack, k -> new HashSet<>(1));
- tList.add(aRecipe);
- }
+ for (ItemStack aStack : aRecipe.mInputs) if (aStack != null) {
+ GT_ItemStack tStack = new GT_ItemStack(aStack);
+ Collection<GT_Recipe> tList = mRecipeItemMap.computeIfAbsent(tStack, k -> new HashSet<>(1));
+ tList.add(aRecipe);
+ }
return aRecipe;
}
@@ -3375,8 +3154,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Nullable
public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) {
- byte overlayKey =
- (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (index == 0 ? 4 : 0) + (isSpecial ? 8 : 0));
+ byte overlayKey = (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0)
+ + (index == 0 ? 4 : 0)
+ + (isSpecial ? 8 : 0));
if (slotOverlays.containsKey(overlayKey)) {
return slotOverlays.get(overlayKey);
}
@@ -3385,8 +3165,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Nullable
public SteamTexture getOverlayForSlotSteam(boolean isFluid, boolean isOutput, int index, boolean isSpecial) {
- byte overlayKey =
- (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0) + (index == 0 ? 4 : 0) + (isSpecial ? 8 : 0));
+ byte overlayKey = (byte) ((isFluid ? 1 : 0) + (isOutput ? 2 : 0)
+ + (index == 0 ? 4 : 0)
+ + (isSpecial ? 8 : 0));
if (slotOverlaysSteam.containsKey(overlayKey)) {
return slotOverlaysSteam.get(overlayKey);
}
@@ -3432,41 +3213,31 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
/**
* Adds slot backgrounds, progressBar, etc.
*/
- public ModularWindow.Builder createNEITemplate(
- IItemHandlerModifiable itemInputsInventory,
- IItemHandlerModifiable itemOutputsInventory,
- IItemHandlerModifiable specialSlotInventory,
- IItemHandlerModifiable fluidInputsInventory,
- IItemHandlerModifiable fluidOutputsInventory,
- Supplier<Float> progressSupplier,
- Pos2d windowOffset) {
- ModularWindow.Builder builder =
- ModularWindow.builder(neiBackgroundSize).setBackground(ModularUITextures.VANILLA_BACKGROUND);
+ public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory,
+ IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory,
+ IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory,
+ Supplier<Float> progressSupplier, Pos2d windowOffset) {
+ ModularWindow.Builder builder = ModularWindow.builder(neiBackgroundSize)
+ .setBackground(ModularUITextures.VANILLA_BACKGROUND);
UIHelper.forEachSlots(
- (i, backgrounds, pos) -> builder.widget(SlotWidget.phantom(itemInputsInventory, i)
- .setBackground(backgrounds)
- .setPos(pos)
- .setSize(18, 18)),
- (i, backgrounds, pos) -> builder.widget(SlotWidget.phantom(itemOutputsInventory, i)
- .setBackground(backgrounds)
- .setPos(pos)
- .setSize(18, 18)),
+ (i, backgrounds, pos) -> builder.widget(
+ SlotWidget.phantom(itemInputsInventory, i).setBackground(backgrounds).setPos(pos)
+ .setSize(18, 18)),
+ (i, backgrounds, pos) -> builder.widget(
+ SlotWidget.phantom(itemOutputsInventory, i).setBackground(backgrounds).setPos(pos)
+ .setSize(18, 18)),
(i, backgrounds, pos) -> {
- if (usesSpecialSlot())
- builder.widget(SlotWidget.phantom(specialSlotInventory, 0)
- .setBackground(backgrounds)
- .setPos(pos)
- .setSize(18, 18));
+ if (usesSpecialSlot()) builder.widget(
+ SlotWidget.phantom(specialSlotInventory, 0).setBackground(backgrounds).setPos(pos)
+ .setSize(18, 18));
},
- (i, backgrounds, pos) -> builder.widget(SlotWidget.phantom(fluidInputsInventory, i)
- .setBackground(backgrounds)
- .setPos(pos)
- .setSize(18, 18)),
- (i, backgrounds, pos) -> builder.widget(SlotWidget.phantom(fluidOutputsInventory, i)
- .setBackground(backgrounds)
- .setPos(pos)
- .setSize(18, 18)),
+ (i, backgrounds, pos) -> builder.widget(
+ SlotWidget.phantom(fluidInputsInventory, i).setBackground(backgrounds).setPos(pos)
+ .setSize(18, 18)),
+ (i, backgrounds, pos) -> builder.widget(
+ SlotWidget.phantom(fluidOutputsInventory, i).setBackground(backgrounds).setPos(pos)
+ .setSize(18, 18)),
ModularUITextures.ITEM_SLOT,
ModularUITextures.FLUID_SLOT,
this,
@@ -3481,29 +3252,25 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
addGregTechLogoUI(builder, windowOffset);
for (Pair<IDrawable, Pair<Size, Pos2d>> specialTexture : specialTextures) {
- builder.widget(new DrawableWidget()
- .setDrawable(specialTexture.getLeft())
- .setSize(specialTexture.getRight().getLeft())
- .setPos(specialTexture.getRight().getRight().add(windowOffset)));
+ builder.widget(
+ new DrawableWidget().setDrawable(specialTexture.getLeft())
+ .setSize(specialTexture.getRight().getLeft())
+ .setPos(specialTexture.getRight().getRight().add(windowOffset)));
}
return builder;
}
- public void addProgressBarUI(
- ModularWindow.Builder builder, Supplier<Float> progressSupplier, Pos2d windowOffset) {
- builder.widget(new ProgressBar()
- .setTexture(getProgressBarTexture(), 20)
- .setDirection(progressBarDirection)
- .setProgress(progressSupplier)
- .setSynced(false, false)
- .setPos(progressBarPos.add(windowOffset))
- .setSize(progressBarSize));
+ public void addProgressBarUI(ModularWindow.Builder builder, Supplier<Float> progressSupplier,
+ Pos2d windowOffset) {
+ builder.widget(
+ new ProgressBar().setTexture(getProgressBarTexture(), 20).setDirection(progressBarDirection)
+ .setProgress(progressSupplier).setSynced(false, false)
+ .setPos(progressBarPos.add(windowOffset)).setSize(progressBarSize));
}
public void addGregTechLogoUI(ModularWindow.Builder builder, Pos2d windowOffset) {
- builder.widget(
- new DrawableWidget().setDrawable(logo).setSize(logoSize).setPos(logoPos.add(windowOffset)));
+ builder.widget(new DrawableWidget().setDrawable(logo).setSize(logoSize).setPos(logoPos.add(windowOffset)));
}
/**
@@ -3604,7 +3371,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
} else if (neiSpecialInfoFormatter != null) {
drawNEITextMultipleLines(
- recipeInfo, neiSpecialInfoFormatter.format(recipeInfo, this::formatSpecialValue));
+ recipeInfo,
+ neiSpecialInfoFormatter.format(recipeInfo, this::formatSpecialValue));
} else {
drawOptionalNEIText(recipeInfo, getNEISpecialInfo(recipeInfo.recipe.mSpecialValue));
}
@@ -3632,8 +3400,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
protected String formatSpecialValue(int specialValue) {
- return mNEISpecialValuePre
- + GT_Utility.formatNumbers((long) specialValue * mNEISpecialValueMultiplier)
+ return mNEISpecialValuePre + GT_Utility.formatNumbers((long) specialValue * mNEISpecialValueMultiplier)
+ mNEISpecialValuePost;
}
@@ -3643,26 +3410,22 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (recipe.owners.size() > 1) {
drawNEIText(
recipeInfo,
- EnumChatFormatting.ITALIC
- + GT_Utility.trans("273", "Original Recipe by: ")
+ EnumChatFormatting.ITALIC + GT_Utility.trans("273", "Original Recipe by: ")
+ recipe.owners.get(0).getName());
for (int i = 1; i < recipe.owners.size(); i++) {
drawNEIText(
recipeInfo,
- EnumChatFormatting.ITALIC
- + GT_Utility.trans("274", "Modified by: ")
+ EnumChatFormatting.ITALIC + GT_Utility.trans("274", "Modified by: ")
+ recipe.owners.get(i).getName());
}
} else if (recipe.owners.size() > 0) {
drawNEIText(
recipeInfo,
- EnumChatFormatting.ITALIC
- + GT_Utility.trans("272", "Recipe by: ")
+ EnumChatFormatting.ITALIC + GT_Utility.trans("272", "Recipe by: ")
+ recipe.owners.get(0).getName());
}
}
- if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace
- && recipe.stackTraces != null
+ if (GT_Mod.gregtechproxy.mNEIRecipeOwnerStackTrace && recipe.stackTraces != null
&& !recipe.stackTraces.isEmpty()) {
drawNEIText(recipeInfo, "stackTrace:");
// todo: good way to show all stacktraces
@@ -3678,6 +3441,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
/**
* Draws text on NEI recipe.
+ *
* @param yShift y position to shift after this text
*/
@SuppressWarnings("SameParameterValue")
@@ -3687,18 +3451,17 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
/**
* Draws text on NEI recipe.
+ *
* @param xStart x position to start drawing
* @param yShift y position to shift after this text
*/
@SuppressWarnings("SameParameterValue")
protected void drawNEIText(NEIRecipeInfo recipeInfo, String text, int xStart, int yShift) {
- Minecraft.getMinecraft()
- .fontRenderer
- .drawString(
- text,
- xStart,
- recipeInfo.yPos,
- neiTextColorOverride != -1 ? neiTextColorOverride : 0x000000);
+ Minecraft.getMinecraft().fontRenderer.drawString(
+ text,
+ xStart,
+ recipeInfo.yPos,
+ neiTextColorOverride != -1 ? neiTextColorOverride : 0x000000);
recipeInfo.yPos += yShift;
}
@@ -3714,13 +3477,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
- public List<String> handleNEIItemTooltip(
- ItemStack stack, List<String> currentTip, GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) {
+ public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip,
+ GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) {
for (PositionedStack pStack : neiCachedRecipe.mInputs) {
if (stack == pStack.item) {
if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) {
currentTip = handleNEIItemInputTooltip(
- currentTip, (GT_NEI_DefaultHandler.FixedPositionedStack) pStack);
+ currentTip,
+ (GT_NEI_DefaultHandler.FixedPositionedStack) pStack);
}
break;
}
@@ -3729,7 +3493,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (stack == pStack.item) {
if (pStack instanceof GT_NEI_DefaultHandler.FixedPositionedStack) {
currentTip = handleNEIItemOutputTooltip(
- currentTip, (GT_NEI_DefaultHandler.FixedPositionedStack) pStack);
+ currentTip,
+ (GT_NEI_DefaultHandler.FixedPositionedStack) pStack);
}
break;
}
@@ -3737,16 +3502,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return currentTip;
}
- protected List<String> handleNEIItemInputTooltip(
- List<String> currentTip, GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
+ protected List<String> handleNEIItemInputTooltip(List<String> currentTip,
+ GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
if (pStack.isNotConsumed()) {
currentTip.add(GRAY + GT_Utility.trans("151", "Does not get consumed in the process"));
}
return currentTip;
}
- protected List<String> handleNEIItemOutputTooltip(
- List<String> currentTip, GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
+ protected List<String> handleNEIItemOutputTooltip(List<String> currentTip,
+ GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
if (pStack.isChanceBased()) {
currentTip.add(GRAY + GT_Utility.trans("150", "Chance: ") + pStack.getChanceText());
}
@@ -3779,8 +3544,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@SuppressWarnings("SameParameterValue")
- protected void drawNEIOverlayText(
- String text, PositionedStack stack, int color, float scale, boolean shadow, Alignment alignment) {
+ protected void drawNEIOverlayText(String text, PositionedStack stack, int color, float scale, boolean shadow,
+ Alignment alignment) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
int width = fontRenderer.getStringWidth(text);
int x = (int) ((stack.relx + 8 + 8 * alignment.x) / scale) - (width / 2 * (alignment.x + 1));
@@ -3820,7 +3585,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Use {@link #getItemInputPositions} or {@link #getSpecialItemPosition} or {@link #getFluidInputPositions} instead
+ * Use {@link #getItemInputPositions} or {@link #getSpecialItemPosition} or {@link #getFluidInputPositions}
+ * instead
*/
@Deprecated
public ArrayList<PositionedStack> getInputPositionedStacks(GT_Recipe recipe) {
@@ -3843,30 +3609,19 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
// -----------------------------------------------------------------------------------------------------------------
/**
- * Nicely display NEI with many items and fluids.
- * Remember to call {@link GT_Recipe_Map#setUsualFluidInputCount} and {@link GT_Recipe_Map#setUsualFluidOutputCount}.
- * If row count >= 6, it doesn't fit in 2 recipes per page, so change it via IMC.
+ * Nicely display NEI with many items and fluids. Remember to call {@link GT_Recipe_Map#setUsualFluidInputCount} and
+ * {@link GT_Recipe_Map#setUsualFluidOutputCount}. If row count >= 6, it doesn't fit in 2 recipes per page, so
+ * change it via IMC.
*/
public static class GT_Recipe_Map_LargeNEI extends GT_Recipe_Map {
private static final int xDirMaxCount = 3;
private static final int yOrigin = 8;
- public GT_Recipe_Map_LargeNEI(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map_LargeNEI(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -3909,14 +3664,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public ModularWindow.Builder createNEITemplate(
- IItemHandlerModifiable itemInputsInventory,
- IItemHandlerModifiable itemOutputsInventory,
- IItemHandlerModifiable specialSlotInventory,
- IItemHandlerModifiable fluidInputsInventory,
- IItemHandlerModifiable fluidOutputsInventory,
- Supplier<Float> progressSupplier,
- Pos2d windowOffset) {
+ public ModularWindow.Builder createNEITemplate(IItemHandlerModifiable itemInputsInventory,
+ IItemHandlerModifiable itemOutputsInventory, IItemHandlerModifiable specialSlotInventory,
+ IItemHandlerModifiable fluidInputsInventory, IItemHandlerModifiable fluidOutputsInventory,
+ Supplier<Float> progressSupplier, Pos2d windowOffset) {
// Delay setter so that calls to #setUsualFluidInputCount and #setUsualFluidOutputCount are considered
setNEIBackgroundSize(172, 82 + (Math.max(getItemRowCount() + getFluidRowCount() - 4, 0)) * 18);
return super.createNEITemplate(
@@ -3943,21 +3694,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
*/
public static class GT_Recipe_Map_FluidOnly extends GT_Recipe_Map {
- public GT_Recipe_Map_FluidOnly(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map_FluidOnly(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -3993,21 +3733,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Abstract Class for general Recipe Handling of non GT Recipes
*/
public abstract static class GT_Recipe_Map_NonGTRecipes extends GT_Recipe_Map {
- public GT_Recipe_Map_NonGTRecipes(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_NonGTRecipes(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4043,31 +3773,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe addRecipe(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
+ int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
int aSpecialValue) {
return null;
}
@Override
- public GT_Recipe addRecipe(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
+ FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
return null;
}
@@ -4077,46 +3791,23 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ int aDuration, int aEUt, int aSpecialValue) {
return null;
}
@Override
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
int aSpecialValue) {
return null;
}
@Override
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue,
- boolean hidden) {
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
+ int aSpecialValue, boolean hidden) {
return null;
}
@@ -4145,23 +3836,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Just a Recipe Map with Utility specifically for Fuels.
*/
public static class GT_Recipe_Map_Fuel extends GT_Recipe_Map {
+
private final Map<String, GT_Recipe> mRecipesByFluidInput = new HashMap<>();
- public GT_Recipe_Map_Fuel(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map_Fuel(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4193,30 +3874,21 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
}
- public GT_Recipe addFuel(
- ItemStack aInput,
- ItemStack aOutput,
- FluidStack aFluidInput,
- FluidStack aFluidOutput,
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput,
int aFuelValueInEU) {
return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
}
- public GT_Recipe addFuel(
- ItemStack aInput,
- ItemStack aOutput,
- FluidStack aFluidInput,
- FluidStack aFluidOutput,
- int aChance,
- int aFuelValueInEU) {
+ public GT_Recipe addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput,
+ int aChance, int aFuelValueInEU) {
return addRecipe(
true,
- new ItemStack[] {aInput},
- new ItemStack[] {aOutput},
+ new ItemStack[] { aInput },
+ new ItemStack[] { aOutput },
null,
- new int[] {aChance},
- new FluidStack[] {aFluidInput},
- new FluidStack[] {aFluidOutput},
+ new int[] { aChance },
+ new FluidStack[] { aFluidInput },
+ new FluidStack[] { aFluidOutput },
0,
0,
aFuelValueInEU);
@@ -4225,8 +3897,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public GT_Recipe add(GT_Recipe aRecipe) {
aRecipe = super.add(aRecipe);
- if (aRecipe.mInputs != null
- && GT_Utility.getNonnullElementCount(aRecipe.mInputs) == 1
+ if (aRecipe.mInputs != null && GT_Utility.getNonnullElementCount(aRecipe.mInputs) == 1
&& (aRecipe.mFluidInputs == null || GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 0)) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(aRecipe.mInputs[0], true);
if (tFluid != null) {
@@ -4237,8 +3908,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
&& aRecipe.mFluidInputs != null
&& GT_Utility.getNonnullElementCount(aRecipe.mFluidInputs) == 1
&& aRecipe.mFluidInputs[0] != null) {
- mRecipesByFluidInput.put(aRecipe.mFluidInputs[0].getUnlocalizedName(), aRecipe);
- }
+ mRecipesByFluidInput.put(aRecipe.mFluidInputs[0].getUnlocalizedName(), aRecipe);
+ }
return aRecipe;
}
@@ -4251,21 +3922,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Furnace Recipe handling.
*/
public static class GT_Recipe_Map_Furnace extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Furnace(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Furnace(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4286,23 +3947,16 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null);
- return tOutput == null
- ? null
+ return tOutput == null ? null
: new GT_Recipe(
false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- new ItemStack[] {tOutput},
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ new ItemStack[] { tOutput },
null,
null,
null,
@@ -4322,21 +3976,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Microwave Recipe handling.
*/
public static class GT_Recipe_Map_Microwave extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Microwave(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Microwave(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4357,14 +4001,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
ItemStack tOutput = GT_ModHandler.getSmeltingOutput(aInputs[0], false, null);
@@ -4372,9 +4010,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (GT_Utility.areStacksEqual(aInputs[0], new ItemStack(Items.book, 1, W))) {
return new GT_Recipe(
false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- new ItemStack[] {GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1))
- },
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ new ItemStack[] {
+ GT_Utility.getWrittenBook("Manual_Microwave", ItemList.Book_Written_03.get(1)) },
null,
null,
null,
@@ -4386,12 +4024,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
// Check Container Item of Input since it is around the Input, then the Input itself, then Container Item of
// Output and last check the Output itself
- for (ItemStack tStack : new ItemStack[] {
- GT_Utility.getContainerItem(aInputs[0], true),
- aInputs[0],
- GT_Utility.getContainerItem(tOutput, true),
- tOutput
- })
+ for (ItemStack tStack : new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true), aInputs[0],
+ GT_Utility.getContainerItem(tOutput, true), tOutput })
if (tStack != null) {
if (GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.netherrack, 1, W), true)
|| GT_Utility.areStacksEqual(tStack, new ItemStack(Blocks.tnt, 1, W), true)
@@ -4426,24 +4060,23 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return null;
}
}
- for (MaterialStack tMaterial : tData.mByProducts)
- if (tMaterial != null) {
- if (tMaterial.mMaterial.contains(SubTag.METAL)
- || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- GT_Log.exp.println("Microwave Explosion due to METAL insertion");
- ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
- }
- return null;
+ for (MaterialStack tMaterial : tData.mByProducts) if (tMaterial != null) {
+ if (tMaterial.mMaterial.contains(SubTag.METAL)
+ || tMaterial.mMaterial.contains(SubTag.EXPLOSIVE)) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ GT_Log.exp.println("Microwave Explosion due to METAL insertion");
+ ((IGregTechTileEntity) aTileEntity).doExplosion(aVoltage * 4);
}
- if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
- if (aTileEntity instanceof IGregTechTileEntity) {
- ((IGregTechTileEntity) aTileEntity).setOnFire();
- GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion");
- }
- return null;
+ return null;
+ }
+ if (tMaterial.mMaterial.contains(SubTag.FLAMMABLE)) {
+ if (aTileEntity instanceof IGregTechTileEntity) {
+ ((IGregTechTileEntity) aTileEntity).setOnFire();
+ GT_Log.exp.println("Microwave INFLAMMATION due to FLAMMABLE insertion");
}
+ return null;
}
+ }
}
if (TileEntityFurnace.getItemBurnTime(tStack) > 0) {
if (aTileEntity instanceof IGregTechTileEntity) {
@@ -4454,12 +4087,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
- return tOutput == null
- ? null
+ return tOutput == null ? null
: new GT_Recipe(
false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- new ItemStack[] {tOutput},
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ new ItemStack[] { tOutput },
null,
null,
null,
@@ -4479,21 +4111,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Unboxinator handling.
*/
public static class GT_Recipe_Map_Unboxinator extends GT_Recipe_Map {
- public GT_Recipe_Map_Unboxinator(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Unboxinator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4514,14 +4136,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || !ItemList.IC2_Scrapbox.isStackEqual(aInputs[0], false, true))
return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
ItemStack tOutput = GT_ModHandler.getRandomScrapboxDrop();
@@ -4529,8 +4145,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
GT_Recipe rRecipe = new GT_Recipe(
false,
- new ItemStack[] {ItemList.IC2_Scrapbox.get(1)},
- new ItemStack[] {tOutput},
+ new ItemStack[] { ItemList.IC2_Scrapbox.get(1) },
+ new ItemStack[] { tOutput },
null,
null,
null,
@@ -4556,21 +4172,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Fluid Canner handling.
*/
public static class GT_Recipe_Map_FluidCanner extends GT_Recipe_Map {
- public GT_Recipe_Map_FluidCanner(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_FluidCanner(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4591,51 +4197,49 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
- GT_Recipe rRecipe =
- super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- if (aInputs == null
- || aInputs.length <= 0
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ GT_Recipe rRecipe = super.findRecipe(
+ aTileEntity,
+ aRecipe,
+ aNotUnificated,
+ aVoltage,
+ aFluids,
+ aSpecialSlot,
+ aInputs);
+ if (aInputs == null || aInputs.length <= 0
|| aInputs[0] == null
|| rRecipe != null
- || !GregTech_API.sPostloadFinished) return rRecipe;
+ || !GregTech_API.sPostloadFinished)
+ return rRecipe;
if (aFluids != null && aFluids.length > 0 && aFluids[0] != null) {
ItemStack tOutput = GT_Utility.fillFluidContainer(aFluids[0], aInputs[0], false, true);
FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
- if (tFluid != null)
- rRecipe = new GT_Recipe(
- false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- new ItemStack[] {tOutput},
- null,
- null,
- new FluidStack[] {tFluid},
- null,
- Math.max(tFluid.amount / 64, 16),
- 1,
- 0);
+ if (tFluid != null) rRecipe = new GT_Recipe(
+ false,
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ new ItemStack[] { tOutput },
+ null,
+ null,
+ new FluidStack[] { tFluid },
+ null,
+ Math.max(tFluid.amount / 64, 16),
+ 1,
+ 0);
}
if (rRecipe == null) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInputs[0], true);
- if (tFluid != null)
- rRecipe = new GT_Recipe(
- false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- new ItemStack[] {GT_Utility.getContainerItem(aInputs[0], true)},
- null,
- null,
- null,
- new FluidStack[] {tFluid},
- Math.max(tFluid.amount / 64, 16),
- 1,
- 0);
+ if (tFluid != null) rRecipe = new GT_Recipe(
+ false,
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ new ItemStack[] { GT_Utility.getContainerItem(aInputs[0], true) },
+ null,
+ null,
+ null,
+ new FluidStack[] { tFluid },
+ Math.max(tFluid.amount / 64, 16),
+ 1,
+ 0);
}
if (rRecipe != null) rRecipe.mCanBeBuffered = false;
return rRecipe;
@@ -4643,10 +4247,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public boolean containsInput(ItemStack aStack) {
- return aStack != null
- && (super.containsInput(aStack)
- || (aStack.getItem() instanceof IFluidContainerItem
- && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0));
+ return aStack != null && (super.containsInput(aStack) || (aStack.getItem() instanceof IFluidContainerItem
+ && ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0));
}
@Override
@@ -4664,21 +4266,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Recycler Recipe handling.
*/
public static class GT_Recipe_Map_Recycler extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Recycler(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Recycler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4699,24 +4291,17 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
return new GT_Recipe(
false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null
- ? null
- : new ItemStack[] {ItemList.IC2_Scrap.get(1)},
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aInputs[0]), 0) == null ? null
+ : new ItemStack[] { ItemList.IC2_Scrap.get(1) },
null,
- new int[] {1250},
+ new int[] { 1250 },
null,
null,
45,
@@ -4734,21 +4319,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Compressor Recipe handling.
*/
public static class GT_Recipe_Map_Compressor extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Compressor(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Compressor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4769,14 +4344,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]);
@@ -4791,9 +4360,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return GT_Utility.arrayContainsNonNull(tOutputItems)
? new GT_Recipe(
false,
- new ItemStack[] {
- GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])
- },
+ new ItemStack[] { GT_Utility
+ .copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) },
tOutputItems,
null,
null,
@@ -4807,14 +4375,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(
- GT_Utility.copyAmount(64, aStack),
- ic2.api.recipe.Recipes.compressor.getRecipes(),
- false,
- new NBTTagCompound(),
- null,
- null,
- null));
+ return GT_Utility.arrayContainsNonNull(
+ GT_ModHandler.getMachineOutput(
+ GT_Utility.copyAmount(64, aStack),
+ ic2.api.recipe.Recipes.compressor.getRecipes(),
+ false,
+ new NBTTagCompound(),
+ null,
+ null,
+ null));
}
}
@@ -4822,21 +4391,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Extractor Recipe handling.
*/
public static class GT_Recipe_Map_Extractor extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_Extractor(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Extractor(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4857,14 +4416,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]);
@@ -4879,9 +4432,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return GT_Utility.arrayContainsNonNull(tOutputItems)
? new GT_Recipe(
false,
- new ItemStack[] {
- GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])
- },
+ new ItemStack[] { GT_Utility
+ .copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) },
tOutputItems,
null,
null,
@@ -4895,14 +4447,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(
- GT_Utility.copyAmount(64, aStack),
- ic2.api.recipe.Recipes.extractor.getRecipes(),
- false,
- new NBTTagCompound(),
- null,
- null,
- null));
+ return GT_Utility.arrayContainsNonNull(
+ GT_ModHandler.getMachineOutput(
+ GT_Utility.copyAmount(64, aStack),
+ ic2.api.recipe.Recipes.extractor.getRecipes(),
+ false,
+ new NBTTagCompound(),
+ null,
+ null,
+ null));
}
}
@@ -4910,21 +4463,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Thermal Centrifuge Recipe handling.
*/
public static class GT_Recipe_Map_ThermalCentrifuge extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_ThermalCentrifuge(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_ThermalCentrifuge(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName,
+ String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -4945,14 +4488,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null) return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]);
@@ -4967,9 +4504,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return GT_Utility.arrayContainsNonNull(tOutputItems)
? new GT_Recipe(
false,
- new ItemStack[] {
- GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])
- },
+ new ItemStack[] { GT_Utility
+ .copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) },
tOutputItems,
null,
null,
@@ -4983,14 +4519,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(
- GT_Utility.copyAmount(64, aStack),
- ic2.api.recipe.Recipes.centrifuge.getRecipes(),
- false,
- new NBTTagCompound(),
- null,
- null,
- null));
+ return GT_Utility.arrayContainsNonNull(
+ GT_ModHandler.getMachineOutput(
+ GT_Utility.copyAmount(64, aStack),
+ ic2.api.recipe.Recipes.centrifuge.getRecipes(),
+ false,
+ new NBTTagCompound(),
+ null,
+ null,
+ null));
}
}
@@ -4998,21 +4535,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Ore Washer Recipe handling.
*/
public static class GT_Recipe_Map_OreWasher extends GT_Recipe_Map_NonGTRecipes {
- public GT_Recipe_Map_OreWasher(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_OreWasher(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -5033,20 +4560,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
- if (aInputs == null
- || aInputs.length <= 0
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ if (aInputs == null || aInputs.length <= 0
|| aInputs[0] == null
|| aFluids == null
|| aFluids.length < 1
- || !GT_ModHandler.isWater(aFluids[0])) return null;
+ || !GT_ModHandler.isWater(aFluids[0]))
+ return null;
if (aRecipe != null && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs)) return aRecipe;
ItemStack tComparedInput = GT_Utility.copyOrNull(aInputs[0]);
NBTTagCompound aRecipeMetaData = new NBTTagCompound();
@@ -5061,17 +4582,14 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return GT_Utility.arrayContainsNonNull(tOutputItems)
? new GT_Recipe(
false,
- new ItemStack[] {
- GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])
- },
+ new ItemStack[] { GT_Utility
+ .copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) },
tOutputItems,
null,
null,
- new FluidStack[] {
- new FluidStack(
- aFluids[0].getFluid(),
- ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount"))
- },
+ new FluidStack[] { new FluidStack(
+ aFluids[0].getFluid(),
+ ((NBTTagCompound) aRecipeMetaData.getTag("return")).getInteger("amount")) },
null,
400,
16,
@@ -5081,14 +4599,15 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public boolean containsInput(ItemStack aStack) {
- return GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(
- GT_Utility.copyAmount(64, aStack),
- ic2.api.recipe.Recipes.oreWashing.getRecipes(),
- false,
- new NBTTagCompound(),
- null,
- null,
- null));
+ return GT_Utility.arrayContainsNonNull(
+ GT_ModHandler.getMachineOutput(
+ GT_Utility.copyAmount(64, aStack),
+ ic2.api.recipe.Recipes.oreWashing.getRecipes(),
+ false,
+ new NBTTagCompound(),
+ null,
+ null,
+ null));
}
@Override
@@ -5106,21 +4625,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Macerator/RockCrusher Recipe handling.
*/
public static class GT_Recipe_Map_Macerator extends GT_Recipe_Map {
- public GT_Recipe_Map_Macerator(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Macerator(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -5141,14 +4650,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
if (aInputs == null || aInputs.length <= 0 || aInputs[0] == null || !GregTech_API.sPostloadFinished)
return super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
aRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
@@ -5156,12 +4659,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
try {
List<ItemStack> tRecipeOutputs = mods.railcraft.api.crafting.RailcraftCraftingManager.rockCrusher
- .getRecipe(GT_Utility.copyAmount(1, aInputs[0]))
- .getRandomizedOuputs();
+ .getRecipe(GT_Utility.copyAmount(1, aInputs[0])).getRandomizedOuputs();
if (tRecipeOutputs != null) {
aRecipe = new GT_Recipe(
false,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
tRecipeOutputs.toArray(new ItemStack[0]),
null,
null,
@@ -5192,9 +4694,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return GT_Utility.arrayContainsNonNull(tOutputItems)
? new GT_Recipe(
false,
- new ItemStack[] {
- GT_Utility.copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0])
- },
+ new ItemStack[] { GT_Utility
+ .copyAmount(aInputs[0].stackSize - tComparedInput.stackSize, aInputs[0]) },
tOutputItems,
null,
null,
@@ -5208,8 +4709,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
@Override
public boolean containsInput(ItemStack aStack) {
- return super.containsInput(aStack)
- || GT_Utility.arrayContainsNonNull(GT_ModHandler.getMachineOutput(
+ return super.containsInput(aStack) || GT_Utility.arrayContainsNonNull(
+ GT_ModHandler.getMachineOutput(
GT_Utility.copyAmount(64, aStack),
ic2.api.recipe.Recipes.macerator.getRecipes(),
false,
@@ -5225,21 +4726,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
*/
public static class GT_Recipe_Map_Assembler extends GT_Recipe_Map {
- public GT_Recipe_Map_Assembler(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map_Assembler(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -5260,63 +4750,26 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
GT_Recipe rRecipe = super.findRecipe(aTileEntity, aRecipe, true, aVoltage, aFluids, aSpecialSlot, aInputs);
/*
-
-
- Doesnt work, keep it as a reminder tho
-
- if (rRecipe == null){
- Set<ItemStack> aInputs2 = new TreeSet<ItemStack>();
- for (ItemStack aInput : aInputs) {
- aInputs2.add(aInput);
- }
-
- for (ItemStack aInput : aInputs) {
- aInputs2.remove(aInput);
- int[] oredictIDs = OreDictionary.getOreIDs(aInput);
- if ( oredictIDs.length > 1){
- for (final int i : oredictIDs){
- final ItemStack[] oredictIS = (ItemStack[]) OreDictionary.getOres(OreDictionary.getOreName(i)).toArray();
- if (oredictIS != null && oredictIS.length > 1){
- for (final ItemStack IS : oredictIS){
- aInputs2.add(IS);
- ItemStack[] temp = (ItemStack[]) aInputs2.toArray();
- rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot,temp);
- if(rRecipe!= null){
- break;
- }
- else {
- aInputs2.remove(IS);
- }
- }
- if(rRecipe!= null)
- break;
- }
- }
- if(rRecipe!= null)
- break;
- }else
- aInputs2.add(aInput);
- if(rRecipe!= null)
- break;
- }
- }
- */
- if (aInputs == null
- || aInputs.length <= 0
+ * Doesnt work, keep it as a reminder tho if (rRecipe == null){ Set<ItemStack> aInputs2 = new
+ * TreeSet<ItemStack>(); for (ItemStack aInput : aInputs) { aInputs2.add(aInput); } for (ItemStack aInput :
+ * aInputs) { aInputs2.remove(aInput); int[] oredictIDs = OreDictionary.getOreIDs(aInput); if (
+ * oredictIDs.length > 1){ for (final int i : oredictIDs){ final ItemStack[] oredictIS = (ItemStack[])
+ * OreDictionary.getOres(OreDictionary.getOreName(i)).toArray(); if (oredictIS != null && oredictIS.length >
+ * 1){ for (final ItemStack IS : oredictIS){ aInputs2.add(IS); ItemStack[] temp = (ItemStack[])
+ * aInputs2.toArray(); rRecipe = super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids,
+ * aSpecialSlot,temp); if(rRecipe!= null){ break; } else { aInputs2.remove(IS); } } if(rRecipe!= null)
+ * break; } } if(rRecipe!= null) break; }else aInputs2.add(aInput); if(rRecipe!= null) break; } }
+ */
+ if (aInputs == null || aInputs.length <= 0
|| aInputs[0] == null
|| rRecipe == null
- || !GregTech_API.sPostloadFinished) return rRecipe;
+ || !GregTech_API.sPostloadFinished)
+ return rRecipe;
for (ItemStack aInput : aInputs) {
if (ItemList.Paper_Printed_Pages.isStackEqual(aInput, false, true)) {
@@ -5333,21 +4786,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Forming Press handling.
*/
public static class GT_Recipe_Map_FormingPress extends GT_Recipe_Map {
- public GT_Recipe_Map_FormingPress(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_FormingPress(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -5368,14 +4811,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- boolean aDontCheckStackSizes,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot,
ItemStack... aInputs) {
GT_Recipe rRecipe = super.findRecipe(
aTileEntity,
@@ -5386,11 +4823,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
aFluids,
aSpecialSlot,
aInputs);
- if (aInputs == null
- || aInputs.length < 2
+ if (aInputs == null || aInputs.length < 2
|| aInputs[0] == null
|| aInputs[1] == null
- || !GregTech_API.sPostloadFinished) return rRecipe;
+ || !GregTech_API.sPostloadFinished)
+ return rRecipe;
if (rRecipe == null) return findRenamingRecipe(aInputs);
for (ItemStack aMold : aInputs) {
if (ItemList.Shape_Mold_Credit.isStackEqual(aMold, false, true)) {
@@ -5432,8 +4869,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
output.setStackDisplayName(mold.getDisplayName());
GT_Recipe recipe = new GT_Recipe(
false,
- new ItemStack[] {ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input)},
- new ItemStack[] {output},
+ new ItemStack[] { ItemList.Shape_Mold_Name.get(0), GT_Utility.copyAmount(1, input) },
+ new ItemStack[] { output },
null,
null,
null,
@@ -5450,21 +4887,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
* Special Class for Printer handling.
*/
public static class GT_Recipe_Map_Printer extends GT_Recipe_Map {
- public GT_Recipe_Map_Printer(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+
+ public GT_Recipe_Map_Printer(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -5485,30 +4912,29 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe findRecipe(
- IHasWorldObjectAndCoords aTileEntity,
- GT_Recipe aRecipe,
- boolean aNotUnificated,
- long aVoltage,
- FluidStack[] aFluids,
- ItemStack aSpecialSlot,
- ItemStack... aInputs) {
- GT_Recipe rRecipe =
- super.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, aSpecialSlot, aInputs);
- if (aInputs == null
- || aInputs.length <= 0
+ public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ GT_Recipe rRecipe = super.findRecipe(
+ aTileEntity,
+ aRecipe,
+ aNotUnificated,
+ aVoltage,
+ aFluids,
+ aSpecialSlot,
+ aInputs);
+ if (aInputs == null || aInputs.length <= 0
|| aInputs[0] == null
|| aFluids == null
|| aFluids.length <= 0
|| aFluids[0] == null
- || !GregTech_API.sPostloadFinished) return rRecipe;
+ || !GregTech_API.sPostloadFinished)
+ return rRecipe;
Dyes aDye = null;
- for (Dyes tDye : Dyes.VALUES)
- if (tDye.isFluidDye(aFluids[0])) {
- aDye = tDye;
- break;
- }
+ for (Dyes tDye : Dyes.VALUES) if (tDye.isFluidDye(aFluids[0])) {
+ aDye = tDye;
+ break;
+ }
if (aDye == null) return rRecipe;
@@ -5524,50 +4950,48 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
aInputs[0],
aInputs[0],
aInputs[0]);
- if (tOutput != null)
- return addRecipe(
- new GT_Recipe(
- true,
- new ItemStack[] {GT_Utility.copyAmount(8, aInputs[0])},
- new ItemStack[] {tOutput},
- null,
- null,
- new FluidStack[] {new FluidStack(aFluids[0].getFluid(), (int) L)},
- null,
- 256,
- 2,
- 0),
- false,
- false,
- true);
+ if (tOutput != null) return addRecipe(
+ new GT_Recipe(
+ true,
+ new ItemStack[] { GT_Utility.copyAmount(8, aInputs[0]) },
+ new ItemStack[] { tOutput },
+ null,
+ null,
+ new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) },
+ null,
+ 256,
+ 2,
+ 0),
+ false,
+ false,
+ true);
tOutput = GT_ModHandler.getAllRecipeOutput(
aTileEntity == null ? null : aTileEntity.getWorld(),
aInputs[0],
ItemList.DYE_ONLY_ITEMS[aDye.mIndex].get(1));
- if (tOutput != null)
- return addRecipe(
- new GT_Recipe(
- true,
- new ItemStack[] {GT_Utility.copyAmount(1, aInputs[0])},
- new ItemStack[] {tOutput},
- null,
- null,
- new FluidStack[] {new FluidStack(aFluids[0].getFluid(), (int) L)},
- null,
- 32,
- 2,
- 0),
- false,
- false,
- true);
+ if (tOutput != null) return addRecipe(
+ new GT_Recipe(
+ true,
+ new ItemStack[] { GT_Utility.copyAmount(1, aInputs[0]) },
+ new ItemStack[] { tOutput },
+ null,
+ null,
+ new FluidStack[] { new FluidStack(aFluids[0].getFluid(), (int) L) },
+ null,
+ 32,
+ 2,
+ 0),
+ false,
+ false,
+ true);
} else {
if (aInputs[0].getItem() == Items.paper) {
if (!ItemList.Tool_DataStick.isStackEqual(aSpecialSlot, false, true)) return null;
NBTTagCompound tNBT = aSpecialSlot.getTagCompound();
- if (tNBT == null
- || GT_Utility.isStringInvalid(tNBT.getString("title"))
- || GT_Utility.isStringInvalid(tNBT.getString("author"))) return null;
+ if (tNBT == null || GT_Utility.isStringInvalid(tNBT.getString("title"))
+ || GT_Utility.isStringInvalid(tNBT.getString("author")))
+ return null;
rRecipe = rRecipe.copy();
rRecipe.mCanBeBuffered = false;
@@ -5591,8 +5015,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
rRecipe = rRecipe.copy();
rRecipe.mCanBeBuffered = false;
- rRecipe.mOutputs[0].setTagCompound(GT_Utility.getNBTContainingString(
- new NBTTagCompound(), "GT.PunchCardData", tNBT.getString("GT.PunchCardData")));
+ rRecipe.mOutputs[0].setTagCompound(
+ GT_Utility.getNBTContainingString(
+ new NBTTagCompound(),
+ "GT.PunchCardData",
+ tNBT.getString("GT.PunchCardData")));
return rRecipe;
}
}
@@ -5617,11 +5044,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static class GT_Recipe_Map_LargeBoilerFakeFuels extends GT_Recipe_Map {
- private static final List<String> ALLOWED_SOLID_FUELS =
- Arrays.asList(GregTech_API.sMachineFile.mConfig.getStringList(
+ private static final List<String> ALLOWED_SOLID_FUELS = Arrays.asList(
+ GregTech_API.sMachineFile.mConfig.getStringList(
"LargeBoiler.allowedFuels",
ConfigCategories.machineconfig.toString(),
- new String[] {"gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7"},
+ new String[] { "gregtech:gt.blockreinforced:6", "gregtech:gt.blockreinforced:7" },
"Allowed fuels for the Large Titanium Boiler and Large Tungstensteel Boiler"));
public GT_Recipe_Map_LargeBoilerFakeFuels() {
@@ -5641,8 +5068,17 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
E,
true,
true);
- GT_Recipe explanatoryRecipe =
- new GT_Recipe(true, new ItemStack[] {}, new ItemStack[] {}, null, null, null, null, 1, 1, 1);
+ GT_Recipe explanatoryRecipe = new GT_Recipe(
+ true,
+ new ItemStack[] {},
+ new ItemStack[] {},
+ null,
+ null,
+ null,
+ null,
+ 1,
+ 1,
+ 1);
explanatoryRecipe.setNeiDesc(
"Not all solid fuels are listed.",
"Any item that burns in a",
@@ -5690,7 +5126,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
return addRecipe(
new GT_Recipe(
true,
- new ItemStack[] {fuelItemStack},
+ new ItemStack[] { fuelItemStack },
new ItemStack[] {},
null,
null,
@@ -5758,6 +5194,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
public static class GT_Recipe_Map_IC2NuclearFake extends GT_Recipe_Map {
+
public GT_Recipe_Map_IC2NuclearFake() {
super(
new HashSet<>(10),
@@ -5783,21 +5220,17 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
/**
* Add a breeder cell.
- * @param input raw stack. should be undamaged.
- * @param output breed output
+ *
+ * @param input raw stack. should be undamaged.
+ * @param output breed output
* @param heatMultiplier bonus progress per neutron pulse per heat step
- * @param heatStep divisor for hull heat
- * @param reflector true if also acts as a neutron reflector, false otherwise.
+ * @param heatStep divisor for hull heat
+ * @param reflector true if also acts as a neutron reflector, false otherwise.
* @param requiredPulses progress required to complete breeding
* @return added fake recipe
*/
- public GT_Recipe addBreederCell(
- ItemStack input,
- ItemStack output,
- boolean reflector,
- int heatStep,
- int heatMultiplier,
- int requiredPulses) {
+ public GT_Recipe addBreederCell(ItemStack input, ItemStack output, boolean reflector, int heatStep,
+ int heatMultiplier, int requiredPulses) {
return addFakeRecipe(
input,
output,
@@ -5809,13 +5242,22 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public GT_Recipe addFakeRecipe(ItemStack input, ItemStack output, String... neiDesc) {
GT_Recipe r = new GT_Recipe(
- new ItemStack[] {input}, new ItemStack[] {output}, null, new int[] {10000}, null, null, 0, 0, 0);
+ new ItemStack[] { input },
+ new ItemStack[] { output },
+ null,
+ new int[] { 10000 },
+ null,
+ null,
+ 0,
+ 0,
+ 0);
r.setNeiDesc(neiDesc);
return addRecipe(r, true, true, false);
}
}
public static class GT_Recipe_Map_LargeChemicalReactor extends GT_Recipe_Map_LargeNEI {
+
private static final int TOTAL_INPUT_COUNT = 6;
private static final int OUTPUT_COUNT = 6;
@@ -5839,16 +5281,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe addRecipe(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
+ public GT_Recipe addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial,
+ int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
int aSpecialValue) {
aOptimize = false;
ArrayList<ItemStack> adjustedInputs = new ArrayList<>();
@@ -5872,13 +5306,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
adjustedFluidInputs.add(inputFluidContent);
} else {
ItemData itemData = GT_OreDictUnificator.getItemData(input);
- if (itemData != null
- && itemData.hasValidPrefixMaterialData()
+ if (itemData != null && itemData.hasValidPrefixMaterialData()
&& itemData.mMaterial.mMaterial == Materials.Empty) {
continue;
} else {
- if (itemData != null
- && itemData.hasValidPrefixMaterialData()
+ if (itemData != null && itemData.hasValidPrefixMaterialData()
&& itemData.mPrefix == OrePrefixes.cell) {
ItemStack dustStack = itemData.mMaterial.mMaterial.getDust(input.stackSize);
if (dustStack != null) {
@@ -5916,8 +5348,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
adjustedFluidOutputs.add(outputFluidContent);
} else {
ItemData itemData = GT_OreDictUnificator.getItemData(output);
- if (!(itemData != null
- && itemData.hasValidPrefixMaterialData()
+ if (!(itemData != null && itemData.hasValidPrefixMaterialData()
&& itemData.mMaterial.mMaterial == Materials.Empty)) {
adjustedOutputs.add(output);
}
@@ -5994,6 +5425,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
public static class GT_Recipe_Map_OilCracker extends GT_Recipe_Map {
+
private final Set<String> mValidCatalystFluidNames = new HashSet<>();
public GT_Recipe_Map_OilCracker() {
@@ -6033,18 +5465,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
ItemStack[][] mOreDictAlt;
- public GT_Recipe_WithAlt(
- boolean aOptimize,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecialItems,
- int[] aChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue,
- ItemStack[][] aAlt) {
+ public GT_Recipe_WithAlt(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems,
+ int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
+ int aSpecialValue, ItemStack[][] aAlt) {
super(
aOptimize,
aInputs,
@@ -6077,21 +5500,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
private static class ReplicatorFakeMap extends GT_Recipe_Map {
- public ReplicatorFakeMap(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public ReplicatorFakeMap(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName, String aLocalName,
+ String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -6112,23 +5524,13 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe addFakeRecipe(
- boolean aCheckForCollisions,
- ItemStack[] aInputs,
- ItemStack[] aOutputs,
- Object aSpecial,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
+ public GT_Recipe addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs,
+ Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt,
int aSpecialValue) {
AtomicInteger ai = new AtomicInteger();
- Optional.ofNullable(GT_OreDictUnificator.getAssociation(aOutputs[0]))
- .map(itemData -> itemData.mMaterial)
- .map(materialsStack -> materialsStack.mMaterial)
- .map(materials -> materials.mElement)
- .map(Element::getMass)
- .ifPresent(e -> {
+ Optional.ofNullable(GT_OreDictUnificator.getAssociation(aOutputs[0])).map(itemData -> itemData.mMaterial)
+ .map(materialsStack -> materialsStack.mMaterial).map(materials -> materials.mElement)
+ .map(Element::getMass).ifPresent(e -> {
aFluidInputs[0].amount = (int) GT_MetaTileEntity_Replicator.cubicFluidMultiplier(e);
ai.set(GT_Utility.safeInt(aFluidInputs[0].amount * 512L, 1));
});
@@ -6150,21 +5552,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static class GT_Recipe_Map_ComplexFusion extends GT_Recipe_Map {
- public GT_Recipe_Map_ComplexFusion(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map_ComplexFusion(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName,
+ String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -6185,13 +5576,8 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public GT_Recipe addRecipe(
- int[] aOutputChances,
- FluidStack[] aFluidInputs,
- FluidStack[] aFluidOutputs,
- int aDuration,
- int aEUt,
- int aSpecialValue) {
+ public GT_Recipe addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs,
+ int aDuration, int aEUt, int aSpecialValue) {
return addRecipe(
new GT_Recipe(
false,
@@ -6222,21 +5608,10 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static class GT_Recipe_Map_AssemblyLineFake extends GT_Recipe_Map {
- public GT_Recipe_Map_AssemblyLineFake(
- Collection<GT_Recipe> aRecipeList,
- String aUnlocalizedName,
- String aLocalName,
- String aNEIName,
- String aNEIGUIPath,
- int aUsualInputCount,
- int aUsualOutputCount,
- int aMinimalInputItems,
- int aMinimalInputFluids,
- int aAmperage,
- String aNEISpecialValuePre,
- int aNEISpecialValueMultiplier,
- String aNEISpecialValuePost,
- boolean aShowVoltageAmperageInNEI,
+ public GT_Recipe_Map_AssemblyLineFake(Collection<GT_Recipe> aRecipeList, String aUnlocalizedName,
+ String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount,
+ int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre,
+ int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
boolean aNEIAllowed) {
super(
aRecipeList,
@@ -6278,32 +5653,27 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
@Override
- public void addProgressBarUI(
- ModularWindow.Builder builder, Supplier<Float> progressSupplier, Pos2d windowOffset) {
+ public void addProgressBarUI(ModularWindow.Builder builder, Supplier<Float> progressSupplier,
+ Pos2d windowOffset) {
int bar1Width = 17;
int bar2Width = 18;
- builder.widget(new ProgressBar()
- .setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17)
- .setDirection(ProgressBar.Direction.RIGHT)
- .setProgress(() -> progressSupplier.get() * ((float) (bar1Width + bar2Width) / bar1Width))
- .setSynced(false, false)
- .setPos(new Pos2d(88, 8).add(windowOffset))
- .setSize(bar1Width, 72));
- builder.widget(new ProgressBar()
- .setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18)
- .setDirection(ProgressBar.Direction.RIGHT)
- .setProgress(() -> (progressSupplier.get() - ((float) bar1Width / (bar1Width + bar2Width)))
- * ((float) (bar1Width + bar2Width) / bar2Width))
- .setSynced(false, false)
- .setPos(new Pos2d(124, 8).add(windowOffset))
- .setSize(bar2Width, 72));
- builder.widget(new ProgressBar()
- .setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18)
- .setDirection(ProgressBar.Direction.UP)
- .setProgress(progressSupplier)
- .setSynced(false, false)
- .setPos(new Pos2d(146, 26).add(windowOffset))
- .setSize(10, 18));
+ builder.widget(
+ new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_1, 17)
+ .setDirection(ProgressBar.Direction.RIGHT)
+ .setProgress(() -> progressSupplier.get() * ((float) (bar1Width + bar2Width) / bar1Width))
+ .setSynced(false, false).setPos(new Pos2d(88, 8).add(windowOffset)).setSize(bar1Width, 72));
+ builder.widget(
+ new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_2, 18)
+ .setDirection(ProgressBar.Direction.RIGHT)
+ .setProgress(
+ () -> (progressSupplier.get() - ((float) bar1Width / (bar1Width + bar2Width)))
+ * ((float) (bar1Width + bar2Width) / bar2Width))
+ .setSynced(false, false).setPos(new Pos2d(124, 8).add(windowOffset))
+ .setSize(bar2Width, 72));
+ builder.widget(
+ new ProgressBar().setTexture(GT_UITextures.PROGRESSBAR_ASSEMBLY_LINE_3, 18)
+ .setDirection(ProgressBar.Direction.UP).setProgress(progressSupplier)
+ .setSynced(false, false).setPos(new Pos2d(146, 26).add(windowOffset)).setSize(10, 18));
}
}
}
diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
index a353eff44d..81d11ad7f2 100644
--- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
+++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java
@@ -5,18 +5,9 @@ import static gregtech.api.enums.Materials.*;
import static gregtech.api.enums.Materials.Void;
import static gregtech.api.util.GT_Utility.calculateRecipeEU;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.SetMultimap;
-import cpw.mods.fml.relauncher.ReflectionHelper;
-import gregtech.GT_Mod;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
-import gregtech.api.objects.ItemData;
-import gregtech.api.objects.MaterialStack;
-import ic2.api.reactor.IReactorComponent;
import java.lang.reflect.Field;
import java.util.*;
+
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBlock;
@@ -28,112 +19,110 @@ import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.SetMultimap;
+
+import cpw.mods.fml.relauncher.ReflectionHelper;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.*;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+import ic2.api.reactor.IReactorComponent;
+
/**
* Class for Automatic Recipe registering.
*/
public class GT_RecipeRegistrator {
+
/**
- * List of Materials, which are used in the Creation of Sticks. All Rod Materials are automatically added to this List.
+ * List of Materials, which are used in the Creation of Sticks. All Rod Materials are automatically added to this
+ * List.
*/
public static final List<Materials> sRodMaterialList = new ArrayList<Materials>();
private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0);
private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R";
private static final RecipeShape[] sShapes = new RecipeShape[] {
- new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null),
- new RecipeShape(sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1),
- new RecipeShape(null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1),
- new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null),
- new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1),
- new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1),
- new RecipeShape(null, null, null, sMt1, null, sMt1, sMt1, null, sMt1),
- new RecipeShape(null, sMt1, null, null, sMt1, null, null, sMt2, null),
- new RecipeShape(sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null),
- new RecipeShape(null, sMt1, null, null, sMt2, null, null, sMt2, null),
- new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null),
- new RecipeShape(null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null),
- new RecipeShape(sMt1, sMt1, null, null, sMt2, null, null, sMt2, null),
- new RecipeShape(null, sMt1, sMt1, null, sMt2, null, null, sMt2, null),
- new RecipeShape(null, sMt1, null, sMt1, null, null, null, sMt1, sMt2),
- new RecipeShape(null, sMt1, null, null, null, sMt1, sMt2, sMt1, null),
- new RecipeShape(null, sMt1, null, sMt1, null, sMt1, null, null, sMt2),
- new RecipeShape(null, sMt1, null, sMt1, null, sMt1, sMt2, null, null),
- new RecipeShape(null, sMt2, null, null, sMt1, null, null, sMt1, null),
- new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1),
- new RecipeShape(null, sMt2, null, null, sMt2, null, null, sMt1, null),
- new RecipeShape(null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null),
- new RecipeShape(null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1),
- new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, null),
- new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, sMt2),
- new RecipeShape(null, null, sMt1, null, sMt2, null, sMt2, null, null),
- new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, null),
- new RecipeShape(null, null, sMt1, null, sMt2, null, null, null, null),
- new RecipeShape(sMt1, sMt2, null, null, null, null, null, null, null),
- new RecipeShape(sMt2, sMt1, null, null, null, null, null, null, null),
- new RecipeShape(sMt1, null, null, sMt2, null, null, null, null, null),
- new RecipeShape(sMt2, null, null, sMt1, null, null, null, null, null),
- new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null),
- new RecipeShape(sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null),
- new RecipeShape(null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1),
- new RecipeShape(null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1),
- new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null),
- new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null),
- new RecipeShape(null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1),
- new RecipeShape(null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1),
- new RecipeShape(sMt1, null, null, null, sMt1, null, null, null, null),
- new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null),
- new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null),
- new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2)
- };
+ new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null),
+ new RecipeShape(sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1),
+ new RecipeShape(null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1),
+ new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null),
+ new RecipeShape(sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1),
+ new RecipeShape(sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1),
+ new RecipeShape(null, null, null, sMt1, null, sMt1, sMt1, null, sMt1),
+ new RecipeShape(null, sMt1, null, null, sMt1, null, null, sMt2, null),
+ new RecipeShape(sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null),
+ new RecipeShape(null, sMt1, null, null, sMt2, null, null, sMt2, null),
+ new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null),
+ new RecipeShape(null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null),
+ new RecipeShape(sMt1, sMt1, null, null, sMt2, null, null, sMt2, null),
+ new RecipeShape(null, sMt1, sMt1, null, sMt2, null, null, sMt2, null),
+ new RecipeShape(null, sMt1, null, sMt1, null, null, null, sMt1, sMt2),
+ new RecipeShape(null, sMt1, null, null, null, sMt1, sMt2, sMt1, null),
+ new RecipeShape(null, sMt1, null, sMt1, null, sMt1, null, null, sMt2),
+ new RecipeShape(null, sMt1, null, sMt1, null, sMt1, sMt2, null, null),
+ new RecipeShape(null, sMt2, null, null, sMt1, null, null, sMt1, null),
+ new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1),
+ new RecipeShape(null, sMt2, null, null, sMt2, null, null, sMt1, null),
+ new RecipeShape(null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null),
+ new RecipeShape(null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1),
+ new RecipeShape(null, sMt2, null, null, sMt2, null, sMt1, sMt1, null),
+ new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, sMt2),
+ new RecipeShape(null, null, sMt1, null, sMt2, null, sMt2, null, null),
+ new RecipeShape(sMt1, null, null, null, sMt2, null, null, null, null),
+ new RecipeShape(null, null, sMt1, null, sMt2, null, null, null, null),
+ new RecipeShape(sMt1, sMt2, null, null, null, null, null, null, null),
+ new RecipeShape(sMt2, sMt1, null, null, null, null, null, null, null),
+ new RecipeShape(sMt1, null, null, sMt2, null, null, null, null, null),
+ new RecipeShape(sMt2, null, null, sMt1, null, null, null, null, null),
+ new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null),
+ new RecipeShape(sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null),
+ new RecipeShape(null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1),
+ new RecipeShape(null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1),
+ new RecipeShape(sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null),
+ new RecipeShape(sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null),
+ new RecipeShape(null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1),
+ new RecipeShape(null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1),
+ new RecipeShape(sMt1, null, null, null, sMt1, null, null, null, null),
+ new RecipeShape(null, sMt1, null, sMt1, null, null, null, null, null),
+ new RecipeShape(sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null),
+ new RecipeShape(null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2) };
public static final Field SHAPED_ORE_RECIPE_WIDTH = ReflectionHelper.findField(ShapedOreRecipe.class, "width");
public static final Field SHAPED_ORE_RECIPE_HEIGHT = ReflectionHelper.findField(ShapedOreRecipe.class, "height");
private static volatile Map<RecipeShape, List<IRecipe>> indexedRecipeListCache;
- private static final String[][] sShapesA = new String[][] {
- null,
- null,
- null,
- {"Helmet", s_P + s_P + s_P, s_P + s_H + s_P},
- {"ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P},
- {"Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P},
- {"Boots", s_P + " " + s_P, s_P + s_H + s_P},
- {"Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " "},
- {"Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " "},
- {"Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " "},
- {"Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " "},
- {"Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " "},
- {"Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " "},
- {"Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " "},
- {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
- {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
- {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
- {"Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R},
- {"Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " "},
- {"Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I},
- {"Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H},
- {"Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H},
- {"Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H},
- {"Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H},
- {"Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H},
- {"Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R},
- {"Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R},
- {"Knive", s_H + s_P, s_R + s_F},
- {"Knive", s_F + s_H, s_P + s_R},
- {"Knive", s_F + s_H, s_P + s_R},
- {"Knive", s_P + s_F, s_R + s_H},
- {"Knive", s_P + s_F, s_R + s_H},
- null,
- null,
- null,
- null,
- {"WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H},
- null,
- null,
- null,
- {"Shears", s_H + s_P, s_P + s_F},
- {"Shears", s_H + s_P, s_P + s_F},
- {"Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " "},
- {"Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R}
- };
+ private static final String[][] sShapesA = new String[][] { null, null, null,
+ { "Helmet", s_P + s_P + s_P, s_P + s_H + s_P },
+ { "ChestPlate", s_P + s_H + s_P, s_P + s_P + s_P, s_P + s_P + s_P },
+ { "Pants", s_P + s_P + s_P, s_P + s_H + s_P, s_P + " " + s_P },
+ { "Boots", s_P + " " + s_P, s_P + s_H + s_P },
+ { "Sword", " " + s_P + " ", s_F + s_P + s_H, " " + s_R + " " },
+ { "Pickaxe", s_P + s_I + s_I, s_F + s_R + s_H, " " + s_R + " " },
+ { "Shovel", s_F + s_P + s_H, " " + s_R + " ", " " + s_R + " " },
+ { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " },
+ { "Axe", s_P + s_I + s_H, s_P + s_R + " ", s_F + s_R + " " },
+ { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " },
+ { "Hoe", s_P + s_I + s_H, s_F + s_R + " ", " " + s_R + " " },
+ { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R },
+ { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R },
+ { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R },
+ { "Sickle", " " + s_P + " ", s_P + s_F + " ", s_H + s_P + s_R },
+ { "Sword", " " + s_R + " ", s_F + s_P + s_H, " " + s_P + " " },
+ { "Pickaxe", " " + s_R + " ", s_F + s_R + s_H, s_P + s_I + s_I },
+ { "Shovel", " " + s_R + " ", " " + s_R + " ", s_F + s_P + s_H },
+ { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H },
+ { "Axe", s_F + s_R + " ", s_P + s_R + " ", s_P + s_I + s_H },
+ { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H },
+ { "Hoe", " " + s_R + " ", s_F + s_R + " ", s_P + s_I + s_H },
+ { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R },
+ { "Spear", s_P + s_H + " ", s_F + s_R + " ", " " + " " + s_R }, { "Knive", s_H + s_P, s_R + s_F },
+ { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_F + s_H, s_P + s_R }, { "Knive", s_P + s_F, s_R + s_H },
+ { "Knive", s_P + s_F, s_R + s_H }, null, null, null, null,
+ { "WarAxe", s_P + s_P + s_P, s_P + s_R + s_P, s_F + s_R + s_H }, null, null, null,
+ { "Shears", s_H + s_P, s_P + s_F }, { "Shears", s_H + s_P, s_P + s_F },
+ { "Scythe", s_I + s_P + s_H, s_R + s_F + s_P, s_R + " " + " " },
+ { "Scythe", s_H + s_P + s_I, s_P + s_F + s_R, " " + " " + s_R } };
public static volatile int VERSION = 509;
static {
@@ -141,8 +130,8 @@ public class GT_RecipeRegistrator {
GregTech_API.sAfterGTPostload.add(() -> indexedRecipeListCache = null);
}
- public static void registerMaterialRecycling(
- ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) {
+ public static void registerMaterialRecycling(ItemStack aStack, Materials aMaterial, long aMaterialAmount,
+ MaterialStack aByproduct) {
if (GT_Utility.isStackInvalid(aStack)) return;
if (aByproduct != null) {
aByproduct = aByproduct.clone();
@@ -154,17 +143,20 @@ public class GT_RecipeRegistrator {
}
public static void registerMaterialRecycling(ItemStack aStack, ItemData aData) {
- if (GT_Utility.isStackInvalid(aStack)
- || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack)
+ if (GT_Utility.isStackInvalid(aStack) || GT_Utility.areStacksEqual(new ItemStack(Items.blaze_rod), aStack)
|| aData == null
|| !aData.hasValidMaterialData()
|| !aData.mMaterial.mMaterial.mAutoGenerateRecycleRecipes
|| aData.mMaterial.mAmount <= 0
|| GT_Utility.getFluidForFilledItem(aStack, false) != null
- || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES)) return;
+ || aData.mMaterial.mMaterial.mSubTags.contains(SubTag.NO_RECIPES))
+ return;
registerReverseMacerating(GT_Utility.copyAmount(1, aStack), aData, aData.mPrefix == null);
registerReverseSmelting(
- GT_Utility.copyAmount(1, aStack), aData.mMaterial.mMaterial, aData.mMaterial.mAmount, true);
+ GT_Utility.copyAmount(1, aStack),
+ aData.mMaterial.mMaterial,
+ aData.mMaterial.mAmount,
+ true);
registerReverseFluidSmelting(
GT_Utility.copyAmount(1, aStack),
aData.mMaterial.mMaterial,
@@ -178,43 +170,41 @@ public class GT_RecipeRegistrator {
* @param aMaterial the Material.
* @param aMaterialAmount the amount of it in Material Units.
*/
- public static void registerReverseFluidSmelting(
- ItemStack aStack, Materials aMaterial, long aMaterialAmount, MaterialStack aByproduct) {
- if (aStack == null
- || aMaterial == null
+ public static void registerReverseFluidSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount,
+ MaterialStack aByproduct) {
+ if (aStack == null || aMaterial == null
|| aMaterial.mSmeltInto.mStandardMoltenFluid == null
|| !aMaterial.contains(SubTag.SMELTING_TO_FLUID)
- || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0) return;
+ || (L * aMaterialAmount) / (M * aStack.stackSize) <= 0)
+ return;
ItemData tData = GT_OreDictUnificator.getItemData(aStack);
boolean tHide = aStack.getUnlocalizedName().startsWith("gt.blockmachines")
&& (GT_Mod.gregtechproxy.mHideRecyclingRecipes);
- if (GT_Mod.gregtechproxy.mHideRecyclingRecipes
- && tData != null
+ if (GT_Mod.gregtechproxy.mHideRecyclingRecipes && tData != null
&& tData.hasValidPrefixData()
- && !(tData.mPrefix == OrePrefixes.dust
- || tData.mPrefix == OrePrefixes.ingot
+ && !(tData.mPrefix == OrePrefixes.dust || tData.mPrefix == OrePrefixes.ingot
|| tData.mPrefix == OrePrefixes.block | tData.mPrefix == OrePrefixes.plate)) {
tHide = true;
}
- // boolean tHide = (aMaterial != Materials.Iron && aMaterial!=
+ // boolean tHide = (aMaterial != Materials.Iron && aMaterial!=
// Materials.Redstone)&&(GT_Mod.gregtechproxy.mHideRecyclingRecipes);
- // if(tHide && tData!=null&&tData.hasValidPrefixData()&&tData.mPrefix==OrePrefixes.ingot){
- // tHide=false;
- // }
+ // if(tHide && tData!=null&&tData.hasValidPrefixData()&&tData.mPrefix==OrePrefixes.ingot){
+ // tHide=false;
+ // }
RA.addFluidSmelterRecipe(
GT_Utility.copyAmount(1, aStack),
- aByproduct == null
- ? null
+ aByproduct == null ? null
: aByproduct.mMaterial.contains(SubTag.NO_SMELTING)
- || !aByproduct.mMaterial.contains(SubTag.METAL)
- ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE)
- ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2)
- : aByproduct.mMaterial.contains(SubTag.UNBURNABLE)
- ? GT_OreDictUnificator.getDustOrIngot(
- aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount)
- : null
- : GT_OreDictUnificator.getIngotOrDust(
- aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount),
+ || !aByproduct.mMaterial.contains(SubTag.METAL)
+ ? aByproduct.mMaterial.contains(SubTag.FLAMMABLE)
+ ? GT_OreDictUnificator.getDust(Materials.Ash, aByproduct.mAmount / 2)
+ : aByproduct.mMaterial.contains(SubTag.UNBURNABLE)
+ ? GT_OreDictUnificator.getDustOrIngot(
+ aByproduct.mMaterial.mSmeltInto,
+ aByproduct.mAmount)
+ : null
+ : GT_OreDictUnificator
+ .getIngotOrDust(aByproduct.mMaterial.mSmeltInto, aByproduct.mAmount),
aMaterial.mSmeltInto.getMolten((L * aMaterialAmount) / (M * aStack.stackSize)),
10000,
(int) Math.max(1, (24 * aMaterialAmount) / M),
@@ -228,37 +218,30 @@ public class GT_RecipeRegistrator {
* @param aMaterialAmount the amount of it in Material Units.
* @param aAllowAlloySmelter if it is allowed to be recycled inside the Alloy Smelter.
*/
- public static void registerReverseSmelting(
- ItemStack aStack, Materials aMaterial, long aMaterialAmount, boolean aAllowAlloySmelter) {
- if (aStack == null
- || aMaterial == null
+ public static void registerReverseSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount,
+ boolean aAllowAlloySmelter) {
+ if (aStack == null || aMaterial == null
|| aMaterialAmount <= 0
|| aMaterial.contains(SubTag.NO_SMELTING)
|| (aMaterialAmount > M && aMaterial.contains(SubTag.METAL))
- || (aMaterial.getProcessingMaterialTierEU() > TierEU.IV)) return;
+ || (aMaterial.getProcessingMaterialTierEU() > TierEU.IV))
+ return;
if (aMaterial == Materials.Naquadah || aMaterial == Materials.NaquadahEnriched) return;
aMaterialAmount /= aStack.stackSize;
boolean tHide = (aMaterial != Materials.Iron) && (GT_Mod.gregtechproxy.mHideRecyclingRecipes);
- if (aAllowAlloySmelter)
- GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(
- GT_Utility.copyAmount(1, aStack),
- GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount),
- tHide);
- else
- GT_ModHandler.addSmeltingRecipe(
- GT_Utility.copyAmount(1, aStack),
- GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
+ if (aAllowAlloySmelter) GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(
+ GT_Utility.copyAmount(1, aStack),
+ GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount),
+ tHide);
+ else GT_ModHandler.addSmeltingRecipe(
+ GT_Utility.copyAmount(1, aStack),
+ GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount));
}
- public static void registerReverseArcSmelting(
- ItemStack aStack,
- Materials aMaterial,
- long aMaterialAmount,
- MaterialStack aByProduct01,
- MaterialStack aByProduct02,
- MaterialStack aByProduct03) {
+ public static void registerReverseArcSmelting(ItemStack aStack, Materials aMaterial, long aMaterialAmount,
+ MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03) {
registerReverseArcSmelting(
aStack,
new ItemData(
@@ -276,10 +259,10 @@ public class GT_RecipeRegistrator {
boolean tIron = false;
for (MaterialStack tMaterial : aData.getAllMaterialStacks()) {
- if (tMaterial.mMaterial == Materials.Iron
- || tMaterial.mMaterial == Materials.Copper
+ if (tMaterial.mMaterial == Materials.Iron || tMaterial.mMaterial == Materials.Copper
|| tMaterial.mMaterial == Materials.WroughtIron
- || tMaterial.mMaterial == Materials.AnnealedCopper) tIron = true;
+ || tMaterial.mMaterial == Materials.AnnealedCopper)
+ tIron = true;
if (tMaterial.mMaterial.contains(SubTag.UNBURNABLE)) {
tMaterial.mMaterial = tMaterial.mMaterial.mSmeltInto.mArcSmeltInto;
@@ -311,10 +294,9 @@ public class GT_RecipeRegistrator {
}
aData = new ItemData(aData);
- if (aData.mByProducts.length > 3)
- for (MaterialStack tMaterial : aData.getAllMaterialStacks()) {
- if (tMaterial.mMaterial == Materials.Ash) tMaterial.mAmount = 0;
- }
+ if (aData.mByProducts.length > 3) for (MaterialStack tMaterial : aData.getAllMaterialStacks()) {
+ if (tMaterial.mMaterial == Materials.Ash) tMaterial.mAmount = 0;
+ }
aData = new ItemData(aData);
@@ -327,26 +309,18 @@ public class GT_RecipeRegistrator {
boolean tHide = !tIron && GT_Mod.gregtechproxy.mHideRecyclingRecipes;
RA.addArcFurnaceRecipe(
aStack,
- new ItemStack[] {
- GT_OreDictUnificator.getIngotOrDust(aData.mMaterial),
- GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)),
- GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)),
- GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2))
- },
+ new ItemStack[] { GT_OreDictUnificator.getIngotOrDust(aData.mMaterial),
+ GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(0)),
+ GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(1)),
+ GT_OreDictUnificator.getIngotOrDust(aData.getByProduct(2)) },
null,
(int) Math.max(16, tAmount / M),
90,
tHide);
}
- public static void registerReverseMacerating(
- ItemStack aStack,
- Materials aMaterial,
- long aMaterialAmount,
- MaterialStack aByProduct01,
- MaterialStack aByProduct02,
- MaterialStack aByProduct03,
- boolean aAllowHammer) {
+ public static void registerReverseMacerating(ItemStack aStack, Materials aMaterial, long aMaterialAmount,
+ MaterialStack aByProduct01, MaterialStack aByProduct02, MaterialStack aByProduct03, boolean aAllowHammer) {
registerReverseMacerating(
aStack,
new ItemData(
@@ -376,59 +350,43 @@ public class GT_RecipeRegistrator {
boolean tHide = (aData.mMaterial.mMaterial != Materials.Iron) && (GT_Mod.gregtechproxy.mHideRecyclingRecipes);
RA.addPulveriserRecipe(
aStack,
- new ItemStack[] {
- GT_OreDictUnificator.getDust(aData.mMaterial),
- GT_OreDictUnificator.getDust(aData.getByProduct(0)),
- GT_OreDictUnificator.getDust(aData.getByProduct(1)),
- GT_OreDictUnificator.getDust(aData.getByProduct(2))
- },
+ new ItemStack[] { GT_OreDictUnificator.getDust(aData.mMaterial),
+ GT_OreDictUnificator.getDust(aData.getByProduct(0)),
+ GT_OreDictUnificator.getDust(aData.getByProduct(1)),
+ GT_OreDictUnificator.getDust(aData.getByProduct(2)) },
null,
aData.mMaterial.mMaterial == Materials.Marble ? 1 : (int) Math.max(16, tAmount / M),
4,
tHide);
- if (aAllowHammer)
- for (MaterialStack tMaterial : aData.getAllMaterialStacks())
- if (tMaterial.mMaterial.contains(SubTag.CRYSTAL)
- && !tMaterial.mMaterial.contains(SubTag.METAL)
- && tMaterial.mMaterial != Materials.Glass) {
- if (RA.addForgeHammerRecipe(
- GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.getDust(aData.mMaterial), 200, 30))
- break;
- }
+ if (aAllowHammer) for (MaterialStack tMaterial : aData.getAllMaterialStacks())
+ if (tMaterial.mMaterial.contains(SubTag.CRYSTAL) && !tMaterial.mMaterial.contains(SubTag.METAL)
+ && tMaterial.mMaterial != Materials.Glass) {
+ if (RA.addForgeHammerRecipe(
+ GT_Utility.copyAmount(1, aStack),
+ GT_OreDictUnificator.getDust(aData.mMaterial),
+ 200,
+ 30))
+ break;
+ }
}
/**
* Place Materials which you want to replace in Non-GT-Recipes here (warning HUGHE impact on loading times!)
*/
- private static final Materials[] VANILLA_MATS = {
- Cobalt,
- Gold,
- Iron,
- Lead,
- FierySteel,
- Void,
- Bronze,
- Diamond,
- Ruby,
- Sapphire,
- Steel,
- IronWood,
- Steeleaf,
- Knightmetal,
- Thaumium,
- DarkSteel,
- };
+ private static final Materials[] VANILLA_MATS = { Cobalt, Gold, Iron, Lead, FierySteel, Void, Bronze, Diamond, Ruby,
+ Sapphire, Steel, IronWood, Steeleaf, Knightmetal, Thaumium, DarkSteel, };
/**
- * You give this Function a Material and it will scan almost everything for adding recycling Recipes and replacing Ingots, Gems etc.
+ * You give this Function a Material and it will scan almost everything for adding recycling Recipes and replacing
+ * Ingots, Gems etc.
*
* @param aMats Materials, for example an Ingot or a Gem.
* @param aPlate the Plate referenced to aMat
* @param aRecipeReplacing allows to replace the Recipe with a Plate variant
*/
- public static synchronized void registerUsagesForMaterials(
- String aPlate, boolean aRecipeReplacing, ItemStack... aMats) {
+ public static synchronized void registerUsagesForMaterials(String aPlate, boolean aRecipeReplacing,
+ ItemStack... aMats) {
for (ItemStack aMat : aMats) {
aMat = GT_Utility.copyOrNull(aMat);
@@ -452,13 +410,14 @@ public class GT_RecipeRegistrator {
GT_OreDictUnificator.addItemData(
tCrafted,
new ItemData(
- aItemData.mMaterial.mMaterial, aItemData.mMaterial.mAmount * tRecipe.amount1));
+ aItemData.mMaterial.mMaterial,
+ aItemData.mMaterial.mAmount * tRecipe.amount1));
//
// GT_Log.out.println("###################################################################################");
- // GT_Log.out.println("registerUsagesForMaterials used aPlate: "+aPlate);
- // GT_Log.out.println("registerUsagesForMaterials used aPlate:
+ // GT_Log.out.println("registerUsagesForMaterials used aPlate: "+aPlate);
+ // GT_Log.out.println("registerUsagesForMaterials used aPlate:
// "+aMat.getUnlocalizedName());
- // GT_Log.out.println("registerUsagesForMaterials used aPlate:
+ // GT_Log.out.println("registerUsagesForMaterials used aPlate:
// "+aMat.getDisplayName());
//
// GT_Log.out.println("###################################################################################");
@@ -484,8 +443,7 @@ public class GT_RecipeRegistrator {
private static Map<RecipeShape, List<IRecipe>> createIndexedRecipeListCache() {
Map<RecipeShape, List<IRecipe>> result = new IdentityHashMap<>();
@SuppressWarnings("unchecked")
- ArrayList<IRecipe> allRecipeList =
- (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
+ ArrayList<IRecipe> allRecipeList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
// filter using the empty slots in the shape.
// if the empty slots doesn't match, the recipe will definitely fail
SetMultimap<List<Integer>, RecipeShape> filter = HashMultimap.create();
@@ -502,8 +460,7 @@ public class GT_RecipeRegistrator {
}
buffer.clear();
ItemStack tStack = tRecipe.getRecipeOutput();
- if (GT_Utility.isStackValid(tStack)
- && tStack.getMaxStackSize() == 1
+ if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1
&& tStack.getMaxDamage() > 0
&& !(tStack.getItem() instanceof ItemBlock)
&& !(tStack.getItem() instanceof IReactorComponent)
@@ -543,8 +500,8 @@ public class GT_RecipeRegistrator {
return result;
}
- private static boolean checkRecipeShape(
- List<Integer> emptySlotIndexesBuffer, Object[] input, int tRecipeWidth, int tRecipeHeight) {
+ private static boolean checkRecipeShape(List<Integer> emptySlotIndexesBuffer, Object[] input, int tRecipeWidth,
+ int tRecipeHeight) {
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++) {
if (x >= tRecipeWidth || y >= tRecipeHeight) {
@@ -557,8 +514,7 @@ public class GT_RecipeRegistrator {
continue;
}
if (tObject instanceof ItemStack
- && (((ItemStack) tObject).getItem() == null
- || ((ItemStack) tObject).getMaxStackSize() < 2
+ && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2
|| ((ItemStack) tObject).getMaxDamage() > 0
|| ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
return false;
@@ -583,8 +539,8 @@ public class GT_RecipeRegistrator {
for (int i = 0; i < sShapes.length; i++) {
RecipeShape tRecipe = sShapes[i];
- for (ItemStack tCrafted :
- GT_ModHandler.getRecipeOutputs(getRecipeList(tRecipe), true, tRecipe.shape)) {
+ for (ItemStack tCrafted : GT_ModHandler
+ .getRecipeOutputs(getRecipeList(tRecipe), true, tRecipe.shape)) {
if (aItemData != null && aItemData.hasValidPrefixMaterialData())
GT_OreDictUnificator.addItemData(
tCrafted,
@@ -592,7 +548,8 @@ public class GT_RecipeRegistrator {
aItemData.mMaterial.mMaterial,
aItemData.mMaterial.mAmount * tRecipe.amount1,
new MaterialStack(
- tMaterial, OrePrefixes.stick.mMaterialAmount * tRecipe.amount2)));
+ tMaterial,
+ OrePrefixes.stick.mMaterialAmount * tRecipe.amount2)));
if (aRecipeReplacing && aPlate != null && sShapesA[i] != null && sShapesA[i].length > 1) {
assert aItemData != null;
@@ -604,42 +561,28 @@ public class GT_RecipeRegistrator {
switch (sShapesA[i].length) {
case 2:
GT_ModHandler.addCraftingRecipe(
- tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
- sShapesA[i][1],
- s_P.charAt(0),
- aPlate,
- s_R.charAt(0),
- OrePrefixes.stick.get(tMaterial),
- s_I.charAt(0),
- aItemData
- });
+ tStack,
+ GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] { sShapesA[i][1], s_P.charAt(0), aPlate, s_R.charAt(0),
+ OrePrefixes.stick.get(tMaterial), s_I.charAt(0),
+ aItemData });
break;
case 3:
GT_ModHandler.addCraftingRecipe(
- tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
- sShapesA[i][1],
- sShapesA[i][2],
- s_P.charAt(0),
- aPlate,
- s_R.charAt(0),
- OrePrefixes.stick.get(tMaterial),
- s_I.charAt(0),
- aItemData
- });
+ tStack,
+ GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] { sShapesA[i][1], sShapesA[i][2], s_P.charAt(0),
+ aPlate, s_R.charAt(0), OrePrefixes.stick.get(tMaterial),
+ s_I.charAt(0), aItemData });
break;
default:
GT_ModHandler.addCraftingRecipe(
- tStack, GT_ModHandler.RecipeBits.BUFFERED, new Object[] {
- sShapesA[i][1],
- sShapesA[i][2],
- sShapesA[i][3],
- s_P.charAt(0),
- aPlate,
- s_R.charAt(0),
- OrePrefixes.stick.get(tMaterial),
- s_I.charAt(0),
- aItemData
- });
+ tStack,
+ GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[] { sShapesA[i][1], sShapesA[i][2], sShapesA[i][3],
+ s_P.charAt(0), aPlate, s_R.charAt(0),
+ OrePrefixes.stick.get(tMaterial), s_I.charAt(0),
+ aItemData });
break;
}
}
@@ -653,27 +596,34 @@ public class GT_RecipeRegistrator {
/**
* Registers wiremill recipes for given material using integrated circuits.
- * @param aMaterial material to register
+ *
+ * @param aMaterial material to register
* @param baseDuration base duration ticks for ingot -> 1x wire recipe
- * @param aEUt EU/t for recipe
- * If you provide a proper EU tier for recipe processing then aEUt will be overriden with it.
+ * @param aEUt EU/t for recipe If you provide a proper EU tier for recipe processing then aEUt will be
+ * overriden with it.
*/
public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt) {
registerWiremillRecipes(
- aMaterial, baseDuration, calculateRecipeEU(aMaterial, aEUt), OrePrefixes.ingot, OrePrefixes.stick, 2);
+ aMaterial,
+ baseDuration,
+ calculateRecipeEU(aMaterial, aEUt),
+ OrePrefixes.ingot,
+ OrePrefixes.stick,
+ 2);
}
/**
* Registers wiremill recipes for given material using integrated circuits.
- * @param aMaterial material to register
+ *
+ * @param aMaterial material to register
* @param baseDuration base duration ticks for ingot -> 1x wire recipe
- * @param aEUt EU/t for recipe
- * @param prefix1 prefix corresponds to ingot
- * @param prefix2 prefix corresponds to stick
- * @param multiplier amount of wires created from 1 ingot
+ * @param aEUt EU/t for recipe
+ * @param prefix1 prefix corresponds to ingot
+ * @param prefix2 prefix corresponds to stick
+ * @param multiplier amount of wires created from 1 ingot
*/
- public static void registerWiremillRecipes(
- Materials aMaterial, int baseDuration, int aEUt, OrePrefixes prefix1, OrePrefixes prefix2, int multiplier) {
+ public static void registerWiremillRecipes(Materials aMaterial, int baseDuration, int aEUt, OrePrefixes prefix1,
+ OrePrefixes prefix2, int multiplier) {
GT_Values.RA.addWiremillRecipe(
GT_OreDictUnificator.get(prefix1, aMaterial, 1L),
GT_Utility.getIntegratedCircuit(1),
@@ -789,6 +739,7 @@ public class GT_RecipeRegistrator {
}
private static class RecipeShape {
+
private final ItemStack[] shape;
private int amount1;
private int amount2;
diff --git a/src/main/java/gregtech/api/util/GT_RenderingWorld.java b/src/main/java/gregtech/api/util/GT_RenderingWorld.java
index 173631e99c..bab2a30505 100644
--- a/src/main/java/gregtech/api/util/GT_RenderingWorld.java
+++ b/src/main/java/gregtech/api/util/GT_RenderingWorld.java
@@ -1,13 +1,10 @@
package gregtech.api.util;
-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 java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
@@ -20,10 +17,16 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.world.ChunkEvent;
import net.minecraftforge.event.world.WorldEvent;
+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;
+
/**
* Provide a fake IBlockAccess to support CTM. Facade are supposed to set these when they are placed/received by client.
*/
public class GT_RenderingWorld implements IBlockAccess {
+
private static final GT_RenderingWorld INSTANCE = new GT_RenderingWorld();
/*
* I do not think this map would ever grow too huge, so I won't go too overcomplicated on this one
@@ -56,8 +59,7 @@ public class GT_RenderingWorld implements IBlockAccess {
public void register(int x, int y, int z, Block block, int meta) {
ChunkPosition key = new ChunkPosition(x, y, z);
infos.put(key, new BlockInfo(block, meta));
- index.computeIfAbsent(new ChunkCoordIntPair(x >> 4, z >> 4), p -> new HashSet<>())
- .add(key);
+ index.computeIfAbsent(new ChunkCoordIntPair(x >> 4, z >> 4), p -> new HashSet<>()).add(key);
}
public void unregister(int x, int y, int z, Block block, int meta) {
@@ -123,6 +125,7 @@ public class GT_RenderingWorld implements IBlockAccess {
}
public class FMLEventHandler {
+
public FMLEventHandler() {
FMLCommonHandler.instance().bus().register(this);
}
@@ -134,6 +137,7 @@ public class GT_RenderingWorld implements IBlockAccess {
}
public class ForgeEventHandler {
+
private ForgeEventHandler() {
MinecraftForge.EVENT_BUS.register(this);
}
@@ -154,6 +158,7 @@ public class GT_RenderingWorld implements IBlockAccess {
}
private static class BlockInfo {
+
private final Block block;
private final int meta;
diff --git a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java
index ae8d804ee9..62096c1ebd 100644
--- a/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Shaped_Recipe.java
@@ -1,7 +1,5 @@
package gregtech.api.util;
-import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
-import gregtech.api.objects.ReverseShapedRecipe;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.inventory.InventoryCrafting;
@@ -10,19 +8,17 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapedOreRecipe;
+import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
+import gregtech.api.objects.ReverseShapedRecipe;
+
public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRecipe {
+
public final boolean mRemovableByGT, mKeepingNBT;
private final Enchantment[] mEnchantmentsAdded;
private final int[] mEnchantmentLevelsAdded;
- public GT_Shaped_Recipe(
- ItemStack aResult,
- boolean aDismantleAble,
- boolean aRemovableByGT,
- boolean aKeepingNBT,
- Enchantment[] aEnchantmentsAdded,
- int[] aEnchantmentLevelsAdded,
- Object... aRecipe) {
+ public GT_Shaped_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT,
+ Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) {
super(aResult, aRecipe);
mEnchantmentsAdded = aEnchantmentsAdded;
mEnchantmentLevelsAdded = aEnchantmentLevelsAdded;
@@ -42,8 +38,8 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec
if (tStack != null) {
if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i).hasTagCompound())
|| (tStack.hasTagCompound()
- && !tStack.getTagCompound()
- .equals(aGrid.getStackInSlot(i).getTagCompound()))) return false;
+ && !tStack.getTagCompound().equals(aGrid.getStackInSlot(i).getTagCompound())))
+ return false;
}
tStack = aGrid.getStackInSlot(i);
}
@@ -60,33 +56,33 @@ public class GT_Shaped_Recipe extends ShapedOreRecipe implements IGT_CraftingRec
GT_Utility.updateItemStack(rStack);
// Keeping NBT
- if (mKeepingNBT)
- for (int i = 0; i < aGrid.getSizeInventory(); i++) {
- if (aGrid.getStackInSlot(i) != null
- && aGrid.getStackInSlot(i).hasTagCompound()) {
- rStack.setTagCompound((NBTTagCompound)
- aGrid.getStackInSlot(i).getTagCompound().copy());
- break;
- }
+ if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) {
+ if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i).hasTagCompound()) {
+ rStack.setTagCompound((NBTTagCompound) aGrid.getStackInSlot(i).getTagCompound().copy());
+ break;
}
+ }
// Charge Values
if (GT_ModHandler.isElectricItem(rStack)) {
GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true);
int tCharge = 0;
- for (int i = 0; i < aGrid.getSizeInventory(); i++)
- tCharge += GT_ModHandler.dischargeElectricItem(
- aGrid.getStackInSlot(i), Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true);
+ for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem(
+ aGrid.getStackInSlot(i),
+ Integer.MAX_VALUE,
+ Integer.MAX_VALUE,
+ true,
+ true,
+ true);
if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false);
}
// Add Enchantments
- for (int i = 0; i < mEnchantmentsAdded.length; i++)
- GT_Utility.ItemNBT.addEnchantment(
- rStack,
- mEnchantmentsAdded[i],
- EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack)
- + mEnchantmentLevelsAdded[i]);
+ for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment(
+ rStack,
+ mEnchantmentsAdded[i],
+ EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack)
+ + mEnchantmentLevelsAdded[i]);
// Update the Stack again
GT_Utility.updateItemStack(rStack);
diff --git a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java
index 09d8730df5..02c479cc94 100644
--- a/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Shapeless_Recipe.java
@@ -1,7 +1,5 @@
package gregtech.api.util;
-import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
-import gregtech.api.objects.ReverseShapelessRecipe;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.inventory.InventoryCrafting;
@@ -10,19 +8,17 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapelessOreRecipe;
+import gregtech.api.interfaces.internal.IGT_CraftingRecipe;
+import gregtech.api.objects.ReverseShapelessRecipe;
+
public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_CraftingRecipe {
- public final boolean /*mDismantleable,*/ mRemovableByGT, mKeepingNBT;
+
+ public final boolean /* mDismantleable, */ mRemovableByGT, mKeepingNBT;
private final Enchantment[] mEnchantmentsAdded;
private final int[] mEnchantmentLevelsAdded;
- public GT_Shapeless_Recipe(
- ItemStack aResult,
- boolean aDismantleAble,
- boolean aRemovableByGT,
- boolean aKeepingNBT,
- Enchantment[] aEnchantmentsAdded,
- int[] aEnchantmentLevelsAdded,
- Object... aRecipe) {
+ public GT_Shapeless_Recipe(ItemStack aResult, boolean aDismantleAble, boolean aRemovableByGT, boolean aKeepingNBT,
+ Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object... aRecipe) {
super(aResult, aRecipe);
mEnchantmentsAdded = aEnchantmentsAdded;
mEnchantmentLevelsAdded = aEnchantmentLevelsAdded;
@@ -42,8 +38,8 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft
if (tStack != null) {
if ((tStack.hasTagCompound() != aGrid.getStackInSlot(i).hasTagCompound())
|| (tStack.hasTagCompound()
- && !tStack.getTagCompound()
- .equals(aGrid.getStackInSlot(i).getTagCompound()))) return false;
+ && !tStack.getTagCompound().equals(aGrid.getStackInSlot(i).getTagCompound())))
+ return false;
}
tStack = aGrid.getStackInSlot(i);
}
@@ -60,51 +56,51 @@ public class GT_Shapeless_Recipe extends ShapelessOreRecipe implements IGT_Craft
GT_Utility.updateItemStack(rStack);
// Keeping NBT
- if (mKeepingNBT)
- for (int i = 0; i < aGrid.getSizeInventory(); i++) {
- if (aGrid.getStackInSlot(i) != null
- && aGrid.getStackInSlot(i).hasTagCompound()) {
- rStack.setTagCompound((NBTTagCompound)
- aGrid.getStackInSlot(i).getTagCompound().copy());
- break;
- }
+ if (mKeepingNBT) for (int i = 0; i < aGrid.getSizeInventory(); i++) {
+ if (aGrid.getStackInSlot(i) != null && aGrid.getStackInSlot(i).hasTagCompound()) {
+ rStack.setTagCompound((NBTTagCompound) aGrid.getStackInSlot(i).getTagCompound().copy());
+ break;
}
+ }
// Charge Values
if (GT_ModHandler.isElectricItem(rStack)) {
GT_ModHandler.dischargeElectricItem(rStack, Integer.MAX_VALUE, Integer.MAX_VALUE, true, false, true);
int tCharge = 0;
- for (int i = 0; i < aGrid.getSizeInventory(); i++)
- tCharge += GT_ModHandler.dischargeElectricItem(
- aGrid.getStackInSlot(i), Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, true);
+ for (int i = 0; i < aGrid.getSizeInventory(); i++) tCharge += GT_ModHandler.dischargeElectricItem(
+ aGrid.getStackInSlot(i),
+ Integer.MAX_VALUE,
+ Integer.MAX_VALUE,
+ true,
+ true,
+ true);
if (tCharge > 0) GT_ModHandler.chargeElectricItem(rStack, tCharge, Integer.MAX_VALUE, true, false);
}
// Saving Ingredients inside the Item.
- // if (mDismantleable) {
- // NBTTagCompound rNBT = rStack.getTagCompound(), tNBT = new NBTTagCompound();
- // if (rNBT == null) rNBT = new NBTTagCompound();
- // for (int i = 0; i < 9; i++) {
- // ItemStack tStack = aGrid.getStackInSlot(i);
- // if (tStack != null && GT_Utility.getContainerItem(tStack, true) == null &&
+ // if (mDismantleable) {
+ // NBTTagCompound rNBT = rStack.getTagCompound(), tNBT = new NBTTagCompound();
+ // if (rNBT == null) rNBT = new NBTTagCompound();
+ // for (int i = 0; i < 9; i++) {
+ // ItemStack tStack = aGrid.getStackInSlot(i);
+ // if (tStack != null && GT_Utility.getContainerItem(tStack, true) == null &&
// !(tStack.getItem() instanceof GT_MetaGenerated_Tool)) {
- // tStack = GT_Utility.copyAmount(1, tStack);
- // GT_ModHandler.dischargeElectricItem(tStack, Integer.MAX_VALUE, Integer.MAX_VALUE,
+ // tStack = GT_Utility.copyAmount(1, tStack);
+ // GT_ModHandler.dischargeElectricItem(tStack, Integer.MAX_VALUE, Integer.MAX_VALUE,
// true, false, true);
- // tNBT.setTag("Ingredient." + i, tStack.writeToNBT(new NBTTagCompound()));
- // }
- // }
- // rNBT.setTag("GT.CraftingComponents", tNBT);
- // rStack.setTagCompound(rNBT);
- // }
+ // tNBT.setTag("Ingredient." + i, tStack.writeToNBT(new NBTTagCompound()));
+ // }
+ // }
+ // rNBT.setTag("GT.CraftingComponents", tNBT);
+ // rStack.setTagCompound(rNBT);
+ // }
// Add Enchantments
- for (int i = 0; i < mEnchantmentsAdded.length; i++)
- GT_Utility.ItemNBT.addEnchantment(
- rStack,
- mEnchantmentsAdded[i],
- EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack)
- + mEnchantmentLevelsAdded[i]);
+ for (int i = 0; i < mEnchantmentsAdded.length; i++) GT_Utility.ItemNBT.addEnchantment(
+ rStack,
+ mEnchantmentsAdded[i],
+ EnchantmentHelper.getEnchantmentLevel(mEnchantmentsAdded[i].effectId, rStack)
+ + mEnchantmentLevelsAdded[i]);
// Update the Stack again
GT_Utility.updateItemStack(rStack);
diff --git a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java
index 5ff631fad6..fae02badf2 100644
--- a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java
+++ b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check.java
@@ -1,17 +1,20 @@
package gregtech.api.util;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+
/** Used by machines that are locked to a single recipe, for fast computation. */
public class GT_Single_Recipe_Check {
+
protected final GT_MetaTileEntity_MultiBlockBase multiBlockBase;
protected final GT_Recipe recipe;
protected final ImmutableMap<GT_Utility.ItemId, Integer> itemCost;
@@ -20,20 +23,15 @@ public class GT_Single_Recipe_Check {
protected final int totalItemCost;
protected final int totalFluidCost;
- protected GT_Single_Recipe_Check(
- GT_MetaTileEntity_MultiBlockBase multiBlockBase,
- GT_Recipe recipe,
- ImmutableMap<GT_Utility.ItemId, Integer> itemCost,
- ImmutableMap<Fluid, Integer> fluidCost) {
+ protected GT_Single_Recipe_Check(GT_MetaTileEntity_MultiBlockBase multiBlockBase, GT_Recipe recipe,
+ ImmutableMap<GT_Utility.ItemId, Integer> itemCost, ImmutableMap<Fluid, Integer> fluidCost) {
this.multiBlockBase = multiBlockBase;
this.recipe = recipe;
this.itemCost = itemCost;
this.fluidCost = fluidCost;
- this.totalItemCost =
- itemCost.values().stream().mapToInt(Integer::intValue).sum();
- this.totalFluidCost =
- fluidCost.values().stream().mapToInt(Integer::intValue).sum();
+ this.totalItemCost = itemCost.values().stream().mapToInt(Integer::intValue).sum();
+ this.totalFluidCost = fluidCost.values().stream().mapToInt(Integer::intValue).sum();
}
public GT_Recipe getRecipe() {
@@ -41,10 +39,10 @@ public class GT_Single_Recipe_Check {
}
/**
- * Use this method if recipes cannot require more than a single stack of any item or fluid.
- * In particular, {@link GT_MetaTileEntity_MultiBlockBase#getCompactedInputs()} and
- * {@link GT_MetaTileEntity_MultiBlockBase#getCompactedFluids()} both enforce this single-stack
- * restriction, so any multi-block that calls those can use this method.
+ * Use this method if recipes cannot require more than a single stack of any item or fluid. In particular,
+ * {@link GT_MetaTileEntity_MultiBlockBase#getCompactedInputs()} and
+ * {@link GT_MetaTileEntity_MultiBlockBase#getCompactedFluids()} both enforce this single-stack restriction, so any
+ * multi-block that calls those can use this method.
*/
public boolean checkRecipeInputsSingleStack(boolean consumeInputs) {
Map<GT_Utility.ItemId, ItemStack> itemMap = null;
@@ -98,8 +96,8 @@ public class GT_Single_Recipe_Check {
}
/**
- * Use this method if recipes can require more than a single stack of any item or fluid.
- * It is less efficient, though.
+ * Use this method if recipes can require more than a single stack of any item or fluid. It is less efficient,
+ * though.
*/
public boolean checkRecipeInputs(boolean consumeInputs) {
List<ItemStack> items = null;
@@ -194,6 +192,7 @@ public class GT_Single_Recipe_Check {
}
public static final class Builder {
+
private final GT_MetaTileEntity_MultiBlockBase multiBlockBase;
// In order to compute which items and fluids are consumed by the recipe, we compare the
@@ -246,7 +245,10 @@ public class GT_Single_Recipe_Check {
}
return new GT_Single_Recipe_Check(
- multiBlockBase, recipe, itemCostBuilder.build(), fluidCostBuilder.build());
+ multiBlockBase,
+ recipe,
+ itemCostBuilder.build(),
+ fluidCostBuilder.build());
}
}
}
diff --git a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java
index e15ae792a1..c102d63f48 100644
--- a/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java
+++ b/src/main/java/gregtech/api/util/GT_Single_Recipe_Check_Processing_Array.java
@@ -1,32 +1,30 @@
package gregtech.api.util;
-import com.google.common.collect.ImmutableMap;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
+
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
+import com.google.common.collect.ImmutableMap;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+
/** Processing Array-specialized version of {@link gregtech.api.util.GT_Single_Recipe_Check}. */
public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Check {
+
protected final int recipeAmperage;
/**
- * The machine type that the locked recipe is for.
- * We will not allow running with other machines.
+ * The machine type that the locked recipe is for. We will not allow running with other machines.
*/
protected final ItemStack machineStack;
- protected GT_Single_Recipe_Check_Processing_Array(
- GT_MetaTileEntity_MultiBlockBase multiBlockBase,
- GT_Recipe recipe,
- ImmutableMap<GT_Utility.ItemId, Integer> itemCost,
- ImmutableMap<Fluid, Integer> fluidCost,
- int recipeAmperage,
- ItemStack machineStack) {
+ protected GT_Single_Recipe_Check_Processing_Array(GT_MetaTileEntity_MultiBlockBase multiBlockBase, GT_Recipe recipe,
+ ImmutableMap<GT_Utility.ItemId, Integer> itemCost, ImmutableMap<Fluid, Integer> fluidCost,
+ int recipeAmperage, ItemStack machineStack) {
super(multiBlockBase, recipe, itemCost, fluidCost);
this.recipeAmperage = recipeAmperage;
@@ -138,6 +136,7 @@ public class GT_Single_Recipe_Check_Processing_Array extends GT_Single_Recipe_Ch
}
public static final class Builder {
+
private final GT_MetaTileEntity_MultiBlockBase multiBlockBase;
// In order to compute which items and fluids are consumed by the recipe, we compare the
diff --git a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java
index 0661ea56b7..7b03dd8884 100644
--- a/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java
+++ b/src/main/java/gregtech/api/util/GT_SpawnEventHandler.java
@@ -1,18 +1,20 @@
package gregtech.api.util;
-import cpw.mods.fml.common.eventhandler.Event;
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gregtech.api.enums.GT_Values;
-import gregtech.api.metatileentity.BaseMetaTileEntity;
-import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_MonsterRepellent;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
+import cpw.mods.fml.common.eventhandler.Event;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_MonsterRepellent;
+
public class GT_SpawnEventHandler {
public static volatile List<int[]> mobReps = new CopyOnWriteArrayList<>();
@@ -62,17 +64,15 @@ public class GT_SpawnEventHandler {
if (check > maxRangeCheck) continue;
final TileEntity tTile = event.entity.worldObj.getTileEntity(rep[0], rep[1], rep[2]);
- if (tTile instanceof BaseMetaTileEntity
- && ((BaseMetaTileEntity) tTile).getMetaTileEntity()
- instanceof GT_MetaTileEntity_MonsterRepellent) {
- final int r = ((GT_MetaTileEntity_MonsterRepellent)
- ((BaseMetaTileEntity) tTile).getMetaTileEntity())
- .mRange;
+ if (tTile instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTile)
+ .getMetaTileEntity() instanceof GT_MetaTileEntity_MonsterRepellent) {
+ final int r = ((GT_MetaTileEntity_MonsterRepellent) ((BaseMetaTileEntity) tTile)
+ .getMetaTileEntity()).mRange;
if (check <= Math.pow(r, 2)) {
if (event.entityLiving instanceof EntitySlime)
((EntitySlime) event.entityLiving).setCustomNameTag("DoNotSpawnSlimes");
event.setResult(Event.Result.DENY);
- // We're already DENYing it. No reason to keep checking
+ // We're already DENYing it. No reason to keep checking
return;
}
}
diff --git a/src/main/java/gregtech/api/util/GT_StructureUtility.java b/src/main/java/gregtech/api/util/GT_StructureUtility.java
index 756a1c3afa..25ba192794 100644
--- a/src/main/java/gregtech/api/util/GT_StructureUtility.java
+++ b/src/main/java/gregtech/api/util/GT_StructureUtility.java
@@ -6,25 +6,12 @@ import static com.gtnewhorizon.structurelib.structure.IStructureElement.PlaceRes
import static com.gtnewhorizon.structurelib.structure.IStructureElement.PlaceResult.SKIP;
import static com.gtnewhorizon.structurelib.util.ItemStackPredicate.NBTMode.EXACT;
-import com.gtnewhorizon.structurelib.StructureLibAPI;
-import com.gtnewhorizon.structurelib.structure.*;
-import com.gtnewhorizon.structurelib.util.ItemStackPredicate;
-import gregtech.api.GregTech_API;
-import gregtech.api.enums.HeatingCoilLevel;
-import gregtech.api.enums.Materials;
-import gregtech.api.enums.OrePrefixes;
-import gregtech.api.interfaces.IHeatingCoil;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.BaseMetaPipeEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
-import gregtech.common.blocks.GT_Block_Casings5;
-import gregtech.common.blocks.GT_Item_Machines;
import java.util.Arrays;
import java.util.List;
import java.util.function.*;
+
import javax.annotation.Nonnull;
+
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
@@ -37,8 +24,26 @@ import net.minecraft.util.IChatComponent;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
+import com.gtnewhorizon.structurelib.StructureLibAPI;
+import com.gtnewhorizon.structurelib.structure.*;
+import com.gtnewhorizon.structurelib.util.ItemStackPredicate;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.HeatingCoilLevel;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IHeatingCoil;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
+import gregtech.common.blocks.GT_Block_Casings5;
+import gregtech.common.blocks.GT_Item_Machines;
+
public class GT_StructureUtility {
- // private static final Map<Class<?>, String> customNames = new HashMap<>();
+
+ // private static final Map<Class<?>, String> customNames = new HashMap<>();
private GT_StructureUtility() {
throw new AssertionError("Not instantiable");
}
@@ -47,8 +52,8 @@ public class GT_StructureUtility {
return aTile != null && clazz.isInstance(aTile.getMetaTileEntity());
}
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(
- IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, int aDots) {
+ public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex,
+ int aDots) {
return ofHatchAdder(aHatchAdder, aTextureIndex, StructureLibAPI.getBlockHint(), aDots - 1);
}
@@ -87,7 +92,17 @@ public class GT_StructureUtility {
return false;
ItemBlock tFrameStackItem = (ItemBlock) tFrameStack.getItem();
return tFrameStackItem.placeBlockAt(
- tFrameStack, null, world, x, y, z, 6, 0, 0, 0, Items.feather.getDamage(tFrameStack));
+ tFrameStack,
+ null,
+ world,
+ x,
+ y,
+ z,
+ 6,
+ 0,
+ 0,
+ 0,
+ Items.feather.getDamage(tFrameStack));
}
private ItemStack getFrameStack() {
@@ -95,8 +110,8 @@ public class GT_StructureUtility {
}
@Override
- public BlocksToPlace getBlocksToPlace(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
ItemStack tFrameStack = getFrameStack();
if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock))
return BlocksToPlace.errored;
@@ -104,23 +119,21 @@ public class GT_StructureUtility {
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- IItemSource s,
- EntityPlayerMP actor,
- Consumer<IChatComponent> chatter) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
return survivalPlaceBlock(
- t, world, x, y, z, trigger, AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
+ t,
+ world,
+ x,
+ y,
+ z,
+ trigger,
+ AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
if (check(t, world, x, y, z)) return SKIP;
ItemStack tFrameStack = getFrameStack();
if (!GT_Utility.isStackValid(tFrameStack) || !(tFrameStack.getItem() instanceof ItemBlock))
@@ -146,18 +159,20 @@ public class GT_StructureUtility {
}
/**
- * Completely equivalent to {@link #buildHatchAdder()}, except it plays nicer with type inference when statically imported
+ * Completely equivalent to {@link #buildHatchAdder()}, except it plays nicer with type inference when statically
+ * imported
*/
public static <T> GT_HatchElementBuilder<T> buildHatchAdder(Class<T> typeToken) {
return GT_HatchElementBuilder.builder();
}
- public static <T> IStructureElementNoPlacement<T> ofHatchAdder(
- IGT_HatchAdder<T> aHatchAdder, int aTextureIndex, Block aHintBlock, int aHintMeta) {
+ public static <T> IStructureElementNoPlacement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex,
+ Block aHintBlock, int aHintMeta) {
if (aHatchAdder == null || aHintBlock == null) {
throw new IllegalArgumentException();
}
return new IStructureElementNoPlacement<T>() {
+
@Override
public boolean check(T t, World world, int x, int y, int z) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
@@ -173,18 +188,14 @@ public class GT_StructureUtility {
};
}
- public static <T> IStructureElement<T> ofHatchAdder(
- IGT_HatchAdder<T> aHatchAdder,
- int aTextureIndex,
- Block aHintBlock,
- int aHintMeta,
- BiPredicate<T, IGregTechTileEntity> shouldSkip,
- Function<T, Class<? extends IMetaTileEntity>> aMetaId,
- final IStructureElement.PlaceResult acceptType) {
+ public static <T> IStructureElement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex,
+ Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip,
+ Function<T, Class<? extends IMetaTileEntity>> aMetaId, final IStructureElement.PlaceResult acceptType) {
if (aHatchAdder == null) {
throw new IllegalArgumentException();
}
return new IStructureElement<T>() {
+
@Override
public boolean check(T t, World world, int x, int y, int z) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
@@ -205,66 +216,63 @@ public class GT_StructureUtility {
}
@Override
- public BlocksToPlace getBlocksToPlace(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
Class<? extends IMetaTileEntity> clazz = aMetaId.apply(t);
if (clazz == null) return BlocksToPlace.createEmpty();
return BlocksToPlace.create(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- IItemSource s,
- EntityPlayerMP actor,
- Consumer<IChatComponent> chatter) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
return survivalPlaceBlock(
- t, world, x, y, z, trigger, AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
+ t,
+ world,
+ x,
+ y,
+ z,
+ trigger,
+ AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
if (shouldSkip != null) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IGregTechTileEntity
- && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP;
+ && shouldSkip.test(t, (IGregTechTileEntity) tileEntity))
+ return SKIP;
}
if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT;
Class<? extends IMetaTileEntity> clazz = aMetaId.apply(t);
if (clazz == null) return REJECT;
- ItemStack taken =
- env.getSource().takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true);
+ ItemStack taken = env.getSource()
+ .takeOne(is -> clazz.isInstance(GT_Item_Machines.getMetaTileEntity(is)), true);
if (GT_Utility.isStackInvalid(taken)) {
- env.getChatter()
- .accept(new ChatComponentTranslation(
- "GT5U.autoplace.error.no_mte.class_name", clazz.getSimpleName()));
+ env.getChatter().accept(
+ new ChatComponentTranslation(
+ "GT5U.autoplace.error.no_mte.class_name",
+ clazz.getSimpleName()));
return REJECT;
}
- if (StructureUtility.survivalPlaceBlock(
- taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor())
- == ACCEPT) return acceptType;
+ if (StructureUtility
+ .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor())
+ == ACCEPT)
+ return acceptType;
return REJECT;
}
};
}
- public static <T> IStructureElement<T> ofHatchAdder(
- IGT_HatchAdder<T> aHatchAdder,
- int aTextureIndex,
- Block aHintBlock,
- int aHintMeta,
- BiPredicate<T, IGregTechTileEntity> shouldSkip,
- ToIntFunction<T> aMetaId) {
+ public static <T> IStructureElement<T> ofHatchAdder(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex,
+ Block aHintBlock, int aHintMeta, BiPredicate<T, IGregTechTileEntity> shouldSkip, ToIntFunction<T> aMetaId) {
if (aHatchAdder == null) {
throw new IllegalArgumentException();
}
return new IStructureElement<T>() {
+
@Override
public boolean check(T t, World world, int x, int y, int z) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
@@ -285,8 +293,8 @@ public class GT_StructureUtility {
}
@Override
- public BlocksToPlace getBlocksToPlace(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines);
int meta = aMetaId.applyAsInt(t);
if (meta < 0) return BlocksToPlace.createEmpty();
@@ -294,70 +302,67 @@ public class GT_StructureUtility {
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- IItemSource s,
- EntityPlayerMP actor,
- Consumer<IChatComponent> chatter) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
return survivalPlaceBlock(
- t, world, x, y, z, trigger, AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
+ t,
+ world,
+ x,
+ y,
+ z,
+ trigger,
+ AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
if (shouldSkip != null) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IGregTechTileEntity
- && shouldSkip.test(t, (IGregTechTileEntity) tileEntity)) return SKIP;
+ && shouldSkip.test(t, (IGregTechTileEntity) tileEntity))
+ return SKIP;
}
if (!StructureLibAPI.isBlockTriviallyReplaceable(world, x, y, z, env.getActor())) return REJECT;
GT_Item_Machines item = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines);
int meta = aMetaId.applyAsInt(t);
if (meta < 0) return REJECT;
- ItemStack taken =
- env.getSource().takeOne(ItemStackPredicate.from(item).setMeta(meta), true);
+ ItemStack taken = env.getSource().takeOne(ItemStackPredicate.from(item).setMeta(meta), true);
if (GT_Utility.isStackInvalid(taken)) {
env.getChatter().accept(new ChatComponentTranslation("GT5U.autoplace.error.no_mte.id", meta));
return REJECT;
}
- return StructureUtility.survivalPlaceBlock(
- taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor())
- == ACCEPT
- ? ACCEPT_STOP
- : REJECT;
+ return StructureUtility
+ .survivalPlaceBlock(taken, EXACT, null, true, world, x, y, z, env.getSource(), env.getActor())
+ == ACCEPT ? ACCEPT_STOP : REJECT;
}
};
}
- public static <T> IStructureElement<T> ofHatchAdderOptional(
- IGT_HatchAdder<T> aHatchAdder, int textureIndex, int dots, Block placeCasing, int placeCasingMeta) {
+ public static <T> IStructureElement<T> ofHatchAdderOptional(IGT_HatchAdder<T> aHatchAdder, int textureIndex,
+ int dots, Block placeCasing, int placeCasingMeta) {
return ofHatchAdderOptional(
- aHatchAdder, textureIndex, StructureLibAPI.getBlockHint(), dots - 1, placeCasing, placeCasingMeta);
+ aHatchAdder,
+ textureIndex,
+ StructureLibAPI.getBlockHint(),
+ dots - 1,
+ placeCasing,
+ placeCasingMeta);
}
- public static <T> IStructureElement<T> ofHatchAdderOptional(
- IGT_HatchAdder<T> aHatchAdder,
- int aTextureIndex,
- Block aHintBlock,
- int hintMeta,
- Block placeCasing,
- int placeCasingMeta) {
+ public static <T> IStructureElement<T> ofHatchAdderOptional(IGT_HatchAdder<T> aHatchAdder, int aTextureIndex,
+ Block aHintBlock, int hintMeta, Block placeCasing, int placeCasingMeta) {
if (aHatchAdder == null || aHintBlock == null) {
throw new IllegalArgumentException();
}
return new IStructureElement<T>() {
+
@Override
public boolean check(T t, World world, int x, int y, int z) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
Block worldBlock = world.getBlock(x, y, z);
return (tileEntity instanceof IGregTechTileEntity
- && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex))
+ && aHatchAdder.apply(t, (IGregTechTileEntity) tileEntity, (short) aTextureIndex))
|| (worldBlock == placeCasing && worldBlock.getDamageValue(world, x, y, z) == placeCasingMeta);
}
@@ -374,19 +379,11 @@ public class GT_StructureUtility {
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- IItemSource s,
- EntityPlayerMP actor,
- Consumer<IChatComponent> chatter) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
if (check(t, world, x, y, z)) return SKIP;
- return StructureUtility.survivalPlaceBlock(
- placeCasing, placeCasingMeta, world, x, y, z, s, actor, chatter);
+ return StructureUtility
+ .survivalPlaceBlock(placeCasing, placeCasingMeta, world, x, y, z, s, actor, chatter);
}
};
}
@@ -396,31 +393,29 @@ public class GT_StructureUtility {
*
* @see #ofCoil(BiPredicate, Function)
*/
- public static <T> IStructureElement<T> ofCoil(
- BiConsumer<T, HeatingCoilLevel> aHeatingCoilSetter, Function<T, HeatingCoilLevel> aHeatingCoilGetter) {
- return ofCoil(
- (t, l) -> {
- aHeatingCoilSetter.accept(t, l);
- return true;
- },
- aHeatingCoilGetter);
+ public static <T> IStructureElement<T> ofCoil(BiConsumer<T, HeatingCoilLevel> aHeatingCoilSetter,
+ Function<T, HeatingCoilLevel> aHeatingCoilGetter) {
+ return ofCoil((t, l) -> {
+ aHeatingCoilSetter.accept(t, l);
+ return true;
+ }, aHeatingCoilGetter);
}
/**
* Heating coil structure element.
*
- * @param aHeatingCoilSetter Notify the controller of this new coil.
- * Got called exactly once per coil.
- * Might be called less times if structure test fails.
- * If the setter returns false then it assumes the coil is rejected.
+ * @param aHeatingCoilSetter Notify the controller of this new coil. Got called exactly once per coil. Might be
+ * called less times if structure test fails. If the setter returns false then it assumes
+ * the coil is rejected.
* @param aHeatingCoilGetter Get the current heating level. Null means no coil recorded yet.
*/
- public static <T> IStructureElement<T> ofCoil(
- BiPredicate<T, HeatingCoilLevel> aHeatingCoilSetter, Function<T, HeatingCoilLevel> aHeatingCoilGetter) {
+ public static <T> IStructureElement<T> ofCoil(BiPredicate<T, HeatingCoilLevel> aHeatingCoilSetter,
+ Function<T, HeatingCoilLevel> aHeatingCoilGetter) {
if (aHeatingCoilSetter == null || aHeatingCoilGetter == null) {
throw new IllegalArgumentException();
}
return new IStructureElement<T>() {
+
@Override
public boolean check(T t, World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
@@ -455,29 +450,27 @@ public class GT_StructureUtility {
}
@Override
- public BlocksToPlace getBlocksToPlace(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
return BlocksToPlace.create(GregTech_API.sBlockCasings5, getMetaFromHint(trigger));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t,
- World world,
- int x,
- int y,
- int z,
- ItemStack trigger,
- IItemSource s,
- EntityPlayerMP actor,
- Consumer<IChatComponent> chatter) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ IItemSource s, EntityPlayerMP actor, Consumer<IChatComponent> chatter) {
return survivalPlaceBlock(
- t, world, x, y, z, trigger, AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
+ t,
+ world,
+ x,
+ y,
+ z,
+ trigger,
+ AutoPlaceEnvironment.fromLegacy(s, actor, chatter));
}
@Override
- public PlaceResult survivalPlaceBlock(
- T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) {
+ public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger,
+ AutoPlaceEnvironment env) {
Block block = world.getBlock(x, y, z);
boolean isCoil = block instanceof IHeatingCoil
&& ((IHeatingCoil) block).getCoilHeat(world.getBlockMetadata(x, y, z))
diff --git a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java
index 15f7b69248..699517d288 100644
--- a/src/main/java/gregtech/api/util/GT_TooltipDataCache.java
+++ b/src/main/java/gregtech/api/util/GT_TooltipDataCache.java
@@ -1,15 +1,18 @@
package gregtech.api.util;
-import gregtech.GT_Mod;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import net.minecraft.util.StatCollector;
+import gregtech.GT_Mod;
+
public class GT_TooltipDataCache {
public static class TooltipData {
+
public List<String> text;
public List<String> shiftText;
@@ -24,7 +27,7 @@ public class GT_TooltipDataCache {
/**
* Returns tooltip data respecting the user's configured verbosity levels, applying any formatting arguments.
*
- * @param key the key to lookup
+ * @param key the key to lookup
* @param args arguments for string formatting (prefer using positional arguments)
* @return The tooltip data the user asked for
*/
@@ -40,7 +43,7 @@ public class GT_TooltipDataCache {
/**
* Builds tooltip data respecting the user's configured verbosity levels, applying any formatting arguments.
*
- * @param key the key to lookup
+ * @param key the key to lookup
* @param args arguments for string formatting (prefer using positional arguments)
* @return The tooltip data the user asked for
*/
@@ -48,8 +51,8 @@ public class GT_TooltipDataCache {
List<String> lines = getAllLines(key, args);
int normalLines = lines.size();
if (Math.max(GT_Mod.gregtechproxy.mTooltipVerbosity, GT_Mod.gregtechproxy.mTooltipShiftVerbosity) >= 3) {
- lines.addAll(
- getAllLines(key + ".extended", args)); // Are extended lines enabled? If so add them to the lines
+ lines.addAll(getAllLines(key + ".extended", args)); // Are extended lines enabled? If so add them to the
+ // lines
}
if (lines.size() == 0) {
lines.add(key); // Fallback in case no lines could be found at all
@@ -57,13 +60,14 @@ public class GT_TooltipDataCache {
return new TooltipData(
lines.subList(0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipVerbosity, normalLines, lines.size())),
lines.subList(
- 0, getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size())));
+ 0,
+ getVerbosityIndex(GT_Mod.gregtechproxy.mTooltipShiftVerbosity, normalLines, lines.size())));
}
/**
* Gets all the lines for the given key and every other subsequent consecutive key with a .n suffix, n in {1,2,3...}
*
- * @param key the key to lookup
+ * @param key the key to lookup
* @param args arguments for string formatting (prefer using positional arguments)
* @return The lines for the key and all of it's subkeys
*/
@@ -82,8 +86,8 @@ public class GT_TooltipDataCache {
* Determines how many lines from a tooltip to include from the full line list to respect a given verbosity level.
*
* @param tooltipVerbosity the verbosity level we're applying
- * @param defaultIndex return if tooltipVerbosity is 2
- * @param maxIndex return if tooltipVerbosity is greater than 2
+ * @param defaultIndex return if tooltipVerbosity is 2
+ * @param maxIndex return if tooltipVerbosity is greater than 2
* @return verbosity appropriate index
*/
private static int getVerbosityIndex(int tooltipVerbosity, int defaultIndex, int maxIndex) {
diff --git a/src/main/java/gregtech/api/util/GT_Util.java b/src/main/java/gregtech/api/util/GT_Util.java
index 9de1726162..6e203a2682 100644
--- a/src/main/java/gregtech/api/util/GT_Util.java
+++ b/src/main/java/gregtech/api/util/GT_Util.java
@@ -1,6 +1,5 @@
package gregtech.api.util;
-import gregtech.api.multitileentity.interfaces.IMultiTileEntity;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTBase;
@@ -11,7 +10,10 @@ import net.minecraft.util.Tuple;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
+import gregtech.api.multitileentity.interfaces.IMultiTileEntity;
+
public class GT_Util {
+
// Last broken tile entity
public static final ThreadLocal<TileEntity> LAST_BROKEN_TILEENTITY = new ThreadLocal<>();
@@ -23,13 +25,13 @@ public class GT_Util {
if (aNBT1 == null) return aNBT2 == null ? new NBTTagCompound() : (NBTTagCompound) aNBT2.copy();
final NBTTagCompound rNBT = (NBTTagCompound) aNBT1.copy();
if (aNBT2 == null) return rNBT;
- for (Object tKey : aNBT2.func_150296_c /*getKeySet*/())
+ for (Object tKey : aNBT2.func_150296_c /* getKeySet */())
if (!rNBT.hasKey(tKey.toString())) rNBT.setTag(tKey.toString(), aNBT2.getTag(tKey.toString()));
return rNBT;
}
/**
- * Construct a NBTTagCompound from a series of key, value pairs. Inspired from GT6.
+ * Construct a NBTTagCompound from a series of key, value pairs. Inspired from GT6.
*/
public static NBTTagCompound makeNBT(Tuple... aTags) {
final NBTTagCompound rNBT = new NBTTagCompound();
@@ -43,10 +45,8 @@ public class GT_Util {
rNBT.setInteger(t.getFirst().toString(), (Integer) t.getSecond());
else if (t.getSecond() instanceof Long) rNBT.setLong(t.getFirst().toString(), (Long) t.getSecond());
else if (t.getSecond() instanceof Float) rNBT.setFloat(t.getFirst().toString(), (Float) t.getSecond());
- else if (t.getSecond() instanceof Double)
- rNBT.setDouble(t.getFirst().toString(), (Double) t.getSecond());
- else if (t.getSecond() instanceof String)
- rNBT.setString(t.getFirst().toString(), (String) t.getSecond());
+ else if (t.getSecond() instanceof Double) rNBT.setDouble(t.getFirst().toString(), (Double) t.getSecond());
+ else if (t.getSecond() instanceof String) rNBT.setString(t.getFirst().toString(), (String) t.getSecond());
else if (t.getSecond() instanceof NBTBase) rNBT.setTag(t.getFirst().toString(), (NBTBase) t.getSecond());
else rNBT.setString(t.getFirst().toString(), t.getSecond().toString());
}
@@ -70,22 +70,22 @@ public class GT_Util {
}
/** Sets the TileEntity at the passed position, with the option of turning adjacent TileEntity updates off. */
- public static TileEntity setTileEntity(
- World aWorld, int aX, int aY, int aZ, TileEntity aTileEntity, boolean aCauseTileEntityUpdates) {
+ public static TileEntity setTileEntity(World aWorld, int aX, int aY, int aZ, TileEntity aTileEntity,
+ boolean aCauseTileEntityUpdates) {
if (aCauseTileEntityUpdates) aWorld.setTileEntity(aX, aY, aZ, aTileEntity);
else {
Chunk tChunk = aWorld.getChunkFromChunkCoords(aX >> 4, aZ >> 4);
if (tChunk != null) {
aWorld.addTileEntity(aTileEntity);
- tChunk.func_150812_a /*setBlockTileEntityInChunk*/(aX & 15, aY, aZ & 15, aTileEntity);
+ tChunk.func_150812_a /* setBlockTileEntityInChunk */(aX & 15, aY, aZ & 15, aTileEntity);
tChunk.setChunkModified();
}
}
return aTileEntity;
}
- public static boolean setTileEntity(
- World aWorld, int aX, int aY, int aZ, Block aBlock, short aMeta, long aFlags, boolean aRemoveGrassBelow) {
+ public static boolean setTileEntity(World aWorld, int aX, int aY, int aZ, Block aBlock, short aMeta, long aFlags,
+ boolean aRemoveGrassBelow) {
if (aRemoveGrassBelow) {
final Block tBlock = aWorld.getBlock(aX, aY - 1, aZ);
if (tBlock == Blocks.grass || tBlock == Blocks.mycelium)
@@ -106,29 +106,29 @@ public class GT_Util {
aWorld.getBlockMetadata(aX, 0, aZ);
aChunk = aWorld.getChunkFromBlockCoords(aX, aZ);
if (aChunk == null) {
- GT_Log.err.println("Some important Chunk does not exist for some reason at Coordinates X: " + aX
- + " and Z: " + aZ);
+ GT_Log.err.println(
+ "Some important Chunk does not exist for some reason at Coordinates X: " + aX
+ + " and Z: "
+ + aZ);
return false;
}
}
aChunk.setChunkModified();
return true;
}
+
/** Marks a Chunk dirty so it is saved */
public static boolean markChunkDirty(Object aTileEntity) {
- return aTileEntity instanceof TileEntity
- && markChunkDirty(
- ((TileEntity) aTileEntity).getWorldObj(),
- ((TileEntity) aTileEntity).xCoord,
- ((TileEntity) aTileEntity).zCoord);
+ return aTileEntity instanceof TileEntity && markChunkDirty(
+ ((TileEntity) aTileEntity).getWorldObj(),
+ ((TileEntity) aTileEntity).xCoord,
+ ((TileEntity) aTileEntity).zCoord);
}
public static int mixRGBInt(int aRGB1, int aRGB2) {
- return getRGBInt(new short[] {
- (short) ((getR(aRGB1) + getR(aRGB2)) >> 1),
- (short) ((getG(aRGB1) + getG(aRGB2)) >> 1),
- (short) ((getB(aRGB1) + getB(aRGB2)) >> 1)
- });
+ return getRGBInt(
+ new short[] { (short) ((getR(aRGB1) + getR(aRGB2)) >> 1), (short) ((getG(aRGB1) + getG(aRGB2)) >> 1),
+ (short) ((getB(aRGB1) + getB(aRGB2)) >> 1) });
}
public static int getRGBInt(short[] aColors) {
@@ -152,12 +152,8 @@ public class GT_Util {
}
public static short[] getRGBaArray(int aColors) {
- return new short[] {
- (short) ((aColors >>> 16) & 255),
- (short) ((aColors >>> 8) & 255),
- (short) (aColors & 255),
- (short) ((aColors >>> 24) & 255)
- };
+ return new short[] { (short) ((aColors >>> 16) & 255), (short) ((aColors >>> 8) & 255), (short) (aColors & 255),
+ (short) ((aColors >>> 24) & 255) };
}
public static short getR(int aColors) {
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index f1cdde1d48..2134d94253 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -12,50 +12,6 @@ import static gregtech.api.enums.GT_Values.W;
import static gregtech.api.enums.Materials.FLUID_MAP;
import static gregtech.common.GT_UndergroundOil.undergroundOilReadInformation;
-import cofh.api.transport.IItemDuct;
-import com.google.auto.value.AutoValue;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-import com.gtnewhorizon.structurelib.alignment.IAlignment;
-import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider;
-import com.mojang.authlib.GameProfile;
-import cpw.mods.fml.common.FMLCommonHandler;
-import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.GregTech_API;
-import gregtech.api.damagesources.GT_DamageSources;
-import gregtech.api.damagesources.GT_DamageSources.DamageSourceHotItem;
-import gregtech.api.enchants.Enchantment_Hazmat;
-import gregtech.api.enchants.Enchantment_Radioactivity;
-import gregtech.api.enums.*;
-import gregtech.api.events.BlockScanningEvent;
-import gregtech.api.interfaces.IBlockContainer;
-import gregtech.api.interfaces.IDebugableBlock;
-import gregtech.api.interfaces.IHasIndexedTexture;
-import gregtech.api.interfaces.IProjectileItem;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.interfaces.tileentity.IMachineProgress;
-import gregtech.api.interfaces.tileentity.IUpgradableMachine;
-import gregtech.api.items.GT_EnergyArmor_Item;
-import gregtech.api.items.GT_Generic_Item;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-import gregtech.api.net.GT_Packet_Sound;
-import gregtech.api.objects.CollectorUtils;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_ItemStack2;
-import gregtech.api.objects.ItemData;
-import gregtech.api.threads.GT_Runnable_Sound;
-import gregtech.api.util.extensions.ArrayExt;
-import gregtech.common.GT_Pollution;
-import gregtech.common.blocks.GT_Block_Ores_Abstract;
-import ic2.api.recipe.IRecipeInput;
-import ic2.api.recipe.RecipeInputItemStack;
-import ic2.api.recipe.RecipeInputOreDict;
-import ic2.api.recipe.RecipeOutput;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -68,7 +24,9 @@ import java.util.Map.Entry;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.function.Supplier;
+
import javax.annotation.Nullable;
+
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -120,23 +78,73 @@ import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.oredict.OreDictionary;
+import cofh.api.transport.IItemDuct;
+
+import com.google.auto.value.AutoValue;
+import com.google.common.base.Suppliers;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Maps;
+import com.gtnewhorizon.structurelib.alignment.IAlignment;
+import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider;
+import com.mojang.authlib.GameProfile;
+
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.registry.GameRegistry;
+import gregtech.api.GregTech_API;
+import gregtech.api.damagesources.GT_DamageSources;
+import gregtech.api.damagesources.GT_DamageSources.DamageSourceHotItem;
+import gregtech.api.enchants.Enchantment_Hazmat;
+import gregtech.api.enchants.Enchantment_Radioactivity;
+import gregtech.api.enums.*;
+import gregtech.api.events.BlockScanningEvent;
+import gregtech.api.interfaces.IBlockContainer;
+import gregtech.api.interfaces.IDebugableBlock;
+import gregtech.api.interfaces.IHasIndexedTexture;
+import gregtech.api.interfaces.IProjectileItem;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IBasicEnergyContainer;
+import gregtech.api.interfaces.tileentity.ICoverable;
+import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.IMachineProgress;
+import gregtech.api.interfaces.tileentity.IUpgradableMachine;
+import gregtech.api.items.GT_EnergyArmor_Item;
+import gregtech.api.items.GT_Generic_Item;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+import gregtech.api.net.GT_Packet_Sound;
+import gregtech.api.objects.CollectorUtils;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_ItemStack2;
+import gregtech.api.objects.ItemData;
+import gregtech.api.threads.GT_Runnable_Sound;
+import gregtech.api.util.extensions.ArrayExt;
+import gregtech.common.GT_Pollution;
+import gregtech.common.blocks.GT_Block_Ores_Abstract;
+import ic2.api.recipe.IRecipeInput;
+import ic2.api.recipe.RecipeInputItemStack;
+import ic2.api.recipe.RecipeInputOreDict;
+import ic2.api.recipe.RecipeOutput;
+
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
* Just a few Utility Functions I use.
*/
public class GT_Utility {
+
/** Formats a number with group separator and at most 2 fraction digits. */
private static final Map<Locale, DecimalFormat> decimalFormatters = new HashMap<>();
/**
- * Forge screwed the Fluid Registry up again, so I make my own, which is also much more efficient than the stupid Stuff over there.
+ * Forge screwed the Fluid Registry up again, so I make my own, which is also much more efficient than the stupid
+ * Stuff over there.
*/
private static final List<FluidContainerData> sFluidContainerList = new ArrayList<>();
- private static final Map<GT_ItemStack, FluidContainerData> sFilledContainerToData = new /*Concurrent*/ HashMap<>();
- private static final Map<GT_ItemStack, Map<Fluid, FluidContainerData>> sEmptyContainerToFluidToData =
- new /*Concurrent*/ HashMap<>();
+ private static final Map<GT_ItemStack, FluidContainerData> sFilledContainerToData = new /* Concurrent */ HashMap<>();
+ private static final Map<GT_ItemStack, Map<Fluid, FluidContainerData>> sEmptyContainerToFluidToData = new /*
+ * Concurrent
+ */ HashMap<>();
private static final Map<Fluid, List<ItemStack>> sFluidToContainers = new HashMap<>();
private static final Map<String, Fluid> sFluidUnlocalizedNameToFluid = new HashMap<>();
/** Must use {@code Supplier} here because the ore prefixes have not yet been registered at class load time. */
@@ -145,10 +153,10 @@ public class GT_Utility {
private static final Map<Integer, Boolean> sOreTable = new HashMap<>();
public static volatile int VERSION = 509;
public static boolean TE_CHECK = false, BC_CHECK = false, CHECK_ALL = true, RF_CHECK = false;
- public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new /*Concurrent*/ HashMap<>();
+ public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new /* Concurrent */ HashMap<>();
private static int sBookCount = 0;
- public static UUID defaultUuid =
- null; // maybe default non-null? UUID.fromString("00000000-0000-0000-0000-000000000000");
+ public static UUID defaultUuid = null; // maybe default non-null?
+ // UUID.fromString("00000000-0000-0000-0000-000000000000");
static {
GregTech_API.sItemStackMappings.add(sFilledContainerToData);
@@ -156,8 +164,8 @@ public class GT_Utility {
// 1 is the magic index to get the cobblestone block.
// See: GT_Block_Stones.java, GT_Block_Granites.java
- Function<Materials, Supplier<ItemStack>> materialToCobble = m -> Suppliers.memoize(
- () -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m).get(1))::get;
+ Function<Materials, Supplier<ItemStack>> materialToCobble = m -> Suppliers
+ .memoize(() -> GT_OreDictUnificator.getOres(OrePrefixes.stone, m).get(1))::get;
sOreToCobble.put(OrePrefixes.oreBlackgranite, materialToCobble.apply(Materials.GraniteBlack));
sOreToCobble.put(OrePrefixes.oreRedgranite, materialToCobble.apply(Materials.GraniteRed));
sOreToCobble.put(OrePrefixes.oreMarble, materialToCobble.apply(Materials.Marble));
@@ -171,8 +179,7 @@ public class GT_Utility {
}
public static int safeInt(long number) {
- return number > V[V.length - 1]
- ? safeInt(V[V.length - 1], 1)
+ return number > V[V.length - 1] ? safeInt(V[V.length - 1], 1)
: number < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) number;
}
@@ -181,7 +188,7 @@ public class GT_Utility {
try {
rField = aObject.getClass().getDeclaredField(aField);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return rField;
}
@@ -192,7 +199,7 @@ public class GT_Utility {
rField = aObject.getClass().getDeclaredField(aField);
rField.setAccessible(true);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return rField;
}
@@ -203,7 +210,7 @@ public class GT_Utility {
rField = aObject.getDeclaredField(aField);
rField.setAccessible(true);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return rField;
}
@@ -214,7 +221,7 @@ public class GT_Utility {
rMethod = aObject.getMethod(aMethod, aParameterTypes);
rMethod.setAccessible(true);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return rMethod;
}
@@ -225,17 +232,15 @@ public class GT_Utility {
rMethod = aObject.getClass().getMethod(aMethod, aParameterTypes);
rMethod.setAccessible(true);
} catch (Throwable e) {
- /*Do nothing*/
+ /* Do nothing */
}
return rMethod;
}
public static Field getField(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) {
try {
- Field tField = (aObject instanceof Class)
- ? ((Class) aObject).getDeclaredField(aField)
- : (aObject instanceof String)
- ? Class.forName((String) aObject).getDeclaredField(aField)
+ Field tField = (aObject instanceof Class) ? ((Class) aObject).getDeclaredField(aField)
+ : (aObject instanceof String) ? Class.forName((String) aObject).getDeclaredField(aField)
: aObject.getClass().getDeclaredField(aField);
if (aPrivate) tField.setAccessible(true);
return tField;
@@ -247,10 +252,8 @@ public class GT_Utility {
public static Object getFieldContent(Object aObject, String aField, boolean aPrivate, boolean aLogErrors) {
try {
- Field tField = (aObject instanceof Class)
- ? ((Class) aObject).getDeclaredField(aField)
- : (aObject instanceof String)
- ? Class.forName((String) aObject).getDeclaredField(aField)
+ Field tField = (aObject instanceof Class) ? ((Class) aObject).getDeclaredField(aField)
+ : (aObject instanceof String) ? Class.forName((String) aObject).getDeclaredField(aField)
: aObject.getClass().getDeclaredField(aField);
if (aPrivate) tField.setAccessible(true);
return tField.get(aObject instanceof Class || aObject instanceof String ? null : aObject);
@@ -268,13 +271,8 @@ public class GT_Utility {
return callMethod(aObject, aMethod, true, false, true, aParameters);
}
- public static Object callMethod(
- Object aObject,
- String aMethod,
- boolean aPrivate,
- boolean aUseUpperCasedDataTypes,
- boolean aLogErrors,
- Object... aParameters) {
+ public static Object callMethod(Object aObject, String aMethod, boolean aPrivate, boolean aUseUpperCasedDataTypes,
+ boolean aLogErrors, Object... aParameters) {
try {
Class<?>[] tParameterTypes = new Class<?>[aParameters.length];
for (byte i = 0; i < aParameters.length; i++) {
@@ -295,8 +293,7 @@ public class GT_Utility {
}
}
- Method tMethod = (aObject instanceof Class)
- ? ((Class) aObject).getMethod(aMethod, tParameterTypes)
+ Method tMethod = (aObject instanceof Class) ? ((Class) aObject).getMethod(aMethod, tParameterTypes)
: aObject.getClass().getMethod(aMethod, tParameterTypes);
if (aPrivate) tMethod.setAccessible(true);
return tMethod.invoke(aObject, aParameters);
@@ -306,34 +303,29 @@ public class GT_Utility {
return null;
}
- public static Object callConstructor(
- String aClass,
- int aConstructorIndex,
- Object aReplacementObject,
- boolean aLogErrors,
- Object... aParameters) {
+ public static Object callConstructor(String aClass, int aConstructorIndex, Object aReplacementObject,
+ boolean aLogErrors, Object... aParameters) {
try {
return callConstructor(
- Class.forName(aClass), aConstructorIndex, aReplacementObject, aLogErrors, aParameters);
+ Class.forName(aClass),
+ aConstructorIndex,
+ aReplacementObject,
+ aLogErrors,
+ aParameters);
} catch (Throwable e) {
if (aLogErrors) e.printStackTrace(GT_Log.err);
}
return aReplacementObject;
}
- public static Object callConstructor(
- Class<?> aClass,
- int aConstructorIndex,
- Object aReplacementObject,
- boolean aLogErrors,
- Object... aParameters) {
+ public static Object callConstructor(Class<?> aClass, int aConstructorIndex, Object aReplacementObject,
+ boolean aLogErrors, Object... aParameters) {
if (aConstructorIndex < 0) {
try {
for (Constructor<?> tConstructor : aClass.getConstructors()) {
try {
return tConstructor.newInstance(aParameters);
- } catch (Throwable ignored) {
- }
+ } catch (Throwable ignored) {}
}
} catch (Throwable e) {
if (aLogErrors) e.printStackTrace(GT_Log.err);
@@ -377,9 +369,7 @@ public class GT_Utility {
public static String getClassName(Object aObject) {
if (aObject == null) return "null";
- return aObject.getClass()
- .getName()
- .substring(aObject.getClass().getName().lastIndexOf(".") + 1);
+ return aObject.getClass().getName().substring(aObject.getClass().getName().lastIndexOf(".") + 1);
}
public static void removePotion(EntityLivingBase aPlayer, int aPotionIndex) {
@@ -424,10 +414,11 @@ public class GT_Utility {
return false;
}
- public static ItemStack suckOneItemStackAt(
- World aWorld, double aX, double aY, double aZ, double aL, double aH, double aW) {
+ public static ItemStack suckOneItemStackAt(World aWorld, double aX, double aY, double aZ, double aL, double aH,
+ double aW) {
for (EntityItem tItem : (ArrayList<EntityItem>) aWorld.getEntitiesWithinAABB(
- EntityItem.class, AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + aL, aY + aH, aZ + aW))) {
+ EntityItem.class,
+ AxisAlignedBB.getBoundingBox(aX, aY, aZ, aX + aL, aY + aH, aZ + aW))) {
if (!tItem.isDead) {
aWorld.removeEntity(tItem);
tItem.setDead();
@@ -497,23 +488,15 @@ public class GT_Utility {
.isPipeConnected(ForgeDirection.getOrientation(aSide));
return GregTech_API.mTranslocator && aTileEntity instanceof codechicken.translocator.TileItemTranslocator;
}
+
/**
* Moves Stack from Inv-Slot to Inv-Slot, without checking if its even allowed.
*
* @return the Amount of moved Items
*/
- public static byte moveStackIntoPipe(
- IInventory aTileEntity1,
- Object aTileEntity2,
- int[] aGrabSlots,
- int aGrabFrom,
- int aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce) {
+ public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom,
+ int aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize,
+ byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) {
return moveStackIntoPipe(
aTileEntity1,
aTileEntity2,
@@ -534,32 +517,25 @@ public class GT_Utility {
*
* @return the Amount of moved Items
*/
- public static byte moveStackIntoPipe(
- IInventory aTileEntity1,
- Object aTileEntity2,
- int[] aGrabSlots,
- int aGrabFrom,
- int aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- boolean dropItem) {
- if (aTileEntity1 == null
- || aMaxTargetStackSize <= 0
+ public static byte moveStackIntoPipe(IInventory aTileEntity1, Object aTileEntity2, int[] aGrabSlots, int aGrabFrom,
+ int aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize,
+ byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean dropItem) {
+ if (aTileEntity1 == null || aMaxTargetStackSize <= 0
|| aMinTargetStackSize <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
|| aMaxMoveAtOnce <= 0
- || aMinMoveAtOnce > aMaxMoveAtOnce) return 0;
+ || aMinMoveAtOnce > aMaxMoveAtOnce)
+ return 0;
if (aTileEntity2 != null) {
checkAvailabilities();
if (TE_CHECK && aTileEntity2 instanceof IItemDuct) {
for (int aGrabSlot : aGrabSlots) {
if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) {
if (isAllowedToTakeFromSlot(
- aTileEntity1, aGrabSlot, (byte) aGrabFrom, aTileEntity1.getStackInSlot(aGrabSlot))) {
+ aTileEntity1,
+ aGrabSlot,
+ (byte) aGrabFrom,
+ aTileEntity1.getStackInSlot(aGrabSlot))) {
if (Math.max(aMinMoveAtOnce, aMinTargetStackSize)
<= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) {
ItemStack tStack = copyAmount(
@@ -569,10 +545,11 @@ public class GT_Utility {
aTileEntity1.getStackInSlot(aGrabSlot));
ItemStack rStack = ((IItemDuct) aTileEntity2)
.insertItem(ForgeDirection.getOrientation(aPutTo), copyOrNull(tStack));
- byte tMovedItemCount =
- (byte) (tStack.stackSize - (rStack == null ? 0 : rStack.stackSize));
- if (tMovedItemCount >= 1 /*Math.max(aMinMoveAtOnce, aMinTargetStackSize)*/) {
- // ((cofh.api.transport.IItemConduit)aTileEntity2).insertItem(ForgeDirection.getOrientation(aPutTo), copyAmount(tMovedItemCount, tStack), F);
+ byte tMovedItemCount = (byte) (tStack.stackSize
+ - (rStack == null ? 0 : rStack.stackSize));
+ if (tMovedItemCount >= 1 /* Math.max(aMinMoveAtOnce, aMinTargetStackSize) */) {
+ // ((cofh.api.transport.IItemConduit)aTileEntity2).insertItem(ForgeDirection.getOrientation(aPutTo),
+ // copyAmount(tMovedItemCount, tStack), F);
aTileEntity1.decrStackSize(aGrabSlot, tMovedItemCount);
aTileEntity1.markDirty();
return tMovedItemCount;
@@ -587,7 +564,10 @@ public class GT_Utility {
for (int aGrabSlot : aGrabSlots) {
if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) {
if (isAllowedToTakeFromSlot(
- aTileEntity1, aGrabSlot, (byte) aGrabFrom, aTileEntity1.getStackInSlot(aGrabSlot))) {
+ aTileEntity1,
+ aGrabSlot,
+ (byte) aGrabFrom,
+ aTileEntity1.getStackInSlot(aGrabSlot))) {
if (Math.max(aMinMoveAtOnce, aMinTargetStackSize)
<= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) {
ItemStack tStack = copyAmount(
@@ -616,8 +596,7 @@ public class GT_Utility {
}
ForgeDirection tDirection = ForgeDirection.getOrientation(aGrabFrom);
- if (aTileEntity1 instanceof TileEntity
- && tDirection != ForgeDirection.UNKNOWN
+ if (aTileEntity1 instanceof TileEntity && tDirection != ForgeDirection.UNKNOWN
&& tDirection.getOpposite() == ForgeDirection.getOrientation(aPutTo)) {
int tX = ((TileEntity) aTileEntity1).xCoord + tDirection.offsetX,
tY = ((TileEntity) aTileEntity1).yCoord + tDirection.offsetY,
@@ -626,7 +605,10 @@ public class GT_Utility {
for (int aGrabSlot : aGrabSlots) {
if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabSlot), true, aInvertFilter)) {
if (isAllowedToTakeFromSlot(
- aTileEntity1, aGrabSlot, (byte) aGrabFrom, aTileEntity1.getStackInSlot(aGrabSlot))) {
+ aTileEntity1,
+ aGrabSlot,
+ (byte) aGrabFrom,
+ aTileEntity1.getStackInSlot(aGrabSlot))) {
if (Math.max(aMinMoveAtOnce, aMinTargetStackSize)
<= aTileEntity1.getStackInSlot(aGrabSlot).stackSize) {
ItemStack tStack = copyAmount(
@@ -655,29 +637,22 @@ public class GT_Utility {
}
/**
- * Moves Stack from Inv-Slot to Inv-Slot, without checking if its even allowed. (useful for internal Inventory Operations)
+ * Moves Stack from Inv-Slot to Inv-Slot, without checking if its even allowed. (useful for internal Inventory
+ * Operations)
*
* @return the Amount of moved Items
*/
- public static byte moveStackFromSlotAToSlotB(
- IInventory aTileEntity1,
- IInventory aTileEntity2,
- int aGrabFrom,
- int aPutTo,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce) {
- if (aTileEntity1 == null
- || aTileEntity2 == null
+ public static byte moveStackFromSlotAToSlotB(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom,
+ int aPutTo, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) {
+ if (aTileEntity1 == null || aTileEntity2 == null
|| aMaxTargetStackSize <= 0
|| aMinTargetStackSize <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
|| aMaxMoveAtOnce <= 0
- || aMinMoveAtOnce > aMaxMoveAtOnce) return 0;
+ || aMinMoveAtOnce > aMaxMoveAtOnce)
+ return 0;
- ItemStack tStack1 = aTileEntity1.getStackInSlot(aGrabFrom),
- tStack2 = aTileEntity2.getStackInSlot(aPutTo),
+ ItemStack tStack1 = aTileEntity1.getStackInSlot(aGrabFrom), tStack2 = aTileEntity2.getStackInSlot(aPutTo),
tStack3 = null;
if (tStack1 != null) {
if (tStack2 != null && !areStacksEqual(tStack1, tStack2)) return 0;
@@ -689,11 +664,11 @@ public class GT_Utility {
Math.min(
tStack2 == null ? Integer.MAX_VALUE : tStack2.getMaxStackSize(),
aTileEntity2.getInventoryStackLimit())));
- tStack3.stackSize =
- Math.min(tStack3.stackSize, aMaxTargetStackSize - (tStack2 == null ? 0 : tStack2.stackSize));
+ tStack3.stackSize = Math
+ .min(tStack3.stackSize, aMaxTargetStackSize - (tStack2 == null ? 0 : tStack2.stackSize));
if (tStack3.stackSize > aMaxMoveAtOnce) tStack3.stackSize = aMaxMoveAtOnce;
if (tStack3.stackSize + (tStack2 == null ? 0 : tStack2.stackSize)
- >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize)
+ >= Math.min(tStack3.getMaxStackSize(), aMinTargetStackSize)
&& tStack3.stackSize >= aMinMoveAtOnce) {
tStack3 = aTileEntity1.decrStackSize(aGrabFrom, tStack3.stackSize);
aTileEntity1.markDirty();
@@ -725,8 +700,8 @@ public class GT_Utility {
return true;
}
- public static boolean isAllowedToPutIntoSlot(
- IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack, byte aMaxStackSize) {
+ public static boolean isAllowedToPutIntoSlot(IInventory aTileEntity, int aSlot, byte aSide, ItemStack aStack,
+ byte aMaxStackSize) {
ItemStack tStack = aTileEntity.getStackInSlot(aSlot);
if (tStack != null && (!areStacksEqual(tStack, aStack) || tStack.stackSize >= tStack.getMaxStackSize()))
return false;
@@ -739,7 +714,8 @@ public class GT_Utility {
|| isAllowedToPutIntoSlot(aTileEntity, aSlot, (byte) 5, aStack, aMaxStackSize);
}
if (aTileEntity instanceof ISidedInventory
- && !((ISidedInventory) aTileEntity).canInsertItem(aSlot, aStack, aSide)) return false;
+ && !((ISidedInventory) aTileEntity).canInsertItem(aSlot, aStack, aSide))
+ return false;
return aSlot < aTileEntity.getSizeInventory() && aTileEntity.isItemValidForSlot(aSlot, aStack);
}
@@ -748,55 +724,35 @@ public class GT_Utility {
*
* @return the Amount of moved Items
*/
- public static int moveMultipleItemStacks(
- Object aTileEntity1,
- Object aTileEntity2,
- byte aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- int aStackAmount) {
- if (aTileEntity1 instanceof IInventory)
- return moveMultipleItemStacks(
- (IInventory) aTileEntity1,
- aTileEntity2,
- aGrabFrom,
- aPutTo,
- aFilter,
- aInvertFilter,
- aMaxTargetStackSize,
- aMinTargetStackSize,
- aMaxMoveAtOnce,
- aMinMoveAtOnce,
- aStackAmount,
- true);
+ public static int moveMultipleItemStacks(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aStackAmount) {
+ if (aTileEntity1 instanceof IInventory) return moveMultipleItemStacks(
+ (IInventory) aTileEntity1,
+ aTileEntity2,
+ aGrabFrom,
+ aPutTo,
+ aFilter,
+ aInvertFilter,
+ aMaxTargetStackSize,
+ aMinTargetStackSize,
+ aMaxMoveAtOnce,
+ aMinMoveAtOnce,
+ aStackAmount,
+ true);
return 0;
}
- public static int moveMultipleItemStacks(
- IInventory aTileEntity1,
- Object aTileEntity2,
- byte aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- int aMaxStackTransfer,
- boolean aDoCheckChests) {
- if (aTileEntity1 == null
- || aMaxTargetStackSize <= 0
+ public static int moveMultipleItemStacks(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer, boolean aDoCheckChests) {
+ if (aTileEntity1 == null || aMaxTargetStackSize <= 0
|| aMinTargetStackSize <= 0
|| aMaxMoveAtOnce <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
|| aMinMoveAtOnce > aMaxMoveAtOnce
- || aMaxStackTransfer == 0) return 0;
+ || aMaxStackTransfer == 0)
+ return 0;
// find where to take from
final int[] tGrabSlots = new int[aTileEntity1.getSizeInventory()];
@@ -804,10 +760,10 @@ public class GT_Utility {
if (aTileEntity1 instanceof ISidedInventory) {
for (int i : ((ISidedInventory) aTileEntity1).getAccessibleSlotsFromSide(aGrabFrom)) {
final ItemStack s = aTileEntity1.getStackInSlot(i);
- if (s == null
- || !isAllowedToTakeFromSlot(aTileEntity1, i, aGrabFrom, s)
+ if (s == null || !isAllowedToTakeFromSlot(aTileEntity1, i, aGrabFrom, s)
|| s.stackSize < aMinMoveAtOnce
- || !listContainsItem(aFilter, s, true, aInvertFilter)) continue;
+ || !listContainsItem(aFilter, s, true, aInvertFilter))
+ continue;
tGrabSlots[tGrabSlotsSize++] = i;
}
} else {
@@ -822,19 +778,18 @@ public class GT_Utility {
// no source, bail out
if (tGrabSlotsSize == 0) {
// maybe source is a double chest. check it
- if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest)
- return moveFromAdjacentChests(
- (TileEntityChest) aTileEntity1,
- aTileEntity2,
- aGrabFrom,
- aPutTo,
- aFilter,
- aInvertFilter,
- aMaxTargetStackSize,
- aMinTargetStackSize,
- aMaxMoveAtOnce,
- aMinMoveAtOnce,
- aMaxStackTransfer);
+ if (aDoCheckChests && aTileEntity1 instanceof TileEntityChest) return moveFromAdjacentChests(
+ (TileEntityChest) aTileEntity1,
+ aTileEntity2,
+ aGrabFrom,
+ aPutTo,
+ aFilter,
+ aInvertFilter,
+ aMaxTargetStackSize,
+ aMinTargetStackSize,
+ aMaxMoveAtOnce,
+ aMinMoveAtOnce,
+ aMaxStackTransfer);
return 0;
}
@@ -865,31 +820,31 @@ public class GT_Utility {
tPutFreeSlots.add(slot);
} else if ((s.stackSize < s.getMaxStackSize() && s.stackSize < tPutInventory.getInventoryStackLimit())
&& aMinMoveAtOnce <= s.getMaxStackSize() - s.stackSize) {
- ItemId sID = ItemId.createNoCopy(s);
- tPutItems.merge(
- sID,
- (Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit()) - s.stackSize),
- Integer::sum);
- tPutItemStacks.computeIfAbsent(sID, k -> new ArrayList<>()).add(s);
- }
+ ItemId sID = ItemId.createNoCopy(s);
+ tPutItems.merge(
+ sID,
+ (Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit())
+ - s.stackSize),
+ Integer::sum);
+ tPutItemStacks.computeIfAbsent(sID, k -> new ArrayList<>()).add(s);
+ }
}
// target completely filled, bail out
if (tPutItems.isEmpty() && tPutFreeSlots.isEmpty()) {
// maybe target is a double chest. check it.
- if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest)
- return moveToAdjacentChests(
- aTileEntity1,
- (TileEntityChest) aTileEntity2,
- aGrabFrom,
- aPutTo,
- aFilter,
- aInvertFilter,
- aMaxTargetStackSize,
- aMinTargetStackSize,
- aMaxMoveAtOnce,
- aMinMoveAtOnce,
- aMaxStackTransfer);
+ if (aDoCheckChests && aTileEntity2 instanceof TileEntityChest) return moveToAdjacentChests(
+ aTileEntity1,
+ (TileEntityChest) aTileEntity2,
+ aGrabFrom,
+ aPutTo,
+ aFilter,
+ aInvertFilter,
+ aMaxTargetStackSize,
+ aMinTargetStackSize,
+ aMaxMoveAtOnce,
+ aMinMoveAtOnce,
+ aMaxStackTransfer);
return 0;
}
@@ -971,17 +926,15 @@ public class GT_Utility {
if (s != null) {
// s might be null if tPutInventory is very special, e.g. infinity chest
// if s is null, we will not mark this slot as target candidate for anything
- final int spare =
- Math.min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit())
- - s.stackSize;
+ final int spare = Math
+ .min(s.getMaxStackSize(), tPutInventory.getInventoryStackLimit())
+ - s.stackSize;
if (spare > 0) {
final ItemId ssID = ItemId.createNoCopy(s);
// add back to spare space count
tPutItems.merge(ssID, spare, Integer::sum);
// add to partially filled slot list
- tPutItemStacks
- .computeIfAbsent(ssID, k -> new ArrayList<>())
- .add(s);
+ tPutItemStacks.computeIfAbsent(ssID, k -> new ArrayList<>()).add(s);
}
// this is no longer free
tPutFreeSlots.remove(i);
@@ -1002,8 +955,8 @@ public class GT_Utility {
// check if we have moved enough stacks
if (++tStacksMoved >= aMaxStackTransfer) return tTotalItemsMoved;
}
- } while (tMovedItems > 0
- && tStackSize > 0); // support inventories that store more than a stack in a slot
+ } while (tMovedItems > 0 && tStackSize > 0); // support inventories that store more than a stack in a
+ // slot
}
// check if source is a double chest, if yes, try move from the adjacent as well
@@ -1066,18 +1019,9 @@ public class GT_Utility {
return 0;
}
- private static int moveToAdjacentChests(
- IInventory aTileEntity1,
- TileEntityChest aTargetChest,
- byte aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- int aMaxStackTransfer) {
+ private static int moveToAdjacentChests(IInventory aTileEntity1, TileEntityChest aTargetChest, byte aGrabFrom,
+ byte aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize,
+ byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) {
if (aTargetChest.adjacentChestChecked) {
if (aTargetChest.adjacentChestXNeg != null) {
return moveMultipleItemStacks(
@@ -1140,18 +1084,9 @@ public class GT_Utility {
return 0;
}
- private static int moveFromAdjacentChests(
- TileEntityChest aChest,
- Object aTileEntity2,
- byte aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- int aMaxStackTransfer) {
+ private static int moveFromAdjacentChests(TileEntityChest aChest, Object aTileEntity2, byte aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce, int aMaxStackTransfer) {
if (aChest.adjacentChestXNeg != null) {
return moveMultipleItemStacks(
aChest.adjacentChestXNeg,
@@ -1217,54 +1152,36 @@ public class GT_Utility {
*
* @return the Amount of moved Items
*/
- public static byte moveOneItemStack(
- Object aTileEntity1,
- Object aTileEntity2,
- byte aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce) {
- if (aTileEntity1 instanceof IInventory)
- return moveOneItemStack(
- (IInventory) aTileEntity1,
- aTileEntity2,
- aGrabFrom,
- aPutTo,
- aFilter,
- aInvertFilter,
- aMaxTargetStackSize,
- aMinTargetStackSize,
- aMaxMoveAtOnce,
- aMinMoveAtOnce,
- true);
+ public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce) {
+ if (aTileEntity1 instanceof IInventory) return moveOneItemStack(
+ (IInventory) aTileEntity1,
+ aTileEntity2,
+ aGrabFrom,
+ aPutTo,
+ aFilter,
+ aInvertFilter,
+ aMaxTargetStackSize,
+ aMinTargetStackSize,
+ aMaxMoveAtOnce,
+ aMinMoveAtOnce,
+ true);
return 0;
}
/**
* This is only because I needed an additional Parameter for the Double Chest Check.
*/
- private static byte moveOneItemStack(
- IInventory aTileEntity1,
- Object aTileEntity2,
- byte aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- boolean aDoCheckChests) {
- if (aTileEntity1 == null
- || aMaxTargetStackSize <= 0
+ private static byte moveOneItemStack(IInventory aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) {
+ if (aTileEntity1 == null || aMaxTargetStackSize <= 0
|| aMinTargetStackSize <= 0
|| aMaxMoveAtOnce <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
- || aMinMoveAtOnce > aMaxMoveAtOnce) return 0;
+ || aMinMoveAtOnce > aMaxMoveAtOnce)
+ return 0;
int[] tGrabSlots = null;
if (aTileEntity1 instanceof ISidedInventory)
@@ -1292,7 +1209,11 @@ public class GT_Utility {
&& isAllowedToTakeFromSlot(aTileEntity1, tGrabSlot, aGrabFrom, tGrabStack)) {
for (int tPutSlot : tPutSlots) {
if (isAllowedToPutIntoSlot(
- (IInventory) aTileEntity2, tPutSlot, aPutTo, tGrabStack, aMaxTargetStackSize)) {
+ (IInventory) aTileEntity2,
+ tPutSlot,
+ aPutTo,
+ tGrabStack,
+ aMaxTargetStackSize)) {
tMovedItemCount += moveStackFromSlotAToSlotB(
aTileEntity1,
(IInventory) aTileEntity2,
@@ -1303,7 +1224,8 @@ public class GT_Utility {
(byte) (aMaxMoveAtOnce - tMovedItemCount),
aMinMoveAtOnce);
if (tMovedItemCount >= aMaxMoveAtOnce
- || (tMovedItemCount > 0 && aMaxTargetStackSize < 64)) return tMovedItemCount;
+ || (tMovedItemCount > 0 && aMaxTargetStackSize < 64))
+ return tMovedItemCount;
}
}
}
@@ -1453,25 +1375,17 @@ public class GT_Utility {
*
* @return the Amount of moved Items
*/
- public static byte moveOneItemStackIntoSlot(
- Object aTileEntity1,
- Object aTileEntity2,
- byte aGrabFrom,
- int aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce) {
- if (aTileEntity1 == null
- || !(aTileEntity1 instanceof IInventory)
+ public static byte moveOneItemStackIntoSlot(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, int aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce) {
+ if (aTileEntity1 == null || !(aTileEntity1 instanceof IInventory)
|| aPutTo < 0
|| aMaxTargetStackSize <= 0
|| aMinTargetStackSize <= 0
|| aMaxMoveAtOnce <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
- || aMinMoveAtOnce > aMaxMoveAtOnce) return 0;
+ || aMinMoveAtOnce > aMaxMoveAtOnce)
+ return 0;
int[] tGrabSlots = null;
if (aTileEntity1 instanceof ISidedInventory)
@@ -1484,7 +1398,10 @@ public class GT_Utility {
if (aTileEntity2 instanceof IInventory) {
for (int tGrabSlot : tGrabSlots) {
if (listContainsItem(
- aFilter, ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot), true, aInvertFilter)) {
+ aFilter,
+ ((IInventory) aTileEntity1).getStackInSlot(tGrabSlot),
+ true,
+ aInvertFilter)) {
if (isAllowedToTakeFromSlot(
(IInventory) aTileEntity1,
tGrabSlot,
@@ -1532,30 +1449,26 @@ public class GT_Utility {
*
* @return the Amount of moved Items
*/
- public static byte moveFromSlotToSlot(
- IInventory aTileEntity1,
- IInventory aTileEntity2,
- int aGrabFrom,
- int aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce) {
- if (aTileEntity1 == null
- || aTileEntity2 == null
+ public static byte moveFromSlotToSlot(IInventory aTileEntity1, IInventory aTileEntity2, int aGrabFrom, int aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce) {
+ if (aTileEntity1 == null || aTileEntity2 == null
|| aGrabFrom < 0
|| aPutTo < 0
|| aMaxTargetStackSize <= 0
|| aMinTargetStackSize <= 0
|| aMaxMoveAtOnce <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
- || aMinMoveAtOnce > aMaxMoveAtOnce) return 0;
+ || aMinMoveAtOnce > aMaxMoveAtOnce)
+ return 0;
if (listContainsItem(aFilter, aTileEntity1.getStackInSlot(aGrabFrom), true, aInvertFilter)) {
if (isAllowedToTakeFromSlot(aTileEntity1, aGrabFrom, (byte) 6, aTileEntity1.getStackInSlot(aGrabFrom))) {
if (isAllowedToPutIntoSlot(
- aTileEntity2, aPutTo, (byte) 6, aTileEntity1.getStackInSlot(aGrabFrom), aMaxTargetStackSize)) {
+ aTileEntity2,
+ aPutTo,
+ (byte) 6,
+ aTileEntity1.getStackInSlot(aGrabFrom),
+ aMaxTargetStackSize)) {
byte tMovedItemCount = moveStackFromSlotAToSlotB(
aTileEntity1,
aTileEntity2,
@@ -1577,24 +1490,15 @@ public class GT_Utility {
*
* @return the Amount of moved Items
*/
- public static byte moveFromSlotToSide(
- IInventory fromTile,
- Object toTile,
- int aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce,
- boolean aDoCheckChests) {
- if (fromTile == null
- || aGrabFrom < 0
+ public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce, boolean aDoCheckChests) {
+ if (fromTile == null || aGrabFrom < 0
|| aMinTargetStackSize <= 0
|| aMaxMoveAtOnce <= 0
|| aMinTargetStackSize > aMaxTargetStackSize
- || aMinMoveAtOnce > aMaxMoveAtOnce) return 0;
+ || aMinMoveAtOnce > aMaxMoveAtOnce)
+ return 0;
if (!listContainsItem(aFilter, fromTile.getStackInSlot(aGrabFrom), true, aInvertFilter)
|| !isAllowedToTakeFromSlot(fromTile, aGrabFrom, (byte) 6, fromTile.getStackInSlot(aGrabFrom)))
@@ -1697,7 +1601,7 @@ public class GT_Utility {
return moveStackIntoPipe(
fromTile,
toTile,
- new int[] {aGrabFrom},
+ new int[] { aGrabFrom },
(byte) 6,
aPutTo,
aFilter,
@@ -1709,17 +1613,9 @@ public class GT_Utility {
aDoCheckChests);
}
- public static byte moveFromSlotToSide(
- IInventory fromTile,
- Object toTile,
- int aGrabFrom,
- byte aPutTo,
- List<ItemStack> aFilter,
- boolean aInvertFilter,
- byte aMaxTargetStackSize,
- byte aMinTargetStackSize,
- byte aMaxMoveAtOnce,
- byte aMinMoveAtOnce) {
+ public static byte moveFromSlotToSide(IInventory fromTile, Object toTile, int aGrabFrom, byte aPutTo,
+ List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize,
+ byte aMaxMoveAtOnce, byte aMinMoveAtOnce) {
return moveFromSlotToSide(
fromTile,
toTile,
@@ -1734,8 +1630,8 @@ public class GT_Utility {
true);
}
- public static boolean listContainsItem(
- Collection<ItemStack> aList, ItemStack aStack, boolean aTIfListEmpty, boolean aInvertFilter) {
+ public static boolean listContainsItem(Collection<ItemStack> aList, ItemStack aStack, boolean aTIfListEmpty,
+ boolean aInvertFilter) {
if (aStack == null || aStack.stackSize < 1) return false;
if (aList == null) return aTIfListEmpty;
boolean tEmpty = true;
@@ -1754,8 +1650,7 @@ public class GT_Utility {
if (aStack1 != null && aStack2 != null && aStack1.getItem() == aStack2.getItem()) {
if (aStack1.getItem().isDamageable()) return true;
return ((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null))
- && (aStack1.getTagCompound() == null
- || aStack1.getTagCompound().equals(aStack2.getTagCompound()))
+ && (aStack1.getTagCompound() == null || aStack1.getTagCompound().equals(aStack2.getTagCompound()))
&& (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2)
|| Items.feather.getDamage(aStack1) == W
|| Items.feather.getDamage(aStack2) == W);
@@ -1768,12 +1663,10 @@ public class GT_Utility {
}
public static boolean areFluidsEqual(FluidStack aFluid1, FluidStack aFluid2, boolean aIgnoreNBT) {
- return aFluid1 != null
- && aFluid2 != null
+ return aFluid1 != null && aFluid2 != null
&& aFluid1.getFluid() == aFluid2.getFluid()
- && (aIgnoreNBT
- || ((aFluid1.tag == null) == (aFluid2.tag == null))
- && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag)));
+ && (aIgnoreNBT || ((aFluid1.tag == null) == (aFluid2.tag == null))
+ && (aFluid1.tag == null || aFluid1.tag.equals(aFluid2.tag)));
}
public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2) {
@@ -1781,13 +1674,11 @@ public class GT_Utility {
}
public static boolean areStacksEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) {
- return aStack1 != null
- && aStack2 != null
+ return aStack1 != null && aStack2 != null
&& aStack1.getItem() == aStack2.getItem()
- && (aIgnoreNBT
- || (((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null))
- && (aStack1.getTagCompound() == null
- || aStack1.getTagCompound().equals(aStack2.getTagCompound()))))
+ && (aIgnoreNBT || (((aStack1.getTagCompound() == null) == (aStack2.getTagCompound() == null))
+ && (aStack1.getTagCompound() == null
+ || aStack1.getTagCompound().equals(aStack2.getTagCompound()))))
&& (Items.feather.getDamage(aStack1) == Items.feather.getDamage(aStack2)
|| Items.feather.getDamage(aStack1) == W
|| Items.feather.getDamage(aStack2) == W);
@@ -1798,19 +1689,19 @@ public class GT_Utility {
*
* Since ItemStack doesn't override equals and hashCode, you cannot just use Objects.equals
*/
- public static boolean areStackListsEqual(
- List<ItemStack> lhs, List<ItemStack> rhs, boolean ignoreStackSize, boolean ignoreNBT) {
+ public static boolean areStackListsEqual(List<ItemStack> lhs, List<ItemStack> rhs, boolean ignoreStackSize,
+ boolean ignoreNBT) {
if (lhs == null) return rhs == null;
if (rhs == null) return false;
if (lhs.size() != rhs.size()) return false;
- for (Iterator<ItemStack> it1 = lhs.iterator(), it2 = rhs.iterator(); it1.hasNext() && it2.hasNext(); ) {
+ for (Iterator<ItemStack> it1 = lhs.iterator(), it2 = rhs.iterator(); it1.hasNext() && it2.hasNext();) {
if (!areStacksEqualExtended(it1.next(), it2.next(), ignoreStackSize, ignoreNBT)) return false;
}
return true;
}
- private static boolean areStacksEqualExtended(
- ItemStack lhs, ItemStack rhs, boolean ignoreStackSize, boolean ignoreNBT) {
+ private static boolean areStacksEqualExtended(ItemStack lhs, ItemStack rhs, boolean ignoreStackSize,
+ boolean ignoreNBT) {
if (lhs == null) return rhs == null;
if (rhs == null) return false;
return lhs.getItem() == rhs.getItem()
@@ -1824,7 +1715,9 @@ public class GT_Utility {
public static boolean areUnificationsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) {
return areStacksEqual(
- GT_OreDictUnificator.get_nocopy(aStack1), GT_OreDictUnificator.get_nocopy(aStack2), aIgnoreNBT);
+ GT_OreDictUnificator.get_nocopy(aStack1),
+ GT_OreDictUnificator.get_nocopy(aStack2),
+ aIgnoreNBT);
}
public static String getFluidName(Fluid aFluid, boolean aLocalized) {
@@ -1847,12 +1740,13 @@ public class GT_Utility {
sFluidUnlocalizedNameToFluid.clear();
for (FluidContainerData tData : sFluidContainerList) {
sFilledContainerToData.put(new GT_ItemStack(tData.filledContainer), tData);
- Map<Fluid, FluidContainerData> tFluidToContainer =
- sEmptyContainerToFluidToData.get(new GT_ItemStack(tData.emptyContainer));
+ Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData
+ .get(new GT_ItemStack(tData.emptyContainer));
List<ItemStack> tContainers = sFluidToContainers.get(tData.fluid.getFluid());
if (tFluidToContainer == null) {
sEmptyContainerToFluidToData.put(
- new GT_ItemStack(tData.emptyContainer), tFluidToContainer = new /*Concurrent*/ HashMap<>());
+ new GT_ItemStack(tData.emptyContainer),
+ tFluidToContainer = new /* Concurrent */ HashMap<>());
GregTech_API.sFluidMappings.add(tFluidToContainer);
}
tFluidToContainer.put(tData.fluid.getFluid(), tData);
@@ -1874,12 +1768,12 @@ public class GT_Utility {
public static void addFluidContainerData(FluidContainerData aData) {
sFluidContainerList.add(aData);
sFilledContainerToData.put(new GT_ItemStack(aData.filledContainer), aData);
- Map<Fluid, FluidContainerData> tFluidToContainer =
- sEmptyContainerToFluidToData.get(new GT_ItemStack(aData.emptyContainer));
+ Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData
+ .get(new GT_ItemStack(aData.emptyContainer));
List<ItemStack> tContainers = sFluidToContainers.get(aData.fluid.getFluid());
if (tFluidToContainer == null) {
- sEmptyContainerToFluidToData.put(
- new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new /*Concurrent*/ HashMap<>());
+ sEmptyContainerToFluidToData
+ .put(new GT_ItemStack(aData.emptyContainer), tFluidToContainer = new /* Concurrent */ HashMap<>());
GregTech_API.sFluidMappings.add(tFluidToContainer);
}
tFluidToContainer.put(aData.fluid.getFluid(), aData);
@@ -1899,8 +1793,8 @@ public class GT_Utility {
return new ArrayList<>();
}
- public static ItemStack fillFluidContainer(
- FluidStack aFluid, ItemStack aStack, boolean aRemoveFluidDirectly, boolean aCheckIFluidContainerItems) {
+ public static ItemStack fillFluidContainer(FluidStack aFluid, ItemStack aStack, boolean aRemoveFluidDirectly,
+ boolean aCheckIFluidContainerItems) {
if (isStackInvalid(aStack) || aFluid == null) return null;
if (GT_ModHandler.isWater(aFluid) && ItemList.Bottle_Empty.isStackEqual(aStack)) {
if (aFluid.amount >= 250) {
@@ -1909,14 +1803,12 @@ public class GT_Utility {
}
return null;
}
- if (aCheckIFluidContainerItems
- && aStack.getItem() instanceof IFluidContainerItem
+ if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem
&& ((IFluidContainerItem) aStack.getItem()).getFluid(aStack) == null
&& ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) <= aFluid.amount) {
- if (aRemoveFluidDirectly)
- aFluid.amount -=
- ((IFluidContainerItem) aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, true);
- else ((IFluidContainerItem) aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, true);
+ if (aRemoveFluidDirectly) aFluid.amount -= ((IFluidContainerItem) aStack.getItem())
+ .fill(aStack = copyAmount(1, aStack), aFluid, true);
+ else((IFluidContainerItem) aStack.getItem()).fill(aStack = copyAmount(1, aStack), aFluid, true);
return aStack;
}
Map<Fluid, FluidContainerData> tFluidToContainer = sEmptyContainerToFluidToData.get(new GT_ItemStack(aStack));
@@ -1928,8 +1820,7 @@ public class GT_Utility {
}
public static int calculateRecipeEU(Materials aMaterial, int defaultRecipeEUPerTick) {
- return aMaterial.getProcessingMaterialTierEU() == 0
- ? defaultRecipeEUPerTick
+ return aMaterial.getProcessingMaterialTierEU() == 0 ? defaultRecipeEUPerTick
: aMaterial.getProcessingMaterialTierEU();
}
@@ -1957,35 +1848,32 @@ public class GT_Utility {
tNBT.setBoolean("mHideStackSize", aHideStackSize);
try {
tNBT.setString("mFluidMaterialName", FLUID_MAP.get(aFluid.getFluid()).mName);
- } catch (Exception ignored) {
- }
+ } catch (Exception ignored) {}
rStack.setTagCompound(tNBT);
return rStack;
}
public static FluidStack getFluidFromDisplayStack(ItemStack aDisplayStack) {
- if (!isStackValid(aDisplayStack)
- || aDisplayStack.getItem() != ItemList.Display_Fluid.getItem()
- || !aDisplayStack.hasTagCompound()) return null;
+ if (!isStackValid(aDisplayStack) || aDisplayStack.getItem() != ItemList.Display_Fluid.getItem()
+ || !aDisplayStack.hasTagCompound())
+ return null;
Fluid tFluid = FluidRegistry.getFluid(ItemList.Display_Fluid.getItem().getDamage(aDisplayStack));
return new FluidStack(tFluid, (int) aDisplayStack.getTagCompound().getLong("mFluidDisplayAmount"));
}
public static boolean containsFluid(ItemStack aStack, FluidStack aFluid, boolean aCheckIFluidContainerItems) {
if (isStackInvalid(aStack) || aFluid == null) return false;
- if (aCheckIFluidContainerItems
- && aStack.getItem() instanceof IFluidContainerItem
+ if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem
&& ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)
- return aFluid.isFluidEqual(
- ((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack)));
+ return aFluid
+ .isFluidEqual(((IFluidContainerItem) aStack.getItem()).getFluid(aStack = copyAmount(1, aStack)));
FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack));
return tData != null && tData.fluid.isFluidEqual(aFluid);
}
public static FluidStack getFluidForFilledItem(ItemStack aStack, boolean aCheckIFluidContainerItems) {
if (isStackInvalid(aStack)) return null;
- if (aCheckIFluidContainerItems
- && aStack.getItem() instanceof IFluidContainerItem
+ if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem
&& ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0)
return ((IFluidContainerItem) aStack.getItem()).drain(copyAmount(1, aStack), Integer.MAX_VALUE, true);
FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack));
@@ -1999,8 +1887,7 @@ public class GT_Utility {
if (isStackInvalid(aStack)) return null;
FluidContainerData tData = sFilledContainerToData.get(new GT_ItemStack(aStack));
if (tData != null) return copyAmount(1, tData.emptyContainer);
- if (aCheckIFluidContainerItems
- && aStack.getItem() instanceof IFluidContainerItem
+ if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem
&& ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) {
((IFluidContainerItem) aStack.getItem()).drain(aStack = copyAmount(1, aStack), Integer.MAX_VALUE, true);
return aStack;
@@ -2015,15 +1902,16 @@ public class GT_Utility {
public static ItemStack getContainerItem(ItemStack aStack, boolean aCheckIFluidContainerItems) {
if (isStackInvalid(aStack)) return null;
if (aStack.getItem().hasContainerItem(aStack)) return aStack.getItem().getContainerItem(aStack);
- /** These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items */
+ /**
+ * These are all special Cases, in which it is intended to have only GT Blocks outputting those Container Items
+ */
if (ItemList.Cell_Empty.isStackEqual(aStack, false, true)) return null;
- if (aStack.getItem() == Items.potionitem
- || aStack.getItem() == Items.experience_bottle
+ if (aStack.getItem() == Items.potionitem || aStack.getItem() == Items.experience_bottle
|| ItemList.TF_Vial_FieryBlood.isStackEqual(aStack)
- || ItemList.TF_Vial_FieryTears.isStackEqual(aStack)) return ItemList.Bottle_Empty.get(1);
+ || ItemList.TF_Vial_FieryTears.isStackEqual(aStack))
+ return ItemList.Bottle_Empty.get(1);
- if (aCheckIFluidContainerItems
- && aStack.getItem() instanceof IFluidContainerItem
+ if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem
&& ((IFluidContainerItem) aStack.getItem()).getCapacity(aStack) > 0) {
ItemStack tStack = copyAmount(1, aStack);
((IFluidContainerItem) aStack.getItem()).drain(tStack, Integer.MAX_VALUE, true);
@@ -2047,79 +1935,71 @@ public class GT_Utility {
return fluidStack;
}
- public static synchronized boolean removeIC2BottleRecipe(
- ItemStack aContainer,
- ItemStack aInput,
- Map<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> aRecipeList,
- ItemStack aOutput) {
+ public static synchronized boolean removeIC2BottleRecipe(ItemStack aContainer, ItemStack aInput,
+ Map<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> aRecipeList, ItemStack aOutput) {
if ((isStackInvalid(aInput) && isStackInvalid(aOutput) && isStackInvalid(aContainer)) || aRecipeList == null)
return false;
boolean rReturn = false;
- Iterator<Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput>> tIterator =
- aRecipeList.entrySet().iterator();
+ Iterator<Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput>> tIterator = aRecipeList
+ .entrySet().iterator();
aOutput = GT_OreDictUnificator.get(aOutput);
while (tIterator.hasNext()) {
Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> tEntry = tIterator.next();
if (aInput == null || tEntry.getKey().matches(aContainer, aInput)) {
List<ItemStack> tList = tEntry.getValue().items;
- if (tList != null)
- for (ItemStack tOutput : tList)
- if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) {
- tIterator.remove();
- rReturn = true;
- break;
- }
+ if (tList != null) for (ItemStack tOutput : tList)
+ if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) {
+ tIterator.remove();
+ rReturn = true;
+ break;
+ }
}
}
return rReturn;
}
- public static synchronized boolean removeSimpleIC2MachineRecipe(
- ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList, ItemStack aOutput) {
+ public static synchronized boolean removeSimpleIC2MachineRecipe(ItemStack aInput,
+ Map<IRecipeInput, RecipeOutput> aRecipeList, ItemStack aOutput) {
if ((isStackInvalid(aInput) && isStackInvalid(aOutput)) || aRecipeList == null) return false;
boolean rReturn = false;
- Iterator<Map.Entry<IRecipeInput, RecipeOutput>> tIterator =
- aRecipeList.entrySet().iterator();
+ Iterator<Map.Entry<IRecipeInput, RecipeOutput>> tIterator = aRecipeList.entrySet().iterator();
aOutput = GT_OreDictUnificator.get(aOutput);
while (tIterator.hasNext()) {
Map.Entry<IRecipeInput, RecipeOutput> tEntry = tIterator.next();
if (aInput == null || tEntry.getKey().matches(aInput)) {
List<ItemStack> tList = tEntry.getValue().items;
- if (tList != null)
- for (ItemStack tOutput : tList)
- if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) {
- tIterator.remove();
- rReturn = true;
- break;
- }
+ if (tList != null) for (ItemStack tOutput : tList)
+ if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) {
+ tIterator.remove();
+ rReturn = true;
+ break;
+ }
}
}
return rReturn;
}
- public static synchronized void bulkRemoveSimpleIC2MachineRecipe(
- Map<ItemStack, ItemStack> toRemove, Map<IRecipeInput, RecipeOutput> aRecipeList) {
+ public static synchronized void bulkRemoveSimpleIC2MachineRecipe(Map<ItemStack, ItemStack> toRemove,
+ Map<IRecipeInput, RecipeOutput> aRecipeList) {
if (aRecipeList == null || aRecipeList.isEmpty()) return;
toRemove.entrySet().removeIf(aEntry -> (isStackInvalid(aEntry.getKey()) && isStackInvalid(aEntry.getValue())));
- final Map<ItemStack, ItemStack> finalToRemove =
- Maps.transformValues(toRemove, GT_OreDictUnificator::get_nocopy);
+ final Map<ItemStack, ItemStack> finalToRemove = Maps
+ .transformValues(toRemove, GT_OreDictUnificator::get_nocopy);
- aRecipeList.entrySet().removeIf(tEntry -> finalToRemove.entrySet().stream()
- .anyMatch(aEntry -> {
- final ItemStack aInput = aEntry.getKey(), aOutput = aEntry.getValue();
- final List<ItemStack> tList = tEntry.getValue().items;
+ aRecipeList.entrySet().removeIf(tEntry -> finalToRemove.entrySet().stream().anyMatch(aEntry -> {
+ final ItemStack aInput = aEntry.getKey(), aOutput = aEntry.getValue();
+ final List<ItemStack> tList = tEntry.getValue().items;
- if (tList == null) return false;
- if (aInput != null && !tEntry.getKey().matches(aInput)) return false;
+ if (tList == null) return false;
+ if (aInput != null && !tEntry.getKey().matches(aInput)) return false;
- return tList.stream()
- .anyMatch(tOutput ->
- (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)));
- }));
+ return tList.stream().anyMatch(
+ tOutput -> (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)));
+ }));
}
- public static boolean addSimpleIC2MachineRecipe(
- ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList, NBTTagCompound aNBT, Object... aOutput) {
+ public static boolean addSimpleIC2MachineRecipe(ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList,
+ NBTTagCompound aNBT, Object... aOutput) {
if (isStackInvalid(aInput) || aOutput.length == 0 || aRecipeList == null) return false;
ItemData tOreName = GT_OreDictUnificator.getAssociation(aInput);
for (Object o : aOutput) {
@@ -2131,13 +2011,14 @@ public class GT_Utility {
ItemStack[] tStack = GT_OreDictUnificator.getStackArray(true, aOutput);
if (tStack.length > 0 && areStacksEqual(aInput, tStack[0])) return false;
if (tOreName != null) {
- if (tOreName.toString().equals("dustAsh")
- && tStack[0].getUnlocalizedName().equals("tile.volcanicAsh")) return false;
- aRecipeList.put(
- new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack));
+ if (tOreName.toString().equals("dustAsh") && tStack[0].getUnlocalizedName().equals("tile.volcanicAsh"))
+ return false;
+ aRecipeList
+ .put(new RecipeInputOreDict(tOreName.toString(), aInput.stackSize), new RecipeOutput(aNBT, tStack));
} else {
aRecipeList.put(
- new RecipeInputItemStack(copyOrNull(aInput), aInput.stackSize), new RecipeOutput(aNBT, tStack));
+ new RecipeInputItemStack(copyOrNull(aInput), aInput.stackSize),
+ new RecipeOutput(aNBT, tStack));
}
return true;
}
@@ -2165,8 +2046,8 @@ public class GT_Utility {
tNBT.setString("author", aAuthor);
NBTTagList tNBTList = new NBTTagList();
for (byte i = 0; i < aPages.length; i++) {
- aPages[i] = GT_LanguageManager.addStringLocalization(
- "Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), aPages[i]);
+ aPages[i] = GT_LanguageManager
+ .addStringLocalization("Book." + aTitle + ".Page" + ((i < 10) ? "0" + i : i), aPages[i]);
if (i < 48) {
if (aPages[i].length() < 256) tNBTList.appendTag(new NBTTagString(aPages[i]));
else GT_Log.err.println("WARNING: String for written Book too long! -> " + aPages[i]);
@@ -2175,12 +2056,21 @@ public class GT_Utility {
break;
}
}
- tNBTList.appendTag(new NBTTagString("Credits to " + aAuthor + " for writing this Book. This was Book Nr. "
- + sBookCount + " at its creation. Gotta get 'em all!"));
+ tNBTList.appendTag(
+ new NBTTagString(
+ "Credits to " + aAuthor
+ + " for writing this Book. This was Book Nr. "
+ + sBookCount
+ + " at its creation. Gotta get 'em all!"));
tNBT.setTag("pages", tNBTList);
rStack.setTagCompound(tNBT);
- GT_Log.out.println("GT_Mod: Added Book to Book List - Mapping: '" + aMapping + "' - Name: '" + aTitle
- + "' - Author: '" + aAuthor + "'");
+ GT_Log.out.println(
+ "GT_Mod: Added Book to Book List - Mapping: '" + aMapping
+ + "' - Name: '"
+ + aTitle
+ + "' - Author: '"
+ + aAuthor
+ + "'");
GregTech_API.sBookList.put(aMapping, rStack);
return copyOrNull(rStack);
}
@@ -2194,20 +2084,25 @@ public class GT_Utility {
return doSoundAtClient(sound.resourceLocation, aTimeUntilNextSound, aSoundStrength, GT.getThePlayer());
}
- public static boolean doSoundAtClient(
- ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, float aSoundStrength) {
+ public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound,
+ float aSoundStrength) {
return doSoundAtClient(aSoundResourceLocation, aTimeUntilNextSound, aSoundStrength, GT.getThePlayer());
}
- public static boolean doSoundAtClient(
- String aSoundName, int aTimeUntilNextSound, float aSoundStrength, Entity aEntity) {
+ public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength,
+ Entity aEntity) {
if (aEntity == null || aSoundName == null) return false;
return doSoundAtClient(
- aSoundName, aTimeUntilNextSound, aSoundStrength, aEntity.posX, aEntity.posY, aEntity.posZ);
+ aSoundName,
+ aTimeUntilNextSound,
+ aSoundStrength,
+ aEntity.posX,
+ aEntity.posY,
+ aEntity.posZ);
}
- public static boolean doSoundAtClient(
- ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound, float aSoundStrength, Entity aEntity) {
+ public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound,
+ float aSoundStrength, Entity aEntity) {
if (aEntity == null) return false;
return doSoundAtClient(
aSoundResourceLocation.toString(),
@@ -2218,13 +2113,8 @@ public class GT_Utility {
aEntity.posZ);
}
- public static boolean doSoundAtClient(
- ResourceLocation aSoundResourceLocation,
- int aTimeUntilNextSound,
- float aSoundStrength,
- double aX,
- double aY,
- double aZ) {
+ public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound,
+ float aSoundStrength, double aX, double aY, double aZ) {
return doSoundAtClient(aSoundResourceLocation, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ);
}
@@ -2233,65 +2123,61 @@ public class GT_Utility {
* @deprecated Use {@link #doSoundAtClient(ResourceLocation, int, float, double, double, double)}
*/
@Deprecated
- public static boolean doSoundAtClient(
- String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) {
+ public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX,
+ double aY, double aZ) {
if (aSoundName == null) return false;
return doSoundAtClient(
- new ResourceLocation(aSoundName), aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ);
+ new ResourceLocation(aSoundName),
+ aTimeUntilNextSound,
+ aSoundStrength,
+ 1.01818028F,
+ aX,
+ aY,
+ aZ);
}
- public static boolean doSoundAtClient(
- SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) {
+ public static boolean doSoundAtClient(SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength,
+ double aX, double aY, double aZ) {
return doSoundAtClient(aSound.resourceLocation, aTimeUntilNextSound, aSoundStrength, aX, aY, aZ);
}
- public static boolean doSoundAtClient(
- SoundResource aSound,
- int aTimeUntilNextSound,
- float aSoundStrength,
- float aSoundModulation,
- double aX,
- double aY,
- double aZ) {
+ public static boolean doSoundAtClient(SoundResource aSound, int aTimeUntilNextSound, float aSoundStrength,
+ float aSoundModulation, double aX, double aY, double aZ) {
return doSoundAtClient(
- aSound.resourceLocation, aTimeUntilNextSound, aSoundStrength, aSoundModulation, aX, aY, aZ);
+ aSound.resourceLocation,
+ aTimeUntilNextSound,
+ aSoundStrength,
+ aSoundModulation,
+ aX,
+ aY,
+ aZ);
}
- public static boolean doSoundAtClient(
- ResourceLocation aSoundResourceLocation,
- int aTimeUntilNextSound,
- float aSoundStrength,
- float aSoundModulation,
- double aX,
- double aY,
- double aZ) {
- if (!FMLCommonHandler.instance().getEffectiveSide().isClient()
- || GT.getThePlayer() == null
- || !GT.getThePlayer().worldObj.isRemote) return false;
- if (GregTech_API.sMultiThreadedSounds)
- new Thread(
- new GT_Runnable_Sound(
- GT.getThePlayer().worldObj,
- MathHelper.floor_double(aX),
- MathHelper.floor_double(aY),
- MathHelper.floor_double(aZ),
- aTimeUntilNextSound,
- aSoundResourceLocation,
- aSoundStrength,
- aSoundModulation),
- "Sound Effect")
- .start();
- else
- new GT_Runnable_Sound(
- GT.getThePlayer().worldObj,
- MathHelper.floor_double(aX),
- MathHelper.floor_double(aY),
- MathHelper.floor_double(aZ),
- aTimeUntilNextSound,
- aSoundResourceLocation,
- aSoundStrength,
- aSoundModulation)
- .run();
+ public static boolean doSoundAtClient(ResourceLocation aSoundResourceLocation, int aTimeUntilNextSound,
+ float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) {
+ if (!FMLCommonHandler.instance().getEffectiveSide().isClient() || GT.getThePlayer() == null
+ || !GT.getThePlayer().worldObj.isRemote)
+ return false;
+ if (GregTech_API.sMultiThreadedSounds) new Thread(
+ new GT_Runnable_Sound(
+ GT.getThePlayer().worldObj,
+ MathHelper.floor_double(aX),
+ MathHelper.floor_double(aY),
+ MathHelper.floor_double(aZ),
+ aTimeUntilNextSound,
+ aSoundResourceLocation,
+ aSoundStrength,
+ aSoundModulation),
+ "Sound Effect").start();
+ else new GT_Runnable_Sound(
+ GT.getThePlayer().worldObj,
+ MathHelper.floor_double(aX),
+ MathHelper.floor_double(aY),
+ MathHelper.floor_double(aZ),
+ aTimeUntilNextSound,
+ aSoundResourceLocation,
+ aSoundStrength,
+ aSoundModulation).run();
return true;
}
@@ -2300,34 +2186,42 @@ public class GT_Utility {
* @Deprecated Use {@link #doSoundAtClient(ResourceLocation, int, float, float, double, double, double)}
*/
@Deprecated
- public static boolean doSoundAtClient(
- String aSoundName,
- int aTimeUntilNextSound,
- float aSoundStrength,
- float aSoundModulation,
- double aX,
- double aY,
- double aZ) {
+ public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength,
+ float aSoundModulation, double aX, double aY, double aZ) {
if (isStringInvalid(aSoundName)) return false;
return doSoundAtClient(
- new ResourceLocation(aSoundName), aTimeUntilNextSound, aSoundStrength, aSoundModulation, aX, aY, aZ);
+ new ResourceLocation(aSoundName),
+ aTimeUntilNextSound,
+ aSoundStrength,
+ aSoundModulation,
+ aX,
+ aY,
+ aZ);
}
- public static boolean sendSoundToPlayers(
- World aWorld, String aSoundName, float aSoundStrength, float aSoundModulation, int aX, int aY, int aZ) {
+ public static boolean sendSoundToPlayers(World aWorld, String aSoundName, float aSoundStrength,
+ float aSoundModulation, int aX, int aY, int aZ) {
if (isStringInvalid(aSoundName) || aWorld == null || aWorld.isRemote) return false;
NW.sendPacketToAllPlayersInRange(
- aWorld, new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ), aX, aZ);
+ aWorld,
+ new GT_Packet_Sound(aSoundName, aSoundStrength, aSoundModulation, aX, (short) aY, aZ),
+ aX,
+ aZ);
return true;
}
- public static boolean sendSoundToPlayers(
- World aWorld, SoundResource sound, float aSoundStrength, float aSoundModulation, int aX, int aY, int aZ) {
+ public static boolean sendSoundToPlayers(World aWorld, SoundResource sound, float aSoundStrength,
+ float aSoundModulation, int aX, int aY, int aZ) {
if (aWorld == null || aWorld.isRemote) return false;
NW.sendPacketToAllPlayersInRange(
aWorld,
new GT_Packet_Sound(
- sound.resourceLocation.toString(), aSoundStrength, aSoundModulation, aX, (short) aY, aZ),
+ sound.resourceLocation.toString(),
+ aSoundStrength,
+ aSoundModulation,
+ aX,
+ (short) aY,
+ aZ),
aX,
aZ);
return true;
@@ -2400,7 +2294,7 @@ public class GT_Utility {
public static <T> ArrayList<T> getArrayListWithoutTrailingNulls(T... aArray) {
if (aArray == null) return new ArrayList<>();
ArrayList<T> rList = new ArrayList<>(Arrays.asList(aArray));
- for (int i = rList.size() - 1; i >= 0 && rList.get(i) == null; ) rList.remove(i--);
+ for (int i = rList.size() - 1; i >= 0 && rList.get(i) == null;) rList.remove(i--);
return rList;
}
@@ -2437,21 +2331,21 @@ public class GT_Utility {
}
public static boolean isStackValid(Object aStack) {
- return (aStack instanceof ItemStack)
- && ((ItemStack) aStack).getItem() != null
+ return (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null
&& ((ItemStack) aStack).stackSize >= 0;
}
public static boolean isStackInvalid(Object aStack) {
- return aStack == null
- || !(aStack instanceof ItemStack)
+ return aStack == null || !(aStack instanceof ItemStack)
|| ((ItemStack) aStack).getItem() == null
|| ((ItemStack) aStack).stackSize < 0;
}
public static boolean isDebugItem(ItemStack aStack) {
- return /*ItemList.Armor_Cheat.isStackEqual(aStack, T, T) || */ areStacksEqual(
- GT_ModHandler.getIC2Item("debug", 1), aStack, true);
+ return /* ItemList.Armor_Cheat.isStackEqual(aStack, T, T) || */ areStacksEqual(
+ GT_ModHandler.getIC2Item("debug", 1),
+ aStack,
+ true);
}
public static ItemStack updateItemStack(ItemStack aStack) {
@@ -2473,9 +2367,8 @@ public class GT_Utility {
}
public static void setCoordsOnFire(World aWorld, int aX, int aY, int aZ, boolean aReplaceCenter) {
- if (aReplaceCenter)
- if (aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) == null)
- aWorld.setBlock(aX, aY, aZ, Blocks.fire);
+ if (aReplaceCenter) if (aWorld.getBlock(aX, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) == null)
+ aWorld.setBlock(aX, aY, aZ, Blocks.fire);
if (aWorld.getBlock(aX + 1, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX + 1, aY, aZ) == null)
aWorld.setBlock(aX + 1, aY, aZ, Blocks.fire);
if (aWorld.getBlock(aX - 1, aY, aZ).getCollisionBoundingBoxFromPool(aWorld, aX - 1, aY, aZ) == null)
@@ -2491,34 +2384,28 @@ public class GT_Utility {
}
public static ItemStack getProjectile(SubTag aProjectileType, IInventory aInventory) {
- if (aInventory != null)
- for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) {
- ItemStack rStack = aInventory.getStackInSlot(i);
- if (isStackValid(rStack)
- && rStack.getItem() instanceof IProjectileItem
- && ((IProjectileItem) rStack.getItem()).hasProjectile(aProjectileType, rStack))
- return updateItemStack(rStack);
- }
+ if (aInventory != null) for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) {
+ ItemStack rStack = aInventory.getStackInSlot(i);
+ if (isStackValid(rStack) && rStack.getItem() instanceof IProjectileItem
+ && ((IProjectileItem) rStack.getItem()).hasProjectile(aProjectileType, rStack))
+ return updateItemStack(rStack);
+ }
return null;
}
public static void removeNullStacksFromInventory(IInventory aInventory) {
- if (aInventory != null)
- for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) {
- ItemStack tStack = aInventory.getStackInSlot(i);
- if (tStack != null && (tStack.stackSize == 0 || tStack.getItem() == null))
- aInventory.setInventorySlotContents(i, null);
- }
+ if (aInventory != null) for (int i = 0, j = aInventory.getSizeInventory(); i < j; i++) {
+ ItemStack tStack = aInventory.getStackInSlot(i);
+ if (tStack != null && (tStack.stackSize == 0 || tStack.getItem() == null))
+ aInventory.setInventorySlotContents(i, null);
+ }
}
/**
- * Initializes new empty texture page for casings
- * page 0 is old CASING_BLOCKS
+ * Initializes new empty texture page for casings page 0 is old CASING_BLOCKS
*
- * Then casings should be registered like this:
- * for (byte i = MIN_USED_META; i < MAX_USED_META; i = (byte) (i + 1)) {
- * Textures.BlockIcons.casingTexturePages[PAGE][i+START_INDEX] = new GT_CopiedBlockTexture(this, 6, i);
- * }
+ * Then casings should be registered like this: for (byte i = MIN_USED_META; i < MAX_USED_META; i = (byte) (i + 1))
+ * { Textures.BlockIcons.casingTexturePages[PAGE][i+START_INDEX] = new GT_CopiedBlockTexture(this, 6, i); }
*
* @param page 0 to 127
* @return true if it made empty page, false if one already existed...
@@ -2534,7 +2421,8 @@ public class GT_Utility {
/**
* Return texture id from page and index, for use when determining hatches, but can also be precomputed from:
* (page<<7)+index
- * @param page 0 to 127 page
+ *
+ * @param page 0 to 127 page
* @param index 0 to 127 texture index
* @return casing texture 0 to 16383
*/
@@ -2548,21 +2436,30 @@ public class GT_Utility {
/**
* Return texture id from page and index, for use when determining hatches, but can also be precomputed from:
* (page<<7)+index
- * @param page 0 to 127 page
+ *
+ * @param page 0 to 127 page
* @param startIndex 0 to 127 start texture index
- * @param blockMeta meta of the block
+ * @param blockMeta meta of the block
* @return casing texture 0 to 16383
*/
public static int getTextureId(byte page, byte startIndex, byte blockMeta) {
if (page >= 0 && startIndex >= 0 && blockMeta >= 0 && (startIndex + blockMeta) <= 127) {
return (page << 7) + (startIndex + blockMeta);
}
- throw new RuntimeException("Index out of range: [" + page + "][" + startIndex + "+" + blockMeta + "="
- + (startIndex + blockMeta) + "]");
+ throw new RuntimeException(
+ "Index out of range: [" + page
+ + "]["
+ + startIndex
+ + "+"
+ + blockMeta
+ + "="
+ + (startIndex + blockMeta)
+ + "]");
}
/**
* Return texture id from item stack, unoptimized but readable?
+ *
* @return casing texture 0 to 16383
*/
@Deprecated
@@ -2572,6 +2469,7 @@ public class GT_Utility {
/**
* Return texture id from item stack, unoptimized but readable?
+ *
* @return casing texture 0 to 16383
*/
public static int getTextureId(Block blockFromBlock, byte metaFromBlock) {
@@ -2590,8 +2488,10 @@ public class GT_Utility {
}
}
}
- throw new RuntimeException("Probably missing mapping or different texture class used for: "
- + blockFromBlock.getUnlocalizedName() + " meta:" + metaFromBlock);
+ throw new RuntimeException(
+ "Probably missing mapping or different texture class used for: " + blockFromBlock.getUnlocalizedName()
+ + " meta:"
+ + metaFromBlock);
}
/**
@@ -2745,8 +2645,7 @@ public class GT_Utility {
public static float getHeatDamageFromItem(ItemStack aStack) {
ItemData tData = GT_OreDictUnificator.getItemData(aStack);
- return tData == null
- ? 0
+ return tData == null ? 0
: (tData.mPrefix == null ? 0 : tData.mPrefix.mHeatDamage)
+ (tData.hasValidMaterialData() ? tData.mMaterial.mMaterial.mHeatDamage : 0);
}
@@ -2775,8 +2674,7 @@ public class GT_Utility {
}
private static boolean applyHeatDamage(EntityLivingBase aEntity, float aDamage, DamageSource source) {
- if (aDamage > 0
- && aEntity != null
+ if (aDamage > 0 && aEntity != null
&& aEntity.getActivePotionEffect(Potion.fireResistance) == null
&& !isWearingFullHeatHazmat(aEntity)) {
aEntity.attackEntityFrom(source, aDamage);
@@ -2803,66 +2701,59 @@ public class GT_Utility {
}
public static boolean applyRadioactivity(EntityLivingBase aEntity, int aLevel, int aAmountOfItems) {
- if (aLevel > 0
- && aEntity != null
+ if (aLevel > 0 && aEntity != null
&& aEntity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD
&& aEntity.getCreatureAttribute() != EnumCreatureAttribute.ARTHROPOD
&& !isWearingFullRadioHazmat(aEntity)) {
PotionEffect tEffect = null;
- aEntity.addPotionEffect(new PotionEffect(
- Potion.moveSlowdown.id,
- aLevel * 140 * aAmountOfItems
- + Math.max(
+ aEntity.addPotionEffect(
+ new PotionEffect(
+ Potion.moveSlowdown.id,
+ aLevel * 140 * aAmountOfItems + Math.max(
0,
- ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown)) == null
- ? 0
+ ((tEffect = aEntity.getActivePotionEffect(Potion.moveSlowdown)) == null ? 0
: tEffect.getDuration())),
- Math.max(0, (5 * aLevel) / 7)));
- aEntity.addPotionEffect(new PotionEffect(
- Potion.digSlowdown.id,
- aLevel * 150 * aAmountOfItems
- + Math.max(
+ Math.max(0, (5 * aLevel) / 7)));
+ aEntity.addPotionEffect(
+ new PotionEffect(
+ Potion.digSlowdown.id,
+ aLevel * 150 * aAmountOfItems + Math.max(
0,
- ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown)) == null
- ? 0
+ ((tEffect = aEntity.getActivePotionEffect(Potion.digSlowdown)) == null ? 0
: tEffect.getDuration())),
- Math.max(0, (5 * aLevel) / 7)));
- aEntity.addPotionEffect(new PotionEffect(
- Potion.confusion.id,
- aLevel * 130 * aAmountOfItems
- + Math.max(
+ Math.max(0, (5 * aLevel) / 7)));
+ aEntity.addPotionEffect(
+ new PotionEffect(
+ Potion.confusion.id,
+ aLevel * 130 * aAmountOfItems + Math.max(
0,
- ((tEffect = aEntity.getActivePotionEffect(Potion.confusion)) == null
- ? 0
+ ((tEffect = aEntity.getActivePotionEffect(Potion.confusion)) == null ? 0
: tEffect.getDuration())),
- Math.max(0, (5 * aLevel) / 7)));
- aEntity.addPotionEffect(new PotionEffect(
- Potion.weakness.id,
- aLevel * 150 * aAmountOfItems
- + Math.max(
+ Math.max(0, (5 * aLevel) / 7)));
+ aEntity.addPotionEffect(
+ new PotionEffect(
+ Potion.weakness.id,
+ aLevel * 150 * aAmountOfItems + Math.max(
0,
- ((tEffect = aEntity.getActivePotionEffect(Potion.weakness)) == null
- ? 0
+ ((tEffect = aEntity.getActivePotionEffect(Potion.weakness)) == null ? 0
: tEffect.getDuration())),
- Math.max(0, (5 * aLevel) / 7)));
- aEntity.addPotionEffect(new PotionEffect(
- Potion.hunger.id,
- aLevel * 130 * aAmountOfItems
- + Math.max(
+ Math.max(0, (5 * aLevel) / 7)));
+ aEntity.addPotionEffect(
+ new PotionEffect(
+ Potion.hunger.id,
+ aLevel * 130 * aAmountOfItems + Math.max(
0,
- ((tEffect = aEntity.getActivePotionEffect(Potion.hunger)) == null
- ? 0
+ ((tEffect = aEntity.getActivePotionEffect(Potion.hunger)) == null ? 0
: tEffect.getDuration())),
- Math.max(0, (5 * aLevel) / 7)));
- aEntity.addPotionEffect(new PotionEffect(
- 24 /* IC2 Radiation */,
- aLevel * 180 * aAmountOfItems
- + Math.max(
+ Math.max(0, (5 * aLevel) / 7)));
+ aEntity.addPotionEffect(
+ new PotionEffect(
+ 24 /* IC2 Radiation */,
+ aLevel * 180 * aAmountOfItems + Math.max(
0,
- ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null
- ? 0
+ ((tEffect = aEntity.getActivePotionEffect(Potion.potionTypes[24])) == null ? 0
: tEffect.getDuration())),
- Math.max(0, (5 * aLevel) / 7)));
+ Math.max(0, (5 * aLevel) / 7)));
return true;
}
return false;
@@ -3041,8 +2932,7 @@ public class GT_Utility {
}
public static <X, Y extends Comparable<Y>> LinkedHashMap<X, Y> sortMapByValuesAcending(Map<X, Y> map) {
- return map.entrySet().stream()
- .sorted(Entry.comparingByValue())
+ return map.entrySet().stream().sorted(Entry.comparingByValue())
.collect(CollectorUtils.entriesToMap(LinkedHashMap::new));
}
@@ -3067,7 +2957,8 @@ public class GT_Utility {
}
/**
- * Translates a Material Amount into an Amount of Fluid. Second Parameter for things like Bucket Amounts (1000) and similar
+ * Translates a Material Amount into an Amount of Fluid. Second Parameter for things like Bucket Amounts (1000) and
+ * similar
*/
public static long translateMaterialToAmount(long aMaterialAmount, long aAmountPerUnit, boolean aRoundUp) {
return Math.max(
@@ -3077,8 +2968,7 @@ public class GT_Utility {
}
/**
- * This checks if the Dimension is really a Dimension and not another Planet or something.
- * Used for my Teleporter.
+ * This checks if the Dimension is really a Dimension and not another Planet or something. Used for my Teleporter.
*/
public static boolean isRealDimension(int aDimensionID) {
if (aDimensionID <= 1 && aDimensionID >= -1 && !GregTech_API.sDimensionalList.contains(aDimensionID))
@@ -3087,8 +2977,8 @@ public class GT_Utility {
&& DimensionManager.isDimensionRegistered(aDimensionID);
}
- public static boolean moveEntityToDimensionAtCoords(
- Entity entity, int aDimension, double aX, double aY, double aZ) {
+ public static boolean moveEntityToDimensionAtCoords(Entity entity, int aDimension, double aX, double aY,
+ double aZ) {
// Credit goes to BrandonCore Author :!:
if (entity == null || entity.worldObj.isRemote) return false;
@@ -3096,8 +2986,8 @@ public class GT_Utility {
if (entity.riddenByEntity != null) entity.riddenByEntity.mountEntity(null);
World startWorld = entity.worldObj;
- World destinationWorld =
- FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(aDimension);
+ World destinationWorld = FMLCommonHandler.instance().getMinecraftServerInstance()
+ .worldServerForDimension(aDimension);
if (destinationWorld == null) {
return false;
@@ -3111,11 +3001,12 @@ public class GT_Utility {
EntityPlayerMP player = (EntityPlayerMP) entity;
player.closeScreen(); // added
player.dimension = aDimension;
- player.playerNetServerHandler.sendPacket(new S07PacketRespawn(
- player.dimension,
- player.worldObj.difficultySetting,
- destinationWorld.getWorldInfo().getTerrainType(),
- player.theItemInWorldManager.getGameType()));
+ player.playerNetServerHandler.sendPacket(
+ new S07PacketRespawn(
+ player.dimension,
+ player.worldObj.difficultySetting,
+ destinationWorld.getWorldInfo().getTerrainType(),
+ player.theItemInWorldManager.getGameType()));
((WorldServer) startWorld).getPlayerManager().removePlayer(player);
startWorld.playerEntities.remove(player);
@@ -3169,8 +3060,8 @@ public class GT_Utility {
if (((entity instanceof EntityPlayerMP)) && interDimensional) {
EntityPlayerMP player = (EntityPlayerMP) entity;
player.theItemInWorldManager.setWorld((WorldServer) destinationWorld);
- player.mcServer.getConfigurationManager().updateTimeAndWeatherForPlayer(player, (WorldServer)
- destinationWorld);
+ player.mcServer.getConfigurationManager()
+ .updateTimeAndWeatherForPlayer(player, (WorldServer) destinationWorld);
player.mcServer.getConfigurationManager().syncPlayerInventory(player);
for (PotionEffect potionEffect : (Iterable<PotionEffect>) player.getActivePotionEffects()) {
@@ -3179,9 +3070,10 @@ public class GT_Utility {
player.playerNetServerHandler.sendPacket(
new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel));
- FMLCommonHandler.instance()
- .firePlayerChangedDimensionEvent(
- player, startWorld.provider.dimensionId, destinationWorld.provider.dimensionId);
+ FMLCommonHandler.instance().firePlayerChangedDimensionEvent(
+ player,
+ startWorld.provider.dimensionId,
+ destinationWorld.provider.dimensionId);
}
entity.setLocationAndAngles(aX, aY, aZ, entity.rotationYaw, entity.rotationPitch);
@@ -3194,18 +3086,8 @@ public class GT_Utility {
return (int) Math.floor(aValue / aScale);
}
- public static int getCoordinateScan(
- ArrayList<String> aList,
- EntityPlayer aPlayer,
- World aWorld,
- int aScanLevel,
- int aX,
- int aY,
- int aZ,
- int aSide,
- float aClickX,
- float aClickY,
- float aClickZ) {
+ public static int getCoordinateScan(ArrayList<String> aList, EntityPlayer aPlayer, World aWorld, int aScanLevel,
+ int aX, int aY, int aZ, int aSide, float aClickX, float aClickY, float aClickZ) {
if (aList == null) return 0;
ArrayList<String> tList = new ArrayList<>();
@@ -3215,43 +3097,60 @@ public class GT_Utility {
final Block tBlock = aWorld.getBlock(aX, aY, aZ);
- tList.add("----- X: " + EnumChatFormatting.AQUA + formatNumbers(aX) + EnumChatFormatting.RESET + " Y: "
- + EnumChatFormatting.AQUA + formatNumbers(aY) + EnumChatFormatting.RESET + " Z: "
- + EnumChatFormatting.AQUA + formatNumbers(aZ) + EnumChatFormatting.RESET + " D: "
- + EnumChatFormatting.AQUA + aWorld.provider.dimensionId + EnumChatFormatting.RESET + " -----");
- try {
- if (tTileEntity instanceof IInventory)
- tList.add(GT_Utility.trans("162", "Name: ")
- + EnumChatFormatting.BLUE
- + ((IInventory) tTileEntity).getInventoryName()
+ tList.add(
+ "----- X: " + EnumChatFormatting.AQUA
+ + formatNumbers(aX)
+ + EnumChatFormatting.RESET
+ + " Y: "
+ + EnumChatFormatting.AQUA
+ + formatNumbers(aY)
+ EnumChatFormatting.RESET
- + GT_Utility.trans("163", " MetaData: ")
+ + " Z: "
+ EnumChatFormatting.AQUA
- + aWorld.getBlockMetadata(aX, aY, aZ)
- + EnumChatFormatting.RESET);
- else
- tList.add(GT_Utility.trans("162", "Name: ")
- + EnumChatFormatting.BLUE
- + tBlock.getUnlocalizedName()
+ + formatNumbers(aZ)
+ EnumChatFormatting.RESET
- + GT_Utility.trans("163", " MetaData: ")
+ + " D: "
+ EnumChatFormatting.AQUA
- + aWorld.getBlockMetadata(aX, aY, aZ)
- + EnumChatFormatting.RESET);
-
- tList.add(GT_Utility.trans("164", "Hardness: ")
- + EnumChatFormatting.YELLOW
- + tBlock.getBlockHardness(aWorld, aX, aY, aZ)
- + EnumChatFormatting.RESET
- + GT_Utility.trans("165", " Blast Resistance: ")
- + EnumChatFormatting.YELLOW
- + tBlock.getExplosionResistance(
- aPlayer, aWorld, aX, aY, aZ, aPlayer.posX, aPlayer.posY, aPlayer.posZ)
- + EnumChatFormatting.RESET);
- if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ))
- tList.add(EnumChatFormatting.GOLD
- + GT_Utility.trans("166", "Is valid Beacon Pyramid Material")
- + EnumChatFormatting.RESET);
+ + aWorld.provider.dimensionId
+ + EnumChatFormatting.RESET
+ + " -----");
+ try {
+ if (tTileEntity instanceof IInventory) tList.add(
+ GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE
+ + ((IInventory) tTileEntity).getInventoryName()
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("163", " MetaData: ")
+ + EnumChatFormatting.AQUA
+ + aWorld.getBlockMetadata(aX, aY, aZ)
+ + EnumChatFormatting.RESET);
+ else tList.add(
+ GT_Utility.trans("162", "Name: ") + EnumChatFormatting.BLUE
+ + tBlock.getUnlocalizedName()
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("163", " MetaData: ")
+ + EnumChatFormatting.AQUA
+ + aWorld.getBlockMetadata(aX, aY, aZ)
+ + EnumChatFormatting.RESET);
+
+ tList.add(
+ GT_Utility.trans("164", "Hardness: ") + EnumChatFormatting.YELLOW
+ + tBlock.getBlockHardness(aWorld, aX, aY, aZ)
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("165", " Blast Resistance: ")
+ + EnumChatFormatting.YELLOW
+ + tBlock.getExplosionResistance(
+ aPlayer,
+ aWorld,
+ aX,
+ aY,
+ aZ,
+ aPlayer.posX,
+ aPlayer.posY,
+ aPlayer.posZ)
+ + EnumChatFormatting.RESET);
+ if (tBlock.isBeaconBase(aWorld, aX, aY, aZ, aX, aY + 1, aZ)) tList.add(
+ EnumChatFormatting.GOLD + GT_Utility.trans("166", "Is valid Beacon Pyramid Material")
+ + EnumChatFormatting.RESET);
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
@@ -3259,17 +3158,24 @@ public class GT_Utility {
try {
if (tTileEntity instanceof IFluidHandler) {
rEUAmount += 500;
- final FluidTankInfo[] tTanks =
- ((IFluidHandler) tTileEntity).getTankInfo(ForgeDirection.getOrientation(aSide));
- if (tTanks != null)
- for (byte i = 0; i < tTanks.length; i++) {
- tList.add(GT_Utility.trans("167", "Tank ") + i + ": " + EnumChatFormatting.GREEN
- + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount))
- + EnumChatFormatting.RESET + " L / " + EnumChatFormatting.YELLOW
- + formatNumbers(tTanks[i].capacity) + EnumChatFormatting.RESET + " L "
- + EnumChatFormatting.GOLD + getFluidName(tTanks[i].fluid, true)
- + EnumChatFormatting.RESET);
- }
+ final FluidTankInfo[] tTanks = ((IFluidHandler) tTileEntity)
+ .getTankInfo(ForgeDirection.getOrientation(aSide));
+ if (tTanks != null) for (byte i = 0; i < tTanks.length; i++) {
+ tList.add(
+ GT_Utility.trans("167", "Tank ") + i
+ + ": "
+ + EnumChatFormatting.GREEN
+ + formatNumbers((tTanks[i].fluid == null ? 0 : tTanks[i].fluid.amount))
+ + EnumChatFormatting.RESET
+ + " L / "
+ + EnumChatFormatting.YELLOW
+ + formatNumbers(tTanks[i].capacity)
+ + EnumChatFormatting.RESET
+ + " L "
+ + EnumChatFormatting.GOLD
+ + getFluidName(tTanks[i].fluid, true)
+ + EnumChatFormatting.RESET);
+ }
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3285,17 +3191,22 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.reactor.IReactor) {
rEUAmount += 500;
- tList.add(GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN
- + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getHeat())
- + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW
- + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat())
- + EnumChatFormatting.RESET);
tList.add(
- GT_Utility.trans("169", "HEM: ")
+ GT_Utility.trans("168", "Heat: ") + EnumChatFormatting.GREEN
+ + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getHeat())
+ + EnumChatFormatting.RESET
+ + " / "
+ EnumChatFormatting.YELLOW
+ + formatNumbers(((ic2.api.reactor.IReactor) tTileEntity).getMaxHeat())
+ + EnumChatFormatting.RESET);
+ tList.add(
+ GT_Utility.trans("169", "HEM: ") + EnumChatFormatting.YELLOW
+ ((ic2.api.reactor.IReactor) tTileEntity).getHeatEffectModifier()
+ EnumChatFormatting.RESET
- /* + GT_Utility.trans("170"," Base EU Output: ")/* + ((ic2.api.reactor.IReactor)tTileEntity).getOutput()*/ );
+ /*
+ * + GT_Utility.trans("170"," Base EU Output: ")/* +
+ * ((ic2.api.reactor.IReactor)tTileEntity).getOutput()
+ */ );
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3305,10 +3216,10 @@ public class GT_Utility {
final IAlignment tAlignment = ((IAlignmentProvider) tTileEntity).getAlignment();
if (tAlignment != null) {
rEUAmount += 100;
- tList.add(GT_Utility.trans("219", "Extended Facing: ")
- + EnumChatFormatting.GREEN
- + tAlignment.getExtendedFacing()
- + EnumChatFormatting.RESET);
+ tList.add(
+ GT_Utility.trans("219", "Extended Facing: ") + EnumChatFormatting.GREEN
+ + tAlignment.getExtendedFacing()
+ + EnumChatFormatting.RESET);
}
}
} catch (Throwable e) {
@@ -3317,11 +3228,15 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.tile.IWrenchable) {
rEUAmount += 100;
- tList.add(GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN
- + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing() + EnumChatFormatting.RESET
- + GT_Utility.trans("172", " / Chance: ") + EnumChatFormatting.YELLOW
- + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100)
- + EnumChatFormatting.RESET + "%");
+ tList.add(
+ GT_Utility.trans("171", "Facing: ") + EnumChatFormatting.GREEN
+ + ((ic2.api.tile.IWrenchable) tTileEntity).getFacing()
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("172", " / Chance: ")
+ + EnumChatFormatting.YELLOW
+ + (((ic2.api.tile.IWrenchable) tTileEntity).getWrenchDropRate() * 100)
+ + EnumChatFormatting.RESET
+ + "%");
tList.add(
((ic2.api.tile.IWrenchable) tTileEntity).wrenchCanRemove(aPlayer)
? EnumChatFormatting.GREEN
@@ -3337,10 +3252,10 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.energy.tile.IEnergyConductor) {
rEUAmount += 200;
- tList.add(GT_Utility.trans("175", "Conduction Loss: ")
- + EnumChatFormatting.YELLOW
- + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()
- + EnumChatFormatting.RESET);
+ tList.add(
+ GT_Utility.trans("175", "Conduction Loss: ") + EnumChatFormatting.YELLOW
+ + ((ic2.api.energy.tile.IEnergyConductor) tTileEntity).getConductionLoss()
+ + EnumChatFormatting.RESET);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3348,11 +3263,15 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ic2.api.tile.IEnergyStorage) {
rEUAmount += 200;
- tList.add(GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW
- + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getStored())
- + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW
- + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity())
- + EnumChatFormatting.RESET + " EU");
+ tList.add(
+ GT_Utility.trans("176", "Contained Energy: ") + EnumChatFormatting.YELLOW
+ + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getStored())
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + formatNumbers(((ic2.api.tile.IEnergyStorage) tTileEntity).getCapacity())
+ + EnumChatFormatting.RESET
+ + " EU");
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3360,10 +3279,9 @@ public class GT_Utility {
try {
if (tTileEntity instanceof IUpgradableMachine) {
rEUAmount += 500;
- if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade())
- tList.add(EnumChatFormatting.GREEN
- + GT_Utility.trans("177", "Has Muffler Upgrade")
- + EnumChatFormatting.RESET);
+ if (((IUpgradableMachine) tTileEntity).hasMufflerUpgrade()) tList.add(
+ EnumChatFormatting.GREEN + GT_Utility.trans("177", "Has Muffler Upgrade")
+ + EnumChatFormatting.RESET);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3378,11 +3296,14 @@ public class GT_Utility {
}
rEUAmount += 400;
int tValue = 0;
- if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress()))
- tList.add(GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN
- + formatNumbers(((IMachineProgress) tTileEntity).getProgress())
- + EnumChatFormatting.RESET + " / " + EnumChatFormatting.YELLOW + formatNumbers(tValue)
- + EnumChatFormatting.RESET);
+ if (0 < (tValue = ((IMachineProgress) tTileEntity).getMaxProgress())) tList.add(
+ GT_Utility.trans("178", "Progress/Load: ") + EnumChatFormatting.GREEN
+ + formatNumbers(((IMachineProgress) tTileEntity).getProgress())
+ + EnumChatFormatting.RESET
+ + " / "
+ + EnumChatFormatting.YELLOW
+ + formatNumbers(tValue)
+ + EnumChatFormatting.RESET);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3390,8 +3311,7 @@ public class GT_Utility {
try {
if (tTileEntity instanceof ICoverable) {
rEUAmount += 300;
- final String tString = ((ICoverable) tTileEntity)
- .getCoverInfoAtSide((byte) aSide)
+ final String tString = ((ICoverable) tTileEntity).getCoverInfoAtSide((byte) aSide)
.getBehaviorDescription();
if (tString != null && !tString.equals(E)) tList.add(tString);
}
@@ -3401,33 +3321,49 @@ public class GT_Utility {
try {
if (tTileEntity instanceof IBasicEnergyContainer
&& ((IBasicEnergyContainer) tTileEntity).getEUCapacity() > 0) {
- tList.add(GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED
- + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputVoltage()) + " ("
- + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())] + ") "
- + EnumChatFormatting.RESET + GT_Utility.trans("182", " EU at ") + EnumChatFormatting.RED
- + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputAmperage())
- + EnumChatFormatting.RESET + GT_Utility.trans("183", " A"));
- tList.add(GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED
- + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputVoltage()) + " ("
- + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())] + ") "
- + EnumChatFormatting.RESET + GT_Utility.trans("182", " EU at ") + EnumChatFormatting.RED
- + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputAmperage())
- + EnumChatFormatting.RESET + GT_Utility.trans("183", " A"));
- tList.add(GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN
- + formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU())
- + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW
- + formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity())
- + EnumChatFormatting.RESET + " EU");
+ tList.add(
+ GT_Utility.trans("179", "Max IN: ") + EnumChatFormatting.RED
+ + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputVoltage())
+ + " ("
+ + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getInputVoltage())]
+ + ") "
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("182", " EU at ")
+ + EnumChatFormatting.RED
+ + formatNumbers(((IBasicEnergyContainer) tTileEntity).getInputAmperage())
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("183", " A"));
+ tList.add(
+ GT_Utility.trans("181", "Max OUT: ") + EnumChatFormatting.RED
+ + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())
+ + " ("
+ + GT_Values.VN[getTier(((IBasicEnergyContainer) tTileEntity).getOutputVoltage())]
+ + ") "
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("182", " EU at ")
+ + EnumChatFormatting.RED
+ + formatNumbers(((IBasicEnergyContainer) tTileEntity).getOutputAmperage())
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("183", " A"));
+ tList.add(
+ GT_Utility.trans("184", "Energy: ") + EnumChatFormatting.GREEN
+ + formatNumbers(((IBasicEnergyContainer) tTileEntity).getStoredEU())
+ + EnumChatFormatting.RESET
+ + " EU / "
+ + EnumChatFormatting.YELLOW
+ + formatNumbers(((IBasicEnergyContainer) tTileEntity).getEUCapacity())
+ + EnumChatFormatting.RESET
+ + " EU");
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
}
try {
if (tTileEntity instanceof IGregTechTileEntity) {
- tList.add(GT_Utility.trans("186", "Owned by: ")
- + EnumChatFormatting.BLUE
- + ((IGregTechTileEntity) tTileEntity).getOwnerName()
- + EnumChatFormatting.RESET);
+ tList.add(
+ GT_Utility.trans("186", "Owned by: ") + EnumChatFormatting.BLUE
+ + ((IGregTechTileEntity) tTileEntity).getOwnerName()
+ + EnumChatFormatting.RESET);
}
} catch (Throwable e) {
if (D1) e.printStackTrace(GT_Log.err);
@@ -3446,29 +3382,29 @@ public class GT_Utility {
final ic2.api.crops.ICropTile crop = (ic2.api.crops.ICropTile) tTileEntity;
if (crop.getScanLevel() < 4) crop.setScanLevel((byte) 4);
if (crop.getCrop() != null) {
- tList.add(GT_Utility.trans("187", "Type -- Crop-Name: ")
- + crop.getCrop().name()
- + GT_Utility.trans("188", " Growth: ")
- + crop.getGrowth()
- + GT_Utility.trans("189", " Gain: ")
- + crop.getGain()
- + GT_Utility.trans("190", " Resistance: ")
- + crop.getResistance());
+ tList.add(
+ GT_Utility.trans("187", "Type -- Crop-Name: ") + crop.getCrop().name()
+ + GT_Utility.trans("188", " Growth: ")
+ + crop.getGrowth()
+ + GT_Utility.trans("189", " Gain: ")
+ + crop.getGain()
+ + GT_Utility.trans("190", " Resistance: ")
+ + crop.getResistance());
}
- tList.add(GT_Utility.trans("191", "Plant -- Fertilizer: ")
- + crop.getNutrientStorage()
- + GT_Utility.trans("192", " Water: ")
- + crop.getHydrationStorage()
- + GT_Utility.trans("193", " Weed-Ex: ")
- + crop.getWeedExStorage()
- + GT_Utility.trans("194", " Scan-Level: ")
- + crop.getScanLevel());
- tList.add(GT_Utility.trans("195", "Environment -- Nutrients: ")
- + crop.getNutrients()
- + GT_Utility.trans("196", " Humidity: ")
- + crop.getHumidity()
- + GT_Utility.trans("197", " Air-Quality: ")
- + crop.getAirQuality());
+ tList.add(
+ GT_Utility.trans("191", "Plant -- Fertilizer: ") + crop.getNutrientStorage()
+ + GT_Utility.trans("192", " Water: ")
+ + crop.getHydrationStorage()
+ + GT_Utility.trans("193", " Weed-Ex: ")
+ + crop.getWeedExStorage()
+ + GT_Utility.trans("194", " Scan-Level: ")
+ + crop.getScanLevel());
+ tList.add(
+ GT_Utility.trans("195", "Environment -- Nutrients: ") + crop.getNutrients()
+ + GT_Utility.trans("196", " Humidity: ")
+ + crop.getHumidity()
+ + GT_Utility.trans("197", " Air-Quality: ")
+ + crop.getAirQuality());
if (crop.getCrop() != null) {
final StringBuilder tStringB = new StringBuilder();
for (String tAttribute : crop.getCrop().attributes()) {
@@ -3476,8 +3412,7 @@ public class GT_Utility {
}
final String tString = tStringB.toString();
tList.add(GT_Utility.trans("198", "Attributes:") + tString.replaceFirst(",", E));
- tList.add(GT_Utility.trans("199", "Discovered by: ")
- + crop.getCrop().discoveredBy());
+ tList.add(GT_Utility.trans("199", "Discovered by: ") + crop.getCrop().discoveredBy());
}
}
} catch (Throwable e) {
@@ -3486,8 +3421,7 @@ public class GT_Utility {
try {
if (tTileEntity instanceof forestry.arboriculture.tiles.TileLeaves) {
- final forestry.arboriculture.tiles.TileLeaves tileLeaves =
- (forestry.arboriculture.tiles.TileLeaves) tTileEntity;
+ final forestry.arboriculture.tiles.TileLeaves tileLeaves = (forestry.arboriculture.tiles.TileLeaves) tTileEntity;
final forestry.api.arboriculture.ITree tree = tileLeaves.getTree();
if (tree != null) {
rEUAmount += 1000;
@@ -3503,24 +3437,34 @@ public class GT_Utility {
final Chunk currentChunk = aWorld.getChunkFromBlockCoords(aX, aZ);
if (aPlayer.capabilities.isCreativeMode) {
final FluidStack tFluid = undergroundOilReadInformation(currentChunk); // -# to only read
- if (tFluid != null)
- tList.add(EnumChatFormatting.GOLD + tFluid.getLocalizedName() + EnumChatFormatting.RESET + ": "
- + EnumChatFormatting.YELLOW + formatNumbers(tFluid.amount) + EnumChatFormatting.RESET + " L");
- else
- tList.add(EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing") + EnumChatFormatting.RESET + ": "
- + EnumChatFormatting.YELLOW + '0' + EnumChatFormatting.RESET + " L");
- }
- // if(aPlayer.capabilities.isCreativeMode){
+ if (tFluid != null) tList.add(
+ EnumChatFormatting.GOLD + tFluid.getLocalizedName()
+ + EnumChatFormatting.RESET
+ + ": "
+ + EnumChatFormatting.YELLOW
+ + formatNumbers(tFluid.amount)
+ + EnumChatFormatting.RESET
+ + " L");
+ else tList.add(
+ EnumChatFormatting.GOLD + GT_Utility.trans("201", "Nothing")
+ + EnumChatFormatting.RESET
+ + ": "
+ + EnumChatFormatting.YELLOW
+ + '0'
+ + EnumChatFormatting.RESET
+ + " L");
+ }
+ // if(aPlayer.capabilities.isCreativeMode){
if (GT_Pollution.hasPollution(currentChunk)) {
- tList.add(GT_Utility.trans("202", "Pollution in Chunk: ")
- + EnumChatFormatting.RED
- + formatNumbers(GT_Pollution.getPollution(currentChunk))
- + EnumChatFormatting.RESET
- + GT_Utility.trans("203", " gibbl"));
+ tList.add(
+ GT_Utility.trans("202", "Pollution in Chunk: ") + EnumChatFormatting.RED
+ + formatNumbers(GT_Pollution.getPollution(currentChunk))
+ + EnumChatFormatting.RESET
+ + GT_Utility.trans("203", " gibbl"));
} else {
- tList.add(EnumChatFormatting.GREEN
- + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!")
- + EnumChatFormatting.RESET);
+ tList.add(
+ EnumChatFormatting.GREEN + GT_Utility.trans("204", "No Pollution in Chunk! HAYO!")
+ + EnumChatFormatting.RESET);
}
try {
@@ -3562,30 +3506,31 @@ public class GT_Utility {
}
/**
- * @return an Array containing the X and the Y Coordinate of the clicked Point, with the top left Corner as Origin, like on the Texture Sheet. return values should always be between [0.0F and 0.99F].
+ * @return an Array containing the X and the Y Coordinate of the clicked Point, with the top left Corner as Origin,
+ * like on the Texture Sheet. return values should always be between [0.0F and 0.99F].
*/
public static float[] getClickedFacingCoords(byte aSide, float aX, float aY, float aZ) {
switch (aSide) {
case 0:
- return new float[] {Math.min(0.99F, Math.max(0, 1 - aX)), Math.min(0.99F, Math.max(0, aZ))};
+ return new float[] { Math.min(0.99F, Math.max(0, 1 - aX)), Math.min(0.99F, Math.max(0, aZ)) };
case 1:
- return new float[] {Math.min(0.99F, Math.max(0, aX)), Math.min(0.99F, Math.max(0, aZ))};
+ return new float[] { Math.min(0.99F, Math.max(0, aX)), Math.min(0.99F, Math.max(0, aZ)) };
case 2:
- return new float[] {Math.min(0.99F, Math.max(0, 1 - aX)), Math.min(0.99F, Math.max(0, 1 - aY))};
+ return new float[] { Math.min(0.99F, Math.max(0, 1 - aX)), Math.min(0.99F, Math.max(0, 1 - aY)) };
case 3:
- return new float[] {Math.min(0.99F, Math.max(0, aX)), Math.min(0.99F, Math.max(0, 1 - aY))};
+ return new float[] { Math.min(0.99F, Math.max(0, aX)), Math.min(0.99F, Math.max(0, 1 - aY)) };
case 4:
- return new float[] {Math.min(0.99F, Math.max(0, aZ)), Math.min(0.99F, Math.max(0, 1 - aY))};
+ return new float[] { Math.min(0.99F, Math.max(0, aZ)), Math.min(0.99F, Math.max(0, 1 - aY)) };
case 5:
- return new float[] {Math.min(0.99F, Math.max(0, 1 - aZ)), Math.min(0.99F, Math.max(0, 1 - aY))};
+ return new float[] { Math.min(0.99F, Math.max(0, 1 - aZ)), Math.min(0.99F, Math.max(0, 1 - aY)) };
default:
- return new float[] {0.5F, 0.5F};
+ return new float[] { 0.5F, 0.5F };
}
}
/**
- * This Function determines the direction a Block gets when being Wrenched.
- * returns -1 if invalid. Even though that could never happen.
+ * This Function determines the direction a Block gets when being Wrenched. returns -1 if invalid. Even though that
+ * could never happen.
*/
public static byte determineWrenchingSide(byte aSide, float aX, float aY, float aZ) {
byte tBack = getOppositeSide(aSide);
@@ -3676,13 +3621,12 @@ public class GT_Utility {
}
/*
- * Check if stack has enough items of given gregtech material (will be oredicted)
- * and subtract from stack, if there's no creative or 111 stack.
+ * Check if stack has enough items of given gregtech material (will be oredicted) and subtract from stack, if
+ * there's no creative or 111 stack.
*/
- public static boolean consumeItems(
- EntityPlayer player, ItemStack stack, gregtech.api.enums.Materials mat, int count) {
- if (stack != null
- && GT_OreDictUnificator.getItemData(stack).mMaterial.mMaterial == mat
+ public static boolean consumeItems(EntityPlayer player, ItemStack stack, gregtech.api.enums.Materials mat,
+ int count) {
+ if (stack != null && GT_OreDictUnificator.getItemData(stack).mMaterial.mMaterial == mat
&& stack.stackSize >= count) {
if ((!player.capabilities.isCreativeMode) && (stack.stackSize != 111)) stack.stackSize -= count;
return true;
@@ -3726,7 +3670,13 @@ public class GT_Utility {
if (aPlayer == null) return false;
World aWorld = aPlayer.worldObj;
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(
- aX, aY, aZ, aWorld, aWorld.getBlock(aX, aY, aZ), aWorld.getBlockMetadata(aX, aY, aZ), aPlayer);
+ aX,
+ aY,
+ aZ,
+ aWorld,
+ aWorld.getBlock(aX, aY, aZ),
+ aWorld.getBlockMetadata(aX, aY, aZ),
+ aPlayer);
MinecraftForge.EVENT_BUS.post(event);
if (!event.isCanceled()) {
if (!isSimulate) return aWorld.setBlockToAir(aX, aY, aZ);
@@ -3735,12 +3685,14 @@ public class GT_Utility {
return false;
}
- public static boolean setBlockByFakePlayer(
- FakePlayer aPlayer, int aX, int aY, int aZ, Block aBlock, int aMeta, boolean isSimulate) {
+ public static boolean setBlockByFakePlayer(FakePlayer aPlayer, int aX, int aY, int aZ, Block aBlock, int aMeta,
+ boolean isSimulate) {
if (aPlayer == null) return false;
World aWorld = aPlayer.worldObj;
BlockEvent.PlaceEvent event = ForgeEventFactory.onPlayerBlockPlace(
- aPlayer, new BlockSnapshot(aWorld, aX, aY, aZ, aBlock, aMeta), ForgeDirection.UNKNOWN);
+ aPlayer,
+ new BlockSnapshot(aWorld, aX, aY, aZ, aBlock, aMeta),
+ ForgeDirection.UNKNOWN);
if (!event.isCanceled()) {
if (!isSimulate) return aWorld.setBlock(aX, aY, aZ, aBlock, aMeta, 3);
return true;
@@ -3758,6 +3710,7 @@ public class GT_Utility {
}
public static class ItemNBT {
+
public static void setNBT(ItemStack aStack, NBTTagCompound aNBT) {
if (aNBT == null) {
aStack.setTagCompound(null);
@@ -3766,8 +3719,7 @@ public class GT_Utility {
ArrayList<String> tTagsToRemove = new ArrayList<>();
for (Object tKey : aNBT.func_150296_c()) {
NBTBase tValue = aNBT.getTag((String) tKey);
- if (tValue == null
- || (tValue instanceof NBTPrimitive && ((NBTPrimitive) tValue).func_150291_c() == 0)
+ if (tValue == null || (tValue instanceof NBTPrimitive && ((NBTPrimitive) tValue).func_150291_c() == 0)
|| (tValue instanceof NBTTagString
&& isStringInvalid(((NBTTagString) tValue).func_150285_a_())))
tTagsToRemove.add((String) tKey);
@@ -3837,15 +3789,19 @@ public class GT_Utility {
return tNBT.getString("author");
}
- public static void setProspectionData(
- ItemStack aStack, int aX, int aY, int aZ, int aDim, FluidStack aFluid, String... aOres) {
+ public static void setProspectionData(ItemStack aStack, int aX, int aY, int aZ, int aDim, FluidStack aFluid,
+ String... aOres) {
NBTTagCompound tNBT = getNBT(aStack);
StringBuilder tData = new StringBuilder(aX + "," + aY + "," + aZ + "," + aDim + ",");
- if (aFluid != null)
- tData.append(aFluid.amount)
- .append(",")
- .append(aFluid.getLocalizedName())
- .append(","); // TODO CHECK IF THAT /5000 is needed (Not needed)
+ if (aFluid != null) tData.append(aFluid.amount).append(",").append(aFluid.getLocalizedName()).append(","); // TODO
+ // CHECK
+ // IF
+ // THAT
+ // /5000
+ // is
+ // needed
+ // (Not
+ // needed)
for (String tString : aOres) {
tData.append(tString).append(",");
}
@@ -3853,16 +3809,8 @@ public class GT_Utility {
setNBT(aStack, tNBT);
}
- public static void setAdvancedProspectionData(
- byte aTier,
- ItemStack aStack,
- int aX,
- short aY,
- int aZ,
- int aDim,
- ArrayList<String> aOils,
- ArrayList<String> aOres,
- int aRadius) {
+ public static void setAdvancedProspectionData(byte aTier, ItemStack aStack, int aX, short aY, int aZ, int aDim,
+ ArrayList<String> aOils, ArrayList<String> aOres, int aRadius) {
setBookTitle(aStack, "Raw Prospection Data");
@@ -3884,8 +3832,10 @@ public class GT_Utility {
tNBT.setString("prospection_oils", joinListToString(tOilsTransformed));
- String tOilsPosStr =
- "X: " + Math.floorDiv(aX, 16 * 8) * 16 * 8 + " Z: " + Math.floorDiv(aZ, 16 * 8) * 16 * 8 + "\n";
+ String tOilsPosStr = "X: " + Math.floorDiv(aX, 16 * 8) * 16 * 8
+ + " Z: "
+ + Math.floorDiv(aZ, 16 * 8) * 16 * 8
+ + "\n";
int xOff = aX - Math.floorDiv(aX, 16 * 8) * 16 * 8;
xOff = xOff / 16;
int xOffRemain = 7 - xOff;
@@ -3910,8 +3860,10 @@ public class GT_Utility {
for (; zOffRemain > 0; zOffRemain--) {
tOilsPosStr = tOilsPosStr.concat("--------\n");
}
- tOilsPosStr = tOilsPosStr.concat(" X: " + (Math.floorDiv(aX, 16 * 8) + 1) * 16 * 8 + " Z: "
- + (Math.floorDiv(aZ, 16 * 8) + 1) * 16 * 8); // +1 oilfied to find bottomright of [5]
+ tOilsPosStr = tOilsPosStr.concat(
+ " X: " + (Math.floorDiv(aX, 16 * 8) + 1) * 16 * 8
+ + " Z: "
+ + (Math.floorDiv(aZ, 16 * 8) + 1) * 16 * 8); // +1 oilfied to find bottomright of [5]
tNBT.setString("prospection_oils_pos", tOilsPosStr);
@@ -3930,16 +3882,33 @@ public class GT_Utility {
if (tDataArray.length > 6) {
tNBT.setString(
"author",
- " Dim: " + tDataArray[3] + "X: " + tDataArray[0] + " Y: " + tDataArray[1] + " Z: "
+ " Dim: " + tDataArray[3]
+ + "X: "
+ + tDataArray[0]
+ + " Y: "
+ + tDataArray[1]
+ + " Z: "
+ tDataArray[2]);
NBTTagList tNBTList = new NBTTagList();
StringBuilder tOres = new StringBuilder(" Prospected Ores: ");
for (int i = 6; tDataArray.length > i; i++) {
tOres.append(tDataArray[i]).append(" ");
}
- tNBTList.appendTag(new NBTTagString("Tier " + tTier + " Prospecting Data From: X" + tDataArray[0]
- + " Z:" + tDataArray[2] + " Dim:" + tDataArray[3] + " Produces " + tDataArray[4] + "L "
- + tDataArray[5] + " " + tOres));
+ tNBTList.appendTag(
+ new NBTTagString(
+ "Tier " + tTier
+ + " Prospecting Data From: X"
+ + tDataArray[0]
+ + " Z:"
+ + tDataArray[2]
+ + " Dim:"
+ + tDataArray[3]
+ + " Produces "
+ + tDataArray[4]
+ + "L "
+ + tDataArray[5]
+ + " "
+ + tOres));
tNBT.setTag("pages", tNBTList);
}
} else { // advanced prospection data
@@ -3955,10 +3924,14 @@ public class GT_Utility {
NBTTagList tNBTList = new NBTTagList();
- String tPageText = "Prospector report\n"
- + tPos + "\n\n"
- + "Oils: " + (tOils != null ? tOils.length : 0) + "\n\n"
- + "Ores within " + tRadius + " blocks\n\n"
+ String tPageText = "Prospector report\n" + tPos
+ + "\n\n"
+ + "Oils: "
+ + (tOils != null ? tOils.length : 0)
+ + "\n\n"
+ + "Ores within "
+ + tRadius
+ + " blocks\n\n"
+ "Location is center of orevein\n\n"
+ "Check NEI to confirm orevein type";
tNBTList.appendTag(new NBTTagString(tPageText));
@@ -3967,12 +3940,15 @@ public class GT_Utility {
if (tOils != null) fillBookWithList(tNBTList, "Oils%s\n\n", "\n", 9, tOils);
- tPageText = "Oil notes\n\n"
- + "Prospects from NW to SE 576 chunks"
- + "(9 8x8 oilfields)\n around and gives min-max amount" + "\n\n"
- + "[1][2][3]" + "\n"
- + "[4][5][6]" + "\n"
- + "[7][8][9]" + "\n"
+ tPageText = "Oil notes\n\n" + "Prospects from NW to SE 576 chunks"
+ + "(9 8x8 oilfields)\n around and gives min-max amount"
+ + "\n\n"
+ + "[1][2][3]"
+ + "\n"
+ + "[4][5][6]"
+ + "\n"
+ + "[7][8][9]"
+ + "\n"
+ "\n"
+ "[5] - Prospector in this 8x8 area";
tNBTList.appendTag(new NBTTagString(tPageText));
@@ -3986,8 +3962,8 @@ public class GT_Utility {
setNBT(aStack, tNBT);
}
- public static void fillBookWithList(
- NBTTagList aBook, String aPageHeader, String aListDelimiter, int aItemsPerPage, String[] list) {
+ public static void fillBookWithList(NBTTagList aBook, String aPageHeader, String aListDelimiter,
+ int aItemsPerPage, String[] list) {
String aPageFormatter = " %d/%d";
int tTotalPages = list.length / aItemsPerPage + (list.length % aItemsPerPage > 0 ? 1 : 0);
int tPage = 0;
@@ -3995,9 +3971,7 @@ public class GT_Utility {
do {
tPageText = new StringBuilder();
for (int i = tPage * aItemsPerPage; i < (tPage + 1) * aItemsPerPage && i < list.length; i += 1)
- tPageText
- .append((tPageText.length() == 0) ? "" : aListDelimiter)
- .append(list[i]);
+ tPageText.append((tPageText.length() == 0) ? "" : aListDelimiter).append(list[i]);
if (tPageText.length() > 0) {
String tPageCounter = tTotalPages > 1 ? String.format(aPageFormatter, tPage + 1, tTotalPages) : "";
@@ -4040,6 +4014,7 @@ public class GT_Utility {
* THIS IS BULLSHIT!!! WHY DO I HAVE TO DO THIS SHIT JUST TO HAVE ENCHANTS PROPERLY!?!
*/
public static class GT_EnchantmentHelper {
+
private static final BullshitIteratorA mBullshitIteratorA = new BullshitIteratorA();
private static final BullshitIteratorB mBullshitIteratorB = new BullshitIteratorB();
@@ -4085,10 +4060,12 @@ public class GT_Utility {
}
interface IBullshit {
+
void calculateModifier(Enchantment aEnchantment, int aLevel);
}
static final class BullshitIteratorA implements IBullshit {
+
public EntityLivingBase mPlayer;
public Entity mEntity;
@@ -4101,6 +4078,7 @@ public class GT_Utility {
}
static final class BullshitIteratorB implements IBullshit {
+
public EntityLivingBase mPlayer;
public Entity mEntity;
@@ -4123,10 +4101,7 @@ public class GT_Utility {
public static boolean isPartOfMaterials(ItemStack aStack, Materials aMaterials) {
return GT_OreDictUnificator.getAssociation(aStack) != null
- && GT_OreDictUnificator.getAssociation(aStack)
- .mMaterial
- .mMaterial
- .equals(aMaterials);
+ && GT_OreDictUnificator.getAssociation(aStack).mMaterial.mMaterial.equals(aMaterials);
}
public static boolean isPartOfOrePrefix(ItemStack aStack, OrePrefixes aPrefix) {
@@ -4140,8 +4115,7 @@ public class GT_Utility {
"gtPlusPlus.core.block.base.BlockBaseOre");
public static boolean isOre(Block aBlock, int aMeta) {
- return (aBlock instanceof GT_Block_Ores_Abstract)
- || isOre(new ItemStack(aBlock, 1, aMeta))
+ return (aBlock instanceof GT_Block_Ores_Abstract) || isOre(new ItemStack(aBlock, 1, aMeta))
|| ORE_BLOCK_CLASSES.contains(aBlock.getClass().getName());
}
@@ -4161,16 +4135,16 @@ public class GT_Utility {
}
/**
- * Do <b>NOT</b> mutate the returned {@code ItemStack}!
- * We return {@code ItemStack} instead of {@code Block} so that we can include metadata.
+ * Do <b>NOT</b> mutate the returned {@code ItemStack}! We return {@code ItemStack} instead of {@code Block} so that
+ * we can include metadata.
*/
public static ItemStack getCobbleForOre(Block ore, short metaData) {
// We need to convert small ores to regular ores because small ores don't have associated ItemData.
// We take the modulus of the metadata by 16000 because that is the magic number to convert small ores to
// regular ores.
// See: GT_TileEntity_Ores.java
- ItemData association =
- GT_OreDictUnificator.getAssociation(new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000));
+ ItemData association = GT_OreDictUnificator
+ .getAssociation(new ItemStack(Item.getItemFromBlock(ore), 1, metaData % 16000));
if (association != null) {
Supplier<ItemStack> supplier = sOreToCobble.get(association.mPrefix);
if (supplier != null) {
@@ -4194,8 +4168,7 @@ public class GT_Utility {
} else if (o instanceof String) {
ItemStack stack = GT_OreDictUnificator.get(o, 1);
if (stack == null) {
- Optional<ItemStack> oStack =
- OreDictionary.getOres((String) o).stream().findAny();
+ Optional<ItemStack> oStack = OreDictionary.getOres((String) o).stream().findAny();
if (oStack.isPresent()) {
ItemStack copy = oStack.get().copy();
inputs.add(copy);
@@ -4211,8 +4184,18 @@ public class GT_Utility {
inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool);
- return Optional.of(new GT_Recipe(
- false, new ItemStack[] {output}, inputs.toArray(new ItemStack[0]), null, null, null, null, 300, 30, 0));
+ return Optional.of(
+ new GT_Recipe(
+ false,
+ new ItemStack[] { output },
+ inputs.toArray(new ItemStack[0]),
+ null,
+ null,
+ null,
+ null,
+ 300,
+ 30,
+ 0));
}
public static Optional<GT_Recipe> reverseShapedRecipe(ItemStack output, Object... aRecipe) {
@@ -4252,8 +4235,7 @@ public class GT_Utility {
if (ToolDictNames.contains(dictName)) continue;
ItemStack stack = GT_OreDictUnificator.get(dictName, null, amount, false, true);
if (stack == null) {
- Optional<ItemStack> oStack =
- OreDictionary.getOres(dictName).stream().findAny();
+ Optional<ItemStack> oStack = OreDictionary.getOres(dictName).stream().findAny();
if (oStack.isPresent()) {
ItemStack copy = oStack.get().copy();
copy.stackSize = amount;
@@ -4272,13 +4254,23 @@ public class GT_Utility {
// Remove tools from inputs in case a recipe has one as a direct Item or ItemStack reference
inputs.removeIf(x -> x.getItem() instanceof GT_MetaGenerated_Tool);
- return Optional.of(new GT_Recipe(
- false, new ItemStack[] {output}, inputs.toArray(new ItemStack[0]), null, null, null, null, 300, 30, 0));
+ return Optional.of(
+ new GT_Recipe(
+ false,
+ new ItemStack[] { output },
+ inputs.toArray(new ItemStack[0]),
+ null,
+ null,
+ null,
+ null,
+ 300,
+ 30,
+ 0));
}
/**
- * Add an itemstack to player inventory, or drop on ground if full.
- * Can be called on client but it probably won't work very well.
+ * Add an itemstack to player inventory, or drop on ground if full. Can be called on client but it probably won't
+ * work very well.
*/
public static void addItemToPlayerInventory(EntityPlayer aPlayer, ItemStack aStack) {
if (isStackInvalid(aStack)) return;
@@ -4389,6 +4381,7 @@ public class GT_Utility {
@AutoValue
public abstract static class ItemId {
+
/** This method copies NBT, as it is mutable. */
public static ItemId create(ItemStack itemStack) {
NBTTagCompound nbt = itemStack.getTagCompound();
@@ -4402,7 +4395,9 @@ public class GT_Utility {
/** This method does not copy NBT in order to save time. Make sure not to mutate it! */
public static ItemId createNoCopy(ItemStack itemStack) {
return new AutoValue_GT_Utility_ItemId(
- itemStack.getItem(), itemStack.getItemDamage(), itemStack.getTagCompound());
+ itemStack.getItem(),
+ itemStack.getItemDamage(),
+ itemStack.getTagCompound());
}
protected abstract Item item();
diff --git a/src/main/java/gregtech/api/util/GT_UtilityClient.java b/src/main/java/gregtech/api/util/GT_UtilityClient.java
index 8cbf6bf4ad..22bf2b746e 100644
--- a/src/main/java/gregtech/api/util/GT_UtilityClient.java
+++ b/src/main/java/gregtech/api/util/GT_UtilityClient.java
@@ -1,18 +1,21 @@
package gregtech.api.util;
-import com.google.common.collect.Lists;
-import cpw.mods.fml.relauncher.ReflectionHelper;
import java.lang.reflect.Field;
import java.util.List;
+
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
+import com.google.common.collect.Lists;
+import cpw.mods.fml.relauncher.ReflectionHelper;
+
public class GT_UtilityClient {
- private static final Field isDrawingField =
- ReflectionHelper.findField(Tessellator.class, "isDrawing", "field_78415_z");
+
+ private static final Field isDrawingField = ReflectionHelper
+ .findField(Tessellator.class, "isDrawing", "field_78415_z");
public static boolean isDrawing(Tessellator tess) {
try {
@@ -27,7 +30,8 @@ public class GT_UtilityClient {
public static List<String> getTooltip(ItemStack aStack, boolean aGuiStyle) {
try {
List<String> tooltip = aStack.getTooltip(
- Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
+ Minecraft.getMinecraft().thePlayer,
+ Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
if (aGuiStyle) {
tooltip.set(
0,
@@ -40,10 +44,9 @@ public class GT_UtilityClient {
return tooltip;
} catch (RuntimeException e) {
// Collections.singletonList() can not be added to. we don't want that
- if (aGuiStyle)
- return Lists.newArrayList(
- (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor
- + aStack.getDisplayName());
+ if (aGuiStyle) return Lists.newArrayList(
+ (aStack.getRarity() == null ? EnumRarity.common : aStack.getRarity()).rarityColor
+ + aStack.getDisplayName());
return Lists.newArrayList(aStack.getDisplayName());
}
}
diff --git a/src/main/java/gregtech/api/util/IGT_HatchAdder.java b/src/main/java/gregtech/api/util/IGT_HatchAdder.java
index ecf2921d36..dee0ac36ad 100644
--- a/src/main/java/gregtech/api/util/IGT_HatchAdder.java
+++ b/src/main/java/gregtech/api/util/IGT_HatchAdder.java
@@ -3,6 +3,7 @@ package gregtech.api.util;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
public interface IGT_HatchAdder<T> {
+
/**
* Callback to add hatch, needs to check if hatch is valid (and add it)
*
diff --git a/src/main/java/gregtech/api/util/ISerializableObject.java b/src/main/java/gregtech/api/util/ISerializableObject.java
index b8014860f8..3895e277ad 100644
--- a/src/main/java/gregtech/api/util/ISerializableObject.java
+++ b/src/main/java/gregtech/api/util/ISerializableObject.java
@@ -1,10 +1,10 @@
package gregtech.api.util;
-import com.google.common.io.ByteArrayDataInput;
-import io.netty.buffer.ByteBuf;
import java.io.IOException;
+
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -14,6 +14,9 @@ import net.minecraft.nbt.NBTSizeTracker;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
+import com.google.common.io.ByteArrayDataInput;
+import io.netty.buffer.ByteBuf;
+
/**
* We could well have used {@link java.io.Serializable}, but that's too slow and should generally be avoided
*
@@ -25,17 +28,16 @@ public interface ISerializableObject {
ISerializableObject copy();
/**
- * If you are overriding this, you must <b>NOT</b> return {@link NBTTagInt} here! That return
- * type is how we tell that we are loading legacy data, and only {@link LegacyCoverData} is
- * allowed to return it. You probably want to return {@link NBTTagCompound} anyway.
+ * If you are overriding this, you must <b>NOT</b> return {@link NBTTagInt} here! That return type is how we tell
+ * that we are loading legacy data, and only {@link LegacyCoverData} is allowed to return it. You probably want to
+ * return {@link NBTTagCompound} anyway.
*/
@Nonnull
NBTBase saveDataToNBT();
/**
- * Write data to given ByteBuf
- * The data saved this way is intended to be stored for short amount of time over network.
- * DO NOT store it to disks.
+ * Write data to given ByteBuf The data saved this way is intended to be stored for short amount of time over
+ * network. DO NOT store it to disks.
*/
// the NBT is an unfortunate piece of tech. everything uses it but its API is not as efficient as could be
void writeToByteBuf(ByteBuf aBuf);
@@ -43,8 +45,9 @@ public interface ISerializableObject {
void loadDataFromNBT(NBTBase aNBT);
/**
- * Read data from given parameter and return this.
- * The data read this way is intended to be stored for short amount of time over network.
+ * Read data from given parameter and return this. The data read this way is intended to be stored for short amount
+ * of time over network.
+ *
* @param aPlayer the player who is sending this packet to server. null if it's client reading data.
*/
// the NBT is an unfortunate piece of tech. everything uses it but its API is not as efficient as could be
@@ -52,8 +55,8 @@ public interface ISerializableObject {
ISerializableObject readFromPacket(ByteArrayDataInput aBuf, @Nullable EntityPlayerMP aPlayer);
/**
- * Reverse engineered and adapted {@link cpw.mods.fml.common.network.ByteBufUtils#readTag(ByteBuf)}
- * Given buffer must contain a serialized NBTTagCompound in minecraft encoding
+ * Reverse engineered and adapted {@link cpw.mods.fml.common.network.ByteBufUtils#readTag(ByteBuf)} Given buffer
+ * must contain a serialized NBTTagCompound in minecraft encoding
*/
static NBTTagCompound readCompoundTagFromGreggyByteBuf(ByteArrayDataInput aBuf) {
short size = aBuf.readShort();
@@ -70,8 +73,8 @@ public interface ISerializableObject {
}
/**
- * Reverse engineered and adapted {@link cpw.mods.fml.common.network.ByteBufUtils#readItemStack(ByteBuf)}
- * Given buffer must contain a serialized ItemStack in minecraft encoding
+ * Reverse engineered and adapted {@link cpw.mods.fml.common.network.ByteBufUtils#readItemStack(ByteBuf)} Given
+ * buffer must contain a serialized ItemStack in minecraft encoding
*/
static ItemStack readItemStackFromGreggyByteBuf(ByteArrayDataInput aBuf) {
ItemStack stack = null;
@@ -86,6 +89,7 @@ public interface ISerializableObject {
}
final class LegacyCoverData implements ISerializableObject {
+
private int mData;
public LegacyCoverData() {}
diff --git a/src/main/java/gregtech/api/util/LightingHelper.java b/src/main/java/gregtech/api/util/LightingHelper.java
index 5aa9000bf2..36d8f4cda3 100644
--- a/src/main/java/gregtech/api/util/LightingHelper.java
+++ b/src/main/java/gregtech/api/util/LightingHelper.java
@@ -1,38 +1,31 @@
/*
- * LightingHelper - Derived and adapted from @Mineshopper / carpentersblocks
- * Copyright (c) 2013-2021.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation version 2.1
- * of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * LightingHelper - Derived and adapted from @Mineshopper / carpentersblocks Copyright (c) 2013-2021. This library is
+ * free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation version 2.1 of the License. This library is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of
+ * the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package gregtech.api.util;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
@SuppressWarnings("unused")
@SideOnly(Side.CLIENT)
public class LightingHelper {
+
public static final int NORMAL_BRIGHTNESS = 0xff00ff;
public static final int MAX_BRIGHTNESS = 0xf000f0;
public static final float NO_Z_FIGHT_OFFSET = 1.0F / 1024.0F;
- protected static final float[] LIGHTNESS = {0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F};
+ protected static final float[] LIGHTNESS = { 0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F };
private final RenderBlocks renderBlocks;
/**
* Brightness for side.
@@ -94,7 +87,7 @@ public class LightingHelper {
float green = color[1] / 255.0F;
float blue = color[2] / 255.0F;
- return new float[] {red, green, blue};
+ return new float[] { red, green, blue };
}
/**
@@ -197,8 +190,7 @@ public class LightingHelper {
}
/**
- * Sets up the color using lightness, brightness, and the primary color
- * value (usually the dye color) for the side.
+ * Sets up the color using lightness, brightness, and the primary color value (usually the dye color) for the side.
*
* @param side the side
* @param rgba the primary short[] RGBA color array
@@ -208,8 +200,7 @@ public class LightingHelper {
}
/**
- * Sets up the color using lightness, brightness, and the primary color
- * value (usually the dye color) for the side.
+ * Sets up the color using lightness, brightness, and the primary color value (usually the dye color) for the side.
*
* @param side the side
* @param hexColor the primary color
@@ -230,21 +221,18 @@ public class LightingHelper {
if (renderBlocks.hasOverrideBlockTexture()) {
- renderBlocks.colorRedTopLeft = renderBlocks.colorRedBottomLeft =
- renderBlocks.colorRedBottomRight = renderBlocks.colorRedTopRight = rgb[0];
- renderBlocks.colorGreenTopLeft = renderBlocks.colorGreenBottomLeft =
- renderBlocks.colorGreenBottomRight = renderBlocks.colorGreenTopRight = rgb[1];
- renderBlocks.colorBlueTopLeft = renderBlocks.colorBlueBottomLeft =
- renderBlocks.colorBlueBottomRight = renderBlocks.colorBlueTopRight = rgb[2];
+ renderBlocks.colorRedTopLeft = renderBlocks.colorRedBottomLeft = renderBlocks.colorRedBottomRight = renderBlocks.colorRedTopRight = rgb[0];
+ renderBlocks.colorGreenTopLeft = renderBlocks.colorGreenBottomLeft = renderBlocks.colorGreenBottomRight = renderBlocks.colorGreenTopRight = rgb[1];
+ renderBlocks.colorBlueTopLeft = renderBlocks.colorBlueBottomLeft = renderBlocks.colorBlueBottomRight = renderBlocks.colorBlueTopRight = rgb[2];
} else {
- renderBlocks.colorRedTopLeft = renderBlocks.colorRedBottomLeft =
- renderBlocks.colorRedBottomRight = renderBlocks.colorRedTopRight = rgb[0] * lightness;
- renderBlocks.colorGreenTopLeft = renderBlocks.colorGreenBottomLeft =
- renderBlocks.colorGreenBottomRight = renderBlocks.colorGreenTopRight = rgb[1] * lightness;
- renderBlocks.colorBlueTopLeft = renderBlocks.colorBlueBottomLeft =
- renderBlocks.colorBlueBottomRight = renderBlocks.colorBlueTopRight = rgb[2] * lightness;
+ renderBlocks.colorRedTopLeft = renderBlocks.colorRedBottomLeft = renderBlocks.colorRedBottomRight = renderBlocks.colorRedTopRight = rgb[0]
+ * lightness;
+ renderBlocks.colorGreenTopLeft = renderBlocks.colorGreenBottomLeft = renderBlocks.colorGreenBottomRight = renderBlocks.colorGreenTopRight = rgb[1]
+ * lightness;
+ renderBlocks.colorBlueTopLeft = renderBlocks.colorBlueBottomLeft = renderBlocks.colorBlueBottomRight = renderBlocks.colorBlueTopRight = rgb[2]
+ * lightness;
renderBlocks.colorRedTopLeft *= aoTopLeft;
renderBlocks.colorGreenTopLeft *= aoTopLeft;
@@ -278,14 +266,13 @@ public class LightingHelper {
float green = (color >> 8 & 0xff) / 255.0F;
float blue = (color & 0xff) / 255.0F;
- return new float[] {red, green, blue};
+ return new float[] { red, green, blue };
}
/**
* Will apply anaglyph color multipliers to RGB float array.
* <p>
- * If {@link EntityRenderer#anaglyphEnable} is false,
- * will do nothing.
+ * If {@link EntityRenderer#anaglyphEnable} is false, will do nothing.
*
* @param rgb array containing red, green and blue float values
*/
@@ -298,8 +285,7 @@ public class LightingHelper {
}
/**
- * Gets mixed ambient occlusion value from two inputs, with a
- * ratio applied to the final result.
+ * Gets mixed ambient occlusion value from two inputs, with a ratio applied to the final result.
*
* @param ao1 the first ambient occlusion value
* @param ao2 the second ambient occlusion value
@@ -342,12 +328,11 @@ public class LightingHelper {
/**
* Sets up lighting for the West face and returns the {@link LightingHelper}.
* <p>
- * This is a consolidated <code>method</code> that sets side shading
- * with respect to the following attributes:
+ * This is a consolidated <code>method</code> that sets side shading with respect to the following attributes:
* <p>
* <ul>
- * <li>{@link RenderBlocks#enableAO}</li>
- * <li>{@link RenderBlocks#partialRenderBounds}</li>
+ * <li>{@link RenderBlocks#enableAO}</li>
+ * <li>{@link RenderBlocks#partialRenderBounds}</li>
* </ul>
*
* @param block the block {@link Block}
@@ -368,22 +353,22 @@ public class LightingHelper {
float ratio = (float) (1.0F - renderBlocks.renderMinX);
float aoLightValue = renderBlocks.blockAccess.getBlock(x - 1, y, z).getAmbientOcclusionLightValue();
- renderBlocks.aoBrightnessXYNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z);
- renderBlocks.aoBrightnessXZNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1);
- renderBlocks.aoBrightnessXZNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1);
- renderBlocks.aoBrightnessXYNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z);
- renderBlocks.aoBrightnessXYZNNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1);
- renderBlocks.aoBrightnessXYZNNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1);
- renderBlocks.aoBrightnessXYZNPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1);
- renderBlocks.aoBrightnessXYZNPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1);
+ renderBlocks.aoBrightnessXYNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z);
+ renderBlocks.aoBrightnessXZNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1);
+ renderBlocks.aoBrightnessXZNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1);
+ renderBlocks.aoBrightnessXYNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z);
+ renderBlocks.aoBrightnessXYZNNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1);
+ renderBlocks.aoBrightnessXYZNNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1);
+ renderBlocks.aoBrightnessXYZNPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1);
+ renderBlocks.aoBrightnessXYZNPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1);
renderBlocks.aoLightValueScratchXYNN = getMixedAo(
renderBlocks.blockAccess.getBlock(x - 1, y - 1, z).getAmbientOcclusionLightValue(),
renderBlocks.blockAccess.getBlock(x, y - 1, z).getAmbientOcclusionLightValue(),
@@ -438,26 +423,18 @@ public class LightingHelper {
renderBlocks.aoBrightnessXYZNPP,
mixedBrightness);
- float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN
- + aoLightValue
- + renderBlocks.aoLightValueScratchXYZNPN
- + renderBlocks.aoLightValueScratchXYNP)
- / 4.0F;
- float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN
- + renderBlocks.aoLightValueScratchXYNN
- + renderBlocks.aoLightValueScratchXZNN
- + aoLightValue)
- / 4.0F;
- float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYNN
- + renderBlocks.aoLightValueScratchXYZNNP
- + aoLightValue
- + renderBlocks.aoLightValueScratchXZNP)
- / 4.0F;
- float aoMixedXYZNPP = (aoLightValue
- + renderBlocks.aoLightValueScratchXZNP
- + renderBlocks.aoLightValueScratchXYNP
- + renderBlocks.aoLightValueScratchXYZNPP)
- / 4.0F;
+ float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN + aoLightValue
+ + renderBlocks.aoLightValueScratchXYZNPN
+ + renderBlocks.aoLightValueScratchXYNP) / 4.0F;
+ float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN + renderBlocks.aoLightValueScratchXYNN
+ + renderBlocks.aoLightValueScratchXZNN
+ + aoLightValue) / 4.0F;
+ float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYNN + renderBlocks.aoLightValueScratchXYZNNP
+ + aoLightValue
+ + renderBlocks.aoLightValueScratchXZNP) / 4.0F;
+ float aoMixedXYZNPP = (aoLightValue + renderBlocks.aoLightValueScratchXZNP
+ + renderBlocks.aoLightValueScratchXYNP
+ + renderBlocks.aoLightValueScratchXYZNPP) / 4.0F;
aoTopLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * renderBlocks.renderMaxZ
+ aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMaxZ)
@@ -520,12 +497,11 @@ public class LightingHelper {
/**
* Sets up lighting for the East face and returns the {@link LightingHelper}.
* <p>
- * This is a consolidated <code>method</code> that sets side shading
- * with respect to the following attributes:
+ * This is a consolidated <code>method</code> that sets side shading with respect to the following attributes:
* <p>
* <ul>
- * <li>{@link RenderBlocks#enableAO}</li>
- * <li>{@link RenderBlocks#partialRenderBounds}</li>
+ * <li>{@link RenderBlocks#enableAO}</li>
+ * <li>{@link RenderBlocks#partialRenderBounds}</li>
* </ul>
*
* @param block the block {@link Block}
@@ -545,22 +521,22 @@ public class LightingHelper {
float aoLightValue = renderBlocks.blockAccess.getBlock(x + 1, y, z).getAmbientOcclusionLightValue();
- renderBlocks.aoBrightnessXYPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z);
- renderBlocks.aoBrightnessXZPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1);
- renderBlocks.aoBrightnessXZPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1);
- renderBlocks.aoBrightnessXYPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z);
- renderBlocks.aoBrightnessXYZPNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1);
- renderBlocks.aoBrightnessXYZPNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1);
- renderBlocks.aoBrightnessXYZPPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1);
- renderBlocks.aoBrightnessXYZPPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1);
+ renderBlocks.aoBrightnessXYPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z);
+ renderBlocks.aoBrightnessXZPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z - 1);
+ renderBlocks.aoBrightnessXZPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y, z + 1);
+ renderBlocks.aoBrightnessXYPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z);
+ renderBlocks.aoBrightnessXYZPNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z - 1);
+ renderBlocks.aoBrightnessXYZPNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y - 1, z + 1);
+ renderBlocks.aoBrightnessXYZPPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z - 1);
+ renderBlocks.aoBrightnessXYZPPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, xOffset, y + 1, z + 1);
renderBlocks.aoLightValueScratchXYPN = getMixedAo(
renderBlocks.blockAccess.getBlock(x + 1, y - 1, z).getAmbientOcclusionLightValue(),
renderBlocks.blockAccess.getBlock(x, y - 1, z).getAmbientOcclusionLightValue(),
@@ -615,26 +591,18 @@ public class LightingHelper {
renderBlocks.aoBrightnessXYPP,
mixedBrightness);
- float aoMixedXYZPPP = (aoLightValue
- + renderBlocks.aoLightValueScratchXZPP
- + renderBlocks.aoLightValueScratchXYPP
- + renderBlocks.aoLightValueScratchXYZPPP)
- / 4.0F;
- float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchXYPN
- + renderBlocks.aoLightValueScratchXYZPNP
- + aoLightValue
- + renderBlocks.aoLightValueScratchXZPP)
- / 4.0F;
- float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchXYZPNN
- + renderBlocks.aoLightValueScratchXYPN
- + renderBlocks.aoLightValueScratchXZPN
- + aoLightValue)
- / 4.0F;
- float aoMixedXYZPPN = (renderBlocks.aoLightValueScratchXZPN
- + aoLightValue
- + renderBlocks.aoLightValueScratchXYZPPN
- + renderBlocks.aoLightValueScratchXYPP)
- / 4.0F;
+ float aoMixedXYZPPP = (aoLightValue + renderBlocks.aoLightValueScratchXZPP
+ + renderBlocks.aoLightValueScratchXYPP
+ + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F;
+ float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchXYPN + renderBlocks.aoLightValueScratchXYZPNP
+ + aoLightValue
+ + renderBlocks.aoLightValueScratchXZPP) / 4.0F;
+ float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchXYZPNN + renderBlocks.aoLightValueScratchXYPN
+ + renderBlocks.aoLightValueScratchXZPN
+ + aoLightValue) / 4.0F;
+ float aoMixedXYZPPN = (renderBlocks.aoLightValueScratchXZPN + aoLightValue
+ + renderBlocks.aoLightValueScratchXYZPPN
+ + renderBlocks.aoLightValueScratchXYPP) / 4.0F;
aoTopLeft = (float) (aoMixedXYZPNP * (1.0D - renderBlocks.renderMinY) * renderBlocks.renderMaxZ
+ aoMixedXYZPNN * (1.0D - renderBlocks.renderMinY) * (1.0D - renderBlocks.renderMaxZ)
@@ -697,12 +665,11 @@ public class LightingHelper {
/**
* Sets up lighting for the bottom face and returns the {@link LightingHelper}.
* <p>
- * This is a consolidated <code>method</code> that sets side shading
- * with respect to the following attributes:
+ * This is a consolidated <code>method</code> that sets side shading with respect to the following attributes:
* <p>
* <ul>
- * <li>{@link RenderBlocks#enableAO}</li>
- * <li>{@link RenderBlocks#partialRenderBounds}</li>
+ * <li>{@link RenderBlocks#enableAO}</li>
+ * <li>{@link RenderBlocks#partialRenderBounds}</li>
* </ul>
*
* @param block the block {@link Block}
@@ -723,22 +690,22 @@ public class LightingHelper {
float ratio = (float) (1.0F - renderBlocks.renderMinY);
float aoLightValue = renderBlocks.blockAccess.getBlock(x, y - 1, z).getAmbientOcclusionLightValue();
- renderBlocks.aoBrightnessXYNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z);
- renderBlocks.aoBrightnessYZNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1);
- renderBlocks.aoBrightnessYZNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1);
- renderBlocks.aoBrightnessXYPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z);
- renderBlocks.aoBrightnessXYZNNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1);
- renderBlocks.aoBrightnessXYZNNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1);
- renderBlocks.aoBrightnessXYZPNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1);
- renderBlocks.aoBrightnessXYZPNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1);
+ renderBlocks.aoBrightnessXYNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z);
+ renderBlocks.aoBrightnessYZNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1);
+ renderBlocks.aoBrightnessYZNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1);
+ renderBlocks.aoBrightnessXYPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z);
+ renderBlocks.aoBrightnessXYZNNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1);
+ renderBlocks.aoBrightnessXYZNNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1);
+ renderBlocks.aoBrightnessXYZPNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1);
+ renderBlocks.aoBrightnessXYZPNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1);
renderBlocks.aoLightValueScratchXYNN = getMixedAo(
renderBlocks.blockAccess.getBlock(x - 1, y - 1, z).getAmbientOcclusionLightValue(),
renderBlocks.blockAccess.getBlock(x - 1, y, z).getAmbientOcclusionLightValue(),
@@ -793,26 +760,18 @@ public class LightingHelper {
renderBlocks.aoBrightnessYZNP,
mixedBrightness);
- float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP
- + aoLightValue
- + renderBlocks.aoLightValueScratchXYZPNP
- + renderBlocks.aoLightValueScratchXYPN)
- / 4.0F;
- float aoMixedXYZPNN = (aoLightValue
- + renderBlocks.aoLightValueScratchYZNN
- + renderBlocks.aoLightValueScratchXYPN
- + renderBlocks.aoLightValueScratchXYZPNN)
- / 4.0F;
- float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYNN
- + renderBlocks.aoLightValueScratchXYZNNN
- + aoLightValue
- + renderBlocks.aoLightValueScratchYZNN)
- / 4.0F;
- float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP
- + renderBlocks.aoLightValueScratchXYNN
- + renderBlocks.aoLightValueScratchYZNP
- + aoLightValue)
- / 4.0F;
+ float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP + aoLightValue
+ + renderBlocks.aoLightValueScratchXYZPNP
+ + renderBlocks.aoLightValueScratchXYPN) / 4.0F;
+ float aoMixedXYZPNN = (aoLightValue + renderBlocks.aoLightValueScratchYZNN
+ + renderBlocks.aoLightValueScratchXYPN
+ + renderBlocks.aoLightValueScratchXYZPNN) / 4.0F;
+ float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYNN + renderBlocks.aoLightValueScratchXYZNNN
+ + aoLightValue
+ + renderBlocks.aoLightValueScratchYZNN) / 4.0F;
+ float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP + renderBlocks.aoLightValueScratchXYNN
+ + renderBlocks.aoLightValueScratchYZNP
+ + aoLightValue) / 4.0F;
aoTopLeft = (float) (aoMixedXYZNNP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX)
+ aoMixedXYZPNP * renderBlocks.renderMaxZ * renderBlocks.renderMinX
@@ -875,12 +834,11 @@ public class LightingHelper {
/**
* Sets up lighting for the top face and returns the {@link LightingHelper}.
* <p>
- * This is a consolidated <code>method</code> that sets side shading
- * with respect to the following attributes:
+ * This is a consolidated <code>method</code> that sets side shading with respect to the following attributes:
* <p>
* <ul>
- * <li>{@link RenderBlocks#enableAO}</li>
- * <li>{@link RenderBlocks#partialRenderBounds}</li>
+ * <li>{@link RenderBlocks#enableAO}</li>
+ * <li>{@link RenderBlocks#partialRenderBounds}</li>
* </ul>
*
* @param block the block {@link Block}
@@ -900,22 +858,22 @@ public class LightingHelper {
float aoLightValue = renderBlocks.blockAccess.getBlock(x, y + 1, z).getAmbientOcclusionLightValue();
- renderBlocks.aoBrightnessXYNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z);
- renderBlocks.aoBrightnessXYPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z);
- renderBlocks.aoBrightnessYZPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1);
- renderBlocks.aoBrightnessYZPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1);
- renderBlocks.aoBrightnessXYZNPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1);
- renderBlocks.aoBrightnessXYZPPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1);
- renderBlocks.aoBrightnessXYZNPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1);
- renderBlocks.aoBrightnessXYZPPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1);
+ renderBlocks.aoBrightnessXYNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z);
+ renderBlocks.aoBrightnessXYPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z);
+ renderBlocks.aoBrightnessYZPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z - 1);
+ renderBlocks.aoBrightnessYZPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, yOffset, z + 1);
+ renderBlocks.aoBrightnessXYZNPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z - 1);
+ renderBlocks.aoBrightnessXYZPPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z - 1);
+ renderBlocks.aoBrightnessXYZNPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, yOffset, z + 1);
+ renderBlocks.aoBrightnessXYZPPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, yOffset, z + 1);
renderBlocks.aoLightValueScratchXYNP = getMixedAo(
renderBlocks.blockAccess.getBlock(x - 1, y + 1, z).getAmbientOcclusionLightValue(),
renderBlocks.blockAccess.getBlock(x - 1, y, z).getAmbientOcclusionLightValue(),
@@ -970,40 +928,32 @@ public class LightingHelper {
renderBlocks.aoBrightnessYZPP,
mixedBrightness);
- float aoMixedXYZPPP = (renderBlocks.aoLightValueScratchYZPP
- + aoLightValue
- + renderBlocks.aoLightValueScratchXYZPPP
- + renderBlocks.aoLightValueScratchXYPP)
- / 4.0F;
- float aoMixedXYZPPN = (aoLightValue
- + renderBlocks.aoLightValueScratchYZPN
- + renderBlocks.aoLightValueScratchXYPP
- + renderBlocks.aoLightValueScratchXYZPPN)
- / 4.0F;
- float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXYNP
- + renderBlocks.aoLightValueScratchXYZNPN
- + aoLightValue
- + renderBlocks.aoLightValueScratchYZPN)
- / 4.0F;
- float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXYZNPP
- + renderBlocks.aoLightValueScratchXYNP
- + renderBlocks.aoLightValueScratchYZPP
- + aoLightValue)
- / 4.0F;
-
- aoTopLeft /*SE*/ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX)
+ float aoMixedXYZPPP = (renderBlocks.aoLightValueScratchYZPP + aoLightValue
+ + renderBlocks.aoLightValueScratchXYZPPP
+ + renderBlocks.aoLightValueScratchXYPP) / 4.0F;
+ float aoMixedXYZPPN = (aoLightValue + renderBlocks.aoLightValueScratchYZPN
+ + renderBlocks.aoLightValueScratchXYPP
+ + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F;
+ float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXYNP + renderBlocks.aoLightValueScratchXYZNPN
+ + aoLightValue
+ + renderBlocks.aoLightValueScratchYZPN) / 4.0F;
+ float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXYZNPP + renderBlocks.aoLightValueScratchXYNP
+ + renderBlocks.aoLightValueScratchYZPP
+ + aoLightValue) / 4.0F;
+
+ aoTopLeft /* SE */ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMaxX)
+ aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMaxX
+ aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMaxX
+ aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMaxX));
- aoBottomLeft /*NE*/ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX)
+ aoBottomLeft /* NE */ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMaxX)
+ aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMaxX
+ aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMaxX
+ aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMaxX));
- aoBottomRight /*NW*/ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX)
+ aoBottomRight /* NW */ = (float) (aoMixedXYZNPP * renderBlocks.renderMinZ * (1.0D - renderBlocks.renderMinX)
+ aoMixedXYZPPP * renderBlocks.renderMinZ * renderBlocks.renderMinX
+ aoMixedXYZPPN * (1.0D - renderBlocks.renderMinZ) * renderBlocks.renderMinX
+ aoMixedXYZNPN * (1.0D - renderBlocks.renderMinZ) * (1.0D - renderBlocks.renderMinX));
- aoTopRight /*SW*/ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX)
+ aoTopRight /* SW */ = (float) (aoMixedXYZNPP * renderBlocks.renderMaxZ * (1.0D - renderBlocks.renderMinX)
+ aoMixedXYZPPP * renderBlocks.renderMaxZ * renderBlocks.renderMinX
+ aoMixedXYZPPN * (1.0D - renderBlocks.renderMaxZ) * renderBlocks.renderMinX
+ aoMixedXYZNPN * (1.0D - renderBlocks.renderMaxZ) * (1.0D - renderBlocks.renderMinX));
@@ -1052,12 +1002,11 @@ public class LightingHelper {
/**
* Sets up lighting for the North face and returns the {@link LightingHelper}.
* <p>
- * This is a consolidated <code>method</code> that sets side shading
- * with respect to the following attributes:
+ * This is a consolidated <code>method</code> that sets side shading with respect to the following attributes:
* <p>
* <ul>
- * <li>{@link RenderBlocks#enableAO}</li>
- * <li>{@link RenderBlocks#partialRenderBounds}</li>
+ * <li>{@link RenderBlocks#enableAO}</li>
+ * <li>{@link RenderBlocks#partialRenderBounds}</li>
* </ul>
*
* @param block the block {@link Block}
@@ -1078,22 +1027,22 @@ public class LightingHelper {
float ratio = (float) (1.0F - renderBlocks.renderMinZ);
float aoLightValue = renderBlocks.blockAccess.getBlock(x, y, z - 1).getAmbientOcclusionLightValue();
- renderBlocks.aoBrightnessXZNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset);
- renderBlocks.aoBrightnessYZNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset);
- renderBlocks.aoBrightnessYZPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset);
- renderBlocks.aoBrightnessXZPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset);
- renderBlocks.aoBrightnessXYZNNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset);
- renderBlocks.aoBrightnessXYZNPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset);
- renderBlocks.aoBrightnessXYZPNN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset);
- renderBlocks.aoBrightnessXYZPPN =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset);
+ renderBlocks.aoBrightnessXZNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset);
+ renderBlocks.aoBrightnessYZNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset);
+ renderBlocks.aoBrightnessYZPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset);
+ renderBlocks.aoBrightnessXZPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset);
+ renderBlocks.aoBrightnessXYZNNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset);
+ renderBlocks.aoBrightnessXYZNPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset);
+ renderBlocks.aoBrightnessXYZPNN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset);
+ renderBlocks.aoBrightnessXYZPPN = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset);
renderBlocks.aoLightValueScratchXZNN = getMixedAo(
renderBlocks.blockAccess.getBlock(x - 1, y, z - 1).getAmbientOcclusionLightValue(),
renderBlocks.blockAccess.getBlock(x - 1, y, z).getAmbientOcclusionLightValue(),
@@ -1148,26 +1097,18 @@ public class LightingHelper {
renderBlocks.aoBrightnessYZPN,
mixedBrightness);
- float aoMixedXYZPPN = (aoLightValue
- + renderBlocks.aoLightValueScratchYZPN
- + renderBlocks.aoLightValueScratchXZPN
- + renderBlocks.aoLightValueScratchXYZPPN)
- / 4.0F;
- float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchYZNN
- + aoLightValue
- + renderBlocks.aoLightValueScratchXYZPNN
- + renderBlocks.aoLightValueScratchXZPN)
- / 4.0F;
- float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN
- + renderBlocks.aoLightValueScratchXZNN
- + renderBlocks.aoLightValueScratchYZNN
- + aoLightValue)
- / 4.0F;
- float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN
- + renderBlocks.aoLightValueScratchXYZNPN
- + aoLightValue
- + renderBlocks.aoLightValueScratchYZPN)
- / 4.0F;
+ float aoMixedXYZPPN = (aoLightValue + renderBlocks.aoLightValueScratchYZPN
+ + renderBlocks.aoLightValueScratchXZPN
+ + renderBlocks.aoLightValueScratchXYZPPN) / 4.0F;
+ float aoMixedXYZPNN = (renderBlocks.aoLightValueScratchYZNN + aoLightValue
+ + renderBlocks.aoLightValueScratchXYZPNN
+ + renderBlocks.aoLightValueScratchXZPN) / 4.0F;
+ float aoMixedXYZNNN = (renderBlocks.aoLightValueScratchXYZNNN + renderBlocks.aoLightValueScratchXZNN
+ + renderBlocks.aoLightValueScratchYZNN
+ + aoLightValue) / 4.0F;
+ float aoMixedXYZNPN = (renderBlocks.aoLightValueScratchXZNN + renderBlocks.aoLightValueScratchXYZNPN
+ + aoLightValue
+ + renderBlocks.aoLightValueScratchYZPN) / 4.0F;
aoTopLeft = (float) (aoMixedXYZNPN * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX)
+ aoMixedXYZPPN * renderBlocks.renderMaxY * renderBlocks.renderMinX
@@ -1230,12 +1171,11 @@ public class LightingHelper {
/**
* Sets up lighting for the South face and returns the {@link LightingHelper}.
* <p>
- * This is a consolidated <code>method</code> that sets side shading
- * with respect to the following attributes:
+ * This is a consolidated <code>method</code> that sets side shading with respect to the following attributes:
* <p>
* <ul>
- * <li>{@link RenderBlocks#enableAO}</li>
- * <li>{@link RenderBlocks#partialRenderBounds}</li>
+ * <li>{@link RenderBlocks#enableAO}</li>
+ * <li>{@link RenderBlocks#partialRenderBounds}</li>
* </ul>
*
* @param block the block {@link Block}
@@ -1255,22 +1195,22 @@ public class LightingHelper {
float aoLightValue = renderBlocks.blockAccess.getBlock(x, y, z + 1).getAmbientOcclusionLightValue();
- renderBlocks.aoBrightnessXZNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset);
- renderBlocks.aoBrightnessXZPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset);
- renderBlocks.aoBrightnessYZNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset);
- renderBlocks.aoBrightnessYZPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset);
- renderBlocks.aoBrightnessXYZNNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset);
- renderBlocks.aoBrightnessXYZNPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset);
- renderBlocks.aoBrightnessXYZPNP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset);
- renderBlocks.aoBrightnessXYZPPP =
- block.getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset);
+ renderBlocks.aoBrightnessXZNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y, zOffset);
+ renderBlocks.aoBrightnessXZPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y, zOffset);
+ renderBlocks.aoBrightnessYZNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y - 1, zOffset);
+ renderBlocks.aoBrightnessYZPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x, y + 1, zOffset);
+ renderBlocks.aoBrightnessXYZNNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y - 1, zOffset);
+ renderBlocks.aoBrightnessXYZNPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x - 1, y + 1, zOffset);
+ renderBlocks.aoBrightnessXYZPNP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y - 1, zOffset);
+ renderBlocks.aoBrightnessXYZPPP = block
+ .getMixedBrightnessForBlock(renderBlocks.blockAccess, x + 1, y + 1, zOffset);
renderBlocks.aoLightValueScratchXZNP = getMixedAo(
renderBlocks.blockAccess.getBlock(x - 1, y, z + 1).getAmbientOcclusionLightValue(),
renderBlocks.blockAccess.getBlock(x - 1, y, z).getAmbientOcclusionLightValue(),
@@ -1325,26 +1265,18 @@ public class LightingHelper {
renderBlocks.aoBrightnessXYZPPP,
mixedBrightness);
- float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXZNP
- + renderBlocks.aoLightValueScratchXYZNPP
- + aoLightValue
- + renderBlocks.aoLightValueScratchYZPP)
- / 4.0F;
- float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP
- + renderBlocks.aoLightValueScratchXZNP
- + renderBlocks.aoLightValueScratchYZNP
- + aoLightValue)
- / 4.0F;
- float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP
- + aoLightValue
- + renderBlocks.aoLightValueScratchXYZPNP
- + renderBlocks.aoLightValueScratchXZPP)
- / 4.0F;
- float aoMixedXYZPPP = (aoLightValue
- + renderBlocks.aoLightValueScratchYZPP
- + renderBlocks.aoLightValueScratchXZPP
- + renderBlocks.aoLightValueScratchXYZPPP)
- / 4.0F;
+ float aoMixedXYZNPP = (renderBlocks.aoLightValueScratchXZNP + renderBlocks.aoLightValueScratchXYZNPP
+ + aoLightValue
+ + renderBlocks.aoLightValueScratchYZPP) / 4.0F;
+ float aoMixedXYZNNP = (renderBlocks.aoLightValueScratchXYZNNP + renderBlocks.aoLightValueScratchXZNP
+ + renderBlocks.aoLightValueScratchYZNP
+ + aoLightValue) / 4.0F;
+ float aoMixedXYZPNP = (renderBlocks.aoLightValueScratchYZNP + aoLightValue
+ + renderBlocks.aoLightValueScratchXYZPNP
+ + renderBlocks.aoLightValueScratchXZPP) / 4.0F;
+ float aoMixedXYZPPP = (aoLightValue + renderBlocks.aoLightValueScratchYZPP
+ + renderBlocks.aoLightValueScratchXZPP
+ + renderBlocks.aoLightValueScratchXYZPPP) / 4.0F;
aoTopLeft = (float) (aoMixedXYZNPP * renderBlocks.renderMaxY * (1.0D - renderBlocks.renderMinX)
+ aoMixedXYZPPP * renderBlocks.renderMaxY * renderBlocks.renderMinX
diff --git a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java
index 50566f79a3..112fcd93cb 100644
--- a/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java
+++ b/src/main/java/gregtech/api/util/WorldSpawnedEventBuilder.java
@@ -3,6 +3,7 @@ package gregtech.api.util;
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
+
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.Vec3;
@@ -10,6 +11,7 @@ import net.minecraft.world.World;
@SuppressWarnings("unused")
public abstract class WorldSpawnedEventBuilder implements Runnable {
+
private static final String ILLEGAL_STATE_STR1 = "Position, identifier and world must be set";
/* Variables */
@@ -47,6 +49,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
/* Interfaces */
private interface IPositionedWorldSpawnedEvent {
+
Vec3 getPosition();
IPositionedWorldSpawnedEvent setPosition(Vec3 position);
@@ -55,18 +58,21 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
private interface IEntityWorldSpawnedEvent {
+
Entity getEntity();
IEntityWorldSpawnedEvent setEntity(Entity entity);
}
private interface IEntityPlayerWorldSpawnedEvent {
+
EntityPlayer getEntityPlayer();
IEntityPlayerWorldSpawnedEvent setEntityPlayer(EntityPlayer entity);
}
private interface IStringIdentifierWorldSpawnedEvent {
+
String getIdentifier();
IStringIdentifierWorldSpawnedEvent setIdentifier(String identifier);
@@ -75,6 +81,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
}
private interface ISoundWorldSpawnedEvent {
+
float getPitch();
float getVolume();
@@ -128,6 +135,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
private abstract static class PositionedWorldSpawnedEventBuilder extends WorldSpawnedEventBuilder
implements IPositionedWorldSpawnedEvent {
+
private Vec3 position;
@Override
@@ -150,6 +158,7 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
private abstract static class StringIdentifierPositionedWorldSpawnedEventBuilder
extends PositionedWorldSpawnedEventBuilder implements IStringIdentifierWorldSpawnedEvent {
+
private String identifier;
@Override
@@ -249,15 +258,14 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
if (getPosition() == null || getIdentifier() == null || getMotion() == null || getWorld() == null)
throw new IllegalStateException("Position, identifier, motion and world must be set");
- getWorld()
- .spawnParticle(
- getIdentifier(),
- getPosition().xCoord,
- getPosition().yCoord,
- getPosition().zCoord,
- getMotion().xCoord,
- getMotion().yCoord,
- getMotion().zCoord);
+ getWorld().spawnParticle(
+ getIdentifier(),
+ getPosition().xCoord,
+ getPosition().yCoord,
+ getPosition().zCoord,
+ getMotion().xCoord,
+ getMotion().yCoord,
+ getMotion().zCoord);
}
}
@@ -303,14 +311,13 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
if (getPosition() == null || getIdentifier() == null || getWorld() == null)
throw new IllegalStateException(ILLEGAL_STATE_STR1);
- getWorld()
- .playSoundEffect(
- getPosition().xCoord,
- getPosition().yCoord,
- getPosition().zCoord,
- getIdentifier(),
- getPitch(),
- getVolume());
+ getWorld().playSoundEffect(
+ getPosition().xCoord,
+ getPosition().yCoord,
+ getPosition().zCoord,
+ getIdentifier(),
+ getPitch(),
+ getVolume());
}
}
@@ -362,15 +369,14 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
if (getPosition() == null || getIdentifier() == null || getWorld() == null)
throw new IllegalStateException(ILLEGAL_STATE_STR1);
- getWorld()
- .playSound(
- getPosition().xCoord,
- getPosition().yCoord,
- getPosition().zCoord,
- getIdentifier(),
- getPitch(),
- getVolume(),
- isProximity());
+ getWorld().playSound(
+ getPosition().xCoord,
+ getPosition().yCoord,
+ getPosition().zCoord,
+ getIdentifier(),
+ getPitch(),
+ getVolume(),
+ isProximity());
}
}
@@ -404,12 +410,16 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
if (getPosition() == null || getIdentifier() == null || getWorld() == null)
throw new IllegalStateException(ILLEGAL_STATE_STR1);
- getWorld().playRecord(getIdentifier(), (int) getPosition().xCoord, (int) getPosition().yCoord, (int)
- getPosition().zCoord);
+ getWorld().playRecord(
+ getIdentifier(),
+ (int) getPosition().xCoord,
+ (int) getPosition().yCoord,
+ (int) getPosition().zCoord);
}
}
public static final class ExplosionEffectEventBuilder extends PositionedEntityWorldSpawnedEventBuilder {
+
private boolean isFlaming, isSmoking;
private float strength;
@@ -460,15 +470,14 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
if (getPosition() == null || getWorld() == null)
throw new IllegalStateException("Position and world must be set");
- getWorld()
- .newExplosion(
- getEntity(),
- getPosition().xCoord,
- getPosition().yCoord,
- getPosition().zCoord,
- strength,
- isFlaming,
- isSmoking);
+ getWorld().newExplosion(
+ getEntity(),
+ getPosition().xCoord,
+ getPosition().yCoord,
+ getPosition().zCoord,
+ strength,
+ isFlaming,
+ isSmoking);
}
}
@@ -521,13 +530,12 @@ public abstract class WorldSpawnedEventBuilder implements Runnable {
if (getEntityPlayer() == null || getPosition() == null || getWorld() == null)
throw new IllegalStateException("EntityPlayer, position and world must be set");
- getWorld()
- .extinguishFire(
- getEntityPlayer(),
- (int) getPosition().xCoord,
- (int) getPosition().yCoord,
- (int) getPosition().zCoord,
- side);
+ getWorld().extinguishFire(
+ getEntityPlayer(),
+ (int) getPosition().xCoord,
+ (int) getPosition().yCoord,
+ (int) getPosition().zCoord,
+ side);
}
}
diff --git a/src/main/java/gregtech/api/util/extensions/ArrayExt.java b/src/main/java/gregtech/api/util/extensions/ArrayExt.java
index 51486bc036..b6ebb07d38 100644
--- a/src/main/java/gregtech/api/util/extensions/ArrayExt.java
+++ b/src/main/java/gregtech/api/util/extensions/ArrayExt.java
@@ -3,6 +3,7 @@ package gregtech.api.util.extensions;
import java.util.function.IntFunction;
public class ArrayExt {
+
public static int[] of(int... objects) {
return objects;
}
diff --git a/src/main/java/gregtech/api/util/extensions/IteratorExt.java b/src/main/java/gregtech/api/util/extensions/IteratorExt.java
index 8662870921..3cbae1c598 100644
--- a/src/main/java/gregtech/api/util/extensions/IteratorExt.java
+++ b/src/main/java/gregtech/api/util/extensions/IteratorExt.java
@@ -1,9 +1,11 @@
package gregtech.api.util.extensions;
-import gregtech.api.objects.iterators.MergedIterator;
import java.util.Iterator;
+import gregtech.api.objects.iterators.MergedIterator;
+
public class IteratorExt {
+
@SafeVarargs
public static <T> Iterator<T> merge(Iterator<T>... iterators) {
return new MergedIterator<>(iterators);