From 76719d65a90d98e228a914774d3b11ed9f01ac8e Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Mon, 4 Sep 2023 03:05:22 +0100 Subject: 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 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../core/handler/AchievementHandler.java | 14 +- .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 20 -- .../core/handler/COMPAT_IntermodStaging.java | 4 - .../java/gtPlusPlus/core/handler/GuiHandler.java | 150 ++------------- .../core/handler/Recipes/RegistrationHandler.java | 2 - .../core/handler/events/BlockEventHandler.java | 211 --------------------- .../handler/events/GeneralTooltipEventHandler.java | 85 --------- .../events/PickaxeBlockBreakEventHandler.java | 66 ------- .../events/ZombieBackupSpawnEventHandler.java | 49 ----- .../core/handler/render/FirepitModel.java | 118 ------------ .../core/handler/render/FirepitRender.java | 60 ------ 11 files changed, 14 insertions(+), 765 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/core/handler/events/BlockEventHandler.java delete mode 100644 src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java delete mode 100644 src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java delete mode 100644 src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java (limited to 'src/main/java/gtPlusPlus/core/handler') 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 oreLimestone; - public static ArrayList 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 mBlockTypes = new ArrayList(); - 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() : "", - * 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(); - * Utils.sendServerMessage("Harvester had wrong tool, clearing drops"); } else { - * Utils.sendServerMessage("Harvester had correct tool, not clearing drops"); } } else { event.drops.clear(); - * Utils.sendServerMessage("No harvester, clearing drops"); } } - */ - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java index 6aa9fde2a8..867a2538f3 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java @@ -1,100 +1,15 @@ package gtPlusPlus.core.handler.events; -import net.minecraft.block.Block; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import advsolar.common.AdvancedSolarPanel; import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.Mods; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.GTplusplus.INIT_PHASE; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; public class GeneralTooltipEventHandler { - ItemStack[] mGregtechTurbines = new ItemStack[6]; - String mTurbine; - String mExtra; - - @SubscribeEvent - public void onItemTooltip(ItemTooltipEvent event) { - - if (GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.STARTED - && GTplusplus.CURRENT_LOAD_PHASE != INIT_PHASE.SERVER_START) { - return; - } - if (event.itemStack == null) { - return; - } - if (CORE.ConfigSwitches.chanceToDropFluoriteOre > 0) { - if (BlockEventHandler.blockLimestone != null && !BlockEventHandler.blockLimestone.isEmpty()) { - for (ItemStack h : BlockEventHandler.blockLimestone) { - if (h != null && Block.getBlockFromItem(h.getItem()) - == Block.getBlockFromItem(event.itemStack.getItem())) { - if (ItemUtils.getModId(h) != null - && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) { - event.toolTip.add("May contain Fluorite Ore"); - } - } - } - } - if (BlockEventHandler.oreLimestone != null && !BlockEventHandler.oreLimestone.isEmpty()) { - for (ItemStack h : BlockEventHandler.oreLimestone) { - if (h != null && Block.getBlockFromItem(h.getItem()) - == Block.getBlockFromItem(event.itemStack.getItem())) { - if (ItemUtils.getModId(h) != null - && !ItemUtils.getModId(h).toLowerCase().contains("biomesoplenty")) { - event.toolTip.add("May contain Fluorite Ore"); - } - } - } - } - } - - // Material Collector Tooltips - if (ModBlocks.blockPooCollector != null - && Block.getBlockFromItem(event.itemStack.getItem()) == ModBlocks.blockPooCollector) { - // Normal - if (event.itemStack.getItemDamage() == 0) { - event.toolTip.add("Used to collect animal waste"); - event.toolTip.add("Collects in a 5x4x5 area starting at Y+1"); - event.toolTip.add("Use Hoppers/Pipes to empty"); - event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "8000L"); - } - // Advanced - else { - event.toolTip.add("Used to collect waste (Works on more than animals)"); - event.toolTip.add("Significantly faster than the simple version"); - event.toolTip.add("Collects in a 5x4x5 area starting at Y+1"); - event.toolTip.add("Use Hoppers/Pipes to empty"); - event.toolTip.add(EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.AQUA + "128000L"); - } - } - - // Custom Flasks - - if (GregtechItemList.VOLUMETRIC_FLASK_8k.hasBeenSet() - && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_8k.getItem()) { - event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(8000) + "L"); - } - if (GregtechItemList.VOLUMETRIC_FLASK_32k.hasBeenSet() - && event.itemStack.getItem() == GregtechItemList.VOLUMETRIC_FLASK_32k.getItem()) { - event.toolTip.add("Max Capacity: " + MathUtils.formatNumbers(32000) + "L"); - } - - if (Mods.AdvancedSolarPanel.isModLoaded()) { - molecularTransformer(event); - } - } - @Optional.Method(modid = Mods.Names.ADVANCED_SOLAR_PANEL) public static void molecularTransformer(ItemTooltipEvent event) { if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) { diff --git a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java index dbcd3be01b..05dc46b2b2 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java @@ -1,77 +1,11 @@ package gtPlusPlus.core.handler.events; -import java.util.List; -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.ChunkPosition; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.world.BlockEvent.BreakEvent; -import net.minecraftforge.event.world.ExplosionEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase; public class PickaxeBlockBreakEventHandler { - @SubscribeEvent - public void onBreakBlock(final BreakEvent event) { - try { - final TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); - if (entity != null) { - if (entity instanceof BaseMetaTileEntity) { - final EntityPlayer playerInternal = event.getPlayer(); - final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity(); - if (X instanceof GregtechMetaSafeBlockBase) { - final UUID ownerUUID = ((GregtechMetaSafeBlockBase) X).ownerUUID; - final UUID accessorUUID = playerInternal.getUniqueID(); - if (((GregtechMetaSafeBlockBase) X).bUnbreakable) { - if (accessorUUID == ownerUUID) { - PlayerUtils.messagePlayer( - playerInternal, - "Since you own this block, it has been destroyed."); - } else { - PlayerUtils.messagePlayer( - playerInternal, - "Since you do not own this block, it has not been destroyed."); - event.setCanceled(true); - } - } - } - } - } - } catch (final NullPointerException e) { - // System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause()); - } - } - - @SubscribeEvent - public void onExplode(ExplosionEvent.Detonate event) { - try { - @SuppressWarnings("unchecked") - List pos = event.explosion.affectedBlockPositions; - for (int i = 0; i < pos.size(); i++) { - ChunkPosition blockpos = (ChunkPosition) pos.get(i); - TileEntity entity = event.world - .getTileEntity(blockpos.chunkPosX, blockpos.chunkPosY, blockpos.chunkPosZ); - if (entity != null) { - if (entity instanceof BaseMetaTileEntity) { - final IMetaTileEntity X = ((BaseMetaTileEntity) entity).getMetaTileEntity(); - if (X instanceof GregtechMetaSafeBlockBase) { - pos.remove(i); - } - } - } - } - } catch (final NullPointerException e) { - - } - } - @SubscribeEvent public void onPlayerInteraction(final PlayerInteractEvent aEvent) { if ((aEvent.entityPlayer != null) && (aEvent.entityPlayer.worldObj != null) diff --git a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java deleted file mode 100644 index 86736fe14b..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/events/ZombieBackupSpawnEventHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package gtPlusPlus.core.handler.events; - -import java.lang.reflect.Field; - -import net.minecraftforge.event.entity.living.ZombieEvent; - -import org.apache.commons.lang3.reflect.FieldUtils; - -import cpw.mods.fml.common.eventhandler.Event.Result; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gtPlusPlus.api.objects.Logger; - -public class ZombieBackupSpawnEventHandler { - - /** - * - * Do we really need this pathetic mechanic to exist when it doesn't work properly at all? - * - */ - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onZombieReinforcement(final ZombieEvent.SummonAidEvent event) { - try { - try { - Field mChance = FieldUtils.getDeclaredField(this.getClass(), "summonChance", true); - FieldUtils.removeFinalModifier(mChance, true); - mChance.set(this, 0); - } catch (Throwable t) {} - if (event.attacker != null) { - // SegmentHelper.getInstance().trackUser(event.attacker.getUniqueID().toString(), "Zombie Backup"); - } - Logger.WARNING("[Zombie] ZombieEvent.SummonAidEvent."); - event.setResult(Result.DENY); - } catch (Throwable t) {} - } - - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void onZombieReinforcement(final ZombieEvent event) { - try { - Logger.WARNING("[Zombie] ZombieEvent."); - if (event.entity != null) { - Logger.WARNING("Event Entity: " + event.entity.getCommandSenderName()); - } - event.setResult(Result.DENY); - } catch (Throwable t) { - - } - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java deleted file mode 100644 index e53ce25e3c..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/render/FirepitModel.java +++ /dev/null @@ -1,118 +0,0 @@ -// Date: 20/12/2016 5:51:14 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX - -package gtPlusPlus.core.handler.render; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -import gtPlusPlus.core.lib.CORE; - -public class FirepitModel extends ModelBase { - - // fields - ModelRenderer Side_A; - ModelRenderer Side_B; - ModelRenderer Side_C; - ModelRenderer Side_D; - ModelRenderer Log1; - ModelRenderer Log2; - ModelRenderer Log3; - ModelRenderer Log4; - - public FirepitModel() { - this.textureWidth = 16; - this.textureHeight = 16; - - this.Side_A = new ModelRenderer(this, 0, 0); - this.Side_A.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_A.setRotationPoint(-6F, 18F, -6F); - this.Side_A.setTextureSize(16, 16); - this.Side_A.mirror = true; - setRotation(this.Side_A, -0.3148822F, 0F, 0F); - // Side_A.mirror = false; - - this.Side_B = new ModelRenderer(this, 0, 0); - this.Side_B.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_B.setRotationPoint(-6F, 18F, 6F); - this.Side_B.setTextureSize(16, 16); - this.Side_B.mirror = true; - setRotation(this.Side_B, -0.3148822F, (CORE.PI / 2), 0F); - - this.Side_C = new ModelRenderer(this, 0, 0); - this.Side_C.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_C.setRotationPoint(6F, 18F, 6F); - this.Side_C.setTextureSize(16, 16); - this.Side_C.mirror = true; - setRotation(this.Side_C, -0.3148822F, CORE.PI, 0F); - // Side_C.mirror = false; - - this.Side_D = new ModelRenderer(this, 0, 0); - this.Side_D.addBox(0F, 0F, 0F, 12, 6, 1); - this.Side_D.setRotationPoint(6F, 18F, -6F); - this.Side_D.setTextureSize(16, 16); - this.Side_D.mirror = true; - setRotation(this.Side_D, -0.3148822F, 4.712389F, 0F); - - this.Log1 = new ModelRenderer(this, 0, 10); - this.Log1.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log1.setRotationPoint(4F, 10F, -4F); - this.Log1.setTextureSize(16, 16); - this.Log1.mirror = true; - setRotation(this.Log1, 0F, 0F, (CORE.PI / 2)); - - this.Log2 = new ModelRenderer(this, -2, 10); - this.Log2.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log2.setRotationPoint(-4F, 10F, -4F); - this.Log2.setTextureSize(16, 16); - this.Log2.mirror = true; - setRotation(this.Log2, (CORE.PI / 2), 0F, (CORE.PI / 2)); - // Log2.mirror = false; - - this.Log3 = new ModelRenderer(this, 0, 10); - this.Log3.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log3.setRotationPoint(-4F, 10F, 4F); - this.Log3.setTextureSize(16, 16); - this.Log3.mirror = true; - setRotation(this.Log3, CORE.PI, 0F, (CORE.PI / 2)); - - this.Log4 = new ModelRenderer(this, -2, 10); - this.Log4.addBox(0F, 0F, 0F, 14, 2, 2); - this.Log4.setRotationPoint(4F, 10F, 4F); - this.Log4.setTextureSize(16, 16); - this.Log4.mirror = true; - setRotation(this.Log4, 4.712389F, 0F, (CORE.PI / 2)); - // Log4.mirror = false; - } - - @Override - public void render(final Entity entity, final float f, final float f1, final float f2, final float f3, - final float f4, final float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - this.Side_A.render(f5); - this.Side_B.render(f5); - this.Side_C.render(f5); - this.Side_D.render(f5); - this.Log1.render(f5); - this.Log2.render(f5); - this.Log3.render(f5); - this.Log4.render(f5); - } - - private static void setRotation(final ModelRenderer model, final float x, final float y, final float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, - final float f5, final Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } -} diff --git a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java b/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java deleted file mode 100644 index 0237047121..0000000000 --- a/src/main/java/gtPlusPlus/core/handler/render/FirepitRender.java +++ /dev/null @@ -1,60 +0,0 @@ -package gtPlusPlus.core.handler.render; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class FirepitRender extends TileEntitySpecialRenderer { - - ResourceLocation texture = new ResourceLocation(GTPlusPlus.ID + ":" + "textures/blocks/FirePit/mossyFirepit.png"); - - private final FirepitModel model; - - public FirepitRender() { - this.model = new FirepitModel(); - } - - private void adjustRotatePivotViaMeta(final World world, final int x, final int y, final int z) { - final int meta = world.getBlockMetadata(x, y, z); - GL11.glPushMatrix(); - GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); - GL11.glPopMatrix(); - } - - @Override - public void renderTileEntityAt(final TileEntity entity, final double x, final double y, final double z, - final float i) { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x + 0.1F, (float) y + 1.0F, (float) z + 0.5F); - GL11.glRotatef(180, 0F, 0F, 1F); - - this.bindTexture(this.texture); - GL11.glPushMatrix(); - this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glTranslatef(1.0f, 1.0f, 1.0f); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } - - // Set the lighting stuff, so it changes it's brightness properly. - private void adjustLightFixture(final World world, final int i, final int j, final int k, final Block block) { - final Tessellator tess = Tessellator.instance; - // float brightness = block.getBlockBrightness(world, i, j, k); - // As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue(): - final float brightness = block.getLightValue(world, i, j, k); - final int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); - final int modulousModifier = skyLight % 65536; - final int divModifier = skyLight / 65536; - tess.setColorOpaque_F(brightness, brightness, brightness); - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier); - } -} -- cgit