aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/handler
diff options
context:
space:
mode:
authorConnor-Colenso <52056774+Connor-Colenso@users.noreply.github.com>2023-10-18 17:03:23 +0100
committerGitHub <noreply@github.com>2023-10-18 18:03:23 +0200
commitfbdbb388c369fae549cfde3eed38b536f7461d90 (patch)
treeb46f7fc949d7e4c6e3be910b81ed725e6dc1648e /src/main/java/gtPlusPlus/core/handler
parentb670446fdf49991093b485f0aa14050039632775 (diff)
downloadGT5-Unofficial-fbdbb388c369fae549cfde3eed38b536f7461d90.tar.gz
GT5-Unofficial-fbdbb388c369fae549cfde3eed38b536f7461d90.tar.bz2
GT5-Unofficial-fbdbb388c369fae549cfde3eed38b536f7461d90.zip
Cleaning up (#767)
* Kill playerAPI * Gut more events and compat that is now obsolete * Remove commented out code * Remove final modifier from methods * Make more stuff final * Remove slow building ring * Protected -> private in final classes * More cleaning * More cleaning v2 * Purging * Clean DevHelper * Clean DevHelper 2 * delete DevHelper * remove useless IFMLLoadingPlugin.MCVersion annotation from @Mod files * check for obfuscation only once in the IFMLloadingPlugin.injectData * don't instantiate the static class ASMConfig * delete unused and empty implementation of IFMLCallHook * delete empty class * delete ClassesToTransform class that just holds the class names constants * delete unused methods and unsless logging in dummymod container * delete unused transformer ClassTransformer_TT_ThaumicRestorer * spotless * Clean * Clean utils * Build checkpoint * Purge * Stage 2 * Stage 3 * Stage 4 * Stage 5 * Stage 6 * Spotless * Imports * Stage idk * Stage 1 * Fix issue * Spotless * Format numbers --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Co-authored-by: Connor Colenso <colen@CONNORSPC>
Diffstat (limited to 'src/main/java/gtPlusPlus/core/handler')
-rw-r--r--src/main/java/gtPlusPlus/core/handler/BookHandler.java553
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java14
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java3
-rw-r--r--src/main/java/gtPlusPlus/core/handler/GuiHandler.java9
-rw-r--r--src/main/java/gtPlusPlus/core/handler/MobMentality.java61
-rw-r--r--src/main/java/gtPlusPlus/core/handler/PacketHandler.java4
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java5
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java2
-rw-r--r--src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java4
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java2
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java20
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java1
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java104
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java20
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java8
-rw-r--r--src/main/java/gtPlusPlus/core/handler/events/SneakManager.java2
-rw-r--r--src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java17
17 files changed, 281 insertions, 548 deletions
diff --git a/src/main/java/gtPlusPlus/core/handler/BookHandler.java b/src/main/java/gtPlusPlus/core/handler/BookHandler.java
index 273179bdcc..5d17b9d90d 100644
--- a/src/main/java/gtPlusPlus/core/handler/BookHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/BookHandler.java
@@ -21,7 +21,7 @@ public class BookHandler {
public static int mBookKeeperCount = 0;
- public static Map<Integer, BookTemplate> mBookMap = new HashMap<Integer, BookTemplate>();
+ public static Map<Integer, BookTemplate> mBookMap = new HashMap<>();
public static BookTemplate book_ThermalBoiler;
public static BookTemplate book_MultiPowerStation;
@@ -64,65 +64,79 @@ public class BookHandler {
"Alkalus",
new String[] {
// Page 1
- "So, when it comes to power storage you really have three separate options:\n" + " \n"
- + "Battery Buffers,\n"
- + "Energy Buffers,\n"
- + "The Power Sub-Station\n",
+ """
+ So, when it comes to power storage you really have three separate options:
+ \s
+ Battery Buffers,
+ Energy Buffers,
+ The Power Sub-Station
+ """,
// Page 2
- "Battery Buffer\n" + " \n"
- + "Is rather portable. Allowing you to throw set one up and insert batteries where ever you may need."
- + "\n"
- + "They output 1A for each battery stored inside, up to a maximum of 16A.",
+ """
+ Battery Buffer
+ \s
+ Is rather portable. Allowing you to throw set one up and insert batteries where ever you may need.
+ They output 1A for each battery stored inside, up to a maximum of 16A.""",
// Page 3
- "Energy Buffer\n" + " \n"
- + "Is a more optimal choice for storage in your base. Once placed down, they cannot be moved without losing all stored power."
- + "\n"
- + "Energy Buffers can output 4A from the output side, however accept 16A as input.",
+ """
+ Energy Buffer
+ \s
+ Is a more optimal choice for storage in your base. Once placed down, they cannot be moved without losing all stored power.
+ Energy Buffers can output 4A from the output side, however accept 16A as input.""",
// Page 4
- "The Power Sub-Station" + " \n"
- + "Is used for storing Insane amounts of power later game."
- + "\n"
- + "Consumes 2% of the average voltage of all energy type hatches every tick."
- + "\n",
+ """
+ The Power Sub-Station\s
+ Is used for storing Insane amounts of power later game.
+ Consumes 2% of the average voltage of all energy type hatches every tick.
+ """,
// Page 5
- "Allows Insertion/Removal of power from the rear face of the controller, swap with a screwdriver."
- + "\n"
- + "Variable Height Structure, between 4-16Y. Inserted Redox Cells dictate max energy tier of structure."
- + "\n",
+ """
+ Allows Insertion/Removal of power from the rear face of the controller, swap with a screwdriver.
+ Variable Height Structure, between 4-16Y. Inserted Redox Cells dictate max energy tier of structure.
+ """,
// Page 6
- "Redox Cells cannot be placed into the Top or Bottom layer and only take up 3xhx3 internally."
- + "\n"
- + "Different Tier cells CANNOT be mixed together."
- + "\n",
+ """
+ Redox Cells cannot be placed into the Top or Bottom layer and only take up 3xhx3 internally.
+ Different Tier cells CANNOT be mixed together.
+ """,
// Page 7
- "All Hatches Must be HV at a Minimum, this minimum tier is in place to stop people abusing ULV/LV hatches to lower the avg/t."
- + "\n"
- + "Currently the GUI will NOT display anything at all until the structure forms, this is a known bug."
- + "\n",
+ """
+ All Hatches Must be HV at a Minimum, this minimum tier is in place to stop people abusing ULV/LV hatches to lower the avg/t.
+ Currently the GUI will NOT display anything at all until the structure forms, this is a known bug.
+ """,
// Page 8
- "Valid Hatches:\n" + "Energy Hatch,\n"
- + "Dynamo Hatch,\n"
- + "Charging Bus,\n"
- + "Discharging Bus,\n"
- + "Dynamo Buffer,\n"
- + "Multi-Amp Dynamo Hatch.\n\n\n"
- + "Structure MUST contain at least one energy input and one energy output hatch." });
+ """
+ Valid Hatches:
+ Energy Hatch,
+ Dynamo Hatch,
+ Charging Bus,
+ Discharging Bus,
+ Dynamo Buffer,
+ Multi-Amp Dynamo Hatch.
+
+
+ Structure MUST contain at least one energy input and one energy output hatch.""" });
// Test Novel
book_ModularBauble = writeBookTemplate(
"Manual_Modular_Bauble",
"How to: Modular Baubles",
"Alkalus",
- new String[] { "Concept: This idea came from wanting flexibility. \n"
- + "First step, Build a Modularity table to begin customisation of your Bauble. \n"
- + " After this has been constructed, you can now combine the upgrades listed within this book to improve the baubles level/100.",
- "Defence:\n" + "Can be upgraded by combining metal plates with the bauble. \n"
- + " | +1 | Aluminium \n"
- + " | +2 | Stainless Steel \n"
- + " | +3 | Tungsten \n"
- + " | +4 | Tungsten Steel \n"
- + " | +5 | Naquadah \n",
- "There was once a sad and lonely oak tree. \n", "There was once a sad and lonely oak tree. \n",
+ new String[] {
+ """
+ Concept: This idea came from wanting flexibility.\s
+ First step, Build a Modularity table to begin customisation of your Bauble.\s
+ After this has been constructed, you can now combine the upgrades listed within this book to improve the baubles level/100.""",
+ """
+ Defence:
+ Can be upgraded by combining metal plates with the bauble.\s
+ | +1 | Aluminium\s
+ | +2 | Stainless Steel\s
+ | +3 | Tungsten\s
+ | +4 | Tungsten Steel\s
+ | +5 | Naquadah\s
+ """, "There was once a sad and lonely oak tree. \n",
+ "There was once a sad and lonely oak tree. \n",
"There was once a sad and lonely oak tree. \n" });
// Test Novel
@@ -145,45 +159,57 @@ public class BookHandler {
"Alkalus",
new String[] {
// Page 1
- "Fission Fuel Processing Plant\n" + "Size: 3x9x3 [LxHxW]\n"
- + "Controller: Center, Bottom\n"
- + "4x Input Hatch\n"
- + "2x Output Hatch\n"
- + "1x Output Bus\n"
- + "1x ZPM+ Muffler\n"
- + "1x Maintenance Hatch\n"
- + "1x Energy Hatch\n",
+ """
+ Fission Fuel Processing Plant
+ Size: 3x9x3 [LxHxW]
+ Controller: Center, Bottom
+ 4x Input Hatch
+ 2x Output Hatch
+ 1x Output Bus
+ 1x ZPM+ Muffler
+ 1x Maintenance Hatch
+ 1x Energy Hatch
+ """,
// Page 2
- "[1] 7x Hastelloy-X or I/O\n" + "[2] 5x Incoloy-DS Fluid Containment\n"
- + "[3] 4x Zeron-100 Shielding\n"
- + "[4] 17x Hastelloy-N Sealant Case"
- + "\n"
- + "Multiblock Construction\n"
- + "Convention is [LxHxW]\n"
- + "\n",
+ """
+ [1] 7x Hastelloy-X or I/O
+ [2] 5x Incoloy-DS Fluid Containment
+ [3] 4x Zeron-100 Shielding
+ [4] 17x Hastelloy-N Sealant Case
+ Multiblock Construction
+ Convention is [LxHxW]
+
+ """,
// Page 3
- "Layer 1/2:\n" + "[1][1][1]\n"
- + "[1][1][1]\n"
- + "[1][1][1]\n"
- + "\n"
- + "Layer 3/5/6\n"
- + "[ ][4][ ]\n"
- + "[4][2][4]\n"
- + "[ ][4][ ]\n"
- + "\n",
+ """
+ Layer 1/2:
+ [1][1][1]
+ [1][1][1]
+ [1][1][1]
+
+ Layer 3/5/6
+ [ ][4][ ]
+ [4][2][4]
+ [ ][4][ ]
+
+ """,
// Page 4
- "Layer 4\n" + "[ ][3][ ]\n"
- + "[3][2][3]\n"
- + "[ ][3][ ]\n"
- + "\n"
- + "Layer 7/8/9\n"
- + "[ ][ ][ ]\n"
- + "[ ][3][ ]\n"
- + "[ ][ ][ ]\n",
+ """
+ Layer 4
+ [ ][3][ ]
+ [3][2][3]
+ [ ][3][ ]
+
+ Layer 7/8/9
+ [ ][ ][ ]
+ [ ][3][ ]
+ [ ][ ][ ]
+ """,
// Page 5
- "Fission Fuel\n" + "Processing Plant"
- + "----------------------\n"
- + "This structure is used to produce the Molten Salts required to run a Liquid Fluorine Thorium Reactor [LFTR]." });
+ """
+ Fission Fuel
+ Processing Plant----------------------
+ This structure is used to produce the Molten Salts required to run a Liquid Fluorine Thorium Reactor [LFTR].""" });
book_MultiChemicalPlant = writeBookTemplate(
"book_Multi_ChemicalPlant",
@@ -195,41 +221,31 @@ public class BookHandler {
"This book will explain how the Chemical Plant is constructed, which blocks are valid to upgrade it and also how the upgrades work.",
// Info
- "Solid Casings = Plant tier" + "\n"
- + "Machine Casings = Hatch tier"
- + "\n"
- + "Higher tier coils More Speed"
- + "\n"
- + "T1 50% , T2 100% , T3 150%, etc"
- + "\n",
- "Higher tier pipe casings boost parallel" + "\n"
- + "and reduce catalyst consumption."
- + "\n"
- + "+2 parallel per tier, 20% extra chance of"
- + "\n"
- + "not damaging catalyst per tier.",
- "Awakened Draconium Coil (or above) with" + "\n"
- + "Tungstensteel Pipe Casing"
- + "\n"
- + "does not damage catalyst at all.",
+ """
+ Solid Casings = Plant tier
+ Machine Casings = Hatch tier
+ Higher tier coils More Speed
+ T1 50% , T2 100% , T3 150%, etc
+ """, """
+ Higher tier pipe casings boost parallel
+ and reduce catalyst consumption.
+ +2 parallel per tier, 20% extra chance of
+ not damaging catalyst per tier.""", """
+ Awakened Draconium Coil (or above) with
+ Tungstensteel Pipe Casing
+ does not damage catalyst at all.""",
// Machine Casings
- "Valid Solid Machine Casings:" + "\n"
- + "1 - Strong Bronze"
- + "\n"
- + "2 - Solid Steel"
- + "\n"
- + "3 - Sturdy Aluminium"
- + "\n"
- + "4 - Clean Stainless Steel"
- + "\n"
- + "5 - Stable Titanium"
- + "\n"
- + "6 - Robust Tungstensteel"
- + "\n"
- + "7 - Vigorous Laurenium"
- + "\n"
- + "8 - Rugged Botmium",
+ """
+ Valid Solid Machine Casings:
+ 1 - Strong Bronze
+ 2 - Solid Steel
+ 3 - Sturdy Aluminium
+ 4 - Clean Stainless Steel
+ 5 - Stable Titanium
+ 6 - Robust Tungstensteel
+ 7 - Vigorous Laurenium
+ 8 - Rugged Botmium""",
// Machine Casings
"Valid Tiered Machine Casings:" + "\n"
@@ -265,201 +281,134 @@ public class BookHandler {
+ GT_Values.VN[9],
// Pipe Casings
- "Valid Pipe Casings:" + "\n"
- + "\n"
- + "1 - Bronze"
- + "\n"
- + "2 - Steel"
- + "\n"
- + "3 - Titanium"
- + "\n"
- + "4 - Tungstensteel",
+ """
+ Valid Pipe Casings:
+
+ 1 - Bronze
+ 2 - Steel
+ 3 - Titanium
+ 4 - Tungstensteel""",
// Coils
- "Valid Coils:" + "\n"
- + "\n"
- + "1 - Cupronickel"
- + "\n"
- + "2 - Kanthal"
- + "\n"
- + "3 - Nichrome"
- + "\n"
- + "4 - TPV-Alloy"
- + "\n"
- + "5 - HSS-G"
- + "\n"
- + "6 - HSS-S"
- + "\n"
- + "7 - Naquadah"
- + "\n"
- + "8 - Naquadah Alloy"
- + "\n"
- + "9 - Trinium"
- + "\n"
- + "10 - Fluxed Electrum",
- "11 - Awakened Draconium" + "\n"
- + "12 - Infinity"
- + "\n"
- + "13 - Hypogen"
- + "\n"
- + "14 - Eternal",
+ """
+ Valid Coils:
+
+ 1 - Cupronickel
+ 2 - Kanthal
+ 3 - Nichrome
+ 4 - TPV-Alloy
+ 5 - HSS-G
+ 6 - HSS-S
+ 7 - Naquadah
+ 8 - Naquadah Alloy
+ 9 - Trinium
+ 10 - Fluxed Electrum""", """
+ 11 - Awakened Draconium
+ 12 - Infinity
+ 13 - Hypogen
+ 14 - Eternal""",
// Requirements
- "Multiblock Requirements:" + "\n"
- + "\n"
- + "27x Coils"
- + "\n"
- + "18x Pipe Casings"
- + "\n"
- + "57x Tiered Machine Casings"
- + "\n"
- + "70+ Solid Casings"
- + "\n"
- + "1x Catalyst Housing (Catalysts cannot go inside an Input Bus)",
+ """
+ Multiblock Requirements:
+
+ 27x Coils
+ 18x Pipe Casings
+ 57x Tiered Machine Casings
+ 70+ Solid Casings
+ 1x Catalyst Housing (Catalysts cannot go inside an Input Bus)""",
// Construction Guide
- "Construction Guide Pt1:" + "\n"
- + "\n"
- + "Controller is placed on a middle casing in the bottom layer"
- + "\n"
- + "Hatches can only be placed on the bottom layer edges",
- "Construction Guide Pt2:" + "\n"
- + "\n"
- + "7x7x7 Hollow frame of solid casings"
- + "\n"
- + "5x1x5 layer of solid casings (fills in top layer)"
- + "\n"
- + "5x1x5 layer of machine casings (fills in bottom layer)",
- "Construction Guide Pt3:" + "\n"
- + "In the central 3x5x3:"
- + "\n"
- + "3x1x3 layer of Coils, surrounded by ring of Machine Casings"
- + "\n"
- + "3x1x3 layer of Pipe Casings"
- + "\n"
- + "3x1x3 layer of Coils"
- + "\n"
- + "3x1x3 layer of Pipe Casings"
- + "\n"
- + "3x1x3 layer of Coils, surrounded by ring of Machine Casings",
+ """
+ Construction Guide Pt1:
+
+ Controller is placed on a middle casing in the bottom layer
+ Hatches can only be placed on the bottom layer edges""", """
+ Construction Guide Pt2:
+
+ 7x7x7 Hollow frame of solid casings
+ 5x1x5 layer of solid casings (fills in top layer)
+ 5x1x5 layer of machine casings (fills in bottom layer)""", """
+ Construction Guide Pt3:
+ In the central 3x5x3:
+ 3x1x3 layer of Coils, surrounded by ring of Machine Casings
+ 3x1x3 layer of Pipe Casings
+ 3x1x3 layer of Coils
+ 3x1x3 layer of Pipe Casings
+ 3x1x3 layer of Coils, surrounded by ring of Machine Casings""",
// Construction Guide Info
- "Information:" + "\n"
- + "\n"
- + "A = Air"
- + "\n"
- + "X = Solid Casing"
- + "\n"
- + "M = Machine Casing"
- + "\n"
- + "P = Pipe Casing"
- + "\n"
- + "C = Coil Casing",
- "Layer 1:" + "\n"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XMMMMMX"
- + "\n"
- + "XMMMMMX"
- + "\n"
- + "XMMMMMX"
- + "\n"
- + "XMMMMMX"
- + "\n"
- + "XMMMMMX"
- + "\n"
- + "XXXXXXX",
- "Layer 2:" + "\n"
- + "\n"
- + "XAAAAAX"
- + "\n"
- + "AMMMMMA"
- + "\n"
- + "AMCCCMA"
- + "\n"
- + "AMCCCMA"
- + "\n"
- + "AMCCCMA"
- + "\n"
- + "AMMMMMA"
- + "\n"
- + "XAAAAAX",
- "Layer 3:" + "\n"
- + "\n"
- + "XAAAAAX"
- + "\n"
- + "AAAAAAA"
- + "\n"
- + "AAPPPAA"
- + "\n"
- + "AAPPPAA"
- + "\n"
- + "AAPPPAA"
- + "\n"
- + "AAAAAAA"
- + "\n"
- + "XAAAAAX",
- "Layer 4:" + "\n"
- + "\n"
- + "XAAAAAX"
- + "\n"
- + "AAAAAAA"
- + "\n"
- + "AACCCAA"
- + "\n"
- + "AACCCAA"
- + "\n"
- + "AACCCAA"
- + "\n"
- + "AAAAAAA"
- + "\n"
- + "XAAAAAX",
- "Layer 5:" + "\n"
- + "\n"
- + "XAAAAAX"
- + "\n"
- + "AAAAAAA"
- + "\n"
- + "AAPPPAA"
- + "\n"
- + "AAPPPAA"
- + "\n"
- + "AAPPPAA"
- + "\n"
- + "AAAAAAA"
- + "\n"
- + "XAAAAAX",
- "Layer 6:" + "\n"
- + "\n"
- + "XAAAAAX"
- + "\n"
- + "AMMMMMA"
- + "\n"
- + "AMCCCMA"
- + "\n"
- + "AMCCCMA"
- + "\n"
- + "AMCCCMA"
- + "\n"
- + "AMMMMMA"
- + "\n"
- + "XAAAAAX",
- "Layer 7:" + "\n"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XXXXXXX"
- + "\n"
- + "XXXXXXX", });
+ """
+ Information:
+
+ A = Air
+ X = Solid Casing
+ M = Machine Casing
+ P = Pipe Casing
+ C = Coil Casing""", """
+ Layer 1:
+
+ XXXXXXX
+ XMMMMMX
+ XMMMMMX
+ XMMMMMX
+ XMMMMMX
+ XMMMMMX
+ XXXXXXX""", """
+ Layer 2:
+
+ XAAAAAX
+ AMMMMMA
+ AMCCCMA
+ AMCCCMA
+ AMCCCMA
+ AMMMMMA
+ XAAAAAX""", """
+ Layer 3:
+
+ XAAAAAX
+ AAAAAAA
+ AAPPPAA
+ AAPPPAA
+ AAPPPAA
+ AAAAAAA
+ XAAAAAX""", """
+ Layer 4:
+
+ XAAAAAX
+ AAAAAAA
+ AACCCAA
+ AACCCAA
+ AACCCAA
+ AAAAAAA
+ XAAAAAX""", """
+ Layer 5:
+
+ XAAAAAX
+ AAAAAAA
+ AAPPPAA
+ AAPPPAA
+ AAPPPAA
+ AAAAAAA
+ XAAAAAX""", """
+ Layer 6:
+
+ XAAAAAX
+ AMMMMMA
+ AMCCCMA
+ AMCCCMA
+ AMCCCMA
+ AMMMMMA
+ XAAAAAX""", """
+ Layer 7:
+
+ XXXXXXX
+ XXXXXXX
+ XXXXXXX
+ XXXXXXX
+ XXXXXXX
+ XXXXXXX
+ XXXXXXX""", });
}
public static ItemStack ItemBookWritten_ThermalBoiler;
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index b359fe99ba..7aa9c73236 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -48,7 +48,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCyclotron;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFactoryGradeReplacementMultis;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeneratorsULV;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechHiAmpTransformer;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialAlloySmelter;
@@ -90,12 +89,10 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerator
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarTower;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamMultis;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperChests;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThaumcraftDevices;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechThreadedBuffers;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredChunkloaders;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTieredFluidTanks;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechTreeFarmerTE;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechWirelessChargers;
@@ -125,11 +122,9 @@ public class COMPAT_HANDLER {
*/
new RECIPES_LaserEngraver();
- GregtechGeneratorsULV.run();
GregtechEnergyBuffer.run();
GregtechLFTR.run();
GregtechNuclearSaltProcessingPlant.run();
- GregtechSteamCondenser.run();
GregtechIndustrialCentrifuge.run();
GregtechIndustrialCokeOven.run();
GregtechIndustrialPlatePress.run();
@@ -163,7 +158,6 @@ public class COMPAT_HANDLER {
GregtechIndustrialCuttingFactory.run();
GregtechSuperChests.run();
GregtechIndustrialFishPond.run();
- GregtechTieredChunkloaders.run();
GregtechIndustrialExtruder.run();
GregtechIndustrialMultiMachine.run();
GregtechBufferDynamos.run();
@@ -250,11 +244,11 @@ public class COMPAT_HANDLER {
runQueuedOnLoadComplete(event);
}
- public static final AutoMap<RunnableWithInfo<String>> mRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
- public static final AutoMap<RunnableWithInfo<String>> mGtRecipesToGenerate = new AutoMap<RunnableWithInfo<String>>();
+ public static final AutoMap<RunnableWithInfo<String>> mRecipesToGenerate = new AutoMap<>();
+ public static final AutoMap<RunnableWithInfo<String>> mGtRecipesToGenerate = new AutoMap<>();
- public static final AutoMap<RunnableWithInfo<String>> mObjectsToRunInPostInit = new AutoMap<RunnableWithInfo<String>>();
- public static final AutoMap<ItemPackage> mObjectsToRunInOnLoadComplete = new AutoMap<ItemPackage>();
+ public static final AutoMap<RunnableWithInfo<String>> mObjectsToRunInPostInit = new AutoMap<>();
+ public static final AutoMap<ItemPackage> mObjectsToRunInOnLoadComplete = new AutoMap<>();
public static void runQueuedRecipes() {
// Add autogenerated Recipes from Item Components
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
index 0593c833f3..af09762c08 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
@@ -10,7 +10,6 @@ import gtPlusPlus.xmod.bop.HANDLER_BiomesOPlenty;
import gtPlusPlus.xmod.forestry.HANDLER_FR;
import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import gtPlusPlus.xmod.ic2.HANDLER_IC2;
-import gtPlusPlus.xmod.ob.HANDLER_OpenBlocks;
import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft;
import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF;
import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers;
@@ -30,7 +29,6 @@ public class COMPAT_IntermodStaging {
public static void init(FMLInitializationEvent init) {
HANDLER_GT.init();
HANDLER_TF.init();
- HANDLER_OpenBlocks.init();
}
public static void postInit(FMLPostInitializationEvent postinit) {
@@ -42,7 +40,6 @@ public class COMPAT_IntermodStaging {
HANDLER_Tinkers.postInit();
HANDLER_CropsPlusPlus.postInit(postinit);
HANDLER_Railcraft.postInit();
- HANDLER_OpenBlocks.postInit();
RecipeRemovals.postInit();
}
diff --git a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
index a2f08e2ba1..2da010cb1f 100644
--- a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java
@@ -15,7 +15,6 @@ import gtPlusPlus.core.container.Container_DecayablesChest;
import gtPlusPlus.core.container.Container_FishTrap;
import gtPlusPlus.core.container.Container_PestKiller;
import gtPlusPlus.core.container.Container_ProjectTable;
-import gtPlusPlus.core.container.Container_RoundRobinator;
import gtPlusPlus.core.container.Container_SuperJukebox;
import gtPlusPlus.core.container.Container_VolumetricFlaskSetter;
import gtPlusPlus.core.gui.beta.Gui_ID_Registry;
@@ -25,7 +24,6 @@ import gtPlusPlus.core.gui.machine.GUI_DecayablesChest;
import gtPlusPlus.core.gui.machine.GUI_FishTrap;
import gtPlusPlus.core.gui.machine.GUI_PestKiller;
import gtPlusPlus.core.gui.machine.GUI_ProjectTable;
-import gtPlusPlus.core.gui.machine.GUI_RoundRobinator;
import gtPlusPlus.core.gui.machine.GUI_SuperJukebox;
import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter;
import gtPlusPlus.core.interfaces.IGuiManager;
@@ -35,7 +33,6 @@ import gtPlusPlus.core.tileentities.general.TileEntityFishTrap;
import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter;
import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller;
import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable;
-import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator;
public class GuiHandler implements IGuiHandler {
@@ -54,7 +51,7 @@ public class GuiHandler implements IGuiHandler {
public static final int GUI13 = 12; // Decayables Chest
public static final int GUI14 = 13; // Super Jukebox
public static final int GUI15 = 14; // Pest Killer
- public static final int GUI16 = 15; // Round-Robinator
+ public static final int GUI16 = 15; // None
public static final int GUI17 = 16; // None
public static final int GUI18 = 17; // Volumetric Flask Setter
@@ -88,8 +85,6 @@ public class GuiHandler implements IGuiHandler {
return new Container_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
} else if (ID == GUI15) {
return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te);
- } else if (ID == GUI16) {
- return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
} else if (ID == GUI18) {
return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te);
}
@@ -130,8 +125,6 @@ public class GuiHandler implements IGuiHandler {
return new GUI_SuperJukebox(player.inventory, (TileEntitySuperJukebox) te);
} else if (ID == GUI15) {
return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te);
- } else if (ID == GUI16) {
- return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te);
} else if (ID == GUI18) {
return new GUI_VolumetricFlaskSetter(
new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te));
diff --git a/src/main/java/gtPlusPlus/core/handler/MobMentality.java b/src/main/java/gtPlusPlus/core/handler/MobMentality.java
deleted file mode 100644
index 15be7cc4f4..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/MobMentality.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package gtPlusPlus.core.handler;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.monster.IMob;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraftforge.event.entity.living.LivingHurtEvent;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import gtPlusPlus.core.util.minecraft.EntityUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-
-public class MobMentality {
-
- public static HashSet<Class<EntityLivingBase>> sIgnoredTypes = new HashSet<Class<EntityLivingBase>>();
-
- @SubscribeEvent
- public void onEntityDamaged(LivingHurtEvent event) {
- final EntityLivingBase target = event.entityLiving;
- for (Class<EntityLivingBase> aEntityClass : sIgnoredTypes) {
- if (aEntityClass.isInstance(target)) {
- return;
- }
- }
- if (target instanceof EntityLivingBase) {
- final EntityLivingBase entity = target;
- final Entity attacker = event.source.getSourceOfDamage();
- if (
- /* this.configuration.shouldIgnoreNeutralMobs() && */ !(entity instanceof IMob)) {
- return;
- }
- if (attacker == null) {
- return;
- }
- if (attacker instanceof EntityLivingBase && !PlayerUtils.isRealPlayer((EntityLivingBase) attacker)) {
- return;
- }
- if (attacker instanceof EntityPlayer && PlayerUtils.isCreative((EntityPlayer) attacker)) {
- return;
- }
- if (attacker instanceof EntityLivingBase) {
- List<Entity> aEntityList = target.worldObj.loadedEntityList;
- List<EntityLivingBase> aRangedEntity = new ArrayList<EntityLivingBase>();
- for (Entity aEntity : aEntityList) {
- if (target.getClass().isInstance(aEntity)) {
- if (EntityUtils.getDistance(target, aEntity) <= 32) {
- aRangedEntity.add((EntityLivingBase) aEntity);
- }
- }
- }
- for (EntityLivingBase aEntity : aRangedEntity) {
- aEntity.setRevengeTarget((EntityLivingBase) attacker);
- }
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
index 8e04b5b68f..9a2f57233b 100644
--- a/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/PacketHandler.java
@@ -30,12 +30,12 @@ public class PacketHandler {
/**
* Registers a message and message handler
*/
- private static final void registerMessage(Class handlerClass, Class messageClass) {
+ private static void registerMessage(Class handlerClass, Class messageClass) {
Side side = AbstractClientMessageHandler.class.isAssignableFrom(handlerClass) ? Side.CLIENT : Side.SERVER;
registerMessage(handlerClass, messageClass, side);
}
- private static final void registerMessage(Class handlerClass, Class messageClass, Side side) {
+ private static void registerMessage(Class handlerClass, Class messageClass, Side side) {
INSTANCE.registerMessage(handlerClass, messageClass, packetId++, side);
if (AbstractPacket.class.isInstance(messageClass.getClass())) {
AbstractPacket aPacket = ReflectionUtils.createNewInstanceFromConstructor(
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
index 371c8f21e4..16781cea8c 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java
@@ -8,7 +8,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
public class DecayableRecipe {
- public static final AutoMap<DecayableRecipe> mRecipes = new AutoMap<DecayableRecipe>();
+ public static final AutoMap<DecayableRecipe> mRecipes = new AutoMap<>();
public final int mTime;
public final ItemStack mInput;
@@ -23,8 +23,7 @@ public class DecayableRecipe {
@Override
public boolean equals(Object o) {
- if (o instanceof DecayableRecipe) {
- DecayableRecipe i = (DecayableRecipe) o;
+ if (o instanceof DecayableRecipe i) {
if (i.mTime == this.mTime && GT_Utility.areStacksEqual(mInput, i.mInput)
&& GT_Utility.areStacksEqual(mOutput, i.mOutput)) {
return true;
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
index 3e20194498..9eb3a1826e 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
@@ -13,7 +13,7 @@ public class LateRegistrationHandler {
init();
}
- private static final void init() {
+ private static void init() {
for (final ShapedRecipeObject item : COMPAT_HANDLER.AddRecipeQueue) {
item.buildRecipe();
}
diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
index 005ebba204..abf7300f7a 100644
--- a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -3,7 +3,6 @@ package gtPlusPlus.core.handler.Recipes;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.handler.COMPAT_HANDLER;
import gtPlusPlus.core.recipe.RECIPES_General;
-import gtPlusPlus.core.recipe.RECIPES_MachineComponents;
import gtPlusPlus.core.recipe.RECIPES_Machines;
import gtPlusPlus.core.recipe.RECIPE_Batteries;
@@ -16,10 +15,9 @@ public class RegistrationHandler {
init();
}
- private static final void init() {
+ private static void init() {
RECIPES_General.loadRecipes();
RECIPES_Machines.loadRecipes();
- RECIPES_MachineComponents.loadRecipes();
RECIPE_Batteries.loadRecipes();
Logger.INFO("Loaded: " + recipesSuccess + " Failed: " + recipesFailed);
COMPAT_HANDLER.areInitItemsLoaded = true;
diff --git a/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java b/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java
index 3546d47f65..678f2ac62f 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/CustomMovementHandler.java
@@ -57,8 +57,6 @@ public class CustomMovementHandler {
// Check to see if Enabled - Added 6/17/14 to provide option to disable Sneak Toggle
final boolean isSneaking = SneakManager.get(thisPlayer).Sneaking();
- // Utils.LOG_INFO("Can sneak: "+isSneaking);
- // Utils.LOG_INFO("Can sprint: "+SneakManager.Sprinting());
if (isSneaking) {
// Key Pressed
if (settings.keyBindSneak.getIsKeyPressed() && !this.handledSneakPress) {
diff --git a/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java b/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
index d464f953a3..c92985b802 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java
@@ -19,8 +19,8 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils;
public class EntityDeathHandler {
- private static final HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>> mMobDropMap = new HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>>();
- private static final HashSet<Class> mInternalClassKeyCache = new HashSet<Class>();
+ private static final HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>> mMobDropMap = new HashMap<>();
+ private static final HashSet<Class> mInternalClassKeyCache = new HashSet<>();
/**
* Provides the ability to provide custom drops upon the death of EntityLivingBase objects.
@@ -31,13 +31,10 @@ public class EntityDeathHandler {
* @param aChance - Chance out of 10000, where 100 is 1%. (1 = 0.01% - this is ok)
*/
public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) {
- Triplet<ItemStack, Integer, Integer> aData = new Triplet<ItemStack, Integer, Integer>(
- aStack,
- aMaxAmount,
- aChance);
+ Triplet<ItemStack, Integer, Integer> aData = new Triplet<>(aStack, aMaxAmount, aChance);
AutoMap<Triplet<ItemStack, Integer, Integer>> aDataMap = mMobDropMap.get(aMobClass);
if (aDataMap == null) {
- aDataMap = new AutoMap<Triplet<ItemStack, Integer, Integer>>();
+ aDataMap = new AutoMap<>();
}
aDataMap.put(aData);
mMobDropMap.put(aMobClass, aDataMap);
@@ -49,9 +46,7 @@ public class EntityDeathHandler {
+ ") as a valid drop for "
+ aMobClass.getCanonicalName());
- if (!mInternalClassKeyCache.contains(aMobClass)) {
- mInternalClassKeyCache.add(aMobClass);
- }
+ mInternalClassKeyCache.add(aMobClass);
}
private static ItemStack processItemDropTriplet(Triplet<ItemStack, Integer, Integer> aData) {
@@ -117,7 +112,6 @@ public class EntityDeathHandler {
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event) {
- boolean aDidDrop = false;
if (event == null || event.entityLiving == null) {
return;
}
@@ -125,9 +119,9 @@ public class EntityDeathHandler {
EntityPlayer aPlayer = (EntityPlayer) event.entityLiving;
dropMeatFromPlayer(aPlayer);
} else {
- for (Class c : mInternalClassKeyCache) {
+ for (Class<?> c : mInternalClassKeyCache) {
if (c.isInstance(event.entityLiving)) {
- aDidDrop = processDropsForMob(event.entityLiving);
+ processDropsForMob(event.entityLiving);
}
}
}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
index 867a2538f3..650fd70efd 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java
@@ -11,6 +11,7 @@ import gregtech.api.enums.Mods;
public class GeneralTooltipEventHandler {
@Optional.Method(modid = Mods.Names.ADVANCED_SOLAR_PANEL)
+ @SuppressWarnings("unused")
public static void molecularTransformer(ItemTooltipEvent event) {
if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) {
event.toolTip.add("" + EnumChatFormatting.RED + "Disabled, Use the multiblock");
diff --git a/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java
deleted file mode 100644
index fec88a5d74..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/events/LoginEventHandler.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package gtPlusPlus.core.handler.events;
-
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.UUID;
-
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.EntityPlayerMP;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-import cpw.mods.fml.common.gameevent.PlayerEvent;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.core.proxy.ClientProxy;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.core.util.player.PlayerCache;
-
-public class LoginEventHandler {
-
- public String localPlayersName;
- public UUID localPlayersUUID;
- private EntityPlayer localPlayerRef;
-
- @SubscribeEvent
- public void onPlayerLogin(final PlayerEvent.PlayerLoggedInEvent event) {
-
- this.localPlayerRef = event.player;
- this.localPlayersName = event.player.getDisplayName();
- this.localPlayersUUID = event.player.getUniqueID();
-
- // Set this for easier use elsewhere.
- if (event.player.getEntityWorld().isRemote) {
- ClientProxy.playerName = this.localPlayersName;
- }
-
- try {
- // new SegmentAnalytics(event.player);
- } catch (Throwable t) {
- // SegmentAnalytics.LOG("Failed to create Analytics submission during log in process.");
- }
-
- try {
-
- if (this.localPlayerRef instanceof EntityPlayerMP) {
-
- // Populates player cache
- if (!this.localPlayerRef.worldObj.isRemote) {
- PlayerCache.appendParamChanges(this.localPlayersName, this.localPlayersUUID.toString());
- }
-
- /*
- * if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009") ||
- * localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
- * Utils.LOG_INFO("Spawning a new Santa Thread."); Thread t = new Thread() { UUID threadHandlerIDthing =
- * localPlayersUUID;
- * @Override public void run() { while(true && Minecraft.getMinecraft().getIntegratedServer() != null) {
- * try { if(localPlayerRef == null){ localPlayerRef =
- * Utils.getPlayerOnServerFromUUID(threadHandlerIDthing); } //ImQ009 is a legend. if
- * (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009")){
- * Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
- * localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.
- * itemIngotRaisinBread, MathUtils.randInt(1, 5))); } if
- * (localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
- * Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
- * localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.
- * itemIngotRaisinBread, MathUtils.randInt(1, 5))); } Thread.sleep(1000*60*MathUtils.randInt(15, 90)); }
- * catch (InterruptedException ie) { Utils.LOG_INFO("Santa Mode Disabled."); } }
- * Utils.LOG_INFO("Thread Stopped. Handler Closed."); } }; //t.start(); }
- */
-
- }
- } catch (final Throwable errr) {
- Logger.INFO("Login Handler encountered an error.");
- }
- }
-
- // Handles notifying the player about a version update.
- public Timer ShortTimer(EntityPlayer localPlayer, final int seconds) {
- Timer timer;
- timer = new Timer();
- timer.schedule(new NotifyPlayer(localPlayer), seconds * 1000);
- return timer;
- }
-
- // Timer Task for notifying the player.
- class NotifyPlayer extends TimerTask {
-
- final EntityPlayer toMessage;
-
- public NotifyPlayer(EntityPlayer localPlayer) {
- toMessage = localPlayer;
- }
-
- @Override
- public void run() {
- if (toMessage != null) {
- if (toMessage instanceof EntityPlayerMP) {
- PlayerUtils.messagePlayer(
- toMessage,
- "You're not using the latest recommended version of GT++, consider updating.");
- }
- }
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
deleted file mode 100644
index 05dc46b2b2..0000000000
--- a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package gtPlusPlus.core.handler.events;
-
-import net.minecraftforge.event.entity.player.PlayerInteractEvent;
-
-import cpw.mods.fml.common.eventhandler.SubscribeEvent;
-
-public class PickaxeBlockBreakEventHandler {
-
- @SubscribeEvent
- public void onPlayerInteraction(final PlayerInteractEvent aEvent) {
- if ((aEvent.entityPlayer != null) && (aEvent.entityPlayer.worldObj != null)
- && (aEvent.action != null)
- && (aEvent.world.provider != null)
- && !aEvent.entityPlayer.worldObj.isRemote
- && (aEvent.action != null)
- && (aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR)) {
- // Utils.LOG_ERROR("Test");
- }
- }
-}
diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
index 5fa5739940..8fb4a61c44 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java
@@ -18,14 +18,14 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.preloader.DevHelper;
+import gtPlusPlus.preloader.CORE_Preloader;
public class PlayerSleepEventHandler {
private static Field sEffectDuration = ReflectionUtils
- .getField(PotionEffect.class, DevHelper.isObfuscatedEnvironment() ? "field_76460_b" : "duration");
- private static ArrayList<Potion> sPositiveEffects = new ArrayList<Potion>();
- private static ArrayList<Potion> sNegativeEffects = new ArrayList<Potion>();
+ .getField(PotionEffect.class, !CORE_Preloader.DEV_ENVIRONMENT ? "field_76460_b" : "duration");
+ private static ArrayList<Potion> sPositiveEffects = new ArrayList<>();
+ private static ArrayList<Potion> sNegativeEffects = new ArrayList<>();
public static void init() {
Utils.registerEvent(new PlayerSleepEventHandler());
diff --git a/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java b/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
index 14e9af20ec..ad6477026f 100644
--- a/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
+++ b/src/main/java/gtPlusPlus/core/handler/events/SneakManager.java
@@ -10,7 +10,7 @@ public class SneakManager {
// We make this a singleton for clientside data storage.
- public static ConcurrentHashMap<String, SneakManager> mPlayerCache = new ConcurrentHashMap<String, SneakManager>();
+ public static ConcurrentHashMap<String, SneakManager> mPlayerCache = new ConcurrentHashMap<>();
private static void addPlayer(EntityPlayer aPlayer) {
String aKey = getKey(aPlayer);
diff --git a/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java b/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
index e9e2609e1e..43b7d3a2d1 100644
--- a/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
+++ b/src/main/java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java
@@ -18,7 +18,7 @@ import net.minecraft.world.World;
public class Workbench_CraftingHandler {
private static final Workbench_CraftingHandler instance = new Workbench_CraftingHandler();
- private final List<IRecipe> recipes = new ArrayList<IRecipe>();
+ private final List<IRecipe> recipes = new ArrayList<>();
public static final Workbench_CraftingHandler getInstance() {
return instance;
@@ -44,8 +44,7 @@ public class Workbench_CraftingHandler {
if (par2ArrayOfObj[i] instanceof String[]) {
final String as[] = (String[]) par2ArrayOfObj[i++];
- for (int l = 0; l < as.length; l++) {
- final String s2 = as[l];
+ for (final String s2 : as) {
k++;
j = s2.length();
s = (new StringBuilder()).append(s).append(s2).toString();
@@ -59,7 +58,7 @@ public class Workbench_CraftingHandler {
}
}
- final HashMap<Character, ItemStack> hashmap = new HashMap<Character, ItemStack>();
+ final HashMap<Character, ItemStack> hashmap = new HashMap<>();
for (; i < par2ArrayOfObj.length; i += 2) {
final Character character = (Character) par2ArrayOfObj[i];
@@ -92,13 +91,11 @@ public class Workbench_CraftingHandler {
}
public void addShapelessRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) {
- final ArrayList<ItemStack> arraylist = new ArrayList<ItemStack>();
+ final ArrayList<ItemStack> arraylist = new ArrayList<>();
final Object aobj[] = par2ArrayOfObj;
final int i = aobj.length;
- for (int j = 0; j < i; j++) {
- final Object obj = aobj[j];
-
+ for (final Object obj : aobj) {
if (obj instanceof ItemStack) {
arraylist.add(((ItemStack) obj).copy());
continue;
@@ -144,9 +141,7 @@ public class Workbench_CraftingHandler {
* item.getMaxDamage() - j1; if (k1 < 0) { k1 = 0; } return new ItemStack(itemstack.itemID, 1, k1); }
*/
- for (int k = 0; k < this.recipes.size(); k++) {
- final IRecipe irecipe = this.recipes.get(k);
-
+ for (final IRecipe irecipe : this.recipes) {
if (irecipe.matches(par1InventoryCrafting, par2World)) {
return irecipe.getCraftingResult(par1InventoryCrafting);
}