From 23494ade8145f1a70d4c533d74815b77b990314a Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Wed, 22 May 2024 18:05:41 +0100 Subject: Cleaning! (#881) * Remove fluorite from sandstone references * Remove some unused content, rogue useless configs * Remove more junk * Remove more * Remove RF converter, I think this is disabled anyway? Or should be? * Opps missed this * Cleaning * Remove sick blaze, I can't even get this to spawn? The spawn egg also isn't in NEI? * Delete unused Australia textures * Unused texture loading * Bulk remove seemingly unused textures. * Remove xpjuice, seemingly no use? Change the localised name of mobessence to Mob Essence. Remove EnchantingUtils, no longer needed. * Clean * Unused tooltips * Remove hydrogen blob * Spotless apply for branch Cleaning! for #881 (#882) spotlessApply Co-authored-by: GitHub GTNH Actions <> * More cleaning * Lots of unused code. * Some reflection cleanup * Revert "Remove sick blaze, I can't even get this to spawn? The spawn egg also isn't in NEI?" This reverts commit d244b7dba00a9aee42b4a0596e842956acb36c5a. * Restore random conversion recipes * Unused texture * Unused stuff * Restore some missing textures * Spotless apply for branch Cleaning! for #881 (#883) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Conditionally enable xpjuice recipe on OpenBlocks loaded * Spotless apply for branch Cleaning! for #881 (#884) spotlessApply Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz --- src/main/java/gtPlusPlus/GTplusplus.java | 3 - .../core/block/base/BasicTileBlockWithTooltip.java | 4 +- .../block/general/antigrief/BlockWitherProof.java | 1 - .../core/common/compat/COMPAT_ExtraUtils.java | 18 - .../java/gtPlusPlus/core/config/ConfigHandler.java | 81 ----- .../gtPlusPlus/core/creative/AddToCreativeTab.java | 1 - .../core/entity/monster/EntitySickBlaze.java | 9 +- .../entity/projectile/EntityToxinballSmall.java | 11 - .../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 2 - src/main/java/gtPlusPlus/core/item/ModItems.java | 13 +- .../item/base/itemblock/ItemBlockBasicTile.java | 8 - .../core/item/base/itemblock/ItemBlockOre.java | 21 -- .../gtPlusPlus/core/item/bauble/BaseBauble.java | 70 +--- .../core/item/bauble/ElectricBaseBauble.java | 2 +- .../core/item/bauble/FireProtectionBauble.java | 9 +- .../core/item/chemistry/NuclearChem.java | 3 +- .../core/item/tool/misc/DebugScanner.java | 108 ------ .../core/item/tool/staballoy/MultiSpadeBase.java | 137 ------- .../core/item/tool/staballoy/StaballoySpade.java | 403 --------------------- src/main/java/gtPlusPlus/core/lib/CORE.java | 65 +--- .../java/gtPlusPlus/core/proxy/ClientProxy.java | 15 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 24 +- .../gtPlusPlus/core/recipe/RECIPES_General.java | 4 - .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 80 ---- .../gtPlusPlus/core/slots/SlotVolumetricFlask.java | 3 - .../core/util/minecraft/EnchantingUtils.java | 29 -- .../gtPlusPlus/core/util/minecraft/FluidUtils.java | 4 - .../gtPlusPlus/core/util/minecraft/LangUtils.java | 83 +---- .../core/util/minecraft/MaterialUtils.java | 8 +- .../core/util/minecraft/MiningUtils.java | 73 +--- .../core/util/minecraft/ModularArmourUtils.java | 35 -- .../gtPlusPlus/core/util/minecraft/NBTUtils.java | 42 --- .../core/util/minecraft/OreDictUtils.java | 5 +- .../core/util/minecraft/PlayerUtils.java | 63 +--- .../core/util/minecraft/RecipeUtils.java | 25 +- .../core/util/minecraft/ShapelessUtils.java | 41 --- .../core/util/reflect/ReflectionUtils.java | 327 +---------------- .../everglades/GTplusplus_Everglades.java | 15 - .../everglades/world/WorldChunkManagerCustom.java | 5 - .../everglades/world/WorldProviderMod.java | 10 - .../java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java | 2 +- .../gtPlusPlus/nei/handlers/NeiTextureHandler.java | 1 - .../plugin/agrichem/item/algae/ItemAlgaeBase.java | 2 +- .../bop/blocks/rainforest/LogRainforestTree.java | 9 - .../xmod/gregtech/api/enums/GregtechItemList.java | 2 - .../common/blocks/textures/TexturesGtBlock.java | 242 +------------ .../common/blocks/textures/TexturesGtTools.java | 2 - .../common/items/MetaGeneratedGregtechItems.java | 53 +-- .../generators/GT_MetaTileEntity_RfConvertor.java | 347 ------------------ .../GregtechMetaTileEntitySolarGenerator.java | 262 -------------- .../gregtech/loaders/RecipeGen_FluidCanning.java | 40 +- .../gregtech/GregtechEnergyBuffer.java | 11 - .../gregtech/GregtechSolarGenerators.java | 71 ---- .../block/TF_Block_Fluid_Cryotheum.java | 9 - .../block/TF_Block_Fluid_Ender.java | 4 - .../block/TF_Block_Fluid_Pyrotheum.java | 4 - .../gtPlusPlus/xmod/tinkers/util/TinkersUtils.java | 34 -- 57 files changed, 73 insertions(+), 2882 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java delete mode 100644 src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java delete mode 100644 src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java delete mode 100644 src/main/java/gtPlusPlus/core/util/minecraft/EnchantingUtils.java delete mode 100644 src/main/java/gtPlusPlus/core/util/minecraft/ModularArmourUtils.java delete mode 100644 src/main/java/gtPlusPlus/core/util/minecraft/ShapelessUtils.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java (limited to 'src/main/java') diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index 69078ee499..73b9cc9aea 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -125,9 +125,6 @@ public class GTplusplus implements ActionListener { // Tools Logger.WARNING("Processing texture: " + TexturesGtTools.ANGLE_GRINDER.getTextureFile().getResourcePath()); Logger.WARNING("Processing texture: " + TexturesGtTools.ELECTRIC_SNIPS.getTextureFile().getResourcePath()); - Logger.WARNING("Processing texture: " + TexturesGtTools.ELECTRIC_LIGHTER.getTextureFile().getResourcePath()); - Logger.WARNING( - "Processing texture: " + TexturesGtTools.ELECTRIC_BUTCHER_KNIFE.getTextureFile().getResourcePath()); // Blocks Logger.WARNING( diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java index c4e8b191d0..d6119e5608 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java +++ b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java @@ -260,9 +260,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement @Override @SideOnly(Side.CLIENT) - public final void registerBlockIcons(final IIconRegister aRegisterer) { - this.blockIcon = aRegisterer.registerIcon(GTPlusPlus.ID + ":" + "net"); - } + public final void registerBlockIcons(final IIconRegister aRegisterer) {} @Override public abstract TileEntity createNewTileEntity(final World world, final int p_149915_2_); diff --git a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java index fa7372090c..c24ef46f5c 100644 --- a/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java +++ b/src/main/java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java @@ -33,7 +33,6 @@ public class BlockWitherProof extends Block { this.setResistance(5000.0F); this.setHarvestLevel("pickaxe", 3); this.setStepSound(soundTypeMetal); - // LanguageRegistry.addName(this, "Wither Cage"); GameRegistry.registerBlock(this, Utils.sanitizeString("blockBlackGate")); } diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java index 907e6a0c42..f61c70ab5b 100644 --- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java +++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java @@ -2,10 +2,8 @@ package gtPlusPlus.core.common.compat; import net.minecraft.item.ItemStack; -import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.recipe.RECIPES_Tools; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; public class COMPAT_ExtraUtils { @@ -16,21 +14,5 @@ public class COMPAT_ExtraUtils { private static void run() { ItemUtils.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0); - // GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium)); - - if (ConfigSwitches.enableAlternativeDivisionSigilRecipe) { - // Division Sigil - RecipeUtils.addShapedRecipe( - "plateNetherStar", - "gemIridium", - "plateNetherStar", - "plateIridium", - RECIPES_Tools.craftingToolHardHammer, - "plateIridium", - "plateNetherStar", - "gemIridium", - "plateNetherStar", - RECIPES_Tools.RECIPE_DivisionSigil); - } } } diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java index b922bb0116..c498164cf9 100644 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java @@ -8,30 +8,20 @@ import static gtPlusPlus.core.lib.CORE.ConfigSwitches.basePollutionPerSecondBoil import static gtPlusPlus.core.lib.CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.boilerSteamPerSecond; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableEnderIOIngotTooltips; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableEnderIOIntegration; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.disableIC2Recipes; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.dumpItemAndBlockData; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAlternativeBatteryAlloy; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAlternativeDivisionSigilRecipe; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableAnimatedTextures; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCapes; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCircuits; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustom_Cables; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustom_Pipes; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Dehydrators; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_FluidTanks; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_GeothermalEngines; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Pollution; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_RF_Convetor; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_RocketEngines; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_SimpleWasher; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_SolarGenerators; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_SteamConverter; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_Tesseracts; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiSizeTools; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_Cyclotron; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge; @@ -55,8 +45,6 @@ import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_NuclearFu import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_NuclearSaltProcessingPlant; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_PowerSubstation; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMultiblock_ThermalBoiler; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableOldGTcircuits; -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableSulfuricAcidFix; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableThaumcraftShardUnification; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableWatchdogBGM; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.hideUniversalCells; @@ -129,13 +117,6 @@ public class ConfigHandler { * DEBUG = config.getBoolean("debugMode", "debug", false, * "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)"); */ - disableEnderIOIntegration = config - .getBoolean("disableEnderIO", "debug", false, "Disables EnderIO Integration."); - disableEnderIOIngotTooltips = config.getBoolean( - "disableEnderIOIngotTooltips", - "debug", - false, - "Disables EnderIO Ingot Tooltips. These apparently may cause issues for a very small number of users."); MACHINE_INFO = config.getBoolean( "enableMachineInfoLogging", "debug", @@ -155,18 +136,11 @@ public class ConfigHandler { "machines", false, "Allows the use of TC shards across many recipes by oreDicting them into a common group."); - enableAlternativeBatteryAlloy = config.getBoolean( - "enableAlternativeBatteryAlloy", - "machines", - false, - "Adds a non-Antimony using Battery Alloy. Not Balanced at all.."); disableIC2Recipes = config.getBoolean( "disableIC2Recipes", "machines", false, "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks."); - enableAlternativeDivisionSigilRecipe = config - .getBoolean("enableAlternativeDivisionSigilRecipe", "machines", false, "Utilizes Neutronium instead."); boilerSteamPerSecond = config.getInt( "boilerSteamPerSecond", "machines", @@ -175,34 +149,7 @@ public class ConfigHandler { 10000, "Sets the steam per second value in LV,MV,HV boilers (respectively 1x,2x,3x this number for the tiers)"); - // requireControlCores - boolean temp = config.getBoolean("requireControlCores", "machines", true, "Multiblocks Require Control Cores"); - - // Circuits - enableCustomCircuits = config.getBoolean( - "enableCustomCircuits", - GregTech.ID, - false, - "Adds custom circuits to expand past the Master Tier. Only really recommended to enable if enableOldGTcircuits is enabled."); - enableOldGTcircuits = config.getBoolean( - "enableOldGTcircuits", - GregTech.ID, - false, - "Restores circuits and their recipes from Pre-5.09.28 times."); - - // Tools - enableMultiSizeTools = config.getBoolean( - "enableMultiSizeTools", - GregTech.ID, - true, - "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available."); - // GT-Fixes - enableSulfuricAcidFix = config.getBoolean( - "enableSulfuricAcidFix", - GregTech.ID, - false, - "Adds GT6 recipes for Sulfuric Acid. Should remove all pre-existing recipes."); turbineCutoffBase = config.getInt( "turbineCutoffBase", GregTech.ID, @@ -215,29 +162,6 @@ public class ConfigHandler { enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", GregTech.ID, true, "Adds Custom GT Fluid Pipes."); enableCustom_Cables = config.getBoolean("enableCustom_Cables", GregTech.ID, true, "Adds Custom GT Cables."); - // Block Drops - chanceToDropDrainedShard = config.getInt( - "chanceToDropDrainedShard", - "blockdrops", - 196, - 0, - 10000, - "Drained shards have a 1 in X chance to drop."); - chanceToDropFluoriteOre = config.getInt( - "chanceToDropFluoriteOre", - "blockdrops", - 32, - 0, - 10000, - "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone.."); - - // Single machines - enableMachine_SolarGenerators = config.getBoolean( - "enableSolarGenerators", - GregTech.ID, - false, - "These may be overpowered, Consult a local electrician."); - enableMachine_Dehydrators = config .getBoolean("enableMachineDehydrators", GregTech.ID, true, "These dehydrate stuff."); enableMachine_SteamConverter = config @@ -266,11 +190,6 @@ public class ConfigHandler { "Very basic automated cauldron for dust washing."); enableMachine_Pollution = config .getBoolean("enableMachinePollution", GregTech.ID, true, "Pollution Detector & Scrubbers."); - enableMachine_RF_Convetor = config.getBoolean( - "enableMachineRFConvetor", - GregTech.ID, - true, - "Converts RF to GTEU. Requires COFH-Core to be installed."); // Multi machines enableMultiblock_AlloyBlastSmelter = config.getBoolean( diff --git a/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java b/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java index 1a01f47ef5..fa0d3844b2 100644 --- a/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java +++ b/src/main/java/gtPlusPlus/core/creative/AddToCreativeTab.java @@ -8,7 +8,6 @@ public class AddToCreativeTab { public static CreativeTabs tabBlock; public static CreativeTabs tabMisc; - public static CreativeTabs tabCombat; public static CreativeTabs tabTools; public static CreativeTabs tabMachines; public static CreativeTabs tabOther; diff --git a/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java b/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java index 741b830885..c5301958ad 100644 --- a/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java +++ b/src/main/java/gtPlusPlus/core/entity/monster/EntitySickBlaze.java @@ -3,7 +3,6 @@ package gtPlusPlus.core.entity.monster; import net.minecraft.entity.Entity; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.DamageSource; @@ -154,13 +153,7 @@ public class EntitySickBlaze extends EntityMob { if (this.field_70846_g > 1) { float f1 = MathHelper.sqrt_float(p_70785_2_) * 0.5F; - this.worldObj.playAuxSFXAtEntity( - (EntityPlayer) null, - 1009, - (int) this.posX, - (int) this.posY, - (int) this.posZ, - 0); + this.worldObj.playAuxSFXAtEntity(null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0); for (int i = 0; i < 1; ++i) { EntityToxinballSmall entitysmalltoxinball = new EntityToxinballSmall( diff --git a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java index f2f8b8a8cc..bf7e2159c7 100644 --- a/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java +++ b/src/main/java/gtPlusPlus/core/entity/projectile/EntityToxinballSmall.java @@ -8,22 +8,11 @@ import net.minecraft.world.World; public class EntityToxinballSmall extends EntityToxinball { - public EntityToxinballSmall(World p_i1770_1_) { - super(p_i1770_1_); - this.setSize(0.3125F, 0.3125F); - } - public EntityToxinballSmall(World world, EntityLivingBase entity, double x, double y, double z) { super(world, entity, x, y, z); this.setSize(0.3125F, 0.3125F); } - public EntityToxinballSmall(World p_i1772_1_, double p_i1772_2_, double p_i1772_4_, double p_i1772_6_, - double p_i1772_8_, double p_i1772_10_, double p_i1772_12_) { - super(p_i1772_1_, p_i1772_2_, p_i1772_4_, p_i1772_6_, p_i1772_8_, p_i1772_10_, p_i1772_12_); - this.setSize(0.3125F, 0.3125F); - } - /** * Called when this EntityFireball hits a block or entity. */ diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 7aa9c73236..3bd35d162d 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -87,7 +87,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRTG; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSemiFluidgenerators; 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.GregtechSteamMultis; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperChests; @@ -135,7 +134,6 @@ public class COMPAT_HANDLER { GregtechIndustrialMassFabricator.run(); GregtechIndustrialBlastSmelter.run(); GregtechQuantumForceTransformer.run(); - GregtechSolarGenerators.run(); GregtechPowerSubStation.run(); GregtechDehydrator.run(); GregtechAdvancedBoilers.run(); diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index c411555d4d..cbd149fbdf 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -64,7 +64,6 @@ import gtPlusPlus.core.item.general.chassis.ItemDehydratorCoilWire; import gtPlusPlus.core.item.general.spawn.ItemCustomSpawnEgg; import gtPlusPlus.core.item.init.ItemsFoods; import gtPlusPlus.core.item.materials.DustDecayable; -import gtPlusPlus.core.item.tool.misc.DebugScanner; import gtPlusPlus.core.item.tool.misc.GregtechPump; import gtPlusPlus.core.item.wearable.WearableLoader; import gtPlusPlus.core.lib.CORE; @@ -98,8 +97,6 @@ public final class ModItems { public static Item itemIngotBatteryAlloy; - public static Item itemHydrogenBlob; - public static Item itemBedLocator_Base; public static Item itemBaseItemWithCharge; @@ -212,8 +209,6 @@ public final class ModItems { public static BatteryPackBaseBauble itemChargePack_High_3; public static BatteryPackBaseBauble itemChargePack_High_4; - public static DebugScanner itemDebugScanner; - public static ItemDummyResearch itemDummyResearch; public static BaseItemMetaFood itemMetaFood; @@ -234,7 +229,6 @@ public final class ModItems { public static void init() { - itemDebugScanner = new DebugScanner(); itemMagicFeather = new ItemMagicFeather(); itemAlkalusDisk = new BaseItemDamageable( @@ -256,8 +250,6 @@ public final class ModItems { MetaGeneratedGregtechItems.INSTANCE.generateMetaItems(); // Register Hydrogen Blobs first, so we can replace old helium blobs. - itemHydrogenBlob = new CoreItem("itemHydrogenBlob", "Mysterious Hydrogen Blob", tabMisc) - .setTextureName(GTPlusPlus.ID + ":itemHeliumBlob"); // Register Old Helium Blob, this will be replaced when held by a player. // Load Wearable Items @@ -720,10 +712,7 @@ public final class ModItems { // Xp Fluids - Dev if (!FluidRegistry.isFluidRegistered("mobessence")) { - FluidUtils.generateFluidNoPrefix("mobessence", "mobessence", 0, new short[] { 125, 175, 125, 100 }); - } - if (!FluidRegistry.isFluidRegistered("xpjuice")) { - FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[] { 50, 150, 50, 100 }); + FluidUtils.generateFluidNoPrefix("mobessence", "Mob Essence", 0, new short[] { 125, 175, 125, 100 }); } dustNeptunium238 = new DustDecayable( diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java index be73e92aee..cf50da52a3 100644 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java +++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockBasicTile.java @@ -26,12 +26,6 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Can also be placed beside upto 4 other fish traps"); list.add("Requires at least two faces touching water"); list.add("1/1000 chance to produce triple loot."); - } else if (this.mID == 1) { // Modularity - list.add("Used to construct modular armour & bauble upgrades.."); - } else if (this.mID == 2) { // Trade - list.add("Allows for SMP trade-o-mat type trading."); - } else if (this.mID == 3) { // Project - list.add("Scan any crafting recipe in this to mass fabricate them in the Autocrafter.."); } else if (this.mID == 4) { // Circuit Table list.add("Easy Circuit Configuration"); list.add("Change default setting with a Screwdriver"); @@ -44,8 +38,6 @@ public class ItemBlockBasicTile extends ItemBlock { list.add("Kills Forestry Butterflies, Bats and other pests"); list.add("Use either Formaldehyde or Hydrogen cyanide"); list.add("Be weary of your neighbours"); - } else if (this.mID == 7) { // Egg Box - list.add("A box for holding big eggs"); } else if (this.mID == 8) { // Volumetric Flask Setter list.add("Easy Flask Configuration"); list.add("Configure default input slot with a screwdriver"); diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java index cdb2934a40..c88a8581b6 100644 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java +++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java @@ -17,8 +17,6 @@ import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialStack; -import gtPlusPlus.core.material.nuclear.FLUORIDES; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Ore_Layer; @@ -28,7 +26,6 @@ public class ItemBlockOre extends ItemBlock { private final BlockBaseOre mThisOre; private final Material mThisMaterial; private final int mThisRadiation; - private final int mThisColour; public ItemBlockOre(final Block block) { super(block); @@ -36,19 +33,13 @@ public class ItemBlockOre extends ItemBlock { this.mThisOre = (BlockBaseOre) block; this.mThisMaterial = this.mThisOre.getMaterialEx(); this.mThisRadiation = this.mThisMaterial.vRadiationLevel; - this.mThisColour = this.mThisMaterial.getRgbAsHex(); } else { this.mThisOre = null; this.mThisMaterial = null; this.mThisRadiation = 0; - this.mThisColour = Utils.rgbtoHexValue(255, 255, 255); } } - public int getRenderColor(final int aMeta) { - return this.mThisColour; - } - private static Map> mMapOreBlockItemToDimName = new LinkedHashMap<>(); private static boolean mInitOres_Everglades = false; private AutoMap mDimsForThisOre = new AutoMap<>(); @@ -83,17 +74,6 @@ public class ItemBlockOre extends ItemBlock { list.add(CORE.GT_Tooltip_Radioactive.get()); } - /** - * Tooltip Handler for Ores - */ - if (this.mThisMaterial == FLUORIDES.FLUORITE) { - list.add( - "Mined from Sandstone with a 1/" + (CORE.ConfigSwitches.chanceToDropFluoriteOre * 20) - + " chance, or Limestone with a 1/" - + (CORE.ConfigSwitches.chanceToDropFluoriteOre) - + " chance."); - } - if (this.mThisMaterial != null) { list.add("Ore contains: "); if (mThisMaterial.getComposites().isEmpty()) { @@ -109,7 +89,6 @@ public class ItemBlockOre extends ItemBlock { Block b = Block.getBlockFromItem(stack.getItem()); if (b != null) { - String aTool = b.getHarvestTool(stack.getItemDamage()); int aMiningLevel1 = b.getHarvestLevel(stack.getItemDamage()); if (aMiningLevel1 != 0) { list.add("Mining Level: " + Math.min(Math.max(aMiningLevel1, 0), 5)); diff --git a/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java index 7b017fb093..74e810f9bd 100644 --- a/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java +++ b/src/main/java/gtPlusPlus/core/item/bauble/BaseBauble.java @@ -2,14 +2,12 @@ package gtPlusPlus.core.item.bauble; import java.util.ArrayList; import java.util.List; -import java.util.UUID; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingAttackEvent; @@ -22,12 +20,10 @@ import baubles.common.container.InventoryBaubles; import baubles.common.lib.PlayerHandler; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Mods; import gregtech.api.util.GT_LanguageManager; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.ModularArmourUtils.BT; import gtPlusPlus.core.util.minecraft.NBTUtils; @Optional.InterfaceList( @@ -43,17 +39,7 @@ public class BaseBauble extends Item implements IBauble { private List damageNegations = new ArrayList<>(); Multimap attributes = HashMultimap.create(); - public BaseBauble(BaubleType type, String displayName) { - this.mThisBauble = type; - Utils.registerEvent(this); - this.setMaxStackSize(1); - this.setCreativeTab(AddToCreativeTab.tabMisc); - this.setUnlocalizedName(Utils.sanitizeString(displayName.toLowerCase())); - GT_LanguageManager.addStringLocalization("gtplusplus." + getUnlocalizedName() + ".name", displayName); - GameRegistry.registerItem(this, getUnlocalizedName()); - } - - public BaseBauble(BaubleType type, String unlocalName, int register) { + public BaseBauble(BaubleType type) { this.mThisBauble = type; Utils.registerEvent(this); this.setMaxStackSize(1); @@ -77,26 +63,14 @@ public class BaseBauble extends Item implements IBauble { } } - public boolean addDamageNegation(DamageSource damageSource) { - return addDamageNegation(damageSource, null); - } - - public boolean addDamageNegation(DamageSource damageSource, ItemStack aStack) { - return damageNegations.add(damageSource.damageType); - } - - public void clearDamageNegation() { - damageNegations.clear(); - } - @Override public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) { - return EntityPlayer.class.isInstance(arg1) ? true : false; + return arg1 instanceof EntityPlayer; } @Override public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) { - return EntityPlayer.class.isInstance(arg1) ? true : false; + return arg1 instanceof EntityPlayer; } @Override @@ -104,23 +78,10 @@ public class BaseBauble extends Item implements IBauble { return mThisBauble; } - public boolean SetBaubleType(BT arg0) { - return SetBaubleType(arg0.getType()); - } - - public boolean SetBaubleType(BaubleType arg0) { - BaubleType temp = this.mThisBauble; - this.mThisBauble = arg0; - if (this.mThisBauble != temp) { - return true; - } - return false; - } - @Override public void onEquipped(ItemStack stack, EntityLivingBase entity) { - if (entity != null && EntityPlayer.class.isInstance(entity)) { - onEquippedOrLoadedIntoWorld(stack, entity); + if (entity instanceof EntityPlayer) { + onEquippedOrLoadedIntoWorld(entity); setPlayerHashcode(stack, entity.hashCode()); } } @@ -128,26 +89,22 @@ public class BaseBauble extends Item implements IBauble { @Override public void onWornTick(ItemStack stack, EntityLivingBase player) { if (getPlayerHashcode(stack) != player.hashCode()) { - onEquippedOrLoadedIntoWorld(stack, player); + onEquippedOrLoadedIntoWorld(player); setPlayerHashcode(stack, player.hashCode()); } } - public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) { + public void onEquippedOrLoadedIntoWorld(EntityLivingBase player) { attributes.clear(); - fillModifiers(attributes, stack); player.getAttributeMap().applyAttributeModifiers(attributes); } @Override public void onUnequipped(ItemStack stack, EntityLivingBase player) { attributes.clear(); - fillModifiers(attributes, stack); player.getAttributeMap().removeAttributeModifiers(attributes); } - void fillModifiers(Multimap attributes, ItemStack stack) {} - public ItemStack getCorrectBauble(EntityPlayer player) { InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player); ItemStack stack1 = baubles.getStackInSlot(1); @@ -164,19 +121,6 @@ public class BaseBauble extends Item implements IBauble { return Integer.MAX_VALUE; } - public static UUID getBaubleUUID(ItemStack stack) { - long most = NBTUtils.getLong(stack, "baubleUUIDMost"); - if (most == 0) { - UUID uuid = UUID.randomUUID(); - NBTUtils.setLong(stack, "baubleUUIDMost", uuid.getMostSignificantBits()); - NBTUtils.setLong(stack, "baubleUUIDLeast", uuid.getLeastSignificantBits()); - return getBaubleUUID(stack); - } - - long least = NBTUtils.getLong(stack, "baubleUUIDLeast"); - return new UUID(most, least); - } - public static int getPlayerHashcode(ItemStack stack) { return NBTUtils.getInteger(stack, "mPlayerHashcode"); } diff --git a/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java index 0b8ce24974..e6b3ab9941 100644 --- a/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java +++ b/src/main/java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java @@ -39,7 +39,7 @@ public abstract class ElectricBaseBauble extends BaseBauble implements IElectric private final BaubleType mType; public ElectricBaseBauble(BaubleType aType, int aTier, double aMaxEU, String aUnlocalName) { - super(aType, aUnlocalName, 0); + super(aType); mType = aType; mTier = aTier; maxValueEU = aMaxEU; diff --git a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java index 5e31b2ad89..95c2462e23 100644 --- a/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java +++ b/src/main/java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java @@ -41,7 +41,7 @@ public class FireProtectionBauble extends BaseBauble { } public FireProtectionBauble() { - super(BaubleType.RING, "GTPP.bauble.fireprotection.0" + ".name", 0); + super(BaubleType.RING); String aUnlocalName = "GTPP.bauble.fireprotection.0" + ".name"; this.setUnlocalizedName(aUnlocalName); this.setTextureName(GTPlusPlus.ID + ":" + getTextureNameForBauble()); @@ -70,7 +70,6 @@ public class FireProtectionBauble extends BaseBauble { return false; } - @SuppressWarnings("unchecked") @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { super.addInformation(stack, aPlayer, list, bool); @@ -87,11 +86,7 @@ public class FireProtectionBauble extends BaseBauble { } @Override - public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) { - if (!aPlayer.worldObj.isRemote) { - if (aPlayer instanceof EntityPlayer bPlayer) {} - } - } + public void onEquipped(final ItemStack arg0, final EntityLivingBase aPlayer) {} @Override public void onUnequipped(final ItemStack arg0, final EntityLivingBase aPlayer) { diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java index 09838c6bac..1fd9416b90 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/NuclearChem.java @@ -4,6 +4,7 @@ import static gregtech.api.util.GT_RecipeBuilder.SECONDS; import static gregtech.api.util.GT_RecipeConstants.UniversalChemical; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -94,7 +95,7 @@ public class NuclearChem extends ItemPackage { .itemInputs( GT_OreDictUnificator.get(OrePrefixes.gem, Materials.NetherStar, 2), GT_Utility.getIntegratedCircuit(20)) - .fluidInputs(FluidUtils.getMobEssence(5000)) + .fluidInputs(FluidRegistry.getFluidStack("mobessence", 5000)) .fluidOutputs(FluidUtils.getFluidStack(GeneticMutagen, 8000)).duration(30 * SECONDS) .eut(TierEU.RECIPE_HV).addTo(UniversalChemical); } diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java b/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java deleted file mode 100644 index 889c64f2f8..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/DebugScanner.java +++ /dev/null @@ -1,108 +0,0 @@ -package gtPlusPlus.core.item.tool.misc; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.item.base.CoreItem; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class DebugScanner extends CoreItem { - - public DebugScanner() { - super( - "gtpp.debug.scanner", - AddToCreativeTab.tabTools, - 1, - 0, - new String[] { "Used to obtain information from GT/GT++ content", "Right Click to use", }, - EnumRarity.epic); - setTextureName(GTPlusPlus.ID + ":itemStickyRubber"); - } - - @Override - public boolean isDamageable() { - return false; - } - - @Override - public boolean onItemUse(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int p_77648_4_, int p_77648_5_, - int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { - // TODO Auto-generated method stub - return super.onItemUse( - aStack, - aPlayer, - aWorld, - p_77648_4_, - p_77648_5_, - p_77648_6_, - p_77648_7_, - p_77648_8_, - p_77648_9_, - p_77648_10_); - } - - @Override - public boolean isRepairable() { - return false; - } - - @Override - public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { - // TODO Auto-generated method stub - return super.onItemRightClick(p_77659_1_, p_77659_2_, p_77659_3_); - } - - @Override - public float getDigSpeed(ItemStack itemstack, Block block, int metadata) { - return 0f; - } - - @Override - public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - if (entity != null && player != null) { - PlayerUtils.messagePlayer(player, "Entity ID: " + entity.getEntityId()); - PlayerUtils.messagePlayer(player, "UUID: " + entity.getUniqueID()); - PlayerUtils.messagePlayer(player, "Invulnerable? " + entity.isEntityInvulnerable()); - PlayerUtils.messagePlayer(player, "Invisible? " + entity.isInvisible()); - PlayerUtils.messagePlayer(player, "Age: " + entity.ticksExisted); - - if (entity instanceof EntityLivingBase g) { - PlayerUtils.messagePlayer(player, "Health: " + g.getHealth() + "/" + g.getMaxHealth()); - PlayerUtils.messagePlayer(player, "On ground? " + g.onGround); - PlayerUtils.messagePlayer(player, "Child? " + g.isChild()); - } - if (entity instanceof EntityLiving g) { - PlayerUtils.messagePlayer(player, "Can Loot? " + g.canPickUpLoot()); - } - if (entity instanceof EntityPlayer y) { - PlayerUtils.messagePlayer(player, "Experience: " + y.experience); - PlayerUtils.messagePlayer(player, "Name: " + y.getCommandSenderName()); - } - } - return true; - } - - @Override - public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) { - return false; - } - - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } - - @Override - public int getHarvestLevel(ItemStack stack, String toolClass) { - return 0; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java deleted file mode 100644 index ab154c2b24..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/MultiSpadeBase.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.core.item.tool.staballoy; - -import static gregtech.api.enums.Mods.GTPlusPlus; -import static gregtech.api.enums.Mods.Minecraft; - -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.RecipeUtils; - -public class MultiSpadeBase extends StaballoySpade { - - /* - * (non-Javadoc) - * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack) - */ - @Override - public double getDurabilityForDisplay(final ItemStack stack) { - if (super.getDurabilityForDisplay(stack) > 0) { - return super.getDurabilityForDisplay(stack); - } - return 0; - } - - protected final int colour; - protected final String materialName; - protected final String displayName; - public boolean isValid = true; - - public MultiSpadeBase(final String unlocalizedName, final ToolMaterial material, final int materialDurability, - final int colour) { - super(Utils.sanitizeString(unlocalizedName), material); - this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName)); - // this.setTextureName(GTPlusPlus.ID + ":" + "itemShovel"); - this.setTextureName(Minecraft.ID + ":" + "iron_shovel"); - this.setMaxStackSize(1); - this.setMaxDamage(materialDurability * 3); - this.colour = colour; - this.materialName = material.name(); - this.displayName = unlocalizedName; - this.setCreativeTab(AddToCreativeTab.tabTools); - try { - this.isValid = this.addRecipe(); - } catch (final Throwable e) {} - if ((colour != 0) && this.isValid) { - if (GameRegistry.findItem(GTPlusPlus.ID, Utils.sanitizeString(unlocalizedName)) == null) { - GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName)); - } - } - } - - private boolean addRecipe() { - final String cleanName = Utils.sanitizeString(this.materialName); - final String plateDense = "plateDense" + cleanName; - final String plateDouble = "plateDouble" + cleanName; - final String rodLong = "stickLong" + cleanName; - final String toolHammer = "craftingToolHardHammer"; - final String toolWrench = "craftingToolWrench"; - final String toolFile = "craftingToolFile"; - final String toolScrewDriver = "craftingToolScrewdriver"; - - if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(rodLong, 1)) { - return false; - } - if (null == ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDense, 1)) { - if (null != ItemUtils.getItemStackOfAmountFromOreDictNoBroken(plateDouble, 1)) { - RecipeUtils.recipeBuilder( - toolFile, - plateDouble, - toolHammer, - null, - rodLong, - null, - toolWrench, - rodLong, - toolScrewDriver, - ItemUtils.getSimpleStack(this)); - - return true; - } - return false; - } - - RecipeUtils.recipeBuilder( - toolFile, - plateDense, - toolHammer, - null, - rodLong, - null, - toolWrench, - rodLong, - toolScrewDriver, - ItemUtils.getSimpleStack(this)); - - return true; - } - - public final String getMaterialName() { - return this.materialName; - } - - @Override - public String getItemStackDisplayName(final ItemStack iStack) { - return this.displayName; - /* - * String name; if (getUnlocalizedName().toLowerCase().contains("wood")){ name = "Wooden"; } else { } return - * "Big "+name+" Spade"; - */ - } - - @Override - public int getColorFromItemStack(final ItemStack stack, final int HEX_OxFFFFFF) { - if (this.colour == 0) { - return MathUtils.generateSingularRandomHexValue(); - } - return this.colour; - } - - @Override - @SideOnly(Side.CLIENT) - public EnumRarity getRarity(final ItemStack par1ItemStack) { - return EnumRarity.uncommon; - } - - @Override - public boolean hasEffect(final ItemStack par1ItemStack, final int pass) { - return false; - } -} diff --git a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java b/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java deleted file mode 100644 index 7af2c3cf56..0000000000 --- a/src/main/java/gtPlusPlus/core/item/tool/staballoy/StaballoySpade.java +++ /dev/null @@ -1,403 +0,0 @@ -package gtPlusPlus.core.item.tool.staballoy; - -import static gregtech.api.enums.Mods.GTPlusPlus; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemSpade; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.MiningUtils; - -public class StaballoySpade extends ItemSpade { - - /* - * (non-Javadoc) - * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack) - */ - @Override - public double getDurabilityForDisplay(final ItemStack stack) { - if (super.getDurabilityForDisplay(stack) > 0) { - return super.getDurabilityForDisplay(stack); - } - return 0; - } - - /** - * Creates an NBT tag for this item if it doesn't have one. This also set some default values. - * - * @param rStack - * @return - */ - private static boolean createNBT(ItemStack rStack) { - final NBTTagCompound tagMain = new NBTTagCompound(); - final NBTTagCompound tagNBT = new NBTTagCompound(); - - tagNBT.setBoolean("FACING_HORIZONTAL", true); - tagNBT.setString("FACING", "north"); - tagNBT.setString("lookingDirection", ""); - - tagMain.setTag("PickStats", tagNBT); - rStack.setTagCompound(tagMain); - return true; - } - - /* - * Is the player facing horizontally? - */ - - public static final boolean isFacingHorizontal(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - return aNBT.getBoolean("FACING_HORIZONTAL"); - } - } else { - createNBT(aStack); - } - return true; - } - - public static final boolean setFacingHorizontal(final ItemStack aStack, final boolean aFacingHorizontal) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - aNBT.setBoolean("FACING_HORIZONTAL", aFacingHorizontal); - return true; - } - } - return false; - } - - /* - * Handles the Direction the player is facing - */ - - public static final String getFacingDirection(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - return aNBT.getString("FACING"); - } - } else { - createNBT(aStack); - } - return "north"; - } - - public static final boolean setFacingDirection(final ItemStack aStack, final String aFacingHorizontal) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - aNBT.setString("FACING", aFacingHorizontal); - return true; - } - } - return false; - } - - /* - * The Looking Direction handlers - */ - - public static final String getLookingDirection(final ItemStack aStack) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - return aNBT.getString("lookingDirection"); - } - } else { - createNBT(aStack); - } - return ""; - } - - public static final boolean setLookingDirection(final ItemStack aStack, final String aFacingHorizontal) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (aNBT != null) { - aNBT = aNBT.getCompoundTag("PickStats"); - if (aNBT != null) { - aNBT.setString("lookingDirection", aFacingHorizontal); - return true; - } - } - return false; - } - - private int miningLevel; - - /* - * Methods - */ - - @Override - public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer aPlayer) { - return super.onItemRightClick(stack, world, aPlayer); - } - - @Override - public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int X, - final int Y, final int Z, final EntityLivingBase entity) { - if (!world.isRemote) { - if (entity instanceof EntityPlayer) { - this.GetDestroyOrientation((EntityPlayer) entity, getLookingDirection(stack), world, X, Y, Z, stack); - } - } - return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity); - } - - public Boolean canPickaxeBlock(final Block currentBlock, final World currentWorld, final int[] xyz) { - String correctTool = ""; - if (!currentWorld.isRemote) { - try { - correctTool = currentBlock.getHarvestTool(0); - // Utils.LOG_WARNING(correctTool); - - Logger.WARNING( - "Tool for Block: " + correctTool + " | Current block: " + currentBlock.getLocalizedName()); - if (MiningUtils.getBlockType(currentBlock, currentWorld, xyz, this.miningLevel) - || correctTool.equals("shovel")) { - return true; - } - } catch (final NullPointerException e) { - return false; - } - } - return false; - } - - private void GetDestroyOrientation(EntityPlayer player, final String FACING, final World world, final int X, - final int Y, final int Z, final ItemStack heldItem) { - float DURABILITY_LOSS = 0; - if (!world.isRemote) { - - switch (FACING) { - case "below", "above" -> { - DURABILITY_LOSS = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - DURABILITY_LOSS = (DURABILITY_LOSS - + this.removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem)); - } - } - } - case "facingEast", "facingWest" -> { - DURABILITY_LOSS = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - DURABILITY_LOSS = (DURABILITY_LOSS - + this.removeBlockAndDropAsItem(world, X, Y + i, Z + j, heldItem)); - } - } - } - case "facingNorth", "facingSouth" -> { - DURABILITY_LOSS = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - DURABILITY_LOSS = (DURABILITY_LOSS - + this.removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem)); - } - } - } - } - - // int heldItemDurability = heldItem.getDamage(1); - Logger.WARNING("Total Loss: " + (int) DURABILITY_LOSS); - Logger.WARNING("1x: " + (heldItem.getItemDamage())); - final int itemdmg = heldItem.getItemDamage(); - final int maxdmg = heldItem.getMaxDamage(); - final int dodmg = (int) DURABILITY_LOSS; - final int durNow = maxdmg - itemdmg; - final int durLeft = (int) ((maxdmg - itemdmg) - DURABILITY_LOSS); - - Logger.WARNING( - "Current Damage: " + itemdmg - + " Max Damage: " - + maxdmg - + " Durability to be lost: " - + dodmg - + " Current Durability: " - + durNow - + " Remaining Durability: " - + durLeft); - - // Break Tool - if (((durNow - dodmg) <= (900)) && (itemdmg != 0)) { - // TODO break tool - Logger.WARNING("Breaking Tool"); - heldItem.stackSize = 0; - } - // Do Damage - else { - // setItemDamage(heldItem, durLeft); - Logger.WARNING("" + (durNow - durLeft)); - this.damageItem(heldItem, (durNow - durLeft) - 1, player); - } - DURABILITY_LOSS = 0; - } - } - - public void damageItem(final ItemStack item, final int damage, final EntityPlayer localPlayer) { - item.damageItem(damage, localPlayer); - } - - public void setItemDamage(final ItemStack item, final int damage) { - item.setItemDamage(damage - 1); - } - - // Should clear up blocks quicker if I chain it. - public int removeBlockAndDropAsItem(final World world, final int X, final int Y, final int Z, - final ItemStack heldItem) { - Logger.WARNING("Trying to drop/remove a block."); - try { - final Block block = world.getBlock(X, Y, Z); - Logger.WARNING(block.toString()); - String removalTool = ""; - removalTool = block.getHarvestTool(0); - if (removalTool != null) { - if (removalTool.equals("shovel")) { - if (this.canPickaxeBlock(block, world, new int[] { X, Y, Z })) { - if ((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) - && (block.getBlockHardness(world, X, Y, Z) <= 100) - && (block != Blocks.water) - && (block != Blocks.lava)) { - - final int itemdmg = heldItem.getItemDamage(); - final int maxdmg = heldItem.getMaxDamage(); - final int dodmg = 100; - final int durNow = maxdmg - itemdmg; - final int durLeft = (maxdmg - itemdmg) - 100; - - if (((durNow - dodmg) <= (900)) && (itemdmg != 0)) { - // Do Nothing, Tool is useless. - return 0; - } - block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0); - world.setBlockToAir(X, Y, Z); - Logger.WARNING("Adding 100 damage to item."); - return 100; - } - Logger.WARNING( - "Incorrect Tool for mining this block. Wrong Block Water/lava/bedrock/blacklist"); - return 0; - } - Logger.WARNING("Incorrect Tool for mining this block. Cannot Shovel this block type."); - return 0; - } - Logger.WARNING("Incorrect Tool for mining this block. Blocks mining tool is now Shovel."); - return 0; - } - Logger.WARNING("Either the block was air or it declares an invalid mining tool."); - return 0; - } catch (final NullPointerException e) { - Logger.WARNING("Something Broke"); - e.printStackTrace(); - return 0; - } - } - - public boolean checkFacing(final ItemStack aStack, final EntityPlayer aPlayer, final World world) { - if (aPlayer != null) { - final int direction = MathHelper.floor_double((aPlayer.rotationYaw * 4F) / 360F + 0.5D) & 3; - - /* - * if (localPlayer.getLookVec().yCoord > 0){ localPlayer.getLookVec().yCoord; } - */ - - final MovingObjectPosition movingobjectposition = this - .getMovingObjectPositionFromPlayer(world, aPlayer, false); - if (movingobjectposition != null) { - final int sideHit = movingobjectposition.sideHit; - String playerStandingPosition = ""; - if (movingobjectposition != null) { - // System.out.println("Side Hit: "+movingobjectposition.sideHit); - } - - if (sideHit == 0) { - playerStandingPosition = "above"; - setFacingHorizontal(aStack, false); - } else if (sideHit == 1) { - playerStandingPosition = "below"; - setFacingHorizontal(aStack, false); - } else if (sideHit == 2) { - playerStandingPosition = "facingSouth"; - setFacingHorizontal(aStack, true); - } else if (sideHit == 3) { - playerStandingPosition = "facingNorth"; - setFacingHorizontal(aStack, true); - } else if (sideHit == 4) { - playerStandingPosition = "facingEast"; - setFacingHorizontal(aStack, true); - } else if (sideHit == 5) { - playerStandingPosition = "facingWest"; - setFacingHorizontal(aStack, true); - } - setLookingDirection(aStack, playerStandingPosition); - - if (direction == 0) { - setFacingDirection(aStack, "south"); - } else if (direction == 1) { - setFacingDirection(aStack, "west"); - } else if (direction == 2) { - setFacingDirection(aStack, "north"); - } else if (direction == 3) { - setFacingDirection(aStack, "east"); - } - } - - return true; - } - return false; - } - - @SuppressWarnings({ "unchecked", "rawt