diff options
| author | Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> | 2023-09-04 03:05:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-04 03:05:22 +0100 |
| commit | 76719d65a90d98e228a914774d3b11ed9f01ac8e (patch) | |
| tree | ce0d35f954e441e9cc4aa95aa347073728e6f4ee /src/main/java/gtPlusPlus/core/handler | |
| parent | 0393b582eb3edcb5c575330804b6747577a55e27 (diff) | |
| download | GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.gz GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.tar.bz2 GT5-Unofficial-76719d65a90d98e228a914774d3b11ed9f01ac8e.zip | |
Clean-up v2 (#729)
* Remove test items from NEI with no texture
* Add number formatting to hand pumps
* Remove heavy plates (no recipes & completely unused).
* Remove helium generator (no texture, no recipe)
* Remove fire pit and fire starter (no use, no recipe, no textures)
* Remove giant chicken and associated unused stuff, has no texture and is unobtainable. Used to be relevant but isn't anymore.
* Remove villagers with silly trades like 1 motor + 1 hull = 1 hull. Why?
* Remove trade bench, no recipe, missing textures. Unused.
* Remove farm processors, no texture, no recipe. Unused.
* Remove MAX tier components, these exist in GT now, have no recipe here and are unused.
* Hide untextured light block from NEI
* Update buildscript
* Remove unused backpacks, no recipe and contains dupe bugs. Bad.
* Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable.
* Remove eatotronic, universal toolbox and magic tool bag. All 3 are missing textures and uncraftable. part 2
* Remove dragon catcher (what?), no texture, no recipe, unused.
* Remove empty item, does nothing, has no recipe, no idea why it is here.
* Empty item v2 removal
* Revert "Empty item v2 removal"
This reverts commit 75bcd3ccfaf55bbfe2c12b2e4167d5c37636030d.
* Revert "Remove empty item, does nothing, has no recipe, no idea why it is here."
This reverts commit e41a9f484392776331c58530ab1faa5ef978ef36.
* Remove debug square. No recipe, unused.
* Number formatting overflow covers
* Remove JVM garbage collection block. Unused, no recipe.
* Remove nanotubes, no recipe for them. Unused.
* Remove "git" item, doesn't seem to work. Has no recipe.
* Remove uncraftable food with awful textures.
* Remove "bat king" mob, unused content. Does not spawn.
* Remove uncraftable doors with bad textures. Unused content.
* Remove uncraftable, unlocalised redstone stuff that crashes game when placed.
* Remove weird spawner item. No recipe, does not exist in world.
* Remove sunnarium bit, no recipe, no usage.
* Remove unused modularity table and some misc uncraftable, unused items.
* Remove Interconnecting Storage Crate, no recipe, unused.
* Delete worse debug power gen, this already exists as part of GT. Unneeded duplication.
* Delete unused placeholder circuit
* Delete uncraftable generator hatches.
* Spotless
* Remove XP tank thing, unused and uncraftable.
* Remove null item, this fluid registry only seemed to register one null fluid. All others exist?
* Remove EU -> RF battery. Unused in GTNH.
* Remove some shelf nonsense, why is this in this mod?
* Remove some weird random tools. These have no realistic usage in GTNH.
* Remove firemaker. Useless in GTNH.
* Removed helium blob. Deprecated item, not used anymore, uncraftable.
* spotlessApply (#730)
Co-authored-by: GitHub GTNH Actions <>
* Stop modulators generating unused blocks with no textures
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove more unused untextured casings
* Remove some weird methods and uncraftable mining parts, probably part of deprecated multiblock.
* spotlessApply (#732)
Co-authored-by: GitHub GTNH Actions <>
* Remove gem shards, unused.
* Remove unused atoms
* Remove unused gum
* Remove unused elements/materials
* Bye bye
* Remove some unused reflection stuff
* Remove control cores, obsolete now.
* Remove mob killing thing with no texture and no recipe.
* Remove uncraftable covers
* Remove pizza gloves
* Net and rope removal, unused
* Remove force crop
* Removal of some old event stuff
* Remove unused nuclear chem items
* Remove player safe, mostly because of the horrible event code that was intercepting every block break. I can't see any real usage of this via discord.
* Remove Force material and associated other nonsense. Also remove some nuclear chem stuff.
* Remove force for realsies
* Skookum Chooker purge.
* Remove some enderio compat, these plates/dusts are added via GT5 anyway now. This is obsolete.
* spotlessApply (#733)
Co-authored-by: GitHub GTNH Actions <>
* Unused textures
* Bump dep
* Revert "Remove force for realsies"
This reverts commit 0d288912a99f9dabce56d2a2623d4d3510f4804e.
* Revert "Remove Force material and associated other nonsense. Also remove some nuclear chem stuff."
This reverts commit 3455e6e916defe1f2aef923be6f9696a6cf3095b.
* Remove nuclear items that are unused
* spotlessApply (#734)
Co-authored-by: GitHub GTNH Actions <>
---------
Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>
Co-authored-by: Connor Colenso <colen@CONNORSPC>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/core/handler')
11 files changed, 14 insertions, 765 deletions
diff --git a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java index 489d26fa96..74f7287ca3 100644 --- a/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/AchievementHandler.java @@ -28,7 +28,6 @@ import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; public class AchievementHandler { @@ -60,17 +59,6 @@ public class AchievementHandler { "", true); - // Useful Info - boolean cores = CORE.ConfigSwitches.requireControlCores; - if (cores || GregtechMeta_MultiBlockBase.DEBUG_DISABLE_CORES_TEMPORARILY) { - this.registerAchievement( - "hatch.control", - -2, - -2, - GregtechItemList.Hatch_Control_Core.get(1), - aBaseAchievementName, - false); - } this.registerAchievement( "hatch.dynamo.buffered", 2, @@ -84,7 +72,7 @@ public class AchievementHandler { -4, -2, GregtechItemList.Industrial_AlloyBlastSmelter.get(1), - cores ? "hatch.control" : aBaseAchievementName, + aBaseAchievementName, true); // Material Advancement diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 8e9a1ca330..5b7d1de7fb 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.handler; -import static gregtech.api.enums.Mods.EnderIO; import static gregtech.api.enums.Mods.ExtraUtilities; import static gregtech.api.enums.Mods.OpenBlocks; import static gregtech.api.enums.Mods.PamsHarvestCraft; @@ -20,7 +19,6 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; -import gtPlusPlus.core.common.compat.COMPAT_EnderIO; import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils; import gtPlusPlus.core.common.compat.COMPAT_HarvestCraft; import gtPlusPlus.core.common.compat.COMPAT_IC2; @@ -29,7 +27,6 @@ import gtPlusPlus.core.common.compat.COMPAT_Thaumcraft; import gtPlusPlus.core.common.compat.COMPAT_Witchery; import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; -import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.recipe.RECIPES_GREGTECH; @@ -37,8 +34,6 @@ import gtPlusPlus.core.recipe.RECIPES_LaserEngraver; import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_ChemicalSkips; @@ -93,7 +88,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechQuantumForceTransformer; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator; -import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSimpleWasher; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators; @@ -119,9 +113,6 @@ public class COMPAT_HANDLER { Logger.INFO("Registering Materials with OreDict."); // In-house - // tools - GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer)); - for (int i = 1; i <= 10; i++) { GT_OreDictUnificator.registerOre( "bufferCore_" + GT_Values.VN[i - 1], @@ -130,13 +121,6 @@ public class COMPAT_HANDLER { } public static void registerGregtechMachines() { - // Debug - GregtechItemList.Garbage_Collector_Debug_Machine.set( - new GregtechMetaGarbageCollector( - "garbagecollector.01.tier.single", - "JVM Garbage Collector", - "Useful for debugging or smoother performance on local servers").getStackForm(1L)); - // Free IDs /* * --- 859 to 868 --- 911 to 940 @@ -148,7 +132,6 @@ public class COMPAT_HANDLER { GregtechLFTR.run(); GregtechNuclearSaltProcessingPlant.run(); GregtechSteamCondenser.run(); - GregtechSafeBlock.run(); GregtechIndustrialCentrifuge.run(); GregtechIndustrialCokeOven.run(); GregtechIndustrialPlatePress.run(); @@ -210,9 +193,6 @@ public class COMPAT_HANDLER { // InterMod public static void intermodOreDictionarySupport() { - if (EnderIO.isModLoaded()) { - COMPAT_EnderIO.OreDict(); - } if (OpenBlocks.isModLoaded()) { COMPAT_OpenBlocks.OreDict(); } diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index d51acebcac..f511e3e6ae 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -12,8 +12,6 @@ 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.sc2.HANDLER_SC2; -import gtPlusPlus.xmod.sol.HANDLER_SpiceOfLife; import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft; import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF; import gtPlusPlus.xmod.tinkers.HANDLER_Tinkers; @@ -26,10 +24,8 @@ public class COMPAT_IntermodStaging { HANDLER_FR.preInit(); HANDLER_IC2.preInit(); HANDLER_BiomesOPlenty.preInit(); - HANDLER_SC2.preInit(); HANDLER_CropsPlusPlus.preInit(preinit); HANDLER_Railcraft.preInit(); - HANDLER_SpiceOfLife.preInit(); } public static void init(FMLInitializationEvent init) { diff --git a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java index 04ad22178b..e0b9e71c2d 100644 --- a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java @@ -10,86 +10,43 @@ import cpw.mods.fml.common.network.NetworkRegistry; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; -import gtPlusPlus.core.container.Container_BackpackBase; -import gtPlusPlus.core.container.Container_CircuitProgrammer; -import gtPlusPlus.core.container.Container_DecayablesChest; -import gtPlusPlus.core.container.Container_EggBox; -import gtPlusPlus.core.container.Container_FishTrap; -import gtPlusPlus.core.container.Container_Grindle; -import gtPlusPlus.core.container.Container_ModularityTable; -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_TradeTable; -import gtPlusPlus.core.container.Container_VolumetricFlaskSetter; -import gtPlusPlus.core.container.box.LunchBoxContainer; -import gtPlusPlus.core.container.box.MagicBagContainer; -import gtPlusPlus.core.container.box.ToolBoxContainer; +import gtPlusPlus.core.container.*; import gtPlusPlus.core.gui.beta.Gui_ID_Registry; import gtPlusPlus.core.gui.beta.MU_GuiId; -import gtPlusPlus.core.gui.item.GuiBaseBackpack; -import gtPlusPlus.core.gui.item.GuiBaseGrindle; -import gtPlusPlus.core.gui.item.box.LunchBoxGui; -import gtPlusPlus.core.gui.item.box.MagicBagGui; -import gtPlusPlus.core.gui.item.box.ToolBoxGui; -import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer; -import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; -import gtPlusPlus.core.gui.machine.GUI_EggBox; -import gtPlusPlus.core.gui.machine.GUI_FishTrap; -import gtPlusPlus.core.gui.machine.GUI_ModularityTable; -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_TradeTable; -import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter; +import gtPlusPlus.core.gui.machine.*; import gtPlusPlus.core.interfaces.IGuiManager; -import gtPlusPlus.core.inventories.BaseInventoryBackpack; -import gtPlusPlus.core.inventories.BaseInventoryGrindle; -import gtPlusPlus.core.inventories.box.LunchBoxInventory; -import gtPlusPlus.core.inventories.box.MagicBagInventory; -import gtPlusPlus.core.inventories.box.ToolBoxInventory; -import gtPlusPlus.core.tileentities.base.TileEntityBase; import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; -import gtPlusPlus.core.tileentities.general.TileEntityEggBox; import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter; -import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; -import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; public class GuiHandler implements IGuiHandler { public static final int GUI1 = 0; // Project Table - public static final int GUI2 = 1; // Helium Generator - public static final int GUI3 = 2; // BackpackHandler + public static final int GUI2 = 1; // None + public static final int GUI3 = 2; // None public static final int GUI4 = 3; // Workbench public static final int GUI5 = 4; // Workbench Adv public static final int GUI6 = 5; // Fish trap - public static final int GUI7 = 6; // Trade table + public static final int GUI7 = 6; // None public static final int GUI8 = 7; // Circuit Programmer - public static final int GUI9 = 8; // Grindle - public static final int GUI10 = 9; // Universal Toolbox - public static final int GUI11 = 10; // Auto Lunchbox - public static final int GUI12 = 11; // Bag for Magic Tools + public static final int GUI9 = 8; // None + public static final int GUI10 = 9; // None + public static final int GUI11 = 10; // None + public static final int GUI12 = 11; // None 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 GUI17 = 16; // Egg Box + public static final int GUI17 = 16; // None public static final int GUI18 = 17; // Volumetric Flask Setter public static void init() { - Logger.INFO("Registering GUIs."); NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler()); - // Register GuiHandler - // NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new - // GuiHandler()); } @Override // ContainerModTileEntity @@ -100,29 +57,15 @@ public class GuiHandler implements IGuiHandler { if (te != null) { if (ID == GUI1) { return new Container_ProjectTable(player.inventory, (TileEntityProjectTable) te); - } else if (ID == GUI2) { - return new Container_ModularityTable(player.inventory, (TileEntityModularityTable) te); - } - } - - if (ID == GUI3) { - // Use the player's held item to create the inventory - return new Container_BackpackBase( - player, - player.inventory, - new BaseInventoryBackpack(player.getHeldItem())); + } else if (ID == GUI2) {} } if (te != null) { - if (ID == GUI4) { - // return new Container_Workbench(player.inventory, (TileEntityWorkbench) te); - } else if (ID == GUI5) { + if (ID == GUI5) { Logger.INFO("sad"); // return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); } else if (ID == GUI6) { return new Container_FishTrap(player.inventory, (TileEntityFishTrap) te); - } else if (ID == GUI7) { - return new Container_TradeTable(player.inventory, (TileEntityTradeTable) te); } else if (ID == GUI8) { return new Container_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te); } else if (ID == GUI13) { @@ -133,27 +76,11 @@ public class GuiHandler implements IGuiHandler { return new Container_PestKiller(player.inventory, (TileEntityPestKiller) te); } else if (ID == GUI16) { return new Container_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); - } else if (ID == GUI17) { - return new Container_EggBox(player.inventory, (TileEntityEggBox) te); } else if (ID == GUI18) { return new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te); } } - if (ID == GUI9) { - return new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem())); - } - // Tool, lunch, magic - if (ID == GUI10) { - return new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem())); - } - if (ID == GUI11) { - return new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem())); - } - if (ID == GUI12) { - return new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem())); - } - return null; } @@ -175,34 +102,12 @@ public class GuiHandler implements IGuiHandler { if (te != null) { if (ID == GUI1) { return new GUI_ProjectTable(player.inventory, (TileEntityProjectTable) te); - } else if (ID == GUI2) { - return new GUI_ModularityTable(player.inventory, (TileEntityModularityTable) te); } } - if (ID == GUI3) { - // We have to cast the new container as our custom class - // and pass in currently held item for the inventory - return new GuiBaseBackpack( - new Container_BackpackBase( - player, - player.inventory, - new BaseInventoryBackpack(player.getHeldItem()))); - } - if (te != null) { - if (ID == GUI4) { - // return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te); - } else if (ID == GUI5) { - Logger.INFO("sad"); - // return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); - } else if (ID == GUI6) { + if (ID == GUI6) { return new GUI_FishTrap(player.inventory, (TileEntityFishTrap) te); - } else if (ID == GUI7) { - return new GUI_TradeTable( - player.inventory, - (TileEntityTradeTable) te, - ((TileEntityBase) te).getOwner()); } else if (ID == GUI8) { return new GUI_CircuitProgrammer(player.inventory, (TileEntityCircuitProgrammer) te); } else if (ID == GUI13) { @@ -213,33 +118,12 @@ public class GuiHandler implements IGuiHandler { return new GUI_PestKiller(player.inventory, (TileEntityPestKiller) te); } else if (ID == GUI16) { return new GUI_RoundRobinator(player.inventory, (TileEntityRoundRobinator) te); - } else if (ID == GUI17) { - return new GUI_EggBox(player.inventory, (TileEntityEggBox) te); } else if (ID == GUI18) { return new GUI_VolumetricFlaskSetter( new Container_VolumetricFlaskSetter(player.inventory, (TileEntityVolumetricFlaskSetter) te)); } } - if (ID == GUI9) { - return new GuiBaseGrindle( - new Container_Grindle(player, player.inventory, new BaseInventoryGrindle(player.getHeldItem()))); - } - - // Tool, lunch, magic - if (ID == GUI10) { - return new ToolBoxGui( - new ToolBoxContainer(player, player.inventory, new ToolBoxInventory(player.getHeldItem()))); - } - if (ID == GUI11) { - return new LunchBoxGui( - new LunchBoxContainer(player, player.inventory, new LunchBoxInventory(player.getHeldItem()))); - } - if (ID == GUI12) { - return new MagicBagGui( - new MagicBagContainer(player, player.inventory, new MagicBagInventory(player.getHeldItem()))); - } - return null; } @@ -265,12 +149,4 @@ public class GuiHandler implements IGuiHandler { return (data << 16) | guiId.getId(); } - private static MU_GuiId decodeGuiID(final int guiData) { - final int guiId = guiData & 0xFF; - return Gui_ID_Registry.getGuiId(guiId); - } - - private static short decodeGuiData(final int guiId) { - return (short) (guiId >> 16); - } } diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java index 12acc8b4d3..005ebba204 100644 --- a/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java @@ -5,7 +5,6 @@ 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.RECIPES_Tools; import gtPlusPlus.core.recipe.RECIPE_Batteries; public class RegistrationHandler { @@ -18,7 +17,6 @@ public class RegistrationHandler { } private static final void init() { - RECIPES_Tools.loadRecipes(); RECIPES_General.loadRecipes(); RECIPES_Machines.loadRecipes(); RECIPES_MachineComponents.loadRecipes(); diff --git a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java deleted file mode 100644 index e2ea5746a1..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ /dev/null @@ -1,211 +0,0 @@ -package gtPlusPlus.core.handler.events; - -import static gregtech.api.enums.Mods.Thaumcraft; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingDropsEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.world.BlockEvent; -import net.minecraftforge.oredict.OreDictionary; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.material.nuclear.FLUORIDES; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class BlockEventHandler { - - public static ArrayList<ItemStack> oreLimestone; - public static ArrayList<ItemStack> blockLimestone; - public static ItemStack fluoriteOre; - - public static void init() { - // Set Variables for Fluorite Block handling - Logger.INFO("Setting some Variables for the block break event handler."); - BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone"); - BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone"); - BlockEventHandler.fluoriteOre = FLUORIDES.FLUORITE.getOre(1); - } - - @SubscribeEvent - public void onBlockLeftClicked(final PlayerInteractEvent event) { - /* - * if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return; ItemStack heldItem = - * event.entityPlayer.getHeldItem(); Block block = event.world.getBlock(event.x, event.y, event.z); // If the - * block clicked was Stone, the player was holding an Iron Pickaxe and a random integer from 0 (inclusive) to 2 - * (exclusive) is 0 (50% chance) if (block == Blocks.stone && heldItem != null && heldItem.getItem() == - * Items.iron_pickaxe && random.nextInt(2) == 0) { ForgeDirection direction = - * ForgeDirection.getOrientation(event.face); // Convert the numeric face to a ForgeDirection int fireX = - * event.x + direction.offsetX, fireY = event.y + direction.offsetY, fireZ = event.z + direction.offsetZ; // - * Offset the block's coordinates according to the direction if (event.world.isAirBlock(fireX, fireY, fireZ)) { - * // If the block at the new coordinates is Air event.world.setBlock(fireX, fireY, fireZ, Blocks.fire); // - * Replace it with Fire event.useBlock = Event.Result.DENY; // Prevent the Fire from being extinguished (also - * prevents Block#onBlockClicked from being called) } } - */ - } - - @SubscribeEvent - public void onEntityDrop(final LivingDropsEvent event) { - /* - * if (event.entityLiving instanceof EntityPig && event.source instanceof EntityDamageSource) { // getEntity - * will return the Entity that caused the damage,even for indirect damage sources like arrows/fireballs // - * (where it will return the Entity that shot the projectile rather than the projectile itself) Entity - * sourceEntity = event.source.getEntity(); ItemStack heldItem = sourceEntity instanceof EntityLiving ? - * ((EntityLiving) sourceEntity).getHeldItem() : sourceEntity instanceof EntityPlayer ? ((EntityPlayer) - * sourceEntity).getHeldItem() : null; if (heldItem != null && heldItem.getItem() == Items.iron_pickaxe) { - * System.out.println("EntityPig drops event"); event.drops.clear(); event.entityLiving.dropItem(Items.diamond, - * 64); } } - */ - } - - @SubscribeEvent - public void onBlockBreak(final BlockEvent.BreakEvent event) {} - - // Used to handle Thaumcraft Shards when TC is not installed. - @SubscribeEvent - public void harvestDrops(final BlockEvent.HarvestDropsEvent event) { - try { - - if (event != null && event.harvester != null && event.harvester.worldObj != null) { - if (!event.harvester.worldObj.isRemote) { - - EntityPlayer p = event.harvester; - - if (PlayerUtils.isRealPlayer(p)) { - // Spawns Fluorite from Lime Stone - if (chanceToDropFluoriteOre != 0) { - if (!oreLimestone.isEmpty() || !blockLimestone.isEmpty()) { - - ArrayList<Block> mBlockTypes = new ArrayList<Block>(); - if (!oreLimestone.isEmpty()) { - for (int i = 0; i < oreLimestone.size(); i++) { - if (ItemUtils.getModId(oreLimestone.get(i)) != null - && !ItemUtils.getModId(oreLimestone.get(i)).toLowerCase() - .contains("biomesoplenty")) { - if (!mBlockTypes - .contains(Block.getBlockFromItem(oreLimestone.get(i).getItem()))) { - mBlockTypes.add(Block.getBlockFromItem(oreLimestone.get(i).getItem())); - } - } - } - } - if (!blockLimestone.isEmpty()) { - for (int i = 0; i < blockLimestone.size(); i++) { - if (ItemUtils.getModId(blockLimestone.get(i)) != null - && !ItemUtils.getModId(blockLimestone.get(i)).toLowerCase() - .contains("biomesoplenty")) { - if (!mBlockTypes.contains( - Block.getBlockFromItem(blockLimestone.get(i).getItem()))) { - mBlockTypes - .add(Block.getBlockFromItem(blockLimestone.get(i).getItem())); - } - } - } - } - - Logger.WARNING("Found Limestone in OreDict."); - if (!mBlockTypes.isEmpty()) { - Logger.WARNING("1a | " + event.block.getUnlocalizedName()); - for (final Block temp : mBlockTypes) { - Logger.WARNING("2a - " + temp.getUnlocalizedName()); - if (event.block == temp) { - Logger.WARNING("3a - found " + temp.getUnlocalizedName()); - if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) { - Logger.WARNING("4a"); - event.drops.clear(); - event.drops.add(fluoriteOre.copy()); - } - } - } - } - } - - if (event.block.getUnlocalizedName().toLowerCase().contains("limestone")) { - Logger.WARNING("1c"); - if (MathUtils.randInt(1, chanceToDropFluoriteOre) == 1) { - Logger.WARNING("2c"); - event.drops.clear(); - event.drops.add(fluoriteOre.copy()); - } - } - - if (event.block == Blocks.sandstone) { - if (MathUtils.randInt(1, chanceToDropFluoriteOre * 20) == 1) { - event.drops.clear(); - event.drops.add(fluoriteOre.copy()); - } - } - } - } - - // Do things that can occur for fake players and real players - - // Spawn Dull Shards (Can spawn from Tree Logs, Grass or Stone. Stone going to - // be the most common source.) - if (((event.block == Blocks.stone) || (event.block == Blocks.sandstone) - || (event.block == Blocks.log) - || (event.block == Blocks.log2) - || (event.block == Blocks.grass)) && !Thaumcraft.isModLoaded() - && (chanceToDropDrainedShard != 0)) { - // small chance for one to spawn per stone mined. 1 per 3 stacks~ - if (MathUtils.randInt(1, chanceToDropDrainedShard) == 1) { - // Let's sort out a lucky charm for the player. - final int FancyChance = MathUtils.randInt(1, 4); - if (MathUtils.randInt(1, 100) < 90) { - event.drops.add(new ItemStack(ModItems.shardDull)); - } - // Make a Fire Shard - else if (FancyChance == 1) { - event.drops.add(new ItemStack(ModItems.shardIgnis)); - } - // Make a Water Shard. - else if (FancyChance == 2) { - event.drops.add(new ItemStack(ModItems.shardAqua)); - } - // Make an Earth Shard. - else if (FancyChance == 3) { - event.drops.add(new ItemStack(ModItems.shardTerra)); - } - // Make an Air Shard. - else if (FancyChance == 4) { - event.drops.add(new ItemStack(ModItems.shardAer)); - } - } else { - Logger.WARNING("invalid chance"); - } - } - } - } - } catch (Throwable r) { - Logger.INFO("Block Event Handler Failed. Please Report this to Alkalus."); - r.printStackTrace(); - } - } - - @SubscribeEvent - public void logsHarvest(final BlockEvent.HarvestDropsEvent event) { - /* - * if (event.block instanceof BlockLog) { // - * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/ - * modification-development/2444501-harvestdropevent-changing-drops-of-vanilla- blocks // - * Utils.sendServerMessage("Logs! Harvester: %s Drops: %s", event.harvester != null ? - * event.harvester.getCommandSenderName() : "<none>", - * event.drops.stream().map(ItemStack.toString()).collect(Collectors. joining(", "))); if (event.harvester != - * null) { ItemStack heldItem = event.harvester.getHeldItem(); if (heldItem == null || - * heldItem.getItem().getHarvestLevel(heldItem, "axe") < 1) { event.drops.clear(); - * Util |
