aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/items
diff options
context:
space:
mode:
authorchill <chill.gtnh@outlook.com>2023-06-05 06:51:28 +0200
committerGitHub <noreply@github.com>2023-06-05 06:51:28 +0200
commitdb089891a20e5696096907864578e39586035e6e (patch)
treee56d68eb64c3b8025193930b68e731b23d0f60d9 /src/main/java/gregtech/common/items
parentdd9bbe334a00a0435502ac502d4155bfa12d123d (diff)
downloadGT5-Unofficial-db089891a20e5696096907864578e39586035e6e.tar.gz
GT5-Unofficial-db089891a20e5696096907864578e39586035e6e.tar.bz2
GT5-Unofficial-db089891a20e5696096907864578e39586035e6e.zip
Code cleanup (#2040)
* remove redundant suppressions * prettify commented code * improve comments The integer comment contradicted the code, so I deleted it. * delete commented-out code * update bitwise int flip from XOR to the dedicated tilda operator The flip was a 32-bit XOR, which is an int-flip. That XOR was replaced with an equivalent tilda operator. * convert a field to inline This field was used only once, so put it straight to where it is used. * remove fluid fix since no-one uses Forge version 1355 or earlier * unwrap switches where fitting In some places, we suppress IntelliJ's inspection RedundantLabeledSwitchRuleCodeBlock - we don't want to unwrap some of the suggested cases because we want to keep the consistency in a switch statement for the sake of readability. * fuse "collect" into Stream API * fix javadocs * remove unnecessary public modifiers from an interface Members of an interface are public by default. * move common parts outside of if * suppress OverrideOnly warning in a javadoc * remove unused lock * suppress warnings about unchecked casts These warnings require non-trivial fixes that are yet to arrive. For now, let's suppress them to reduce the warning-bloat. * remove outdated comment * remove final modifier from private methods Because they are private, it is hard to accidentally overwrite them. Therefore, the final modifier is redundant in this case. * refactor getIcon The first 'if' doesn't cover only tMeta == 9 && mConnectedMachineTextures, therefore the second if can be unrolled. The last switch is redundant because all tMeta values are covered by switches, but let's keep SOLID_STEEL as a fallback just in case. * explain what the casings are and why block casings are split * suppress switch-to-if suggestion * remove unnecessary null check The null is handled in doGenerateItem() * address redundant local variables * rename variables in onTick * suppress warning about accessing static member via instance * rephrase exception * rephrase javadoc * address field-can-be-final warnings * remove empty methods * enum cannot inherit, so protected is redundant * remove redundant throws * update imports to be not wildcard * remove unnecessary try-catch * update for loop * remove redundant code in order to use the diamond operator * update instanceof to use pattern variables * replace blank lines with <p> in javadocs * fix dangling javadocs * suppress warning about unreachable methods in javadocs * remove redundant operation * add the descriptions of parameters in javadocs Also fix javadocs along the way. * relax returned type in javadoc That was done in order to make the docs reflect the code more often. Otherwise, people may forget to change the returned type again with another change. * make long conversion explicit Integer multiplication can give a wrong result if one of the parts is not explicitly cast to long. Let's cast one of the parts where applicable. * remove unary plus * simplify unary minus * use addAll instead of forEach,add It was suggested by IntelliJ to replace the iteration with a bulk operation to improve performance. * replace .asList with .singletonList for consistency * simplify toArray calls Explanation from IntelliJ: There are two styles to convert a collection to an array: * A pre-sized array, for example, c.toArray(new String[c.size()]) * An empty array, for example, c.toArray(new String[0]) In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the size and toArray calls. This may result in extra nulls at the end of the array if the collection was concurrently shrunk during the operation. * split StringBuilder append Explanation by IntelliJ: Reports String concatenation used as the argument to appends. Such calls may profitably be turned into chained append calls on the existing StringBuilder saving the cost of an extra StringBuilder allocation. This inspection ignores compile-time evaluated String concatenations, in which case the conversion would only worsen performance. * annotate overriding methods with @Nonnull where needed The method that was overridden has @Nonnull so the method that is overriding should also have @Nonnull. * remove set adding itself to itself * remove null check because findField either works or blows up cpw.mods.fml.relauncher.ReflectionHelper::findField either returns a non-null value or throws a RuntimeException, so no need to check of null. * remove slot comparison with tInventory.length slot max value is 127 when tInventory.length is set to 256, which results in that the condition is always true and unnecessary. * remove aOutput2 null check As GT_Values.NI is null, there is no need to check aOutput2 for null again * suppress the suggestion to delete tMeta < 13 mConnectedMachineTextures can change, so tMeta range is not guaranteed * remove aCoverVariable % 3 < 2 the if above already limits the result of % 3 to "2", so the condition "less than 2" is always false. * unwrap "if" because bonus is unchanged Unwrap if because even if the bonus is a variable, it hasn't been changed for the past 8 years and is unlikely to be changed in the future. * reformat javadoc * improve ignoring an exception Make them either more clear or concise * fixup fix typo * update deprecated calls of newInstance() * remove testing BaseMetaTileEntity GregTech_API.constructBaseMetaTileEntity() checks the creation by itself, logging and throwing a runtime error if failed. * unwrap hatch-fill for do_SolarSalt To reach this branch, do_coolant needs to be false and we need to still be in the function, which means that do_SolarSalt was set to true in the previous top-tier "if". * remove always-false input-bus checks of MTE PlasmaForge size() is non-negative, and the values it is compared to are final and 0. * length and size are non-negative Therefore, there's no need to check their negativity * aOutput is guaranteed to be positive * tThereWasARecipe is always false when reached in its first occurrence * convert an assert into if Only tStack 2 is checked for null because if it isn't null then tStack1 also isn't null based on the "if" above. Also IntelliJ was sure that tStack is not null for some reason. On a side note, assertions work only either with a specified flag or in debug runs. Therefore, it is dangerous to rely on them. * simplify stone-gravel-cobble if tBlock != Blocks.stone because of the if at the start of the method. for the last else-if, tBlock == Blocks.gravel because of the check slightly above the change. * interDimensional is always true because of the first if * convert an example to javadoc * remove always-false statements * replace referential string equality with equals If we compare strings by "==", we compare references to them, which is not what we usually want. I wasn't sure if String Pool works here, so I played it save with equals(). * use Automatic Resource Management for AutoCloseable ByteBufOutputStream * add todo to swap from sleep to event bus * null is checked by instanceof * merge switch branches * add a TODO to use clamp() * new String declaration is redundant * use getOrDefault for a map * replace StringBuilder with concatenation where fitting Using a StringBuilder to concatenate two string will not make the program faster or more understandable, so I swapped it to concatenation. * remove unnecessary continue * flip if * remove redundant returns * unwrap ifs It's checked at the top "if" that aType == IItemRenderer.ItemRenderType.INVENTORY, so all aType.equals(IItemRenderer.ItemRenderType.INVENTORY below are always true. * remove checking all GT VERSIONs except the API one * remove version check from GT_Mod and delete respective VERSION fields Aside from GregTech_API.VERSION, these fields are not used anywhere in the project, so only GregTech_API.VERSION was kept. The idea and the usage check were done by miozune.
Diffstat (limited to 'src/main/java/gregtech/common/items')
-rw-r--r--src/main/java/gregtech/common/items/CombType.java9
-rw-r--r--src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java20
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java104
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java17
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java35
-rw-r--r--src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java55
-rw-r--r--src/main/java/gregtech/common/items/GT_SensorCard_Item.java7
-rw-r--r--src/main/java/gregtech/common/items/ItemComb.java19
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java5
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java2
-rw-r--r--src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java12
11 files changed, 207 insertions, 78 deletions
diff --git a/src/main/java/gregtech/common/items/CombType.java b/src/main/java/gregtech/common/items/CombType.java
index f3231ac94c..cb746ca32e 100644
--- a/src/main/java/gregtech/common/items/CombType.java
+++ b/src/main/java/gregtech/common/items/CombType.java
@@ -216,7 +216,6 @@ public enum CombType {
public final int chance;
private final int id;
- private final String name;
private final String localizedName;
private final int[] color;
@@ -228,16 +227,16 @@ public enum CombType {
ItemComb.Voltage voltage) {
if (id < 0 && !"INVALIDCOMB".equals(pName)) throw new IllegalArgumentException();
this.id = id;
- this.name = pName;
this.voltage = voltage;
this.material = material;
this.chance = chance;
this.showInList = show;
this.color = new int[] { color1, color2 };
this.localizedName = GT_LanguageManager.addStringLocalization(
- "comb." + this.name,
- this.name.substring(0, 1)
- .toUpperCase() + this.name.substring(1) + " Comb");
+ "comb." + pName,
+ pName.substring(0, 1)
+ .toUpperCase() + pName.substring(1)
+ + " Comb");
}
public void setHidden() {
diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java
index 76c5de859c..0dc5000e7a 100644
--- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java
+++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java
@@ -50,7 +50,7 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo
private static final String aTextEmptyRow = " ";
private static final List<ItemStack> ALL_VARIANTS = new ArrayList<>();
- protected IIcon[] mIconDamage = new IIcon[25];
+ protected final IIcon[] mIconDamage = new IIcon[25];
public GT_IntegratedCircuit_Item() {
super("integrated_circuit", "Programmed Circuit", "");
@@ -189,22 +189,14 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item implements INetwo
public void addAdditionalToolTips(List<String> aList, ItemStack aStack, EntityPlayer aPlayer) {
super.addAdditionalToolTips(aList, aStack, aPlayer);
aList.add(
- GT_LanguageManager.addStringLocalization(
- new StringBuilder().append(getUnlocalizedName())
- .append(".configuration")
- .toString(),
- "Configuration: ") + getConfigurationString(getDamage(aStack)));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".configuration", "Configuration: ")
+ + getConfigurationString(getDamage(aStack)));
aList.add(
- GT_LanguageManager.addStringLocalization(
- new StringBuilder().append(getUnlocalizedName())
- .append(".tooltip.0")
- .toString(),
- "Right click to reconfigure"));
+ GT_LanguageManager
+ .addStringLocalization(getUnlocalizedName() + ".tooltip.0", "Right click to reconfigure"));
aList.add(
GT_LanguageManager.addStringLocalization(
- new StringBuilder().append(getUnlocalizedName())
- .append(".tooltip.1")
- .toString(),
+ getUnlocalizedName() + ".tooltip.1",
"Needs a screwdriver or circuit programming tool"));
}
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
index 3555bf1335..34b922b43d 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java
@@ -1,7 +1,37 @@
package gregtech.common.items;
import static gregtech.api.enums.Mods.GalacticraftMars;
-import static gregtech.api.enums.Textures.BlockIcons.*;
+import static gregtech.api.enums.Textures.BlockIcons.COVER_WOOD_PLATE;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ACTIVITYDETECTOR_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ARM;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_CONTROLLER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_CONVEYOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_CRAFTING;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DRAIN;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ENERGYDETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUIDDETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_FLUID_STORAGE_MONITOR0;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ITEMDETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_MAINTENANCE_DETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PUMP;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_REDSTONE_RECEIVER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_REDSTONE_TRANSMITTER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCREEN;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SCREEN_GLOW;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_SHUTTER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_VALVE;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_8V;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_EV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_HV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_IV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_LV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_LuV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_MV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UV;
+import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_ZPM;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCannerRecipes;
@@ -9,7 +39,19 @@ import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
import static gregtech.api.util.GT_RecipeBuilder.MINUTES;
import static gregtech.api.util.GT_RecipeBuilder.SECONDS;
import static gregtech.api.util.GT_RecipeBuilder.TICKS;
-import static gregtech.client.GT_TooltipHandler.Tier.*;
+import static gregtech.client.GT_TooltipHandler.Tier.ERV;
+import static gregtech.client.GT_TooltipHandler.Tier.EV;
+import static gregtech.client.GT_TooltipHandler.Tier.HV;
+import static gregtech.client.GT_TooltipHandler.Tier.IV;
+import static gregtech.client.GT_TooltipHandler.Tier.LV;
+import static gregtech.client.GT_TooltipHandler.Tier.LuV;
+import static gregtech.client.GT_TooltipHandler.Tier.MAX;
+import static gregtech.client.GT_TooltipHandler.Tier.MV;
+import static gregtech.client.GT_TooltipHandler.Tier.ULV;
+import static gregtech.client.GT_TooltipHandler.Tier.UMV;
+import static gregtech.client.GT_TooltipHandler.Tier.UV;
+import static gregtech.client.GT_TooltipHandler.Tier.UXV;
+import static gregtech.client.GT_TooltipHandler.Tier.ZPM;
import static gregtech.client.GT_TooltipHandler.registerTieredTooltip;
import java.util.Collection;
@@ -52,8 +94,43 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
-import gregtech.common.covers.*;
-import gregtech.common.items.behaviors.*;
+import gregtech.common.covers.GT_Cover_Arm;
+import gregtech.common.covers.GT_Cover_ControlsWork;
+import gregtech.common.covers.GT_Cover_Conveyor;
+import gregtech.common.covers.GT_Cover_Crafting;
+import gregtech.common.covers.GT_Cover_DoesWork;
+import gregtech.common.covers.GT_Cover_Drain;
+import gregtech.common.covers.GT_Cover_EUMeter;
+import gregtech.common.covers.GT_Cover_FluidLimiter;
+import gregtech.common.covers.GT_Cover_FluidRegulator;
+import gregtech.common.covers.GT_Cover_FluidStorageMonitor;
+import gregtech.common.covers.GT_Cover_Fluidfilter;
+import gregtech.common.covers.GT_Cover_ItemFilter;
+import gregtech.common.covers.GT_Cover_ItemMeter;
+import gregtech.common.covers.GT_Cover_LiquidMeter;
+import gregtech.common.covers.GT_Cover_NeedMaintainance;
+import gregtech.common.covers.GT_Cover_PlayerDetector;
+import gregtech.common.covers.GT_Cover_Pump;
+import gregtech.common.covers.GT_Cover_RedstoneReceiverExternal;
+import gregtech.common.covers.GT_Cover_RedstoneReceiverInternal;
+import gregtech.common.covers.GT_Cover_RedstoneTransmitterExternal;
+import gregtech.common.covers.GT_Cover_RedstoneTransmitterInternal;
+import gregtech.common.covers.GT_Cover_Screen;
+import gregtech.common.covers.GT_Cover_Shutter;
+import gregtech.common.covers.GT_Cover_SolarPanel;
+import gregtech.common.covers.GT_Cover_SteamRegulator;
+import gregtech.common.covers.GT_Cover_SteamValve;
+import gregtech.common.items.behaviors.Behaviour_Arrow_Potion;
+import gregtech.common.items.behaviors.Behaviour_Cover_Tool;
+import gregtech.common.items.behaviors.Behaviour_DataOrb;
+import gregtech.common.items.behaviors.Behaviour_DataStick;
+import gregtech.common.items.behaviors.Behaviour_Lighter;
+import gregtech.common.items.behaviors.Behaviour_PrintedPages;
+import gregtech.common.items.behaviors.Behaviour_Scanner;
+import gregtech.common.items.behaviors.Behaviour_SensorKit;
+import gregtech.common.items.behaviors.Behaviour_Sonictron;
+import gregtech.common.items.behaviors.Behaviour_Spray_Color;
+import gregtech.common.items.behaviors.Behaviour_WrittenBook;
public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
@@ -684,11 +761,6 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L),
new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)));
- // GT_ModHandler.addCraftingRecipe(ItemList.Shape_Empty.get(1L, new Object[0]),
- // GT_ModHandler.RecipeBits.MIRRORED | GT_ModHandler.RecipeBits.BUFFERED |
- // GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"hf", "PP", "PP",
- // 'P', OrePrefixes.plate.get(Materials.Steel)});
-
ItemList.Shape_Mold_Plate.set(addItem(tLastID = 301, "Mold (Plate)", "Mold for making Plates"));
ItemList.Shape_Mold_Casing.set(addItem(tLastID = 302, "Mold (Casing)", "Mold for making Item Casings"));
ItemList.Shape_Mold_Gear.set(addItem(tLastID = 303, "Mold (Gear)", "Mold for making Gears"));
@@ -1349,10 +1421,6 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
ItemList.Ingot_Heavy3
.set(addItem(tLastID = 464, "Heavy Duty Alloy Ingot T3", "Used to make Heavy Duty Plates T3"));
- // GT_ModHandler.addCraftingRecipe(ItemList.Ingot_Heavy1.get(1L, new Object[0]),
- // GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"BhB", "CAS", "B B", 'B',
- // OrePrefixes.bolt.get(Materials.StainlessSteel), 'C', OrePrefixes.compressed.get(Materials.Bronze), 'A',
- // OrePrefixes.compressed.get(Materials.Aluminium), 'S', OrePrefixes.compressed.get(Materials.Steel)});
}
ItemList.Ingot_IridiumAlloy.set(
addItem(
@@ -1362,16 +1430,6 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 {
new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L),
new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 4L)));
- // GT_ModHandler.addRollingMachineRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]), new Object[]{"IAI",
- // "ADA", "IAI", 'D', GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true)
- // ? OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A',
- // OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)});
- // GT_ModHandler.addCraftingRecipe(ItemList.Ingot_IridiumAlloy.get(1L, new Object[0]),
- // GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"IAI", "ADA", "IAI", 'D',
- // GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.harderrecipes, "iridiumplate", true) ?
- // OreDictNames.craftingIndustrialDiamond : OrePrefixes.dust.get(Materials.Diamond), 'A',
- // OrePrefixes.plateAlloy.get("Advanced"), 'I', OrePrefixes.plate.get(Materials.Iridium)});
-
ItemList.Paper_Printed_Pages.set(
addItem(
tLastID = 481,
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java
index 5e339b51d5..d652b68714 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_02.java
@@ -1,7 +1,12 @@
package gregtech.common.items;
import static gregtech.api.enums.Mods.Forestry;
-import static gregtech.api.enums.Textures.BlockIcons.*;
+import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ADVANCED_REDSTONE_RECEIVER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ADVANCED_REDSTONE_TRANSMITTER;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_WIRELESS_FLUID_DETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_WIRELESS_ITEM_DETECTOR;
+import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_WIRELESS_MAINTENANCE_DETECTOR;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sCompressorRecipes;
import static gregtech.api.util.GT_RecipeBuilder.MINUTES;
@@ -23,7 +28,15 @@ import net.minecraft.potion.Potion;
import net.minecraft.world.World;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.MaterialsUEVplus;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.TierEU;
import gregtech.api.items.GT_MetaGenerated_Item_X32;
import gregtech.api.objects.ItemData;
import gregtech.api.render.TextureFactory;
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java
index 8218195e32..e0fdb1911d 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_03.java
@@ -3,11 +3,29 @@ package gregtech.common.items;
import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UEV;
import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UHV;
import static gregtech.api.enums.Textures.BlockIcons.SOLARPANEL_UIV;
-import static gregtech.client.GT_TooltipHandler.Tier.*;
+import static gregtech.client.GT_TooltipHandler.Tier.EV;
+import static gregtech.client.GT_TooltipHandler.Tier.HV;
+import static gregtech.client.GT_TooltipHandler.Tier.IV;
+import static gregtech.client.GT_TooltipHandler.Tier.LV;
+import static gregtech.client.GT_TooltipHandler.Tier.LuV;
+import static gregtech.client.GT_TooltipHandler.Tier.MAX;
+import static gregtech.client.GT_TooltipHandler.Tier.MV;
+import static gregtech.client.GT_TooltipHandler.Tier.UEV;
+import static gregtech.client.GT_TooltipHandler.Tier.UHV;
+import static gregtech.client.GT_TooltipHandler.Tier.UIV;
+import static gregtech.client.GT_TooltipHandler.Tier.ULV;
+import static gregtech.client.GT_TooltipHandler.Tier.UMV;
+import static gregtech.client.GT_TooltipHandler.Tier.UV;
+import static gregtech.client.GT_TooltipHandler.Tier.UXV;
+import static gregtech.client.GT_TooltipHandler.Tier.ZPM;
import static gregtech.client.GT_TooltipHandler.registerTieredTooltip;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
import gregtech.api.items.GT_MetaGenerated_Item_X32;
import gregtech.api.render.TextureFactory;
import gregtech.api.util.GT_OreDictUnificator;
@@ -28,18 +46,18 @@ public class GT_MetaGenerated_Item_03 extends GT_MetaGenerated_Item_X32 {
INSTANCE = this;
Object[] o = new Object[0];
- /**
+ /*
* circuit boards tier 1-7: coated circuit board / wood plate + resin Plastic Circuit Board / Plastic + Copper
* Foil + Sulfuric Acid phenolic circuit board /carton+glue+chemical bath epoxy circuit board /epoxy plate +
* copper foil + sulfuric acid fiberglass circuit board (simple + multilayer) / glass + plastic + electrum foil
- * + sulfurci acid wetware lifesupport board / fiberglass CB + teflon +
+ * + sulfuric acid wetware lifesupport board / fiberglass CB + teflon +
*/
ItemList.Circuit_Board_Wetware
.set(addItem(6, "Wetware Lifesupport Circuit Board", "The Board that keeps life", o));
ItemList.Circuit_Board_Plastic.set(addItem(7, "Plastic Circuit Board", "A Good Board", o));
ItemList.Circuit_Board_Bio.set(addItem(8, "Bio Circuit Board", "Bio genetic mutated Board", o));
- /**
+ /*
* electronic components: vacuum tube (glass tube + red alloy cables) basic electronic circuits normal+smd coils
* diodes normal+smd transistors normal+smd capacitors normal+smd Glass Fibers
*/
@@ -142,16 +160,13 @@ public class GT_MetaGenerated_Item_03 extends GT_MetaGenerated_Item_X32 {
ItemList.Circuit_Parts_InductorSMD.get(1L),
true);
- /**
+ /*
* ICs Lenses made from perfect crystals first instead of plates Monocrystalline silicon ingot
* (normal+glowstone+naquadah) EBF, normal silicon no EBF need anymore wafer(normal+glowstone+naquadah) cut mono
* silicon ingot in cutting machine
- *
* Integrated Logic Circuit(8bit DIP) RAM NAND Memory NOR Memory CPU (4 sizes) SoCs(2 sizes, high tier cheap low
* tech component) Power IC/High Power IC/Ultra High power
- *
* nanotube interconnected circuit (H-IC + nanotubes)
- *
* quantum chips
*/
ItemList.Circuit_Silicon_Ingot.set(addItem(30, "Monocrystalline Silicon Boule", "Raw Circuit", o));
@@ -229,7 +244,7 @@ public class GT_MetaGenerated_Item_03 extends GT_MetaGenerated_Item_X32 {
ItemList.Circuit_Wafer_Bioware.set(addItem(188, "Living Bio Wafer", "Raw Circuit", o));
ItemList.Circuit_Parts_Chip_Bioware.set(addItem(189, "Living Bio Chip", "Needed for Circuits", o));
- /**
+ /*
* Engraved Crystal Chip Engraved Lapotron Chip Crystal CPU SoCrystal stem cells (disassemble eggs)
*/
ItemList.Circuit_Chip_CrystalSoC2
diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java
index 5ea7dadfa6..f7d9bbb236 100644
--- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java
+++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Tool_01.java
@@ -5,12 +5,61 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.ToolDictNames;
import gregtech.api.items.GT_MetaGenerated_Tool;
import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.common.tools.*;
-import gregtech.common.tools.pocket.*;
+import gregtech.common.tools.GT_Tool_Axe;
+import gregtech.common.tools.GT_Tool_BranchCutter;
+import gregtech.common.tools.GT_Tool_ButcheryKnife;
+import gregtech.common.tools.GT_Tool_BuzzSaw;
+import gregtech.common.tools.GT_Tool_Chainsaw_HV;
+import gregtech.common.tools.GT_Tool_Chainsaw_LV;
+import gregtech.common.tools.GT_Tool_Chainsaw_MV;
+import gregtech.common.tools.GT_Tool_Crowbar;
+import gregtech.common.tools.GT_Tool_Drill_HV;
+import gregtech.common.tools.GT_Tool_Drill_LV;
+import gregtech.common.tools.GT_Tool_Drill_MV;
+import gregtech.common.tools.GT_Tool_File;
+import gregtech.common.tools.GT_Tool_HardHammer;
+import gregtech.common.tools.GT_Tool_Hoe;
+import gregtech.common.tools.GT_Tool_JackHammer;
+import gregtech.common.tools.GT_Tool_Knife;
+import gregtech.common.tools.GT_Tool_Mortar;
+import gregtech.common.tools.GT_Tool_Pickaxe;
+import gregtech.common.tools.GT_Tool_Plow;
+import gregtech.common.tools.GT_Tool_Plunger;
+import gregtech.common.tools.GT_Tool_RollingPin;
+import gregtech.common.tools.GT_Tool_Saw;
+import gregtech.common.tools.GT_Tool_Scoop;
+import gregtech.common.tools.GT_Tool_Screwdriver;
+import gregtech.common.tools.GT_Tool_Screwdriver_LV;
+import gregtech.common.tools.GT_Tool_Sense;
+import gregtech.common.tools.GT_Tool_Shovel;
+import gregtech.common.tools.GT_Tool_SoftHammer;
+import gregtech.common.tools.GT_Tool_Soldering_Iron;
+import gregtech.common.tools.GT_Tool_Sword;
+import gregtech.common.tools.GT_Tool_Turbine_Huge;
+import gregtech.common.tools.GT_Tool_Turbine_Large;
+import gregtech.common.tools.GT_Tool_Turbine_Normal;
+import gregtech.common.tools.GT_Tool_Turbine_Small;
+import gregtech.common.tools.GT_Tool_UniversalSpade;
+import gregtech.common.tools.GT_Tool_WireCutter;
+import gregtech.common.tools.GT_Tool_Wrench;
+import gregtech.common.tools.GT_Tool_Wrench_HV;
+import gregtech.common.tools.GT_Tool_Wrench_LV;
+import gregtech.common.tools.GT_Tool_Wrench_MV;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_BranchCutter;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_File;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_Knife;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_Multitool;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_Saw;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_Screwdriver;
+import gregtech.common.tools.pocket.GT_Tool_Pocket_WireCutter;
public class GT_MetaGenerated_Tool_01 extends GT_MetaGenerated_Tool {
diff --git a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java
index ac2eba776c..024b089812 100644
--- a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java
+++ b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java
@@ -19,7 +19,12 @@ import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
import gregtech.api.items.GT_Generic_Item;
import gregtech.api.util.GT_LanguageManager;
-import shedar.mods.ic2.nuclearcontrol.api.*;
+import shedar.mods.ic2.nuclearcontrol.api.CardState;
+import shedar.mods.ic2.nuclearcontrol.api.ICardWrapper;
+import shedar.mods.ic2.nuclearcontrol.api.IPanelDataSource;
+import shedar.mods.ic2.nuclearcontrol.api.IRemoteSensor;
+import shedar.mods.ic2.nuclearcontrol.api.PanelSetting;
+import shedar.mods.ic2.nuclearcontrol.api.PanelString;
public class GT_SensorCard_Item extends GT_Generic_Item implements IRemoteSensor, IPanelDataSource {
diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java
index 9a8adb5cab..791bc336ff 100644
--- a/src/main/java/gregtech/common/items/ItemComb.java
+++ b/src/main/java/gregtech/common/items/ItemComb.java
@@ -1556,12 +1556,13 @@ public class ItemComb extends Item implements IGT_ItemWithMaterialRenderer {
addFluidExtractorProcess(CombType.FLUORINE, Materials.Fluorine.getGas(250), Voltage.MV);
addFluidExtractorProcess(CombType.OXYGEN, Materials.Oxygen.getGas(500), Voltage.MV);
// Organic part 2, unknown liquid
- // yes, unknowwater. Its not my typo, its how it is spelled. Stupid game.
+ // yes, unknowwater. It's not a typo, it's how it is spelled. Stupid game.
addFluidExtractorProcess(CombType.UNKNOWNWATER, FluidRegistry.getFluidStack("unknowwater", 250), Voltage.ZPM);
- /**
+ /*
+ * TODO: update this comment
* The Centrifuge Recipes for Infused Shards and Nether/End-Shard from the Infused Shard Line are below the
- * NobleGas Lines for Xenon and co. in Gt_MachineRecipeLoader.java In Lines 1525
- **/
+ * NobleGas Lines for Xenon and co. in GT_MachineRecipeLoader.java In Lines 1525
+ */
}
/**
@@ -1845,19 +1846,19 @@ public class ItemComb extends Item implements IGT_ItemWithMaterialRenderer {
int fluidAmount = this.getFluidAmount();
return switch (this.getVoltageFromEU()) {
case 0 ->
- /** ULV **/
+ /* ULV */
Materials.Water.getFluid(fluidAmount);
case 1 ->
- /** LV **/
+ /* LV */
Materials.SulfuricAcid.getFluid(fluidAmount);
case 2 ->
- /** MV **/
+ /* MV */
Materials.HydrochloricAcid.getFluid(fluidAmount);
case 3 ->
- /** HV **/
+ /* HV */
Materials.PhosphoricAcid.getFluid(fluidAmount);
case 4 ->
- /** EV **/
+ /* EV */
Materials.HydrofluoricAcid.getFluid(this.getFluidAmount());
default -> Materials.PhthalicAcid.getFluid(fluidAmount);
};
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java
index 305993c0d0..bb37e1e933 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Cover_Tool.java
@@ -18,7 +18,10 @@ import gregtech.api.enums.SoundResource;
import gregtech.api.interfaces.IItemBehaviour;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.items.GT_MetaBase_Item;
-import gregtech.api.util.*;
+import gregtech.api.util.GT_CoverBehaviorBase;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.ISerializableObject;
public class Behaviour_Cover_Tool extends Behaviour_None {
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
index 8893245639..ae0627446c 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataOrb.java
@@ -67,7 +67,7 @@ public class Behaviour_DataOrb extends Behaviour_None {
for (int i = 0; i < tNBT_ItemList.tagCount(); i++) {
NBTTagCompound tag = tNBT_ItemList.getCompoundTagAt(i);
byte slot = tag.getByte("Slot");
- if ((slot >= 0) && (slot < tInventory.length)) {
+ if (slot >= 0) {
tInventory[slot] = GT_Utility.loadItem(tag);
}
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
index 13e6622b47..e9db3195c2 100644
--- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
+++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java
@@ -38,15 +38,9 @@ public class Behaviour_DataStick extends Behaviour_None {
aList.add("Rocket Schematic Tier: " + sTier);
} else if (sTier >= 100) {
switch (sTier) {
- case 100 -> {
- aList.add("Moonbuggy Schematic");
- }
- case 101 -> {
- aList.add("Cargo-Rocket Schematic");
- }
- case 102 -> {
- aList.add("Astro-Miner Schematic");
- }
+ case 100 -> aList.add("Moonbuggy Schematic");
+ case 101 -> aList.add("Cargo-Rocket Schematic");
+ case 102 -> aList.add("Astro-Miner Schematic");
}
}
long lastUpdate = GT_Utility.ItemNBT.getNBT(aStack)