diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod')
4 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java index 05ab3c8711..73e01bac7a 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java @@ -69,7 +69,7 @@ public enum CustomCombs { public final int chance; private final String name; - private CustomCombs(String pName, boolean show, Materials material, int chance) { + CustomCombs(String pName, boolean show, Materials material, int chance) { this.name = pName; this.material = material; this.chance = chance; diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java index 0ff3625a25..e136b825e6 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/ItemCustomComb.java @@ -82,13 +82,12 @@ public class ItemCustomComb extends Item { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(CustomCombs.values().length - 1, stack.getItemDamage())); - int colour = CustomCombs.values()[meta].getColours()[0]; - + final CustomCombs[] COMB_VALUES = CustomCombs.values(); + int meta = Math.max(0, Math.min(COMB_VALUES.length - 1, stack.getItemDamage())); + int colour = COMB_VALUES[meta].getColours()[0]; if (pass >= 1) { - colour = CustomCombs.values()[meta].getColours()[1]; + colour = COMB_VALUES[meta].getColours()[1]; } - return colour; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java index ad351caf55..a5ff70f047 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvDistillationTower.java @@ -317,7 +317,7 @@ public class MTEAdvDistillationTower extends GTPPMultiBlockBase<MTEAdvDistillati @Override public void loadNBTData(NBTTagCompound aNBT) { - mMode = Mode.values()[aNBT.getByte("mMode")]; + mMode = Mode.VALUES[aNBT.getByte("mMode")]; mUpgraded = aNBT.getBoolean("mUpgraded"); super.loadNBTData(aNBT); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java index 86c4eb628f..204cd5e6b9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTETreeFarm.java @@ -348,7 +348,8 @@ public class MTETreeFarm extends GTPPMultiBlockBase<MTETreeFarm> implements ISur int tierMultiplier = getTierMultiplier(tier); List<ItemStack> outputs = new ArrayList<>(); - for (Mode mode : Mode.values()) { + final Mode[] MODE_VALUES = Mode.values(); + for (Mode mode : MODE_VALUES) { ItemStack output = outputPerMode.get(mode); if (output == null) continue; // This sapling has no output in this mode. @@ -379,7 +380,7 @@ public class MTETreeFarm extends GTPPMultiBlockBase<MTETreeFarm> implements ISur duration = TICKS_PER_OPERATION; calculatedEut = GTValues.VP[tier]; - for (Mode mode : Mode.values()) { + for (Mode mode : MODE_VALUES) { if (outputPerMode.get(mode) != null) { useToolForMode(mode, true); } @@ -780,10 +781,11 @@ public class MTETreeFarm extends GTPPMultiBlockBase<MTETreeFarm> implements ISur * the mode multiplier, but not tool/tier multipliers as those can change dynamically. If the sapling has an * output in this mode, also add the tools usable for this mode as inputs. */ - ItemStack[][] inputStacks = new ItemStack[Mode.values().length][]; - ItemStack[] outputStacks = new ItemStack[Mode.values().length]; + final Mode[] MODE_VALUES = Mode.values(); + ItemStack[][] inputStacks = new ItemStack[MODE_VALUES.length][]; + ItemStack[] outputStacks = new ItemStack[MODE_VALUES.length]; - for (Mode mode : Mode.values()) { + for (Mode mode : MODE_VALUES) { ItemStack output = switch (mode) { case LOG -> log; case SAPLING -> saplingOut; |
