diff options
author | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-12-09 18:37:46 +0100 |
---|---|---|
committer | bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com> | 2019-12-09 18:37:46 +0100 |
commit | bde05cbe2d7ffa95a7dce10dc309788c5b0cbc72 (patch) | |
tree | 2bc8a51d35c7dfb5f1285cd4d16cf1b038d998d7 /src/main | |
parent | cc5710d5547f8766c6600e4f71962f4721fca505 (diff) | |
download | GT5-Unofficial-bde05cbe2d7ffa95a7dce10dc309788c5b0cbc72.tar.gz GT5-Unofficial-bde05cbe2d7ffa95a7dce10dc309788c5b0cbc72.tar.bz2 GT5-Unofficial-bde05cbe2d7ffa95a7dce10dc309788c5b0cbc72.zip |
Updated Copyright
+fixed or suppressed all warnings
Signed-off-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Former-commit-id: 72b19b4f3b8c4c2151559f06dc7455a045d7f28b
Diffstat (limited to 'src/main')
192 files changed, 699 insertions, 462 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java index f4b61a17ba..bdfdb29ca8 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/ASMUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,9 +32,9 @@ import java.io.OutputStream; public class ASMUtils { public static String matchAny(String toCompare, String... args) { - for (int i = 0; i < args.length; i++) { - if (toCompare.equalsIgnoreCase(args[i])) - return args[i]; + for (String arg : args) { + if (toCompare.equalsIgnoreCase(arg)) + return arg; } return ""; } @@ -43,8 +43,8 @@ public class ASMUtils { * Call this Method twice, one time for the Descriptor and one time for the Name. */ public static boolean isCorrectMethod(MethodNode methodNode, String... args) { - for (int i = 0; i < args.length; i++) { - if (methodNode.name.equalsIgnoreCase(args[i]) || methodNode.desc.equalsIgnoreCase(args[i])) + for (String arg : args) { + if (methodNode.name.equalsIgnoreCase(arg) || methodNode.desc.equalsIgnoreCase(arg)) return true; } return false; diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java index e6143a98d2..a4c8fe9dea 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,6 +42,7 @@ import java.util.List; import static com.github.bartimaeusnek.ASM.BWCoreTransformer.shouldTransform; +@SuppressWarnings("ALL") public class BWCore extends DummyModContainer { public static final String BWCORE_NAME = "BartWorks ASM Core"; diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java index 97f4702d4c..3d8811142d 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCorePlugin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -67,6 +67,7 @@ public class BWCorePlugin implements IFMLLoadingPlugin { } @Override + @SuppressWarnings("rawtypes") public void injectData(Map<String, Object> data) { if (data.get("runtimeDeobfuscationEnabled") != null) { BWCoreTransformer.obfs = (boolean) data.get("runtimeDeobfuscationEnabled"); diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java index 505612cd35..b239563656 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreStaticReplacementMethodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java index f880ed0321..4ec2f70142 100644 --- a/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java +++ b/src/main/java/com/github/bartimaeusnek/ASM/BWCoreTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -155,9 +155,8 @@ public class BWCoreTransformer implements IClassTransformer { String field_deObfs = "locationSunPng"; String field_src = "field_110928_i"; BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(methods.get(i), dsc_universal)) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs, name_Obfs, name_src) && ASMUtils.isCorrectMethod(toPatch, dsc_universal)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -225,9 +224,8 @@ public class BWCoreTransformer implements IClassTransformer { case 4 : { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "<clinit>"; - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs) && (methods.get(i).access & ACC_STATIC) != 0) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs) && (toPatch.access & ACC_STATIC) != 0) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); InsnList nu = new InsnList(); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; @@ -251,10 +249,8 @@ public class BWCoreTransformer implements IClassTransformer { case 5: { BWCore.BWCORE_LOG.info("Could find: " + BWCoreTransformer.CLASSESBEEINGTRANSFORMED[id]); String name_deObfs = "getNewNoise"; - for (int i = 0; i < methods.size(); i++) { - MethodNode toPatch = methods.get(i); - - if (ASMUtils.isCorrectMethod(methods.get(i), name_deObfs)) { + for (MethodNode toPatch : methods) { + if (ASMUtils.isCorrectMethod(toPatch, name_deObfs)) { BWCore.BWCORE_LOG.info("Found " + (name_deObfs) + "! Patching!"); LabelNode[] LabelNodes = {new LabelNode(), new LabelNode()}; InsnList nu = new InsnList(); @@ -277,11 +273,11 @@ public class BWCoreTransformer implements IClassTransformer { nu.add(new VarInsnNode(ISTORE, 3)); nu.add(LabelNodes[1]); - for (int j = 1; j < methods.get(i).instructions.size(); j++) { - nu.add(methods.get(i).instructions.get(j)); + for (int j = 1; j < toPatch.instructions.size(); j++) { + nu.add(toPatch.instructions.get(j)); } - methods.get(i).instructions = nu; + toPatch.instructions = nu; break scase; } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java index 7c2793f2b1..f9fcd4bd37 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/API_REFERENCE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java index 0f181a3559..9c55b47440 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/AcidGenFuelAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java index a3c33ceac9..1035ab7d5c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import java.awt.*; - +@SuppressWarnings("ALL") public final class BioObjectAdder { // @Deprecated @@ -156,7 +156,7 @@ public final class BioObjectAdder { * @return the propper Bacteria Tier (at least 0) */ public static int getBacteriaTierFromVoltageTier(int voltageTier) { - return voltageTier - 6 > 0 ? voltageTier - 6 : 0; + return Math.max(voltageTier - 6, 0); } /** diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java index edee87f534..b38fc86344 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioObjectGetter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,6 +32,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.Collection; +@SuppressWarnings("ALL") public final class BioObjectGetter { public static BioCulture getBioCulture(String aName) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java index 0e40363356..30d387399c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioRecipeAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; +@SuppressWarnings("ALL") public final class BioRecipeAdder { public static final int STANDART = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java index a8fc8dae91..7e17d323e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/BioVatLogicAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,11 +31,11 @@ import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Objects; import static cpw.mods.fml.common.registry.GameRegistry.findBlock; +@SuppressWarnings("ALL") public final class BioVatLogicAdder { @@ -64,9 +64,7 @@ public final class BioVatLogicAdder { public static int getMaxSv() { int ret = MaxSV; - Iterator it = BioVatLogicAdder.RadioHatch.getMaSv().iterator(); - while (it.hasNext()) { - BioVatLogicAdder.MaterialSvPair pair = (BioVatLogicAdder.MaterialSvPair) it.next(); + for (MaterialSvPair pair : RadioHatch.getMaSv()) { if (pair.getSievert() > ret) ret = pair.getSievert(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java index 76612ad404..8d5c0d23ae 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/INoiseGen.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java index 391593d217..b4fe0923bc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/IRadMaterial.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java index 002b175bbf..fe92654fd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileAddsInformation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java index a84f254d8a..5e8663f907 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileDropsContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,6 +27,6 @@ import net.minecraft.inventory.ISidedInventory; public interface ITileDropsContent extends ISidedInventory { default int[] getDropSlots(){ return new int[] {0}; - }; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java index a9318ca7f0..9ae176d26f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileHasDifferentTextureSides.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,15 +38,11 @@ public interface ITileHasDifferentTextureSides { return texture[side.ordinal()]; } - ; - @SideOnly(Side.CLIENT) default IIcon getTextureForSide(int side, int meta) { return getTextureForSide(ForgeDirection.values()[side], meta); } - ; - @SideOnly(Side.CLIENT) void registerBlockIcons(IIconRegister par1IconRegister); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java index 636fcb3a31..deec80e80f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/ITileWithGUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java index 397d949e77..1dc575bd5a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAPI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,6 +26,7 @@ import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; public final class WerkstoffAPI { + @SuppressWarnings("rawtypes") public Werkstoff getWerkstoff(String aName) throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException { Class w = Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader"); return (Werkstoff) w.getField(aName).get(null); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java index 6437ad1087..7efe2af842 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/API/WerkstoffAdderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,11 +32,11 @@ public final class WerkstoffAdderRegistry implements Runnable { private WerkstoffAdderRegistry() { } - public static final WerkstoffAdderRegistry getINSTANCE() { + public static WerkstoffAdderRegistry getINSTANCE() { return INSTANCE; } - public static final void addWerkstoffAdder(Runnable adder) { + public static void addWerkstoffAdder(Runnable adder) { INSTANCE.toRun.add(adder); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java index 5476c65e72..6e46f1dbab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/GuiHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java index f9674b72c7..abd55ddf6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -108,6 +108,7 @@ public final class MainMod { public static BW_Network BW_Network_instance = new BW_Network(); @Mod.EventHandler + @SuppressWarnings("ALL") public void preInit(FMLPreInitializationEvent preinit) { if (!(API_REFERENCE.VERSION.equals(MainMod.APIVERSION))) { @@ -328,6 +329,7 @@ public final class MainMod { } } + @SuppressWarnings("ALL") private static void runMoltenUnificationEnfocement(Werkstoff werkstoff){ if (werkstoff.getGenerationFeatures().enforceUnification && werkstoff.getGenerationFeatures().hasMolten()) { try { @@ -512,6 +514,7 @@ public final class MainMod { toAdd.forEach(GT_Recipe.GT_Recipe_Map.sBlastRecipes::add); } + @SuppressWarnings("ALL") private static void addElectricImplosionCompressorRecipes() { if (eicMap == null) { eicMap = new GT_Recipe.GT_Recipe_Map(new HashSet<>(GT_Recipe.GT_Recipe_Map.sImplosionRecipes.mRecipeList.size()), "gt.recipe.electricimplosioncompressor", "Electric Implosion Compressor", (String) null, "gregtech:textures/gui/basicmachines/Default", 1, 2, 1, 0, 1, "", 1, "", true, true); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java index f3590b4e90..14a146e01a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,8 +41,8 @@ class TooltipCache { if (!tooltip.isEmpty()) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < tooltip.size(); i++) { - sb.append(tooltip.get(i)); + for (String s : tooltip) { + sb.append(s); sb.append(System.lineSeparator()); } char[] rettype = sb.toString().toCharArray(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java index 2532357218..1f28933622 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/ClientEventHandler/TooltipEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java index 2057052be3..628b4acb96 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/BioTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java index 8f45b3d48d..03ecf155e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/GT2Tab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java index c49fdb0aae..41ce06cc81 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/creativetabs/bartworksTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java index 44dc931a23..610aeb14f7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,7 +49,7 @@ public class BW_GUIContainer_HeatedWaterPump extends GuiContainer { if (this.container.fuel > 0) { this.mc.getTextureManager().bindTexture(BW_GUIContainer_HeatedWaterPump.furnaceGuiTextures); - int ik = this.container.maxfuel > 200 ? this.container.maxfuel : 200; + int ik = Math.max(this.container.maxfuel, 200); int i1 = ((this.container.fuel * 13) / ik); this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 13 - i1, 14, i1 + 1); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java index 788bcb379a..5ede1e09f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RadLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java index 597fb1cb0b..94731e1833 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java index df4d721b02..69ec8349b9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/BW_GUIContainer_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java index 8f31fc31db..ba0bc69c3b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java index e672eebe94..2f45e3c7c9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java index 8686cee0be..ae1187c3d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java index 86779b71d0..9bd331c59c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/gui/GT_GUIContainer_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java index a59fb87635..3494b461a5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_ItemRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java index 879274d114..4dd9bc3860 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_GT_Vanilla_Texture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java index 5bcd873fd3..7146293456 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/BW_Renderer_Block_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java index 82150c7913..74bc3e2712 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererGlasBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java index 0a2bf2d99c..cb0f78ffa5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/renderer/RendererSwitchingColorFluid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -170,27 +170,27 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler dInterpolatedV4 = dInterpolatedV; } else { float xFlow = MathHelper.sin(flowDir) * 0.25f, zFlow = MathHelper.cos(flowDir) * 0.25f; - dInterpolatedU = iconStill.getInterpolatedU((double) (8.0f + (-zFlow - xFlow) * 16.0f)); - dInterpolatedV = iconStill.getInterpolatedV((double) (8.0f + (-zFlow + xFlow) * 16.0f)); - dInterpolatedU2 = iconStill.getInterpolatedU((double) (8.0f + (-zFlow + xFlow) * 16.0f)); - dInterpolatedV2 = iconStill.getInterpolatedV((double) (8.0f + (zFlow + xFlow) * 16.0f)); - dInterpolatedU3 = iconStill.getInterpolatedU((double) (8.0f + (zFlow + xFlow) * 16.0f)); - dInterpolatedV3 = iconStill.getInterpolatedV((double) (8.0f + (zFlow - xFlow) * 16.0f)); - dInterpolatedU4 = iconStill.getInterpolatedU((double) (8.0f + (zFlow - xFlow) * 16.0f)); - dInterpolatedV4 = iconStill.getInterpolatedV((double) (8.0f + (-zFlow - xFlow) * 16.0f)); + dInterpolatedU = iconStill.getInterpolatedU(8.0f + (-zFlow - xFlow) * 16.0f); + dInterpolatedV = iconStill.getInterpolatedV(8.0f + (-zFlow + xFlow) * 16.0f); + dInterpolatedU2 = iconStill.getInterpolatedU(8.0f + (-zFlow + xFlow) * 16.0f); + dInterpolatedV2 = iconStill.getInterpolatedV(8.0f + (zFlow + xFlow) * 16.0f); + dInterpolatedU3 = iconStill.getInterpolatedU(8.0f + (zFlow + xFlow) * 16.0f); + dInterpolatedV3 = iconStill.getInterpolatedV(8.0f + (zFlow - xFlow) * 16.0f); + dInterpolatedU4 = iconStill.getInterpolatedU(8.0f + (zFlow - xFlow) * 16.0f); + dInterpolatedV4 = iconStill.getInterpolatedV(8.0f + (-zFlow - xFlow) * 16.0f); } tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y, z)); tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * red, RendererSwitchingColorFluid.LIGHT_Y_POS * green, RendererSwitchingColorFluid.LIGHT_Y_POS * blue); - tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); - tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); - tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); - tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); - tessellator.addVertexWithUV((double) x, y + heightNW, (double) z, dInterpolatedU, dInterpolatedV); - tessellator.addVertexWithUV((double) (x + 1), y + heightNE, (double) z, dInterpolatedU4, dInterpolatedV4); - tessellator.addVertexWithUV((double) (x + 1), y + heightSE, (double) (z + 1), dInterpolatedU3, dInterpolatedV3); - tessellator.addVertexWithUV((double) x, y + heightSW, (double) (z + 1), dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV(x, y + heightNW, z, dInterpolatedU, dInterpolatedV); + tessellator.addVertexWithUV(x + 1, y + heightNE, z, dInterpolatedU4, dInterpolatedV4); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, dInterpolatedU3, dInterpolatedV3); + tessellator.addVertexWithUV(x, y + heightSW, z + 1, dInterpolatedU2, dInterpolatedV2); } @@ -198,7 +198,7 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler rendered = true; tessellator.setBrightness(block.getMixedBrightnessForBlock(iBlockAccess, x, y - 1, z)); tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_NEG * red, RendererSwitchingColorFluid.LIGHT_Y_NEG * green, RendererSwitchingColorFluid.LIGHT_Y_NEG * blue); - renderer.renderFaceYNeg(block, (double) x, y + RendererSwitchingColorFluid.RENDER_OFFSET, (double) z, this.getNullCheckedIiconOrFallbackTexture()); + renderer.renderFaceYNeg(block, x, y + RendererSwitchingColorFluid.RENDER_OFFSET, z, this.getNullCheckedIiconOrFallbackTexture()); } for (int side = 0; side < 4; ++side) { @@ -269,14 +269,14 @@ public class RendererSwitchingColorFluid implements ISimpleBlockRenderingHandler } tessellator.setColorOpaque_F(RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * red, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * green, RendererSwitchingColorFluid.LIGHT_Y_POS * sideLighting * blue); - tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); - tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); - tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, (double) u1Flow, (double) v1Flow); - tessellator.addVertexWithUV(dXcoord1, (double) y, dZcoord1, (double) u1Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord2, (double) y, dZcoord2, (double) u2Flow, (double) v3Flow); - tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, (double) u2Flow, (double) v2Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); + tessellator.addVertexWithUV(dXcoord2, y, dZcoord2, u2Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord1, y, dZcoord1, u1Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord1, y + dHeight1, dZcoord1, u1Flow, v1Flow); + tessellator.addVertexWithUV(dXcoord1, y, dZcoord1, u1Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord2, y, dZcoord2, u2Flow, v3Flow); + tessellator.addVertexWithUV(dXcoord2, y + dHeight2, dZcoord2, u2Flow, v2Flow); } } renderer.renderMinY = 0.0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java index 29b78e568e..4294e1c89c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/client/textures/PrefixTextureLinker.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.client.textures; import com.github.bartimaeusnek.bartworks.system.material.Werkstoff; @@ -25,11 +47,11 @@ public class PrefixTextureLinker implements Runnable { for (OrePrefixes prefixes : OrePrefixes.values()) { if (prefixes == OrePrefixes.rod) continue; - HashMap curr = new HashMap<>(); + HashMap<TextureSet, Textures.ItemIcons.CustomIcon> curr = new HashMap<>(); if (prefixes.mTextureIndex == -1 && Werkstoff.GenerationFeatures.prefixLogic.get(prefixes) != 0) { Arrays.stream(TextureSet.class.getFields()).filter(field -> field.getName().contains("SET")).forEach(SET -> { try { - curr.put(SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); + curr.put((TextureSet) SET.get(null), new Textures.ItemIcons.CustomIcon("materialicons/" + SET.getName().substring(4) + "/" + prefixes)); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java index cf81a296f3..9a1f342b3c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_Blocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -79,6 +79,7 @@ public class BW_Blocks extends Block { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java index 3d6d3e41b0..195d1afb6d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_GlasBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java index b6a1ee611d..4fb77d6671 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -123,9 +123,9 @@ public class BW_TileEntityContainer extends BlockContainer implements ITileAddsI TileEntity t = world.getTileEntity(x,y,z); if (t instanceof ITileDropsContent){ int[] dropSlots = ((ITileDropsContent)t).getDropSlots(); - for (int i = 0; i < dropSlots.length; i++) { - if (((ITileDropsContent)t).getStackInSlot(dropSlots[i]) != null) - world.spawnEntityInWorld(new EntityItem(world,x,y,z,((BW_TileEntity_HeatedWaterPump)t).getStackInSlot(dropSlots[i]))); + for (int dropSlot : dropSlots) { + if (((ITileDropsContent) t).getStackInSlot(dropSlot) != null) + world.spawnEntityInWorld(new EntityItem(world, x, y, z, ((BW_TileEntity_HeatedWaterPump) t).getStackInSlot(dropSlot))); } } super.breakBlock(world, x, y, z, block, meta); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java index eac3b5fd28..41525ef6d7 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BW_TileEntityContainer_Multiple.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -117,6 +117,7 @@ public class BW_TileEntityContainer_Multiple extends BlockContainer { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < this.textureNames.length; i++) { list.add(new ItemStack(item, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java index ea1b074c69..61c93217d9 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/blocks/BioFluidBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java index ec85e7e1d4..d3091afb56 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/ChangeConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,6 +41,7 @@ public class ChangeConfig extends CommandBase { } @Override + @SuppressWarnings("rawtypes") public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) { try{ Field f = ConfigHandler.class.getField(p_71515_2_[0]); @@ -53,7 +54,7 @@ public class ChangeConfig extends CommandBase { p_71515_1_.addChatMessage(new ChatComponentText("you need to enter a number!")); return; } - f.setInt(null, Integer.parseInt(p_71515_2_[1])); + f.setInt(null, l); } else if (c.equals(long.class)) { long l; @@ -72,7 +73,6 @@ public class ChangeConfig extends CommandBase { f.setBoolean(null,false); else { p_71515_1_.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); - return; } } }catch (Exception e){ diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java index 48f7a6d236..3e410ff2d3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/commands/SummonRuin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java index 1f808bae95..d71b89b8cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/configs/ConfigHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java index db5a66173f..46706f6f08 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_ItemBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,6 +40,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; +import java.util.Arrays; import java.util.List; public class BW_ItemBlocks extends ItemBlock { @@ -66,13 +67,12 @@ public class BW_ItemBlocks extends ItemBlock { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (this.field_150939_a instanceof BW_GlasBlocks) aList.add(StatCollector.translateToLocal("tooltip.glas.0.name") + " " + BW_ColorUtil.getColorForTier(BW_Util.getTierFromGlasMeta(aStack.getItemDamage())) + GT_Values.VN[BW_Util.getTierFromGlasMeta(aStack.getItemDamage())]); if (this.field_150939_a instanceof ITileAddsInformation) { - for (int i = 0; i < ((ITileAddsInformation) this.field_150939_a).getInfoData().length; i++) { - aList.add(((ITileAddsInformation) this.field_150939_a).getInfoData()[i]); - } + aList.addAll(Arrays.asList(((ITileAddsInformation) this.field_150939_a).getInfoData())); } aList.add(this.mNoMobsToolTip); if (!(this.field_150939_a instanceof ITileEntityProvider)) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java index f308420d14..e6c0a5ad90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_SimpleWindMeter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -54,6 +54,7 @@ public class BW_SimpleWindMeter extends Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean p_77624_4_) { super.addInformation(itemStack, entityPlayer, list, p_77624_4_); list.add(StatCollector.translateToLocal("tooltip.windmeter.0.name")); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java index 6c11a9be64..fdb263a9f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/BW_Stonage_Rotors.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,6 +68,7 @@ public class BW_Stonage_Rotors extends Item implements IKineticRotor { this.itemIcon = iconRegister.registerIcon(MainMod.MOD_ID + ":" + this.itemTex); } + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean b) { info.add(StatCollector.translateToLocalFormatted("ic2.itemrotor.wind.info", this.DiaMinMax[1], this.DiaMinMax[2])); IKineticRotor.GearboxType type = null; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java index 136ccb27b5..a39d75dd97 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/Circuit_Programmer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,6 +51,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); if (aStack != null && aStack.getTagCompound() != null) @@ -67,6 +68,7 @@ public class Circuit_Programmer extends GT_Generic_Item implements IElectricItem } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java index ea43784383..1376a00bd8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Destructopack_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,6 +46,7 @@ public class GT_Destructopack_Item extends GT_Generic_Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java index 5d5f8b790c..700b8974c3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Rockcutter_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,7 +51,7 @@ import java.util.List; import java.util.Set; public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { - private static Set mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); + private static Set<Block> mineableBlocks = Sets.newHashSet(Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.clay); private final int mCharge; private final int mTransfer; public int mTier; @@ -63,7 +63,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { super(2 * aTier, Item.ToolMaterial.EMERALD, GT_Rockcutter_Item.mineableBlocks); this.mTier = aTier; this.multi = (int) Math.pow(10, (this.mTier - 1)); - GT_Rockcutter_Item.mineableBlocks = new HashSet(); + GT_Rockcutter_Item.mineableBlocks = new HashSet<>(); this.maxStackSize = 1; this.mCharge = 10000 * this.multi; this.mTransfer = (int) GT_Values.V[this.mTier]; @@ -73,7 +73,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { this.setNoRepair(); this.setUnlocalizedName("GT_Rockcutter_Item_" + GT_Values.VN[this.mTier]); } - + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.bw.tier.name") + " " + GT_Values.VN[this.mTier]); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); @@ -110,6 +110,7 @@ public class GT_Rockcutter_Item extends ItemTool implements IElectricItem { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java index b45b831bae..458a80e673 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/GT_Teslastaff_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; @@ -45,7 +46,7 @@ import java.util.List; import java.util.Set; public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { - private static final Set effective = Sets.newHashSet(Blocks.web); + private static final Set<Block> effective = Sets.newHashSet(Blocks.web); private final double mCharge; private final double mTransfer; public int mTier; @@ -65,6 +66,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { aList.add(StatCollector.translateToLocal("tooltip.teslastaff.0.name")); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); @@ -73,8 +75,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { public boolean hitEntity(ItemStack aStack, EntityLivingBase aTarget, EntityLivingBase aPlayer) { if (aTarget instanceof EntityLiving && ElectricItem.manager.canUse(aStack, 9000000)) { EntityLiving tTarget = (EntityLiving) aTarget; - EntityLivingBase tPlayer = aPlayer; - ElectricItem.manager.use(aStack, 9000000, tPlayer); + ElectricItem.manager.use(aStack, 9000000, aPlayer); for (int i = 1; i < 5; ++i) { if (tTarget.getEquipmentInSlot(i) != null && tTarget.getEquipmentInSlot(i).getItem() instanceof IElectricItem) { tTarget.setCurrentItemOrArmor(i, null); @@ -85,6 +86,7 @@ public class GT_Teslastaff_Item extends ItemTool implements IElectricItem { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List itemList) { ItemStack itemStack = new ItemStack(this, 1); if (this.getChargedItem(itemStack) == this) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java index 640fca0014..a588921145 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -40,6 +40,7 @@ public class LabModule extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { aList.add(StatCollector.translateToLocal("tooltip.labmodule.0.name")); super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java index 675eb4602d..b879c94958 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/LabParts.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -74,6 +74,7 @@ public class LabParts extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean b) { if (itemStack == null) return; @@ -124,13 +125,11 @@ public class LabParts extends SimpleSubItemClass { } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (ItemStack stack : getAllPetriDishes()) - list.add(stack); - for (ItemStack stack : getAllDNASampleFlasks()) - list.add(stack); - for (ItemStack stack : getAllPlasmidCells()) - list.add(stack); + list.addAll(getAllPetriDishes()); + list.addAll(getAllDNASampleFlasks()); + list.addAll(getAllPlasmidCells()); super.getSubItems(item, creativeTabs, list); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java index ab19b5d967..d8070f4e90 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleIconItem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java index 3d312d6e37..8287c44778 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/items/SimpleSubItemClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,12 +57,14 @@ public class SimpleSubItemClass extends Item { } @Override + @SuppressWarnings("unchecked") public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { super.addInformation(p_77624_1_, p_77624_2_, aList, p_77624_4_); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < this.tex.length; i++) { p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java index ed84c5a98f..5012725e34 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BeforeGTPreload.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java index 0c13e8b88b..e5591f1150 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioCultureLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java index 7968e2996c..93b2ece861 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioItemList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java index dbb060700a..80a0ff744f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioLabLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java index 3315d5361e..5c2088e606 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/BioRecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -48,6 +48,7 @@ import net.minecraftforge.oredict.OreDictionary; public class BioRecipeLoader extends RecipeLoader { @Override + @SuppressWarnings("deprecation") public void run() { //DNAExtractionModule diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java index 17cb6d84a9..beba91a18d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/FluidLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java index 095e679dc6..f602963c8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/GTNHBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java index b23afa275c..2b61f3250f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/ItemRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java index 9ea0f90050..4f7d83bcf6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/LoaderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,7 @@ public class LoaderRegistry implements Runnable { @Override public void run() { - new ItemRegistry().run(); + ItemRegistry.run(); new RecipeLoader().run(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java index f274260d13..3f703ba688 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/RecipeLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,6 +55,7 @@ public class RecipeLoader implements Runnable { protected static final long BITSD = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE; @Override + @SuppressWarnings("deprecation") public void run() { if (ConfigHandler.GTNH) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java index bb32c7aeb4..7c6ba97d67 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/BW_Network.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -50,6 +50,7 @@ import java.util.List; /* * Original GT File slightly Modified */ +@SuppressWarnings("ALL") @ChannelHandler.Sharable public class BW_Network extends MessageToMessageCodec<FMLProxyPacket, GT_Packet> implements IGT_NetworkHandler { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java index 0da061e352..be1fb4dea5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/CircuitProgrammerPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java index 793f59c899..9a4ce6cf38 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OreDictCachePacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -63,7 +63,7 @@ public class OreDictCachePacket extends GT_Packet { public GT_Packet decode(ByteArrayDataInput byteArrayDataInput) { int size = byteArrayDataInput.readInt(); for (int i = 0; i < size; i++) { - this.hashSet.add(new Pair<Integer,Short>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); + this.hashSet.add(new Pair<>(byteArrayDataInput.readInt(),byteArrayDataInput.readShort())); } return new OreDictCachePacket(this.hashSet); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java index 4147087a51..75d5cddc30 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/OrePacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java index 90a3adc69a..ede9c1df94 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/RendererPacket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java index 149db03d5b..4a1367d1dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/net/ServerJoinedPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java index 9d492bb87f..e382a138ec 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BWTileEntityDimIDBridge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java index 767e6bd383..78df5d33f8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_RotorBlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java index 0e54e9264d..0497a1b5b6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_ExperimentalFloodGate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -71,7 +71,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private synchronized void setUpHashSet() { this.check = new BW_TileEntity_ExperimentalFloodGate.recursiveBelowCheck(); Thread t = new Thread(this.check); - t.run(); + t.start(); while (t.isAlive()) { try { this.wait(); @@ -89,7 +89,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem private class recursiveBelowCheck implements Runnable { - private final List<Coords> hashset = new ArrayList<Coords>(); + private final List<Coords> hashset = new ArrayList<>(); int called = -1; public int getCalled() { @@ -138,7 +138,7 @@ public class BW_TileEntity_ExperimentalFloodGate extends TileFluidHandler implem if (iterations >= 5000) return -1; - int tail = 0; + int tail; int ret = 0; iterations++; int wID = w.provider.dimensionId; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java index ea9bfe6395..fb687ed2a0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java index f9e7553760..f47be6d45e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/classic/BW_TileEntity_InfinityTank.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,11 +31,10 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.*; import java.util.ArrayList; -import java.util.HashSet; public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank, IFluidHandler, ITileWithGUI { - final ArrayList<FluidStack> INTERNALTANKS = new ArrayList<FluidStack>(); + final ArrayList<FluidStack> INTERNALTANKS = new ArrayList<>(); int selectedTank; @@ -61,13 +60,15 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - HashSet<Boolean> ret = new HashSet<Boolean>(); + boolean ret = false; for (FluidStack stack : this.INTERNALTANKS) { - ret.add(GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0))); - if (ret.contains(Boolean.TRUE)) + ret = GT_Utility.areFluidsEqual(stack, new FluidStack(fluid, 0)); + if (ret) { this.selectedTank = this.INTERNALTANKS.indexOf(stack); + break; + } } - return ret.contains(Boolean.TRUE); + return ret; } @Override @@ -94,12 +95,12 @@ public class BW_TileEntity_InfinityTank extends TileEntity implements IFluidTank NBTTagList lInternalTank = new NBTTagList(); - for (int i = 0; i < this.INTERNALTANKS.size(); i++) { - if (this.INTERNALTANKS.get(i) != null) { + for (FluidStack internaltank : this.INTERNALTANKS) { + if (internaltank != null) { NBTTagCompound entry = new NBTTagCompound(); - entry.setString("FluidName", this.INTERNALTANKS.get(i).getFluid().getName()); - entry.setInteger("Ammount", this.INTERNALTANKS.get(i).amount); - entry.setTag("FluidTag", this.INTERNALTANKS.get(i).tag); + entry.setString("FluidName", internaltank.getFluid().getName()); + entry.setInteger("Ammount", internaltank.amount); + entry.setTag("FluidTag", internaltank.tag); lInternalTank.appendTag(entry); } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java index 323a009d0a..ac7c929cba 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/debug/CreativeScanner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java index 3902909ae6..d3d8d5f6ab 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_BioVat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -56,7 +56,6 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { @@ -65,7 +64,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private static final byte MCASING_INDEX = 49; private static final byte TIMERDIVIDER = 20; - private final HashSet<EntityPlayerMP> playerMPHashSet = new HashSet<EntityPlayerMP>(); + private final HashSet<EntityPlayerMP> playerMPHashSet = new HashSet<>(); private final ArrayList<GT_MetaTileEntity_RadioHatch> mRadHatches = new ArrayList<>(); private int height = 1; private GT_Recipe mLastRecipe; @@ -145,7 +144,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private int calcMod(double x) { int ret = (int) Math.ceil(ConfigHandler.bioVatMaxParallelBonus*(-(((2D*x/(double)this.getOutputCapacity())-1D)*(2D*x/(double)this.getOutputCapacity()-1D))+1D)); - return ret <= 0 ? 1 : ret > 100 ? 100 : ret;//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); + return ret <= 0 ? 1 : Math.min(ret, 100);//(int) Math.ceil((-0.00000025D * x * (x - this.getOutputCapacity()))); } @Override @@ -171,7 +170,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); ArrayList<FluidStack> tFluidList = this.getStoredFluids(); int tFluidList_sS = tFluidList.size(); @@ -190,7 +189,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } } - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluidList.size() > 0) { @@ -256,18 +255,16 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { } public ArrayList<FluidStack> getStoredFluidOutputs() { - ArrayList<FluidStack> rList = new ArrayList(); - Iterator var2 = this.mOutputHatches.iterator(); + ArrayList<FluidStack> rList = new ArrayList<>(); - while (var2.hasNext()) { - GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) var2.next(); + for (GT_MetaTileEntity_Hatch_Output tHatch : this.mOutputHatches) { if (tHatch.getFluid() != null) rList.add(tHatch.getFluid()); } return rList; } - private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + private boolean addRadiationInputToMachineList(IGregTechTileEntity aTileEntity) { if (aTileEntity == null) { return false; } else { @@ -275,7 +272,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { if (aMetaTileEntity == null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_RadioHatch) { - ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + ((GT_MetaTileEntity_RadioHatch) aMetaTileEntity).updateTexture(GT_TileEntity_BioVat.MCASING_INDEX); return this.mRadHatches.add((GT_MetaTileEntity_RadioHatch) aMetaTileEntity); } else { return false; @@ -298,7 +295,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { //controller if (y == 0 && xDir + x == 0 && zDir + z == 0) continue; - if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { + if (!(this.addOutputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addRadiationInputToMachineList(tileEntity) || this.addInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addMaintenanceToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX) || this.addEnergyInputToMachineList(tileEntity, GT_TileEntity_BioVat.MCASING_INDEX))) { if (BW_Util.addBlockToMachine(x, y, z, 2, aBaseMetaTileEntity, GregTech_API.sBlockCasings4, 1)) { ++blockcounter; continue; @@ -400,10 +397,8 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { private void check_Chunk() { World aWorld = this.getBaseMetaTileEntity().getWorld(); if (!aWorld.isRemote) { - Iterator var5 = aWorld.playerEntities.iterator(); - while (var5.hasNext()) { - Object tObject = var5.next(); + for (Object tObject : aWorld.playerEntities) { if (!(tObject instanceof EntityPlayerMP)) { break; } @@ -474,7 +469,7 @@ public class GT_TileEntity_BioVat extends GT_MetaTileEntity_MultiBlockBase { for (int x = -1; x < 2; x++) { for (int y = 1; y < this.height; y++) { for (int z = -1; z < 2; z++) { - if (aStack == null || (aStack != null && aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0)) { + if (aStack == null || aStack.getItem() instanceof LabParts && aStack.getItemDamage() == 0) { if (this.mCulture == null || aStack == null || aStack.getTagCompound() == null || this.mCulture.getID() != aStack.getTagCompound().getInteger("ID")) { lCulture = aStack == null || aStack.getTagCompound() == null ? null : BioCulture.getBioCulture(aStack.getTagCompound().getString("Name")); this.sendPackagesOrRenewRenderer(x, y, z, lCulture); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java index 11382078cd..6d664ed7cd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CircuitAssemblyLine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,12 @@ package com.github.bartimaeusnek.bartworks.common.tileentities.multis; -import com.github.bartimaeusnek.bartworks.API.BioVatLogicAdder; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.BW_Meta_Items; import com.github.bartimaeusnek.bartworks.system.material.CircuitGeneration.CircuitImprintLoader; import com.github.bartimaeusnek.bartworks.util.BWRecipes; import com.github.bartimaeusnek.bartworks.util.BW_Util; import com.github.bartimaeusnek.bartworks.util.ChatColorHelper; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -40,8 +38,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java index 50e2c7e632..1f96a207e3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_CrackingDistillTower.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -49,7 +49,7 @@ public class GT_TileEntity_CrackingDistillTower extends GT_MetaTileEntity_Distil return false; else { FluidStack[] array = new FluidStack[0]; - ArrayList<FluidStack> fluidInputs = new ArrayList<FluidStack>(); + ArrayList<FluidStack> fluidInputs = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_Input hatch : this.mInputHatches) { if (hatch != null) { fluidInputs.add(hatch.getFluid()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java index 9b826dc9f4..daadf33416 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_DEHP.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -61,6 +61,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { } @Override + @SuppressWarnings("rawtypes") public void onConfigLoad(GT_Config aConfig) { try { Class c = TileEntityNuclearReactorElectric.class; @@ -158,7 +159,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { try { Field workState = this.getClass().getField("workState"); workState.setInt(this, 0); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { } return true; } @@ -182,7 +183,7 @@ public class GT_TileEntity_DEHP extends GT_MetaTileEntity_DrillerBase { try { Field workState = this.getClass().getSuperclass().getDeclaredField("workState"); workState.setInt(this, 2); - } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException e) { + } catch (NoSuchFieldError | NoSuchFieldException | IllegalAccessException ignored) { } return true; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java index 2dff59f0a2..8eac4a7f09 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ElectricImplosionCompressor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -77,7 +77,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } } - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); if (tInputList.size() > 0) { GT_Recipe tRecipe = GT_TileEntity_ElectricImplosionCompressor.eicMap.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); if (tRecipe != null && tRecipe.isRecipeInputEqual(true, null, tInputs)) { @@ -177,6 +177,7 @@ public class GT_TileEntity_ElectricImplosionCompressor extends GT_MetaTileEntity } @Override + @SuppressWarnings("ALL") public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack itemStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 06ecfecd26..1c39d5e07c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -52,6 +52,7 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.ArrayList; +import java.util.Collections; public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @@ -157,14 +158,10 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { public String[] getDescription() { ArrayList<String> e = new ArrayList<>(); String[] dsc = StatCollector.translateToLocal("tooltip.tile.lesu.0.name").split(";"); - for (int i = 0; i < dsc.length; i++) { - e.add(dsc[i]); - } + Collections.addAll(e, dsc); e.add(StatCollector.translateToLocal("tooltip.tile.lesu.1.name") + " " + ConfigHandler.energyPerCell + "EU"); dsc = StatCollector.translateToLocal("tooltip.tile.lesu.2.name").split(";"); - for (int i = 0; i < dsc.length; i++) { - e.add(dsc[i]); - } + Collections.addAll(e, dsc); e.add(ChatColorHelper.RED + StatCollector.translateToLocal("tooltip.tile.lesu.3.name")); e.add(StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"); return e.toArray(new String[0]); @@ -214,6 +211,7 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { @Override + @SuppressWarnings("ALL") public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { ITexture[] ret = new ITexture[0]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java index 9f830eeeda..8c258a96e6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_ManualTrafo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -119,14 +119,14 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase public long getInputTier() { if (this.mEnergyHatches.size() > 0) - return (long) GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); - else return 0; + return GT_Utility.getTier(this.mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage()); + else return 0L; } public long getOutputTier() { if (this.mDynamoHatches.size() > 0) - return (long) GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); - else return 0; + return GT_Utility.getTier(this.mDynamoHatches.get(0).getBaseMetaTileEntity().getOutputVoltage()); + else return 0L; } @Override @@ -324,7 +324,7 @@ public class GT_TileEntity_ManualTrafo extends GT_MetaTileEntity_MultiBlockBase //check tap hull for (int ty = 1; ty <= y; ++ty) { - byte leveltier = 0; + byte leveltier; if (this.mInventory[1].getItemDamage() == 2) leveltier = ((byte) (intier - ty)); else if (this.mInventory[1].getItemDamage() == 3) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java index 83dbfd0fcd..87e1089e1f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_THTR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index 625e857401..1e3c2dc45d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -58,6 +58,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; +import java.util.Arrays; import static gregtech.api.enums.GT_Values.V; @@ -67,7 +68,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { private static final IIconContainer[] iIconContainers = new IIconContainer[2]; private static final ITexture[] iTextures = new ITexture[3]; - private final ArrayList<TileEntityDispenser> tedList = new ArrayList<TileEntityDispenser>(); + private final ArrayList<TileEntityDispenser> tedList = new ArrayList<>(); private BW_RotorBlock rotorBlock; private byte hasDoor; @@ -102,8 +103,6 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { public boolean recipe_fallback(ItemStack aStack) { //sight... fallback to the macerator recipes GT_Recipe.GT_Recipe_Map tMap = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; - if (tMap == null) - return false; GT_Recipe tRecipe = tMap.findRecipe(this.getBaseMetaTileEntity(), false, false, V[1], null, aStack); if (tRecipe == null) return false; @@ -346,6 +345,7 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { return false; } + @SuppressWarnings("ALL") public boolean addOutput(ItemStack aStack) { if (GT_Utility.isStackInvalid(aStack)) return false; @@ -626,19 +626,13 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_MultiBlockBase { if (aFacing == aSide || aSide == 0) { GT_TileEntity_Windmill.iTextures[0] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[0]); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[0]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[0]); } else if (aSide == 1) { GT_TileEntity_Windmill.iTextures[1] = new GT_RenderedTexture(GT_TileEntity_Windmill.iIconContainers[1]); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[1]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[1]); } else { GT_TileEntity_Windmill.iTextures[2] = new GT_RenderedTexture(Textures.BlockIcons.COVER_WOOD_PLATE); - for (int i = 0; i < ret.length; i++) { - ret[i] = GT_TileEntity_Windmill.iTextures[2]; - } + Arrays.fill(ret, GT_TileEntity_Windmill.iTextures[2]); } } return ret; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java index 229cfa0169..cf38712bc6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaBlastFurnace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -96,9 +96,9 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean onRunningTick(ItemStack aStack) { if (this.lEUt > 0) { - this.addEnergyOutput((long)this.lEUt * (long)this.mEfficiency / 10000L); + this.addEnergyOutput(this.lEUt * (long)this.mEfficiency / 10000L); return true; - } else if (this.lEUt < 0 && !this.drainEnergyInput((long)(-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { + } else if (this.lEUt < 0 && !this.drainEnergyInput((-this.lEUt) * 10000L / (long)Math.max(1000, this.mEfficiency))) { this.stopMachine(); return false; } else { @@ -138,7 +138,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl } } - return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + Integer.toString(this.mProgresstime / 20) + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + Integer.toString(this.mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + Long.toString(-this.lEUt) + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + Long.toString(this.getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + Float.toString((float)this.mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; + return new String[]{StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN + this.mProgresstime / 20 + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW + this.mMaxProgresstime / 20 + EnumChatFormatting.RESET + " s", StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + maxEnergy + EnumChatFormatting.RESET + " EU", StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED + -this.lEUt + EnumChatFormatting.RESET + " EU/t", StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW + this.getMaxInputVoltage() + EnumChatFormatting.RESET + " EU/t(*2A) " + StatCollector.translateToLocal("GT5U.machines.tier") + ": " + EnumChatFormatting.YELLOW + GT_Values.VN[GT_Utility.getTier(this.getMaxInputVoltage())] + EnumChatFormatting.RESET, StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED + (this.getIdealStatus() - this.getRepairStatus()) + EnumChatFormatting.RESET + " " + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW + (float) this.mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"}; } private long lEUt = 0; @@ -206,7 +206,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl FluidStack[] tFluids = this.getStoredFluids().toArray(new FluidStack[0]); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = null; + GT_Recipe tRecipe; if (circuitMode > 0 && Arrays.stream(tInputs).anyMatch(e -> GT_Utility.areStacksEqual(e,GT_Utility.getIntegratedCircuit(circuitMode),true))){ List<ItemStack> modInputs = Arrays.stream(tInputs).filter(Objects::nonNull).filter(e -> !e.getItem().equals(GT_Utility.getIntegratedCircuit(circuitMode).getItem())).collect(Collectors.toList()); modInputs.add(GT_Utility.getIntegratedCircuit(circuitMode)); @@ -222,8 +222,8 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; } - ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>(); - ArrayList<FluidStack> outputFluids = new ArrayList<FluidStack>(); + ArrayList<ItemStack> outputItems = new ArrayList<>(); + ArrayList<FluidStack> outputFluids = new ArrayList<>(); boolean found_Recipe = false; int processed = 0; @@ -250,7 +250,7 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl this.mEfficiency = (10000 - (this.getIdealStatus() - this.getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - byte overclockCount = 0; + byte overclockCount; long actualEUT = (long) (tRecipe.mEUt) * processed; // if (actualEUT > Integer.MAX_VALUE) { // byte divider = 0; @@ -344,13 +344,13 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { this.mHeatingCapacity = 0; - HashSet<Boolean> ret = new HashSet<Boolean>(); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11)); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11)); - ret.add(BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11)); + boolean ret; + ret = BW_Util.check_layer(iGregTechTileEntity, 7, -2, -1, GregTech_API.sBlockCasings1, 11, 7, false,false,true,GregTech_API.sBlockCasings1,11,true,11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, 17, 18, GregTech_API.sBlockCasings1, 11, 7, false, null, -1, 11); + ret &= BW_Util.check_layer(iGregTechTileEntity, 6, -1, 17, GregTech_API.sBlockCasings5, -1, 7, false, false, true, Blocks.air, -1, false, 11); for (int y = -1; y < 17; y++) { - ret.add(BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11)); - if (!this.getCoilHeat(iGregTechTileEntity, 7, y, 6)) + ret &= BW_Util.check_layer(iGregTechTileEntity, 7, y, y + 1, ItemRegistry.bw_glasses[0], -1, 7, y == 0, false, false, null, -1, false, 11); + if (!this.getCoilHeat(iGregTechTileEntity, y)) return false; List<Byte> metasFromLayer = BW_Util.getMetasFromLayer(iGregTechTileEntity, 7, y, y + 1, 7, y == 0, false, false); for (Byte meta : metasFromLayer) { @@ -381,16 +381,16 @@ public class GT_TileEntity_MegaBlastFurnace extends GT_MetaTileEntity_ElectricBl return false; } - return !ret.contains(Boolean.FALSE) && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); + return ret && !this.mMaintenanceHatches.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mInputBusses.isEmpty(); } - private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int offset, int y, int radius) { - int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * offset; - int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * offset; + private boolean getCoilHeat(IGregTechTileEntity iGregTechTileEntity, int y) { + int xDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetX * 7; + int zDir = ForgeDirection.getOrientation(iGregTechTileEntity.getBackFacing()).offsetZ * 7; int internalH = 0; - for (int x = -radius; x <= radius; x++) { - for (int z = -radius; z <= radius; z++) { - if (Math.abs(x) < radius && Math.abs(z) != radius) + for (int x = -6; x <= 6; x++) { + for (int z = -6; z <= 6; z++) { + if (Math.abs(x) < 6 && Math.abs(z) != 6) continue; byte tUsedMeta = iGregTechTileEntity.getMetaIDOffset(xDir + x, y, zDir + z); switch (tUsedMeta) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java index 19e4455a08..127c38d0c4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaDistillTower.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.common.tileentities.multis.mega; import com.github.bartimaeusnek.bartworks.common.configs.ConfigHandler; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java index 3c7c1db53d..89c68563de 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaProcessingArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,7 +37,7 @@ import java.util.ArrayList; import java.util.List; import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine.isValidForLowGravity; - +@SuppressWarnings("ALL") public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_ProcessingArray { private GT_Recipe mLastRecipe; private int tTier; @@ -107,11 +107,11 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process if (!this.mMachine.equals(this.mInventory[1].getUnlocalizedName())) this.mLastRecipe = null; this.mMachine = this.mInventory[1].getUnlocalizedName(); - ItemStack[] tInputs = tInputList.toArray(new ItemStack[tInputList.size()]); + ItemStack[] tInputs = tInputList.toArray(new ItemStack[0]); ArrayList<FluidStack> tFluidList = this.getStoredFluids(); - FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tInputList.size() > 0 || tFluids.length > 0) { GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[this.tTier], tFluids, tInputs); if (tRecipe != null) { @@ -170,15 +170,13 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process } tOut = GT_MetaTileEntity_ProcessingArray.clean(tOut); this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - List<ItemStack> overStacks = new ArrayList<ItemStack>(); - for (int f = 0; f < tOut.length; f++) { - while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - if (tOut[f] != null) { - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp); - } + List<ItemStack> overStacks = new ArrayList<>(); + for (ItemStack itemStack : tOut) { + while (itemStack.getMaxStackSize() < itemStack.stackSize) { + ItemStack tmp = itemStack.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + itemStack.stackSize = itemStack.stackSize - itemStack.getMaxStackSize(); + overStacks.add(tmp); } } if (overStacks.size() > 0) { @@ -186,11 +184,11 @@ public class GT_TileEntity_MegaProcessingArray extends GT_MetaTileEntity_Process tmp = overStacks.toArray(tmp); tOut = ArrayUtils.addAll(tOut, tmp); } - List<ItemStack> tSList = new ArrayList<ItemStack>(); + List<ItemStack> tSList = new ArrayList<>(); for (ItemStack tS : tOut) { if (tS.stackSize > 0) tSList.add(tS); } - tOut = tSList.toArray(new ItemStack[tSList.size()]); + tOut = tSList.toArray(new ItemStack[0]); this.mOutputItems = tOut; this.mOutputFluids = new FluidStack[]{tFOut}; this.updateSlots(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java index fd5fec2e16..434b034160 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/mega/GT_TileEntity_MegaVacuumFreezer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -92,7 +92,7 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkRecipe(ItemStack itemStack) { ItemStack[] tInputs = this.getStoredInputs().toArray(new ItemStack[0]); - ArrayList<ItemStack> outputItems = new ArrayList<ItemStack>(); + ArrayList<ItemStack> outputItems = new ArrayList<>(); long tVoltage = this.getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); @@ -142,13 +142,13 @@ public class GT_TileEntity_MegaVacuumFreezer extends GT_MetaTileEntity_VacuumFre @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - HashSet<Boolean> ret = new HashSet<Boolean>(); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17)); - ret.add(BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17)); - return !(ret.contains(Boolean.FALSE) || this.mInputBusses.isEmpty() || this.mOutputBusses.isEmpty() || this.mEnergyHatches.isEmpty() || this.mMaintenanceHatches.isEmpty()); + return ( + BW_Util.check_layer(aBaseMetaTileEntity, 7, -7, -6, GregTech_API.sBlockCasings2, 1, 7, false, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, -6, 0, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 0, 1, GregTech_API.sBlockCasings2, 1, 7, true, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 1, 7, GregTech_API.sBlockCasings2, 1, 7, false, false, true, Blocks.air, -1, true, 17) + && BW_Util.check_layer(aBaseMetaTileEntity, 7, 7, 8, GregTech_API.sBlockCasings2, 1, 7, false, 17) + ) && !this.mInputBusses.isEmpty() && !this.mOutputBusses.isEmpty() && !this.mEnergyHatches.isEmpty() && !this.mMaintenanceHatches.isEmpty(); } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java index 2453610894..cc82311a70 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_AcidGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -108,7 +108,6 @@ public class GT_MetaTileEntity_AcidGenerator extends GT_MetaTileEntity_BasicGene return aSide == this.getBaseMetaTileEntity().getFrontFacing(); } - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.acidgen.0.name"), StatCollector.translateToLocal("tooltip.tile.acidgen.1.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.rotor.2.name") + " " + ChatColorHelper.YELLOW + this.getEfficiency(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java index e4247a70c5..e7ded86c91 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_BioLab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,6 +68,7 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } @Override + @SuppressWarnings("deprecation") public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { return new GT_MetaTileEntity_BioLab(this.mName, this.mTier, this.mAmperage, this.mDescription, this.mTextures, this.mNEIName); } @@ -247,6 +248,8 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { this.mFluid.amount -= 8000; if (cultureDNABioData.getChance() > new XSTR().nextInt(10000)) { BioCulture out = BioCulture.getBioCulture(BioDNA.convertDataToDNA(cultureDNABioData)); + if (out == null) + return GT_MetaTileEntity_BasicMachine.DID_NOT_FIND_RECIPE; out = out.setPlasmid(BioPlasmid.convertDataToPlasmid(cultureDNABioData)); this.mOutputItems[0] = BioItemList.getPetriDish(out); } @@ -264,7 +267,6 @@ public class GT_MetaTileEntity_BioLab extends GT_MetaTileEntity_BasicMachine { } @Override - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.biolab.0.name"), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java index d4382eac7a..be916e52ff 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_CompressedFluidHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java index 8d3d6d1777..fc7a1e6a05 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Diode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java index 8c4c13d171..f454af02d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_EnergyDistributor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -69,7 +69,6 @@ public class GT_MetaTileEntity_EnergyDistributor extends GT_MetaTileEntity_Trans return 512L + (GT_Values.V[this.mTier] * 320L); } - @SuppressWarnings("deprecation") public String[] getDescription() { return new String[]{StatCollector.translateToLocal("tooltip.tile.energydistributor.0.name"), StatCollector.translateToLocal("tooltip.tile.tiereddsc.0.name") + " " + ChatColorHelper.YELLOW + GT_Values.V[this.mTier], StatCollector.translateToLocal("tooltip.tile.tiereddsc.1.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesIn(), StatCollector.translateToLocal("tooltip.tile.tiereddsc.2.name") + " " + ChatColorHelper.YELLOW + this.maxAmperesOut(), StatCollector.translateToLocal("tooltip.bw.1.name") + ChatColorHelper.DARKGREEN + " BartWorks"}; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java index 8bc01b5554..4f2bebb0d6 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_GiantOutputHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java index c84fbdfd13..eadf67de7a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -76,7 +76,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public static long calcDecayTicks(int x) { - long ret = 0; + long ret; if (x == 43) ret = 5000; else if (x == 61) @@ -107,7 +107,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } public void setCoverage(short coverage) { - byte nu = 0; + byte nu; if (coverage > 100) nu = 100; else if (coverage < 0) @@ -245,7 +245,7 @@ public class GT_MetaTileEntity_RadioHatch extends GT_MetaTileEntity_Hatch { } //check material for general validity - if (lStack != null && GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { + if (GT_OreDictUnificator.getAssociation(lStack) != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial != null && GT_OreDictUnificator.getAssociation(lStack).mMaterial.mMaterial != null) { //check orePrefix for general validity if (GT_OreDictUnificator.getAssociation(lStack).mPrefix != null) { OrePrefixes orePrefixes = GT_OreDictUnificator.getAssociation(lStack).mPrefix; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java index 5fd9b5b5d7..94b1aedd7e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/tiered/GT_MetaTileEntity_Transistor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java index 0dd86aa030..dec4e11c5e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioLabHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java index ddf1da1e15..531c54cfd1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -98,11 +98,8 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler { } } else { tSpecial = 0; - String[] var6 = recipeDesc; - int var7 = recipeDesc.length; - for (int var8 = 0; var8 < var7; ++var8) { - String descLine = var6[var8]; + for (String descLine : recipeDesc) { GT_NEI_DefaultHandler.drawText(10, 73 + 10 * tSpecial, descLine, -16777216); ++tSpecial; } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java index 0bf633dcf2..b23fa6fd0b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_OreHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java index 284fdc973c..48c1b6e6ed 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java index eeb8772b15..33a1333322 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/EventHandler/ServerEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java index 8ea844c82c..4bc7bf3802 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_HeatedWaterPump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -88,6 +88,7 @@ public class BW_Container_HeatedWaterPump extends Container { } @Override + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); if (this.TILE.getWorldObj().isRemote) diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java index 42bdc56e3b..8d2d9b0b51 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/BW_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -126,6 +126,7 @@ public class BW_Container_RadioHatch extends Container { } @Override + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { if (!this.iGregTechTileEntity.getBaseMetaTileEntity().isClientSide() && this.iGregTechTileEntity.getBaseMetaTileEntity().getMetaTileEntity() != null) { this.coverage = this.iGregTechTileEntity.getCoverage(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java index 7545d5225a..f370d07043 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_CircuitProgrammer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java index 6d3b86da1f..2fd79898d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_Item_Destructopack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java index 95d09eefa9..7621a17f0a 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_LESU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java index a1cd7505fe..1b1b4b240f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/GT_Container_RadioHatch.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,6 +46,7 @@ public class GT_Container_RadioHatch extends GT_Container_1by1 { super(aInventoryPlayer, aTileEntity); } + @SuppressWarnings("rawtypes") public void detectAndSendChanges() { super.detectAndSendChanges(); if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java index 133bc2dfbb..84f054b4bb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_DelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,7 @@ public class BW_DelSlot extends Slot { super(new InventoryPlayer(null), 0, 80, 17); } + @SuppressWarnings("ALL") public void putStack(ItemStack p_75215_1_) { p_75215_1_ = null; this.onSlotChanged(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java index 71ed548559..6e2eafdf13 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/server/container/Slots/BW_FuelSlot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java index f0854d78a9..286d3faa84 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/DebugLog.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java index 21268ac1c2..63f27d299f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/log/STFUGTPPLOG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java index d519da3ef6..37c14a6bd0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedFrames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java index df56e4359b..5d876b3986 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOreTE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,7 +70,7 @@ public class BW_MetaGeneratedOreTE extends TileEntity implements ITexturedTileEn } public ArrayList<ItemStack> getDrops(Block aDroppedOre, int aFortune) { - ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + ArrayList<ItemStack> rList = new ArrayList<>(); if (this.mMetaData < 0) { rList.add(new ItemStack(Blocks.cobblestone, 1, 0)); return rList; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java index be3a5d9643..90c30d1adf 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedOre_Item.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -55,6 +55,7 @@ public class BW_MetaGeneratedOre_Item extends BW_ItemBlocks { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { if (!GT_Utility.isStackValid(aStack) || aPlayer == null || aStack.getItemDamage() <= 0) return; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java index ff5c25ef7a..849126df83 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGeneratedSmallOreTE.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.Materials; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java index 6e0f198290..0b11ae9f89 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -95,6 +95,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } } + public boolean onEntityItemUpdate(EntityItem aItemEntity) { if (this.orePrefixes == OrePrefixes.dustImpure || this.orePrefixes == OrePrefixes.dustPure || this.orePrefixes == OrePrefixes.crushed) { int aDamage = aItemEntity.getEntityItem().getItemDamage(); @@ -104,17 +105,15 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa int tX = MathHelper.floor_double(aItemEntity.posX); int tY = MathHelper.floor_double(aItemEntity.posY); int tZ = MathHelper.floor_double(aItemEntity.posZ); + Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); + byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((this.orePrefixes == OrePrefixes.dustImpure) || (this.orePrefixes == OrePrefixes.dustPure)) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.dust, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); return true; } - } else if (this.orePrefixes == OrePrefixes.crushed) { - Block tBlock = aItemEntity.worldObj.getBlock(tX, tY, tZ); - byte tMetaData = (byte) aItemEntity.worldObj.getBlockMetadata(tX, tY, tZ); + } else { if ((tBlock == Blocks.cauldron) && (tMetaData > 0)) { aItemEntity.setEntityItemStack(WerkstoffLoader.getCorrespondingItemStack(OrePrefixes.crushedPurified, aMaterial, aItemEntity.getEntityItem().stackSize)); aItemEntity.worldObj.setBlockMetadataWithNotify(tX, tY, tZ, tMetaData - 1, 3); @@ -128,6 +127,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { // String tooltip = GT_LanguageManager.getTranslation(this.getUnlocalizedName(aStack) + ".tooltip"); // if (!tooltip.isEmpty()) @@ -170,6 +170,7 @@ public class BW_MetaGenerated_Items extends GT_MetaGenerated_Item implements IRa @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (Werkstoff werkstoff : werkstoffHashSet) { if (werkstoff != null && ((werkstoff.getGenerationFeatures().toGenerate & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) != 0) && ((werkstoff.getGenerationFeatures().blacklist & Werkstoff.GenerationFeatures.prefixLogic.get(this.orePrefixes)) == 0)) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java index d4a7ec89a3..9ac1b0f383 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_Ores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,7 @@ import static com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerate public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { - public static ThreadLocal<BW_MetaGeneratedOreTE> mTemporaryTileEntity = new ThreadLocal(); + public static ThreadLocal<BW_MetaGeneratedOreTE> mTemporaryTileEntity = new ThreadLocal<>(); public BW_MetaGenerated_Ores(Material p_i45386_1_, Class<? extends TileEntity> tileEntity, String blockName) { super(p_i45386_1_, tileEntity, blockName); @@ -149,7 +149,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { if ((tTileEntity instanceof BW_MetaGeneratedOreTE)) { return ((BW_MetaGeneratedOreTE) tTileEntity).getDrops(WerkstoffLoader.BWOres,aFortune); } - return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); + return BW_MetaGenerated_Ores.mTemporaryTileEntity.get() == null ? new ArrayList<>() : BW_MetaGenerated_Ores.mTemporaryTileEntity.get().getDrops(WerkstoffLoader.BWOres,aFortune); } public int getHarvestLevel(int metadata) { @@ -162,6 +162,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { } @Override + @SuppressWarnings("unchecked") public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { for (Werkstoff tMaterial : Werkstoff.werkstoffHashSet) { if ((tMaterial != null) && ((tMaterial.getGenerationFeatures().toGenerate & 0x8) != 0) && ((tMaterial.getGenerationFeatures().blacklist & 0x8) == 0)) { @@ -181,7 +182,7 @@ public class BW_MetaGenerated_Ores extends BW_TileEntityContainer { // if ((FMLCommonHandler.instance().getEffectiveSide().isServer() || this.checkForAir(aWorld,aX,aY,aZ)) && aWorld.getTileEntity(aX, aY, aZ) instanceof BW_MetaGeneratedOreTE) // ((BW_MetaGeneratedOreTE)aWorld.getTileEntity(aX, aY, aZ)).sendPacket(); // } - + @SuppressWarnings("unused") private boolean checkForAir(IBlockAccess aWorld, int aX, int aY, int aZ){ for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java index 034b2d3606..24f447c3d8 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_MetaGenerated_SmallOres.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material; import gregtech.api.enums.OrePrefixes; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java index 1c3455147f..1cb7d6ea64 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/BW_NonMeta_MaterialItems.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java index 819d9f98bd..1d1cc94863 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_CircuitsLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java index dfb48a7b50..66038d5d85 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/BW_Meta_Items.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -50,10 +50,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.HashSet; -import java.util.List; +import java.util.*; public class BW_Meta_Items { @@ -73,6 +70,7 @@ public class BW_Meta_Items { GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes.add(new BWRecipes.DynamicGTRecipe(false,new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(2)},new ItemStack[]{BW_Meta_Items.NEWCIRCUITS.getStack(3)},null,new int[]{7500},new FluidStack[]{Materials.SolderingAlloy.getMolten(576)},null,300, BW_Util.getMachineVoltageFromTier(4), BW_Util.CLEANROOM)); } + @SuppressWarnings("deprecation") public void addNewCircuit(int aTier, int aID, String aName){ String additionalOreDictData = ""; @@ -132,6 +130,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { if (aCreativeTab == this.getCreativeTab()) for (NBTTagCompound tag : CircuitImprintLoader.recipeTagMap.keySet()){ @@ -153,7 +152,7 @@ public class BW_Meta_Items { for (short i = CircuitImprintLoader.reverseIDs; i < Short.MAX_VALUE; i++) { if (this.mEnabledItems.get(i)) { - BW_Util.set2DCoordTo1DArray(i,0,2,CircuitImprintLoader.circuitIIconRefs.get(i).get(1).getIconIndex(),this.mIconList); + BW_Util.set2DCoordTo1DArray(i,0,2, Objects.requireNonNull(CircuitImprintLoader.circuitIIconRefs.get(i)).get(1).getIconIndex(),this.mIconList); BW_Util.set2DCoordTo1DArray(i,1,2,aIconRegister.registerIcon(MainMod.MOD_ID+":WrapOverlay"),this.mIconList); //aIconRegister.registerIcon("gregtech:" + (GT_Config.troll ? "troll" : this.getUnlocalizedName() + "/" + i)); } @@ -162,6 +161,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { if (aStack.getItemDamage() == 0 ) if (aStack.getTagCompound() != null && CircuitImprintLoader.getStackFromTag(aStack.getTagCompound()) != null) @@ -210,6 +210,7 @@ public class BW_Meta_Items { return null; } + @SuppressWarnings({"unchecked","rawtypes"}) public final ItemStack addItem(int aID, String aEnglish, String aToolTip, Object... aRandomData) { if (aToolTip == null) { aToolTip = ""; @@ -242,7 +243,8 @@ public class BW_Meta_Items { boolean tUseOreDict = true; if (tRandomData instanceof IItemBehaviour) { - this.addItemBehavior(aID, (IItemBehaviour) tRandomData); + this.addItemBehavior(aID, + (IItemBehaviour) tRandomData); tUseOreDict = false; } @@ -275,6 +277,7 @@ public class BW_Meta_Items { } @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { int j = this.mEnabledItems.length(); @@ -289,6 +292,7 @@ public class BW_Meta_Items { } @Override + @SuppressWarnings("unchecked") protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { super.addAdditionalToolTips(aList, aStack, aPlayer); aList.add(StatCollector.translateToLocal("tooltip.bw.0.name") + ChatColorHelper.DARKGREEN + " BartWorks"); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java index 2dfb4ad7c0..22a1caaaf1 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java index a2442cb6d2..3629b01ead 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitImprintLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -107,6 +107,7 @@ public class CircuitImprintLoader implements Runnable { this.makeCircuitImprints(); } + @SuppressWarnings("deprecation") public static GT_Recipe makeMoreExpensive(GT_Recipe original){ GT_Recipe newRecipe = original.copy(); for (ItemStack is : newRecipe.mInputs){ @@ -122,6 +123,7 @@ public class CircuitImprintLoader implements Runnable { return newRecipe; } + @SuppressWarnings("deprecation") public static GT_Recipe reBuildRecipe(GT_Recipe original){ ItemStack out = original.copy().getOutput(0); out.stackSize *= 16; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index b6d1e83529..c72c7acebc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java index 6befd36ba6..1d1b1a0f35 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/BWGTMetaItems.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.client.textures.PrefixTextureLinker; @@ -30,7 +52,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { private boolean hasList; - public BWGTMetaItems(OrePrefixes orePrefixes, List noSubIDMaterials) { + public BWGTMetaItems(OrePrefixes orePrefixes, List<Materials> noSubIDMaterials) { super(orePrefixes,null); materialloop: for (int i = 0; i < Materials.values().length; i++) { @@ -53,7 +75,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { materialloop: for (int i = 0; i < noSubIDMaterials.size(); i++) { ItemStack tStack = new ItemStack(this, 1, i+1001); - Materials w = (Materials) noSubIDMaterials.get(i); + Materials w = noSubIDMaterials.get(i); if (((w.getMolten(1) == null && orePrefixes == WerkstoffLoader.capsuleMolten) || ((w.getFluid(1) == null && w.getGas(1) == null) && (orePrefixes == OrePrefixes.capsule || orePrefixes == OrePrefixes.bottle)))) continue; for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) @@ -95,6 +117,7 @@ public class BWGTMetaItems extends BW_MetaGenerated_Items { @Override @SideOnly(Side.CLIENT) + @SuppressWarnings("unchecked") public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) { for (int i = 0; i < Materials.values().length; i++) { Materials w = Materials.values()[i]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java index 3cfed71a8c..4beeab09b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/GTMetaItemEnhancer.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.bartworks.system.material.GT_Enhancement; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java index ee1f6b3b57..18651eb7f0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/LuVTierEnhancer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,6 +47,7 @@ import java.util.List; import static gregtech.api.enums.OrePrefixes.*; +@SuppressWarnings("ALL") public class LuVTierEnhancer implements Runnable { public void run() { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java index fa28531234..ff7d384dc3 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/GT_Enhancement/PlatinumSludgeOverHaul.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -42,7 +42,6 @@ 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.blocks.GT_Block_Ores; import gregtech.common.blocks.GT_Block_Ores_Abstract; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; @@ -55,7 +54,6 @@ import org.apache.commons.lang3.reflect.FieldUtils; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.*; -import java.util.stream.Collectors; import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.*; import static gregtech.api.enums.OrePrefixes.*; @@ -208,6 +206,7 @@ public class PlatinumSludgeOverHaul { return false; } + @SuppressWarnings({"unchecked","rawtypes"}) public static void replacePureElements() { //furnace for (Object entry : FurnaceRecipes.smelting().getSmeltingList().entrySet()) { @@ -237,7 +236,7 @@ public class PlatinumSludgeOverHaul { for (GT_Recipe.GT_Recipe_Map map : GT_Recipe.GT_Recipe_Map.sMappings) { if (map == GT_Recipe.GT_Recipe_Map.sFusionRecipes || map == GT_Recipe.GT_Recipe_Map.sUnboxinatorRecipes || map == GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes) continue; - HashSet<GT_Recipe> toDel = new HashSet<GT_Recipe>(); + HashSet<GT_Recipe> toDel = new HashSet<>(); recipeloop: for (GT_Recipe recipe : map.mRecipeList) { if (recipe.mFakeRecipe) @@ -368,7 +367,7 @@ public class PlatinumSludgeOverHaul { } private static void replaceHVCircuitMaterials(){ - GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Nikolite.getDust(8),1800,120); + GT_Values.RA.addMixerRecipe(Materials.Redstone.getDust(1),Materials.Electrum.getDust(1),GT_Utility.getIntegratedCircuit(1),null,null,null,Materials.Electrotine.getDust(8),1800,120); for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.mRecipeList){ if (recipe.mEUt > 512) continue; @@ -441,14 +440,13 @@ public class PlatinumSludgeOverHaul { } // END OF APACHE COMMONS COLLECTION COPY - Object input = null; + Object input; try { input = in.get(obj); } catch (IllegalAccessException e) { e.printStackTrace(); return; } - assert input != null; if (out != null && GT_Utility.areStacksEqual(otpt, Materials.Platinum.getDust(1), true)) { if (PlatinumSludgeOverHaul.checkRecipe(input,Materials.Platinum)) @@ -485,6 +483,7 @@ public class PlatinumSludgeOverHaul { } } + @SuppressWarnings({"rawtypes","unchecked"}) private static boolean checkRecipe(Object input,Materials mat){ if (input instanceof List || input instanceof Object[]) { Set lists = new HashSet(), stacks= new HashSet(); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java index bba6f66547..8957f2a986 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/ThreadedLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java index dd13e5c734..17dd97ec2f 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/Werkstoff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java index 76749db065..9c84b2e7fb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/WerkstoffLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java index c4d4dd1124..f66c2d5d2c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AdditionalRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -86,7 +86,7 @@ public class AdditionalRecipes implements Runnable { //Milk //GT_Values.RA.addFusionReactorRecipe(WerkstoffLoader.Californium.getMolten(16), Materials.Milk.getFluid(12000), WerkstoffLoader.Oganesson.getFluidOrGas(16), 500, 49152, 600000000); - GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphor.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); + GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(1),null,Materials.Milk.getFluid(10000),Materials.Water.getFluid(8832),Materials.Sugar.getDustSmall(21),Materials.Calcium.getDustTiny(1),Materials.Magnesium.getDustTiny(1),Materials.Potassium.getDustTiny(1),Materials.Sodium.getDustTiny(4),Materials.Phosphorus.getDustTiny(1),new int[]{10000,10000,1000,10000,1000,1000},50,120); for (int i = 0; i <= 6; i++) { GT_Recipe.GT_Recipe_Map.sCircuitAssemblerRecipes.add( @@ -128,14 +128,14 @@ public class AdditionalRecipes implements Runnable { GT_Recipe.GT_Recipe_Map.sLargeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 62500); try{ - Class map = GT_Recipe.GT_Recipe_Map.class; + Class<GT_Recipe.GT_Recipe_Map> map = GT_Recipe.GT_Recipe_Map.class; GT_Recipe.GT_Recipe_Map sHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sHugeNaquadahReactorFuels").get(null); GT_Recipe.GT_Recipe_Map sExtremeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sExtremeNaquadahReactorFuels").get(null); GT_Recipe.GT_Recipe_Map sUltraHugeNaquadahReactorFuels = (GT_Recipe.GT_Recipe_Map) FieldUtils.getField(map,"sUltraHugeNaquadahReactorFuels").get(null); sHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); sExtremeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stick)}, new ItemStack[]{}, null, null, null, 0, 0, 31250); sUltraHugeNaquadahReactorFuels.addRecipe(true, new ItemStack[]{WerkstoffLoader.Tiberium.get(stickLong)}, new ItemStack[]{}, null, null, null, 0, 0, 125000); - }catch (NullPointerException | IllegalAccessException e){} + }catch (NullPointerException | IllegalAccessException ignored){} new LoadItemContainers().run(); @@ -156,6 +156,8 @@ public class AdditionalRecipes implements Runnable { GregTech_API.sAfterGTPostload.add(new LuVTierEnhancer()); AdditionalRecipes.oldGThelperMethod(); } + + @SuppressWarnings("unchecked") private static void oldGThelperMethod() { //manual override for older GT Werkstoff werkstoff = WerkstoffLoader.Oganesson; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java index c7c1ed2585..09de02eeb2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/AfterLuVTierEnhacement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java index 1ed1cb0b83..c5295eab6e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/DownTierLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java index 289d76c4f8..f2edb3b32d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/material/processingLoaders/LoadItemContainers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java index 61a1d33d08..9269762a22 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictAdder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,6 +37,7 @@ public class OreDictAdder { OreDictAdder.toAddMap.put(element.getKey(),element.getValue()); } + @SafeVarargs public static synchronized void addToMap(Pair<String, ItemStack>... elements){ for (Pair<String, ItemStack> p : elements) OreDictAdder.toAddMap.put(p.getKey(),p.getValue()); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java index 6bc3627e7c..9aa46ae3b2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oredict/OreDictHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java index 920bb109af..5d86ecf88e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_OreLayer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java index 8a442787b9..3def3800d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WordGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java index 471120793e..b8fda6a8dc 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java index 1659918870..6f32b0007b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/oregen/BW_WorldGenRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java index 39a1ffa5bb..2471a36b60 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/GT_WorldgenUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java index ead000b328..dbeaa9ef3e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/system/worldgen/MapGenRuins.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,7 @@ import java.security.SecureRandom; import java.util.Random; import static net.minecraftforge.common.ChestGenHooks.PYRAMID_JUNGLE_CHEST; - +@SuppressWarnings({"ALL"}) public abstract class MapGenRuins extends WorldGenerator { protected Pair<Block,Integer>[][] ToBuildWith = new Pair[4][0]; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java index 2e3e8cf698..5da71e18b4 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,7 +65,7 @@ public class BWRecipes { public static final byte CIRCUITASSEMBLYLINE = 3; private final GT_Recipe.GT_Recipe_Map sBiolab = new GT_Recipe.GT_Recipe_Map( - new HashSet<GT_Recipe>(150), + new HashSet<>(150), "bw.recipe.biolab", StatCollector.translateToLocal("tile.biolab.name"), null, @@ -74,7 +74,7 @@ public class BWRecipes { "", 1, "", true, false //special handler ); private final BacteriaVatRecipeMap sBacteriaVat = new BacteriaVatRecipeMap( - new HashSet<GT_Recipe>(50), + new HashSet<>(50), "bw.recipe.BacteriaVat", StatCollector.translateToLocal("tile.biovat.name"), null, @@ -83,7 +83,7 @@ public class BWRecipes { " Sievert: ", 1, " Sv", true, false //special handler ); private final BW_Recipe_Map_LiquidFuel sAcidGenFuels = new BW_Recipe_Map_LiquidFuel( - new HashSet<GT_Recipe>(10), + new HashSet<>(10), "bw.fuels.acidgens", StatCollector.translateToLocal("tile.acidgenerator.name"), null, @@ -92,7 +92,7 @@ public class BWRecipes { "EU generated: ", 1000, "", false, true ); private final BWRecipes.SpecialObjectSensitiveMap sCircuitAssemblyLineMap = new SpecialObjectSensitiveMap( - new HashSet<GT_Recipe>(60), + new HashSet<>(60), "bw.recipe.cal", "Circuit Assembly Line", null, diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java index 2c01562b8a..a4a2a794d0 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_ColorUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java index f9d803ef10..703c3b66da 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BW_Util.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java index e7015053ca..ab8eea357d 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioCulture.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java index 4cdbf1a143..7bb8e427cb 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioDNA.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java index 1421f75c40..b64e508abd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,7 @@ import java.util.ArrayList; import java.util.Objects; public class BioData { - public static final ArrayList<BioData> BIO_DATA_ARRAY_LIST = new ArrayList<BioData>(); + public static final ArrayList<BioData> BIO_DATA_ARRAY_LIST = new ArrayList<>(); protected String name; protected int ID; @@ -59,6 +59,7 @@ public class BioData { this.name = bioData.name; this.ID = bioData.ID; this.chance = bioData.chance; + this.tier = bioData.tier; } public static BioData convertBioPlasmidToBioData(BioPlasmid bioPlasmid) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java index 1d59edb5ea..9cadce5239 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BioPlasmid.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java index b78e39afe1..38074acc7b 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ChatColorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java index 7e35affabf..0e8c18f93c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -32,7 +32,7 @@ import java.util.HashSet; public class ConnectedBlocksChecker { - public final HashSet<Coords> hashset = new HashSet<Coords>(2048); + public final HashSet<Coords> hashset = new HashSet<>(2048); public static byte check_sourroundings(Coords C, Block b) { byte ret = 0; diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java index 707b374888..8282b132ee 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/ConnectedBlocksCheckerIteration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,9 +38,9 @@ import java.util.Queue; */ public class ConnectedBlocksCheckerIteration { - public final HashSet<Coords> hashset = new HashSet<Coords>(2048); - public final HashSet<Coords> checked = new HashSet<Coords>(4096); - private final Queue<Coords> kwoe = new LinkedList<Coords>(); + public final HashSet<Coords> hashset = new HashSet<>(2048); + public final HashSet<Coords> checked = new HashSet<>(4096); + private final Queue<Coords> kwoe = new LinkedList<>(); public long get_connected(World w, int x, int y, int z, Block b){ kwoe.add(new Coords(x,y,z,w.provider.dimensionId)); diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java index c27054eb01..4a3ee25235 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Coords.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,10 +41,10 @@ public class Coords { @Override public boolean equals(Object o) { -// if (this == o) -// return true; -// if (o == null || this.getClass() != o.getClass()) -// return false; + if (this == o) + return true; + if (o == null || this.getClass() != o.getClass()) + return false; Coords coords = (Coords) o; return this.x == coords.x && this.y == coords.y && diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java index d37f3f0661..2b740e35d5 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NEIbartworksConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java index d568baf22b..4a6b8584dd 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/BartsNoise.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java index e494594bd2..5dcb897da2 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/NoiseUtil/SimplexNoise.java @@ -17,11 +17,11 @@ package com.github.bartimaeusnek.bartworks.util.NoiseUtil; */ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D - private static Grad grad3[] = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), + private static Grad[] grad3 = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; - private static Grad grad4[]= {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), + private static Grad[] grad4 = {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), @@ -30,7 +30,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; - private static short p[] = {151,160,137,91,90,15, + private static short[] p = {151,160,137,91,90,15, 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, @@ -44,8 +44,8 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; // To remove the need for index wrapping, double the permutation table length - private static short perm[] = new short[512]; - private static short permMod12[] = new short[512]; + private static short[] perm = new short[512]; + private static short[] permMod12 = new short[512]; static { for(int i=0; i<512; i++) { diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java index acc6da7b14..a64793676c 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/Pair.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,8 @@ import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Map; -public class Pair<A, B> implements Map.Entry { +@SuppressWarnings("unchecked") +public class Pair<A, B> implements Map.Entry<A, B> { Object[] pair = new Object[2]; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java index 6c1b1bd175..67deac1066 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/BartWorksCrossmod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java index e424b693d2..11ae398d54 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/GTpp/loader/RadioHatchCompat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -38,7 +38,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.util.*; - +@SuppressWarnings({"unchecked","rawtypes","unused"}) public class RadioHatchCompat implements Runnable { private static Class intf; @@ -225,7 +225,7 @@ public class RadioHatchCompat implements Runnable { if (RadioHatchCompat.isRadioactive.getBoolean(materialObj)) ret += ((int) RadioHatchCompat.radlevel.getByte(m) + RadioHatchCompat.GTPPRadAdapter.clampToZero(RadioHatchCompat.protons.getLong(materialObj))); else - ret += ((int) RadioHatchCompat.radlevel.getByte(m)); + ret += RadioHatchCompat.radlevel.getByte(m); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java index 3b9a70b89d..5e1bb3e792 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/recipe/TCRecipeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,6 +47,7 @@ import java.util.HashSet; import static com.github.bartimaeusnek.crossmod.thaumcraft.util.ThaumcraftHandler.AspectAdder; +@SuppressWarnings("ALL") public class TCRecipeHandler { public static final GT_Recipe.GT_Recipe_Map alchemicalConstructHandler = new TCRecipeHandler.TCRecipeMap(new HashSet<>(15000), "bwcm.recipe.alchemicalConstruct", diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java index 0db95667ae..db9b77ec91 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/tileentities/multi/GT_Industrial_Alchemic_Construct.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -45,6 +45,7 @@ import java.util.Map; import static gregtech.api.enums.GT_Values.V; +@SuppressWarnings("ALL") public class GT_Industrial_Alchemic_Construct extends GT_MetaTileEntity_MultiBlockBase { private List<Object> mEssentiaHatches = new ArrayList<>(); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java index c720de1f07..b6cc37b451 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/emt/util/EMTHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,16 @@ package com.github.bartimaeusnek.crossmod.emt.util; -import java.lang.reflect.Field; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import java.lang.reflect.Field; +@SuppressWarnings("unchecked") public class EMTHandler { - public static Class aEssentiaInputHatch; + public static Class<? extends GT_MetaTileEntity_Hatch_Input> aEssentiaInputHatch; public static Field aAspectField; static { try { - aEssentiaInputHatch = Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); + aEssentiaInputHatch = (Class<? extends GT_MetaTileEntity_Hatch_Input>) Class.forName("emt.gthandler.common.implementations.EssentiaHatch"); aAspectField = aEssentiaInputHatch.getDeclaredField("current"); aAspectField.setAccessible(true); } catch (ClassNotFoundException | NoSuchFieldException e) { diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java index b3648ccabc..255f83a125 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/GalacticraftProxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java index 8eddf5eb04..fb0451d381 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/PlanetsHelperClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java index ddae0648b2..16e4020459 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/UniversalTeleportType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java index 0b835e382c..83238c5f07 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/atmosphere/BWAtmosphereManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -34,8 +34,12 @@ import micdoodle8.mods.galacticraft.api.galaxies.CelestialBody; import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; import micdoodle8.mods.galacticraft.api.world.IAtmosphericGas; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +@SuppressWarnings("unused") public final class BWAtmosphereManager { private static final Map<Integer,Integer[]> COEFFICIENT_MAP = new HashMap<>(); @@ -61,7 +65,6 @@ public final class BWAtmosphereManager { } public static void removeGasFromWorld(int worldID, ISubTagContainer gas){ - HashSet toRemSet = new HashSet(); for (Pair<ISubTagContainer,Integer> pair : BWAtmosphereManager.gasConcentration.get(worldID)){ if (pair.getKey().equals(gas)){ BWAtmosphereManager.gasConcentration.get(worldID).remove(pair); @@ -71,7 +74,7 @@ public final class BWAtmosphereManager { } public static void addGasToWorld(int worldID, ISubTagContainer gas, int amount){ - Pair<ISubTagContainer,Integer> toadd = new Pair<ISubTagContainer,Integer>(gas,amount); + Pair<ISubTagContainer,Integer> toadd = new Pair<>(gas,amount); BWAtmosphereManager.gasConcentration.put(worldID,toadd); } @@ -79,6 +82,7 @@ public final class BWAtmosphereManager { BWAtmosphereManager.gasConcentration.put(worldID,toPut); } + @SafeVarargs public static void addGasToWorld(int worldID, Pair<ISubTagContainer,Integer>... toPut){ for (Pair<ISubTagContainer,Integer> toadd : toPut) BWAtmosphereManager.gasConcentration.put(worldID,toadd); diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java index a404c30e34..3a7e92f186 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/blocks/UniversalSpaceBlocks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java index d30d72bacd..7e082ba695 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/creativetabs/SpaceTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java index 988920cae6..47be16ce21 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/AbstractWorldProviderSpace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java index c815c6f3d6..bc33a08855 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/ChunkProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -65,6 +65,7 @@ public class ChunkProviderRoss128b extends ChunkProviderGenerate { } @Override + @SuppressWarnings("rawtypes") public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_) { return null; } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java index d575bd7dd8..d096ba4962 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/SkyProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java index 40cfbbbca4..f6a5cfc3f3 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128b/WorldProviderRoss128b.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,7 +57,7 @@ public class WorldProviderRoss128b extends AbstractWorldProviderSpace { float blue = 0.0F; red *= angle * 0.94F + 0.06F; green *= angle * 0.94F + 0.06F; - return Vec3.createVectorHelper((double) red, (double) green, (double) blue); + return Vec3.createVectorHelper(red, green, blue); } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java index 2cc84b41ea..69e7c3d525 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/ChunkProviderRoss128ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java index eeb306018c..f445290136 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/planets/ross128ba/WorldProviderRoss128Ba.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java index b548597e08..cc3f2a0744 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticraft/solarsystems/Ross128SolarSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java index ffc3c9f756..cce24d22db 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/DysonSwarmSunReplacement.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; import gregtech.api.interfaces.ITexture; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java index c03a8f5f04..609a718be2 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galaxySpace/tileEntity/GalaxySpaceProxy.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.galaxySpace.tileEntity; import cpw.mods.fml.common.event.FMLInitializationEvent; diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java index 7db0ab7bb5..954364034a 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/GT_NBT_DataBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java index 78251dac89..1cfdcf32d6 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/openComputers/TileEntity_GTDataServer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java index b62ec218b5..8bfa8024d5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TT_TileEntity_ManualTrafo.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.tectech; import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ManualTrafo; @@ -11,9 +33,10 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energ import java.util.ArrayList; import java.util.Iterator; +@SuppressWarnings({"unused"}) public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { - ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> mTTEnerys = new ArrayList<>(); + ArrayList<GT_MetaTileEntity_Hatch_EnergyMulti> mTTEnergyHatches = new ArrayList<>(); ArrayList<GT_MetaTileEntity_Hatch_DynamoMulti> mTTDynamos = new ArrayList<>(); public TT_TileEntity_ManualTrafo(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -43,11 +66,11 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { long totalOutput = 0L; long aFirstVoltageFound = -1L; boolean aFoundMixedDynamos = false; - Iterator var10 = this.mDynamoHatches.iterator(); + Iterator<GT_MetaTileEntity_Hatch_Dynamo> var10 = this.mDynamoHatches.iterator(); long aVoltage; while(var10.hasNext()) { - GT_MetaTileEntity_Hatch_Dynamo aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var10.next(); + GT_MetaTileEntity_Hatch_Dynamo aDynamo = var10.next(); if (aDynamo == null) { return false; } @@ -69,7 +92,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { this.explodeMultiblock(); return false; } else { - Iterator var17 = this.mDynamoHatches.iterator(); + Iterator<GT_MetaTileEntity_Hatch_Dynamo> var17 = this.mDynamoHatches.iterator(); while(true) { GT_MetaTileEntity_Hatch_Dynamo aDynamo; @@ -78,14 +101,14 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { return injected > 0; } - aDynamo = (GT_MetaTileEntity_Hatch_Dynamo)var17.next(); + aDynamo = var17.next(); } while(!isValidMetaTileEntity(aDynamo)); long leftToInject = aEU - (long)injected; aVoltage = aDynamo.maxEUOutput(); int aAmpsToInject = (int)(leftToInject / aVoltage); int aRemainder = (int)(leftToInject - (long)aAmpsToInject * aVoltage); - int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), (long)aAmpsToInject); + int ampsOnCurrentHatch = (int)Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); for(int i = 0; i < ampsOnCurrentHatch; ++i) { aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); @@ -93,7 +116,7 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { injected = (int)((long)injected + aVoltage * (long)ampsOnCurrentHatch); if (aRemainder > 0 && (long)ampsOnCurrentHatch < aDynamo.maxAmperesOut()) { - aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits((long)aRemainder, false); + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); injected += aRemainder; } } @@ -103,11 +126,9 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { public boolean drainEnergyInput(long aEU) { - if (aEU <= 0L) { - return true; - } else { + if (aEU > 0L) { { - Iterator var3 = this.mTTEnerys.iterator(); + Iterator<GT_MetaTileEntity_Hatch_EnergyMulti> var3 = this.mTTEnergyHatches.iterator(); GT_MetaTileEntity_Hatch_EnergyMulti tHatch; do { @@ -115,11 +136,11 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { return false; } - tHatch = (GT_MetaTileEntity_Hatch_EnergyMulti)var3.next(); - } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + tHatch = var3.next(); + } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } { - Iterator var3 = this.mEnergyHatches.iterator(); + Iterator<GT_MetaTileEntity_Hatch_Energy> var3 = this.mEnergyHatches.iterator(); GT_MetaTileEntity_Hatch_Energy tHatch; do { @@ -127,11 +148,11 @@ public class TT_TileEntity_ManualTrafo extends GT_TileEntity_ManualTrafo { return false; } - tHatch = (GT_MetaTileEntity_Hatch_Energy)var3.next(); - } while(!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); + tHatch = var3.next(); + } while (!isValidMetaTileEntity(tHatch) || !tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEU, false)); } - return true; } + return true; } }
\ No newline at end of file diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java index 6c33818755..855c5011a1 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/TecTechResearchLoader.java @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2018-2019 bartimaeusnek + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.github.bartimaeusnek.crossmod.tectech; import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry; @@ -11,6 +33,7 @@ import net.minecraftforge.fluids.FluidStack; public class TecTechResearchLoader { + @SuppressWarnings("deprecation") public static void runResearches(){ TT_recipeAdder.addResearchableAssemblylineRecipe( diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java index 267945116f..c6f9003d9d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/CustomAspects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java index 3700e89287..67c0dfb15d 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_Multi_IndustrialCrucible.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java index 7911b0c9af..991b7ad1b5 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/tile/GT_WandBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,11 +51,8 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; this.mBatteryCount = 0; this.mChargeableCount = 0; - ItemStack[] var4 = this.mInventory; - int var5 = var4.length; - for(int var6 = 0; var6 < var5; ++var6) { - ItemStack tStack = var4[var6]; + for (ItemStack tStack : this.mInventory) { if (ThaumcraftHandler.isWand(tStack)) { ++this.mBatteryCount; ++this.mChargeableCount; @@ -82,23 +79,20 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { boolean storedOverflow = false; long tScale = this.getBaseMetaTileEntity().getEUCapacity(); long tStored = this.getBaseMetaTileEntity().getStoredEU(); - long tStep = 0L; + long tStep; if (this.mInventory != null) { - ItemStack[] var9 = this.mInventory; - int var10 = var9.length; - for(int var11 = 0; var11 < var10; ++var11) { - ItemStack aStack = var9[var11]; + for (ItemStack aStack : this.mInventory) { if (GT_ModHandler.isElectricItem(aStack)) { if (aStack.getItem() instanceof GT_MetaBase_Item) { - Long[] stats = ((GT_MetaBase_Item)aStack.getItem()).getElectricStats(aStack); + Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); if (stats != null) { if (stats[0] > 4611686018427387903L) { scaleOverflow = true; } tScale += stats[0]; - tStep = ((GT_MetaBase_Item)aStack.getItem()).getRealCharge(aStack); + tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); if (tStep > 4611686018427387903L) { storedOverflow = true; } @@ -106,8 +100,8 @@ public class GT_WandBuffer extends GT_MetaTileEntity_BasicBatteryBuffer { tStored += tStep; } } else if (aStack.getItem() instanceof IElectricItem) { - tStored += (long)ElectricItem.manager.getCharge(aStack); - tScale += (long)((IElectricItem)aStack.getItem()).getMaxCharge(aStack); + tStored += (long) ElectricItem.manager.getCharge(aStack); + tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); } } } diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java index 5396f872ec..34fc8be00e 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/thaumcraft/util/ThaumcraftHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 bartimaeusnek + * Copyright (c) 2018-2019 bartimaeusnek * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,6 +37,7 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +@SuppressWarnings({"rawtypes","unchecked","unused"}) public class ThaumcraftHandler { private ThaumcraftHandler(){} |