From 7d1f51a8937e0a86486267437d444696e81e8aa0 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 29 Aug 2022 16:04:28 +0200 Subject: Buildscript + Spotless (#318) * Convert AES.java to readable class * Buildscript * Spotless --- .../java/gtPlusPlus/core/common/BasePlayer.java | 402 ++++++++-------- .../java/gtPlusPlus/core/common/CommonProxy.java | 515 ++++++++++----------- .../core/common/compat/COMPAT_Baubles.java | 89 ++-- .../core/common/compat/COMPAT_BigReactors.java | 21 +- .../common/compat/COMPAT_CompactWindmills.java | 372 ++++++++------- .../core/common/compat/COMPAT_EnderIO.java | 33 +- .../core/common/compat/COMPAT_ExtraUtils.java | 47 +- .../core/common/compat/COMPAT_HarvestCraft.java | 13 +- .../gtPlusPlus/core/common/compat/COMPAT_IC2.java | 108 ++--- .../core/common/compat/COMPAT_MorePlanets.java | 56 +-- .../core/common/compat/COMPAT_OpenBlocks.java | 35 +- .../core/common/compat/COMPAT_PlayerAPI.java | 55 +-- .../core/common/compat/COMPAT_PneumaticCraft.java | 17 +- .../core/common/compat/COMPAT_RFTools.java | 18 +- .../core/common/compat/COMPAT_Railcraft.java | 12 +- .../core/common/compat/COMPAT_SimplyJetpacks.java | 18 +- .../core/common/compat/COMPAT_Thaumcraft.java | 74 +-- .../core/common/compat/COMPAT_Witchery.java | 29 +- 18 files changed, 967 insertions(+), 947 deletions(-) (limited to 'src/main/java/gtPlusPlus/core/common') diff --git a/src/main/java/gtPlusPlus/core/common/BasePlayer.java b/src/main/java/gtPlusPlus/core/common/BasePlayer.java index 4686f34207..69cd46178a 100644 --- a/src/main/java/gtPlusPlus/core/common/BasePlayer.java +++ b/src/main/java/gtPlusPlus/core/common/BasePlayer.java @@ -10,203 +10,205 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.util.MovementInputFromOptions; -public class BasePlayer extends ClientPlayerBase -{ - private final Minecraft mc = Minecraft.getMinecraft(); - private final CustomMovementHandler customMovementInput = new CustomMovementHandler(); - private final GameSettings settings = this.mc.gameSettings; - - public BasePlayer(final ClientPlayerAPI api) - { - super(api); - } - - /* - * EntityPlayerSP.onLivingUpdate() - Adapted to PlayerAPI - */ - @Override - public void onLivingUpdate() { - - super.onLivingUpdate(); - EntityPlayer aPlayer = this.player; - if (aPlayer != null) { - SneakManager aSneak = SneakManager.get(aPlayer); - if (!aSneak.isWearingRing()) { - return; - } - } - - if(this.player.sprintingTicksLeft > 0) - { - --this.player.sprintingTicksLeft; - if(this.player.sprintingTicksLeft == 0) - { - this.player.setSprinting(false); - } - } - - if(this.playerAPI.getSprintToggleTimerField() > 0) - { - this.playerAPI.setSprintToggleTimerField(this.playerAPI.getSprintToggleTimerField() - 1); - } - - if(this.mc.playerController.enableEverythingIsScrewedUpMode()) - { - this.player.posX = this.player.posZ = 0.5D; - this.player.posX = 0.0D; - this.player.posZ = 0.0D; - this.player.rotationYaw = this.player.ticksExisted / 12.0F; - this.player.rotationPitch = 10.0F; - this.player.posY = 68.5D; - } - else - { - - - - - final boolean isJumping = this.player.movementInput.jump; - - final float minSpeed = 0.8F; - final boolean isMovingForward = this.player.movementInput.moveForward >= minSpeed; - this.customMovementInput.update(this.mc, (MovementInputFromOptions)this.player.movementInput, this.player); - - - /* - * Begin ToggleSneak Changes - ToggleSprint - */ - SneakManager aSneak = SneakManager.get(this.player); - - final boolean isSprintDisabled = false; - final boolean canDoubleTap = aSneak.optionDoubleTap; - - - // Detect when ToggleSprint was disabled in the in-game options menu - if(aSneak.wasSprintDisabled) - { - this.player.setSprinting(false); - this.customMovementInput.UpdateSprint(false, false, aSneak); - aSneak.wasSprintDisabled = false; - } - - // Default Sprint routine converted to PlayerAPI, use if ToggleSprint is disabled - TODO - Disable sprinting as a whole - if(isSprintDisabled) - { - //Utils.LOG_INFO("Sprint pressed"); - if(aSneak.optionDoubleTap && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness)) - { - if((this.playerAPI.getSprintToggleTimerField() <= 0) && !this.settings.keyBindSprint.getIsKeyPressed()) - { - this.playerAPI.setSprintToggleTimerField(7); - } - else - { - if (aSneak.Sprinting()){ - this.player.setSprinting(true); - this.customMovementInput.UpdateSprint(true, false, aSneak); - } - else { - this.player.setSprinting(false); - this.customMovementInput.UpdateSprint(false, false, aSneak); - } - } - } - - if(!this.player.isSprinting() && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && this.settings.keyBindSprint.getIsKeyPressed()) - { - if (aSneak.Sprinting()){ - this.player.setSprinting(true); - this.customMovementInput.UpdateSprint(true, false, aSneak); - } - else { - this.player.setSprinting(false); - this.customMovementInput.UpdateSprint(false, false, aSneak); - } - } - } - else - { - final boolean state = this.customMovementInput.sprint; - - // Only handle changes in state under the following conditions: - // On ground, not hungry, not eating/using item, not blind, and not Vanilla - // - // 5/6/14 - onGround check removed to match vanilla's 'start sprint while jumping' behavior. - //if(this.player.onGround && enoughHunger && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased) - - if(!this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased) - { - if((canDoubleTap && !this.player.isSprinting()) || !canDoubleTap) - { - if (aSneak.Sprinting()){ - this.player.setSprinting(state); - } else { - this.player.setSprinting(false); - } - } - } - - if(canDoubleTap && !state && this.player.onGround && !isMovingForward && (this.player.movementInput.moveForward >= minSpeed) && !this.player.isSprinting() && !this.player.isUsingItem() && !this.player.isPotionActive(Potion.blindness)) - { - if(this.playerAPI.getSprintToggleTimerField() == 0) - { - this.playerAPI.setSprintToggleTimerField(7); - } - else - { - if (aSneak.Sprinting()){ - this.player.setSprinting(true); - this.customMovementInput.UpdateSprint(true, true, aSneak); - this.playerAPI.setSprintToggleTimerField(0); - } - } - } - } - - // If sprinting, break the sprint in appropriate circumstances: - // Player stops moving forward, runs into something, or gets too hungry - if(this.player.isSprinting() && ((this.player.movementInput.moveForward < minSpeed) || this.player.isCollidedHorizontally)) - { - this.player.setSprinting(false); - - // Undo toggle if we resumed vanilla operation due to Hold&Release, DoubleTap, Fly, Ride - if ((this.customMovementInput.sprintHeldAndReleased == true) || isSprintDisabled || this.customMovementInput.sprintDoubleTapped || this.player.capabilities.isFlying || this.player.isRiding()) - { - this.customMovementInput.UpdateSprint(false, false, aSneak); - } - } - - /* - * End ToggleSneak Changes - ToggleSprint - */ - - // // - // // Debug Framework - Added 5/7/2014 - // // - // if (this.showDebug && this.settings.keyBindPickBlock.getIsKeyPressed() && !this.handledDebugPress) - // { - // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+")); - // this.player.addChatMessage(new ChatComponentText("| ToggleSneak Debug Info |")); - // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+")); - // this.player.addChatMessage(new ChatComponentText(" ")); - // this.player.addChatMessage(new ChatComponentText("isFlying - " + (this.player.capabilities.isFlying == true ? "True" : "False"))); - // this.player.addChatMessage(new ChatComponentText("isCreative - " + (this.player.capabilities.isCreativeMode == true ? "True" : "False"))); - // this.player.addChatMessage(new ChatComponentText("enableFlyBoost - " + (SneakManager.optionEnableFlyBoost == true ? "True" : "False"))); - // this.player.addChatMessage(new ChatComponentText("flyBoostAmount - " + SneakManager.optionFlyBoostAmount)); - // this.player.addChatMessage(new ChatComponentText(" ")); - // this.player.addChatMessage(new ChatComponentText("keybindSprint - " + (this.settings.keyBindSprint.getIsKeyPressed() == true ? "True" : "False"))); - // this.player.addChatMessage(new ChatComponentText("keybindSneak - " + (this.settings.keyBindSneak.getIsKeyPressed() == true ? "True" : "False"))); - // this.player.addChatMessage(new ChatComponentText("keybindJump - " + (this.settings.keyBindJump.getIsKeyPressed() == true ? "True" : "False"))); - // this.player.addChatMessage(new ChatComponentText(" ")); - // this.player.addChatMessage(new ChatComponentText(" ")); - // - // this.handledDebugPress = true; - // } - // else if (this.showDebug && !this.settings.keyBindPickBlock.getIsKeyPressed() && this.handledDebugPress) - // { - // this.handledDebugPress = false; - // } - - } - } -} \ No newline at end of file +public class BasePlayer extends ClientPlayerBase { + private final Minecraft mc = Minecraft.getMinecraft(); + private final CustomMovementHandler customMovementInput = new CustomMovementHandler(); + private final GameSettings settings = this.mc.gameSettings; + + public BasePlayer(final ClientPlayerAPI api) { + super(api); + } + + /* + * EntityPlayerSP.onLivingUpdate() - Adapted to PlayerAPI + */ + @Override + public void onLivingUpdate() { + + super.onLivingUpdate(); + EntityPlayer aPlayer = this.player; + if (aPlayer != null) { + SneakManager aSneak = SneakManager.get(aPlayer); + if (!aSneak.isWearingRing()) { + return; + } + } + + if (this.player.sprintingTicksLeft > 0) { + --this.player.sprintingTicksLeft; + if (this.player.sprintingTicksLeft == 0) { + this.player.setSprinting(false); + } + } + + if (this.playerAPI.getSprintToggleTimerField() > 0) { + this.playerAPI.setSprintToggleTimerField(this.playerAPI.getSprintToggleTimerField() - 1); + } + + if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { + this.player.posX = this.player.posZ = 0.5D; + this.player.posX = 0.0D; + this.player.posZ = 0.0D; + this.player.rotationYaw = this.player.ticksExisted / 12.0F; + this.player.rotationPitch = 10.0F; + this.player.posY = 68.5D; + } else { + + final boolean isJumping = this.player.movementInput.jump; + + final float minSpeed = 0.8F; + final boolean isMovingForward = this.player.movementInput.moveForward >= minSpeed; + this.customMovementInput.update(this.mc, (MovementInputFromOptions) this.player.movementInput, this.player); + + /* + * Begin ToggleSneak Changes - ToggleSprint + */ + SneakManager aSneak = SneakManager.get(this.player); + + final boolean isSprintDisabled = false; + final boolean canDoubleTap = aSneak.optionDoubleTap; + + // Detect when ToggleSprint was disabled in the in-game options menu + if (aSneak.wasSprintDisabled) { + this.player.setSprinting(false); + this.customMovementInput.UpdateSprint(false, false, aSneak); + aSneak.wasSprintDisabled = false; + } + + // Default Sprint routine converted to PlayerAPI, use if ToggleSprint is disabled - TODO - Disable sprinting + // as a whole + if (isSprintDisabled) { + // Utils.LOG_INFO("Sprint pressed"); + if (aSneak.optionDoubleTap + && this.player.onGround + && !isMovingForward + && (this.player.movementInput.moveForward >= minSpeed) + && !this.player.isSprinting() + && !this.player.isUsingItem() + && !this.player.isPotionActive(Potion.blindness)) { + if ((this.playerAPI.getSprintToggleTimerField() <= 0) + && !this.settings.keyBindSprint.getIsKeyPressed()) { + this.playerAPI.setSprintToggleTimerField(7); + } else { + if (aSneak.Sprinting()) { + this.player.setSprinting(true); + this.customMovementInput.UpdateSprint(true, false, aSneak); + } else { + this.player.setSprinting(false); + this.customMovementInput.UpdateSprint(false, false, aSneak); + } + } + } + + if (!this.player.isSprinting() + && (this.player.movementInput.moveForward >= minSpeed) + && !this.player.isUsingItem() + && !this.player.isPotionActive(Potion.blindness) + && this.settings.keyBindSprint.getIsKeyPressed()) { + if (aSneak.Sprinting()) { + this.player.setSprinting(true); + this.customMovementInput.UpdateSprint(true, false, aSneak); + } else { + this.player.setSprinting(false); + this.customMovementInput.UpdateSprint(false, false, aSneak); + } + } + } else { + final boolean state = this.customMovementInput.sprint; + + // Only handle changes in state under the following conditions: + // On ground, not hungry, not eating/using item, not blind, and not Vanilla + // + // 5/6/14 - onGround check removed to match vanilla's 'start sprint while jumping' behavior. + // if(this.player.onGround && enoughHunger && !this.player.isUsingItem() && + // !this.player.isPotionActive(Potion.blindness) && !this.customMovementInput.sprintHeldAndReleased) + + if (!this.player.isUsingItem() + && !this.player.isPotionActive(Potion.blindness) + && !this.customMovementInput.sprintHeldAndReleased) { + if ((canDoubleTap && !this.player.isSprinting()) || !canDoubleTap) { + if (aSneak.Sprinting()) { + this.player.setSprinting(state); + } else { + this.player.setSprinting(false); + } + } + } + + if (canDoubleTap + && !state + && this.player.onGround + && !isMovingForward + && (this.player.movementInput.moveForward >= minSpeed) + && !this.player.isSprinting() + && !this.player.isUsingItem() + && !this.player.isPotionActive(Potion.blindness)) { + if (this.playerAPI.getSprintToggleTimerField() == 0) { + this.playerAPI.setSprintToggleTimerField(7); + } else { + if (aSneak.Sprinting()) { + this.player.setSprinting(true); + this.customMovementInput.UpdateSprint(true, true, aSneak); + this.playerAPI.setSprintToggleTimerField(0); + } + } + } + } + + // If sprinting, break the sprint in appropriate circumstances: + // Player stops moving forward, runs into something, or gets too hungry + if (this.player.isSprinting() + && ((this.player.movementInput.moveForward < minSpeed) || this.player.isCollidedHorizontally)) { + this.player.setSprinting(false); + + // Undo toggle if we resumed vanilla operation due to Hold&Release, DoubleTap, Fly, Ride + if ((this.customMovementInput.sprintHeldAndReleased == true) + || isSprintDisabled + || this.customMovementInput.sprintDoubleTapped + || this.player.capabilities.isFlying + || this.player.isRiding()) { + this.customMovementInput.UpdateSprint(false, false, aSneak); + } + } + + /* + * End ToggleSneak Changes - ToggleSprint + */ + + // // + // // Debug Framework - Added 5/7/2014 + // // + // if (this.showDebug && this.settings.keyBindPickBlock.getIsKeyPressed() && !this.handledDebugPress) + // { + // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+")); + // this.player.addChatMessage(new ChatComponentText("| ToggleSneak Debug Info |")); + // this.player.addChatMessage(new ChatComponentText("+--------------------------------------+")); + // this.player.addChatMessage(new ChatComponentText(" ")); + // this.player.addChatMessage(new ChatComponentText("isFlying - " + + // (this.player.capabilities.isFlying == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("isCreative - " + + // (this.player.capabilities.isCreativeMode == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("enableFlyBoost - " + + // (SneakManager.optionEnableFlyBoost == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("flyBoostAmount - " + + // SneakManager.optionFlyBoostAmount)); + // this.player.addChatMessage(new ChatComponentText(" ")); + // this.player.addChatMessage(new ChatComponentText("keybindSprint - " + + // (this.settings.keyBindSprint.getIsKeyPressed() == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("keybindSneak - " + + // (this.settings.keyBindSneak.getIsKeyPressed() == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText("keybindJump - " + + // (this.settings.keyBindJump.getIsKeyPressed() == true ? "True" : "False"))); + // this.player.addChatMessage(new ChatComponentText(" ")); + // this.player.addChatMessage(new ChatComponentText(" ")); + // + // this.handledDebugPress = true; + // } + // else if (this.showDebug && !this.settings.keyBindPickBlock.getIsKeyPressed() && this.handledDebugPress) + // { + // this.handledDebugPress = false; + // } + + } + } +} diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java index 2909ef3541..421dd05b8f 100644 --- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java @@ -3,7 +3,6 @@ package gtPlusPlus.core.common; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.OrePrefixes; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -18,12 +17,10 @@ import gtPlusPlus.core.fluids.FluidFactory; import gtPlusPlus.core.handler.*; import gtPlusPlus.core.handler.events.*; import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; -import gtPlusPlus.core.material.Material; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.tileentities.ModTileEntities; import gtPlusPlus.core.util.Utils; @@ -36,7 +33,6 @@ import gtPlusPlus.plugin.villagers.block.BlockGenericSpawner; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.eio.handler.HandlerTooltip_EIO; import gtPlusPlus.xmod.galacticraft.handler.HandlerTooltip_GC; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -50,261 +46,258 @@ import net.minecraftforge.client.IItemRenderer; public class CommonProxy { - public CommonProxy() { - // Should Register Gregtech Materials I've Made - Utils.registerEvent(this); - if (!CORE.GTNH) { - Logger.INFO("We're using Gregtech " + Utils.getGregtechVersionAsString()); - } else { - Logger.INFO("We're using GTNH's Gregtech " + Utils.getGregtechVersionAsString()); - } - } - - public void preInit(final FMLPreInitializationEvent e) { - Logger.INFO("Doing some house cleaning."); - LoadedMods.checkLoaded(); - Logger.INFO("Making sure we're ready to party!"); - - if (!CORE_Preloader.DEBUG_MODE) { - Logger.WARNING("Development mode not enabled."); - } else if (CORE_Preloader.DEBUG_MODE) { - Logger.INFO("Development mode enabled."); - } else { - Logger.WARNING("Development mode not set."); - } - - AddToCreativeTab.initialiseTabs(); - EnumHelperHandler.init(); - - // Moved from Init after Debug Loading. - // 29/01/18 - Alkalus - // Moved earlier into PreInit, so that Items exist before they're called upon in - // recipes. - // 20/03/18 - Alkalus - ModItems.init(); - ModBlocks.init(); - CI.preInit(); - FluidFactory.preInit(); - COMPAT_IntermodStaging.preInit(e); - BookHandler.run(); - // Registration of entities and renderers - Logger.INFO("[Proxy] Calling Entity registrator."); - registerEntities(); - Logger.INFO("[Proxy] Calling Tile Entity registrator."); - registerTileEntities(); - - Logger.INFO("[Proxy] Calling Render registrator."); - registerRenderThings(); - - } - - public void init(final FMLInitializationEvent e) { - // Debug Loading - if (CORE_Preloader.DEBUG_MODE) { - DEBUG_INIT.registerHandlers(); - } - - registerCustomItemsForMaterials(); - ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner(); - CI.init(); - FluidFactory.init(); - - /** - * Register the Event Handlers. - */ - - // Prevents my Safes being destroyed. - Utils.registerEvent(new PickaxeBlockBreakEventHandler()); - // Block Handler for all events. - Utils.registerEvent(new BlockEventHandler()); - Utils.registerEvent(new GeneralTooltipEventHandler()); - // Handles Tooltips for items giving custom multiblock behaviour - Utils.registerEvent(new SpecialBehaviourTooltipHandler()); - // Handles Custom tooltips for EIO. - Utils.registerEvent(new HandlerTooltip_EIO()); - // Handles Custom Tooltips for GC - Utils.registerEvent(new HandlerTooltip_GC()); - // Handles Sleep Benefits - PlayerSleepEventHandler.init(); - // Handles Magic Feather - Utils.registerEvent(ModItems.itemMagicFeather); - - if (CORE.DEVENV) { - Utils.registerEvent(new StopAnnoyingFuckingAchievements()); - } - - Utils.registerEvent(new EnderDragonDeathHandler()); - Utils.registerEvent(new EntityDeathHandler()); - - if (ConfigSwitches.disableZombieReinforcement) { - // Make Zombie reinforcements fuck off. - Utils.registerEvent(new ZombieBackupSpawnEventHandler()); - } - - /** - * End of Subscribe Event registration. - */ - - // Compat Handling - COMPAT_HANDLER.registerMyModsOreDictEntries(); - COMPAT_HANDLER.intermodOreDictionarySupport(); - COMPAT_IntermodStaging.init(e); - } - - public void postInit(final FMLPostInitializationEvent e) { - Logger.INFO("Cleaning up, doing postInit."); - PlayerCache.initCache(); - FluidFactory.postInit(); - - // Make Burnables burnable - if (!CORE.burnables.isEmpty()) { - BurnableFuelHandler fuelHandler = new BurnableFuelHandler(); - GameRegistry.registerFuelHandler(fuelHandler); - Logger.INFO("[Fuel Handler] Registering " + fuelHandler.getClass().getName()); - } - - // Compat Handling - Logger.INFO("Removing recipes from other mods."); - COMPAT_HANDLER.RemoveRecipesFromOtherMods(); - Logger.INFO("Initialising Handler, Then Adding Recipes"); - COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); - Logger.INFO("Loading Intermod staging."); - COMPAT_IntermodStaging.postInit(e); - Logger.INFO("Loading queued recipes."); - COMPAT_HANDLER.runQueuedRecipes(); - Logger.INFO("Registering custom mob drops."); - registerCustomMobDrops(); - - // Moved last in postInit(). - // 12/12/19 - Alkalus - // Moved last, to prevent recipes being generated post initialisation. - Logger.INFO("Loading Gregtech API recipes."); - COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); - } - - public void serverStarting(final FMLServerStartingEvent e) { - COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes(); - } - - public void onLoadComplete(FMLLoadCompleteEvent event) { - COMPAT_IntermodStaging.onLoadComplete(event); - COMPAT_HANDLER.onLoadComplete(event); - } - - public void registerNetworkStuff() { - GuiHandler.init(); - } - - public void registerEntities() { - InternalEntityRegistry.registerEntities(); - } - - public void registerTileEntities() { - ModTileEntities.init(); - } - - public void registerRenderThings() { - - } - - public int addArmor(final String armor) { - return 0; - } - - public void generateMysteriousParticles(final Entity entity) { - - } - - public void generateMobSpawners() { - // Try register some test spawners - Utils.createNewMobSpawner(0, EntityGiantChickenBase.class); - Utils.createNewMobSpawner(1, EntitySickBlaze.class); - Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class); - } - - public void registerCustomItemsForMaterials() { - //Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1)); - } - - public void registerCustomMobDrops() { - - //Zombie - EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100); - EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250); - EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemSandstoneHammer), 1, 10); - EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10); - EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10); - EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10); - - //Blazes - if (ItemUtils.doesOreDictHaveEntryFor("dustPyrotheum")) { - EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10); - EntityUtils.registerDropsForMob(EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10); - } - - - //Special mobs Support - if (ReflectionUtils.doesClassExist("toast.specialMobs.entity.zombie.EntityBrutishZombie")) { - Class aBrutishZombie = ReflectionUtils.getClass("toast.specialMobs.entity.zombie.EntityBrutishZombie"); - ItemStack aFortune1 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1); - ItemStack aFortune2 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1); - ItemStack aFortune3 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1); - EntityUtils.registerDropsForMob(aBrutishZombie, aFortune1, 1, 100); - EntityUtils.registerDropsForMob(aBrutishZombie, aFortune2, 1, 50); - EntityUtils.registerDropsForMob(aBrutishZombie, aFortune3, 1, 1); - EntityUtils.registerDropsForMob(aBrutishZombie, ItemUtils.getItemStackOfAmountFromOreDict("ingotRedAlloy", 1), 3, 200); - } - - //GalaxySpace Support - if (ReflectionUtils.doesClassExist("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze")) { - Class aColdBlaze = ReflectionUtils.getClass("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze"); - ItemStack aSmallBlizz, aTinyBlizz, aSmallCryo, aTinyCryo; - aSmallBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallBlizz", 1); - aTinyBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBlizz", 1); - aSmallCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallCryotheum", 1); - aTinyCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCryotheum", 1); - EntityUtils.registerDropsForMob(aColdBlaze, ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1), 2, 500); - if (aSmallBlizz != null) { - EntityUtils.registerDropsForMob(aColdBlaze, aSmallBlizz, 2, 750); - } - if (aTinyBlizz != null) { - EntityUtils.registerDropsForMob(aColdBlaze, aTinyBlizz, 4, 1500); - } - if (aSmallCryo != null) { - EntityUtils.registerDropsForMob(aColdBlaze, aSmallCryo, 1, 50); - } - if (aTinyCryo != null) { - EntityUtils.registerDropsForMob(aColdBlaze, aTinyCryo, 2, 100); - } - } - - } - - protected final AutoMap> mItemRenderMappings = new AutoMap>(); - - - public static void registerItemRendererGlobal(Item aItem, IItemRenderer aRenderer) { - GTplusplus.proxy.registerItemRenderer(aItem, aRenderer); - } - - public void registerItemRenderer(Item aItem, IItemRenderer aRenderer) { - if (Utils.isServer()) { - return; - } - else { - mItemRenderMappings.add(new Pair(aItem, aRenderer)); - } - } - - public World getClientWorld() { - return null; - } - - /** - * Returns a side-appropriate EntityPlayer for use during message handling - */ - public EntityPlayer getPlayerEntity(MessageContext ctx) { - return ctx.getServerHandler().playerEntity; - } - + public CommonProxy() { + // Should Register Gregtech Materials I've Made + Utils.registerEvent(this); + if (!CORE.GTNH) { + Logger.INFO("We're using Gregtech " + Utils.getGregtechVersionAsString()); + } else { + Logger.INFO("We're using GTNH's Gregtech " + Utils.getGregtechVersionAsString()); + } + } + + public void preInit(final FMLPreInitializationEvent e) { + Logger.INFO("Doing some house cleaning."); + LoadedMods.checkLoaded(); + Logger.INFO("Making sure we're ready to party!"); + + if (!CORE_Preloader.DEBUG_MODE) { + Logger.WARNING("Development mode not enabled."); + } else if (CORE_Preloader.DEBUG_MODE) { + Logger.INFO("Development mode enabled."); + } else { + Logger.WARNING("Development mode not set."); + } + + AddToCreativeTab.initialiseTabs(); + EnumHelperHandler.init(); + + // Moved from Init after Debug Loading. + // 29/01/18 - Alkalus + // Moved earlier into PreInit, so that Items exist before they're called upon in + // recipes. + // 20/03/18 - Alkalus + ModItems.init(); + ModBlocks.init(); + CI.preInit(); + FluidFactory.preInit(); + COMPAT_IntermodStaging.preInit(e); + BookHandler.run(); + // Registration of entities and renderers + Logger.INFO("[Proxy] Calling Entity registrator."); + registerEntities(); + Logger.INFO("[Proxy] Calling Tile Entity registrator."); + registerTileEntities(); + + Logger.INFO("[Proxy] Calling Render registrator."); + registerRenderThings(); + } + + public void init(final FMLInitializationEvent e) { + // Debug Loading + if (CORE_Preloader.DEBUG_MODE) { + DEBUG_INIT.registerHandlers(); + } + + registerCustomItemsForMaterials(); + ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner(); + CI.init(); + FluidFactory.init(); + + /** + * Register the Event Handlers. + */ + + // Prevents my Safes being destroyed. + Utils.registerEvent(new PickaxeBlockBreakEventHandler()); + // Block Handler for all events. + Utils.registerEvent(new BlockEventHandler()); + Utils.registerEvent(new GeneralTooltipEventHandler()); + // Handles Tooltips for items giving custom multiblock behaviour + Utils.registerEvent(new SpecialBehaviourTooltipHandler()); + // Handles Custom tooltips for EIO. + Utils.registerEvent(new HandlerTooltip_EIO()); + // Handles Custom Tooltips for GC + Utils.registerEvent(new HandlerTooltip_GC()); + // Handles Sleep Benefits + PlayerSleepEventHandler.init(); + // Handles Magic Feather + Utils.registerEvent(ModItems.itemMagicFeather); + + if (CORE.DEVENV) { + Utils.registerEvent(new StopAnnoyingFuckingAchievements()); + } + + Utils.registerEvent(new EnderDragonDeathHandler()); + Utils.registerEvent(new EntityDeathHandler()); + + if (ConfigSwitches.disableZombieReinforcement) { + // Make Zombie reinforcements fuck off. + Utils.registerEvent(new ZombieBackupSpawnEventHandler()); + } + + /** + * End of Subscribe Event registration. + */ + + // Compat Handling + COMPAT_HANDLER.registerMyModsOreDictEntries(); + COMPAT_HANDLER.intermodOreDictionarySupport(); + COMPAT_IntermodStaging.init(e); + } + + public void postInit(final FMLPostInitializationEvent e) { + Logger.INFO("Cleaning up, doing postInit."); + PlayerCache.initCache(); + FluidFactory.postInit(); + + // Make Burnables burnable + if (!CORE.burnables.isEmpty()) { + BurnableFuelHandler fuelHandler = new BurnableFuelHandler(); + GameRegistry.registerFuelHandler(fuelHandler); + Logger.INFO("[Fuel Handler] Registering " + fuelHandler.getClass().getName()); + } + + // Compat Handling + Logger.INFO("Removing recipes from other mods."); + COMPAT_HANDLER.RemoveRecipesFromOtherMods(); + Logger.INFO("Initialising Handler, Then Adding Recipes"); + COMPAT_HANDLER.InitialiseHandlerThenAddRecipes(); + Logger.INFO("Loading Intermod staging."); + COMPAT_IntermodStaging.postInit(e); + Logger.INFO("Loading queued recipes."); + COMPAT_HANDLER.runQueuedRecipes(); + Logger.INFO("Registering custom mob drops."); + registerCustomMobDrops(); + + // Moved last in postInit(). + // 12/12/19 - Alkalus + // Moved last, to prevent recipes being generated post initialisation. + Logger.INFO("Loading Gregtech API recipes."); + COMPAT_HANDLER.startLoadingGregAPIBasedRecipes(); + } + + public void serverStarting(final FMLServerStartingEvent e) { + COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes(); + } + + public void onLoadComplete(FMLLoadCompleteEvent event) { + COMPAT_IntermodStaging.onLoadComplete(event); + COMPAT_HANDLER.onLoadComplete(event); + } + + public void registerNetworkStuff() { + GuiHandler.init(); + } + + public void registerEntities() { + InternalEntityRegistry.registerEntities(); + } + + public void registerTileEntities() { + ModTileEntities.init(); + } + + public void registerRenderThings() {} + + public int addArmor(final String armor) { + return 0; + } + + public void generateMysteriousParticles(final Entity entity) {} + + public void generateMobSpawners() { + // Try register some test spawners + Utils.createNewMobSpawner(0, EntityGiantChickenBase.class); + Utils.createNewMobSpawner(1, EntitySickBlaze.class); + Utils.createNewMobSpawner(2, EntityStaballoyConstruct.class); + } + + public void registerCustomItemsForMaterials() { + // Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, + // GregtechItemList.Carbyne_Sheet_Finished.get(1)); + } + + public void registerCustomMobDrops() { + + // Zombie + EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemRope), 3, 100); + EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemFiber), 5, 250); + EntityUtils.registerDropsForMob( + EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemSandstoneHammer), 1, 10); + EntityUtils.registerDropsForMob(EntityZombie.class, ItemUtils.getSimpleStack(ModItems.itemBomb), 2, 10); + EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.TUMBAGA.getTinyDust(1), 1, 10); + EntityUtils.registerDropsForMob(EntityZombie.class, ALLOY.POTIN.getTinyDust(1), 1, 10); + + // Blazes + if (ItemUtils.doesOreDictHaveEntryFor("dustPyrotheum")) { + EntityUtils.registerDropsForMob( + EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10); + EntityUtils.registerDropsForMob( + EntityBlaze.class, ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), 1, 10); + } + + // Special mobs Support + if (ReflectionUtils.doesClassExist("toast.specialMobs.entity.zombie.EntityBrutishZombie")) { + Class aBrutishZombie = ReflectionUtils.getClass("toast.specialMobs.entity.zombie.EntityBrutishZombie"); + ItemStack aFortune1 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1); + ItemStack aFortune2 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1); + ItemStack aFortune3 = ItemUtils.getEnchantedBook(Enchantment.fortune, 1); + EntityUtils.registerDropsForMob(aBrutishZombie, aFortune1, 1, 100); + EntityUtils.registerDropsForMob(aBrutishZombie, aFortune2, 1, 50); + EntityUtils.registerDropsForMob(aBrutishZombie, aFortune3, 1, 1); + EntityUtils.registerDropsForMob( + aBrutishZombie, ItemUtils.getItemStackOfAmountFromOreDict("ingotRedAlloy", 1), 3, 200); + } + + // GalaxySpace Support + if (ReflectionUtils.doesClassExist("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze")) { + Class aColdBlaze = + ReflectionUtils.getClass("galaxyspace.SolarSystem.moons.europa.entities.EntityEvolvedColdBlaze"); + ItemStack aSmallBlizz, aTinyBlizz, aSmallCryo, aTinyCryo; + aSmallBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallBlizz", 1); + aTinyBlizz = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyBlizz", 1); + aSmallCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustSmallCryotheum", 1); + aTinyCryo = ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCryotheum", 1); + EntityUtils.registerDropsForMob( + aColdBlaze, ItemUtils.getItemStackOfAmountFromOreDict("stickBlizz", 1), 2, 500); + if (aSmallBlizz != null) { + EntityUtils.registerDropsForMob(aColdBlaze, aSmallBlizz, 2, 750); + } + if (aTinyBlizz != null) { + EntityUtils.registerDropsForMob(aColdBlaze, aTinyBlizz, 4, 1500); + } + if (aSmallCryo != null) { + EntityUtils.registerDropsForMob(aColdBlaze, aSmallCryo, 1, 50); + } + if (aTinyCryo != null) { + EntityUtils.registerDropsForMob(aColdBlaze, aTinyCryo, 2, 100); + } + } + } + + protected final AutoMap> mItemRenderMappings = new AutoMap>(); + + public static void registerItemRendererGlobal(Item aItem, IItemRenderer aRenderer) { + GTplusplus.proxy.registerItemRenderer(aItem, aRenderer); + } + + public void registerItemRenderer(Item aItem, IItemRenderer aRenderer) { + if (Utils.isServer()) { + return; + } else { + mItemRenderMappings.add(new Pair(aItem, aRenderer)); + } + } + + public World getClientWorld() { + return null; + } + + /** + * Returns a side-appropriate EntityPlayer for use during message handling + */ + public EntityPlayer getPlayerEntity(MessageContext ctx) { + return ctx.getServerHandler().playerEntity; + } } diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java index c9704603af..4af788a9df 100644 --- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java +++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_Baubles.java @@ -21,51 +21,56 @@ import net.minecraft.entity.monster.EntityZombie; public class COMPAT_Baubles { - public static void run(){ - if (LoadedMods.Baubles){ - baublesLoaded(); - } - else { - baublesNotLoaded(); - } - } + public static void run() { + if (LoadedMods.Baubles) { + baublesLoaded(); + } else { + baublesNotLoaded(); + } + } - public static void baublesLoaded(){ - Logger.INFO("Baubles Found - Loading Wearables."); - ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0); - //itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set; - ModItems.itemPersonalHealingDevice = new ItemHealingDevice(); - ModItems.itemPersonalFireProofDevice = new FireProtectionBauble(); + public static void baublesLoaded() { + Logger.INFO("Baubles Found - Loading Wearables."); + ModItems.itemPersonalCloakingDevice = new ItemCloakingDevice(0); + // itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set; + ModItems.itemPersonalHealingDevice = new ItemHealingDevice(); + ModItems.itemPersonalFireProofDevice = new FireProtectionBauble(); - try { - ModItems.itemChargePack_Low_1 = new BatteryPackBaseBauble(1); - ModItems.itemChargePack_Low_2 = new BatteryPackBaseBauble(2); - ModItems.itemChargePack_Low_3 = new BatteryPackBaseBauble(3); - ModItems.itemChargePack_Low_4 = new BatteryPackBaseBauble(4); - ModItems.itemChargePack_Low_5 = new BatteryPackBaseBauble(5); - ModItems.itemChargePack_High_1 = new BatteryPackBaseBauble(6); - ModItems.itemChargePack_High_2 = new BatteryPackBaseBauble(7); - ModItems.itemChargePack_High_3 = new BatteryPackBaseBauble(8); - ModItems.itemChargePack_High_4 = new BatteryPackBaseBauble(9); - } - catch (Throwable t) { - t.printStackTrace(); - } + try { + ModItems.itemChargePack_Low_1 = new BatteryPackBaseBauble(1); + ModItems.itemChargePack_Low_2 = new BatteryPackBaseBauble(2); + ModItems.itemChargePack_Low_3 = new BatteryPackBaseBauble(3); + ModItems.itemChargePack_Low_4 = new BatteryPackBaseBauble(4); + ModItems.itemChargePack_Low_5 = new BatteryPackBaseBauble(5); + ModItems.itemChargePack_High_1 = new BatteryPackBaseBauble(6); + ModItems.itemChargePack_High_2 = new BatteryPackBaseBauble(7); + ModItems.itemChargePack_High_3 = new BatteryPackBaseBauble(8); + ModItems.itemChargePack_High_4 = new BatteryPackBaseBauble(9); + } catch (Throwable t) { + t.printStackTrace(); + } - ModItems.itemAmuletMonsterKiller_Zombie = new MonsterKillerBaseBauble(new Class[] {EntityZombie.class}, "Zombie", 3); - ModItems.itemAmuletMonsterKiller_Skeleton = new MonsterKillerBaseBauble(new Class[] {EntitySkeleton.class}, "Skeleton", 3); - ModItems.itemAmuletMonsterKiller_Spider = new MonsterKillerBaseBauble(new Class[] {EntitySpider.class}, "Spider", 3); - ModItems.itemAmuletMonsterKiller_Creeper = new MonsterKillerBaseBauble(new Class[] {EntityCreeper.class}, "Creeper", 4); - ModItems.itemAmuletMonsterKiller_Enderman = new MonsterKillerBaseBauble(new Class[] {EntityEnderman.class}, "Enderman", 4); - ModItems.itemAmuletMonsterKiller_Nether = new MonsterKillerBaseBauble(new Class[] {EntityPigZombie.class, EntityGhast.class, EntityMagmaCube.class, EntityBlaze.class}, "Hellish", 6); - - if (LoadedMods.PlayerAPI){ - ModItems.itemSlowBuildingRing = new ItemSlowBuildingRing(); - } - } + ModItems.itemAmuletMonsterKiller_Zombie = + new MonsterKillerBaseBauble(new Class[] {EntityZombie.class}, "Zombie", 3); + ModItems.itemAmuletMonsterKiller_Skeleton = + new MonsterKillerBaseBauble(new Class[] {EntitySkeleton.class}, "Skeleton", 3); + ModItems.itemAmuletMonsterKiller_Spider = + new MonsterKillerBaseBauble(new Class[] {EntitySpider.class}, "Spider", 3); + ModItems.itemAmuletMonsterKiller_Creeper = + new MonsterKillerBaseBauble(new Class[] {EntityCreeper.class}, "Creeper", 4); + ModItems.itemAmuletMonsterKiller_Enderman = + new MonsterKillerBaseBauble(new Class[] {EntityEnderman.class}, "Enderman", 4); + ModItems.itemAmuletMonsterKiller_Nether = new MonsterKillerBaseBauble( + new Class[] {EntityPigZombie.class, EntityGhast.class, EntityMagmaCube.class, EntityBlaze.class}, + "Hellish", + 6); - public static void baublesNotLoaded(){ - Logger.INFO("Baubles Not Found - Skipping Resources."); - } + if (LoadedMods.PlayerAPI) { + ModItems.itemSlowBuildingRing = new ItemSlowBuildingRing(); + } + } + public static void baublesNotLoaded() { + Logger.INFO("Baubles Not Found - Skipping Resources."); + } } diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java index 3854f6612f..fcaf76e81c 100644 --- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java +++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java @@ -1,21 +1,18 @@ package gtPlusPlus.core.common.compat; -import net.minecraft.item.ItemStack; - import gregtech.api.util.GT_OreDictUnificator; - import gtPlusPlus.core.item.ModItems; +import net.minecraft.item.ItemStack; public class COMPAT_BigReactors { - public static void OreDict(){ - run(); - } - - private static final void run(){ - GT_OreDictUnificator.registerOre("plateBlutonium", new ItemStack(ModItems.itemPlateBlutonium)); - GT_OreDictUnificator.registerOre("plateCyanite", new ItemStack(ModItems.itemPlateCyanite)); - GT_OreDictUnificator.registerOre("plateLudicrite", new ItemStack(ModItems.itemPlateLudicrite)); - } + public static void OreDict() { + run(); + } + private static final void run() { + GT_OreDictUnificator.registerOre("plateBlutonium", new ItemStack(ModItems.itemPlateBlutonium)); + GT_OreDictUnificator.registerOre("plateCyanite", new ItemStack(ModItems.itemPlateCyanite)); + GT_OreDictUnificator.registerOre("plateLudicrite", new ItemStack(ModItems.itemPlateLudicrite)); + } } diff --git a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java index cd5d36b653..3f097eed4a 100644 --- a/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java +++ b/src/main/java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java @@ -2,171 +2,219 @@ package gtPlusPlus.core.common.compat; import static gtPlusPlus.core.handler.COMPAT_HANDLER.*; -import net.minecraft.item.ItemStack; - import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.minecraft.ItemUtils; - - +import net.minecraft.item.ItemStack; public class COMPAT_CompactWindmills { - //Change IC2 Upgrades - public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1); - public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1); - public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1); - public static String plateRubber = "ore:plateRubber"; - - //Machine Casings - public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1); - public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1); - public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1); - public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1); - public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1); - public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1); - - //GT Transformers - public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1); - public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1); - public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1); - public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1); - public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1); - - //Compact Windmills - public static ItemStack elvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1); - public static ItemStack lvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1); - public static ItemStack mvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1); - public static ItemStack hvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1); - public static ItemStack evWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1); - - //Compact Rotors - public static ItemStack rotor2 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOL", 1); - public static ItemStack rotor1 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOD", 1); - public static ItemStack rotor3 = ItemUtils.getItemStackFromFQRN("CompactWindmills:ALLOY", 1); - public static ItemStack rotor4 = ItemUtils.getItemStackFromFQRN("CompactWindmills:CARBON", 1); - public static ItemStack rotor5 = ItemUtils.getItemStackFromFQRN("CompactWindmills:IRIDIUM", 1); - - //IC2 Rotors - public static ItemStack rotorIC1 = ItemUtils.getItemStackFromFQRN("IC2:itemwoodrotor", 1); - public static ItemStack rotorIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemironrotor", 1); - public static ItemStack rotorIC3 = ItemUtils.getItemStackFromFQRN("IC2:itemsteelrotor", 1); - public static ItemStack rotorIC4 = ItemUtils.getItemStackFromFQRN("IC2:itemwcarbonrotor", 1); - public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1); - public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1); - public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1); - public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1); - - //Plates - public static String plateTier1 = "ore:plateMagnalium"; - public static String plateTier2 = "ore:plateStainlessSteel"; - public static String plateTier3 = "ore:plateTitanium"; - public static String plateTier4 = "ore:plateTungstenSteel"; - public static String plateTier5 = "ore:plateNichrome"; - public static String plateCarbon = "ore:plateAlloyCarbon"; - public static String plateAlloy = "ore:plateAlloyAdvanced"; - - //Circuits - public static String circuitTier1 = "ore:circuitGood"; - public static String circuitTier2 = "ore:circuitAdvanced"; - public static String circuitTier3 = "ore:circuitData"; - public static String circuitTier4 = "ore:circuitElite"; - public static String circuitTier5 = "ore:circuitMaster"; - - //Wooden Rotor - public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject( - rotorBlade1, "ore:plateAnyIron", "ore:plateAnyIron", - "ore:screwAluminium", rotorIC1, "ore:screwAluminium", - rotorBlade1, "plateAnyIron", rotorBlade1, - rotor1); - //Alloy Rotor - public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject( - plateAlloy, plateAlloy, plateAlloy, - plateAlloy, rotorIC3, plateAlloy, - plateAlloy,plateAlloy, plateAlloy, - rotor3); - //Carbon Rotor - public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject( - plateCarbon, rotorBlade4, plateCarbon, - rotorBlade4, rotor3, rotorBlade4, - plateCarbon, rotorBlade4, plateCarbon, - rotor4); - - //Kinetic Wind Turbine - public static ShapedRecipeObject KWT = new ShapedRecipeObject( - plateCarbon, shaftIron, plateCarbon, - cableCopper, mvCasing, cableCopper, - plateRubber, plateCarbon, plateRubber, - kineticWind); - - //ELV Windmill - public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject( - - circuitTier1, elvTransformer, circuitTier1, - plateTier1, lvCasing, plateTier1, - plateTier1, rotor1, plateTier1, - elvWindmill); - - - //LV Windmill - public static ShapedRecipeObject WM_LV = new ShapedRecipeObject( - circuitTier2, lvTransformer, circuitTier2, - plateTier2, mvCasing, plateTier2, - plateTier2, rotor2, plateTier2, - lvWindmill); - - //MV Windmill - public static ShapedRecipeObject WM_MV = new ShapedRecipeObject( - circuitTier3, mvTransformer, circuitTier3, - plateTier3, hvCasing, plateTier3, - plateTier3, rotor3, plateTier3, - mvWindmill); - - //HV Windmill - public static ShapedRecipeObject WM_HV = new ShapedRecipeObject( - circuitTier4, hvTransformer, circuitTier4, - plateTier4, evCasing, plateTier4, - plateTier4, rotor4, plateTier4, - hvWindmill); - - //EV Windmill - public static ShapedRecipeObject WM_EV = new ShapedRecipeObject( - circuitTier5, evTransformer, circuitTier5, - plateTier5, ivCasing, plateTier5, - plateTier5, rotor5, plateTier5, - evWindmill); - - public static void OreDict(){ - run(); - } - - private static final void run(){ - //RemoveRecipeQueue.add("CompactWindmills:WOOL"); - //RemoveRecipeQueue.add("CompactWindmills:WOOD"); - //RemoveRecipeQueue.add("CompactWindmills:ALLOY"); - //RemoveRecipeQueue.add("CompactWindmills:CARBON"); - //RemoveRecipeQueue.add("CompactWindmills:IRIDIUM"); - - //Remove Recipes - RemoveRecipeQueue.add(kineticWind); - RemoveRecipeQueue.add(elvWindmill); - RemoveRecipeQueue.add(lvWindmill); - RemoveRecipeQueue.add(mvWindmill); - RemoveRecipeQueue.add(hvWindmill); - RemoveRecipeQueue.add(evWindmill); - RemoveRecipeQueue.add(rotor1); - RemoveRecipeQueue.add(rotor3); - RemoveRecipeQueue.add(rotor4); - - //Add Recipes - AddRecipeQueue.add(Wooden_Rotor); - AddRecipeQueue.add(Alloy_Rotor); - AddRecipeQueue.add(Carbon_Rotor); - AddRecipeQueue.add(KWT); - AddRecipeQueue.add(WM_ELV); - AddRecipeQueue.add(WM_LV); - AddRecipeQueue.add(WM_MV); - AddRecipeQueue.add(WM_HV); - AddRecipeQueue.add(WM_EV); - - } + // Change IC2 Upgrades + public static ItemStack kineticWind = ItemUtils.simpleMetaStack("IC2:blockKineticGenerator", 0, 1); + public static ItemStack shaftIron = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 11, 1); + public static ItemStack cableCopper = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1); + public static String plateRubber = "ore:plateRubber"; + + // Machine Casings + public static ItemStack elvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 0, 1); + public static ItemStack lvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 1, 1); + public static ItemStack mvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 2, 1); + public static ItemStack hvCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 3, 1); + public static ItemStack evCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 4, 1); + public static ItemStack ivCasing = ItemUtils.simpleMetaStack("gregtech:gt.blockcasings", 5, 1); + + // GT Transformers + public static ItemStack elvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 20, 1); + public static ItemStack lvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 21, 1); + public static ItemStack mvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 22, 1); + public static ItemStack hvTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 23, 1); + public static ItemStack evTransformer = ItemUtils.simpleMetaStack("gregtech:gt.blockmachines", 24, 1); + + // Compact Windmills + public static ItemStack elvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1); + public static ItemStack lvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1); + public static ItemStack mvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1); + public static ItemStack hvWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1); + public static ItemStack evWindmill = ItemUtils.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1); + + // Compact Rotors + public static ItemStack rotor2 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOL", 1); + public static ItemStack rotor1 = ItemUtils.getItemStackFromFQRN("CompactWindmills:WOOD", 1); + public static ItemStack rotor3 = ItemUtils.getItemStackFromFQRN("CompactWindmills:ALLOY", 1); + public static ItemStack rotor4 = ItemUtils.getItemStackFromFQRN("CompactWindmills:CARBON", 1); + public static ItemStack rotor5 = ItemUtils.getItemStackFromFQRN("CompactWindmills:IRIDIUM", 1); + + // IC2 Rotors + public static ItemStack rotorIC1 = ItemUtils.getItemStackFromFQRN("IC2:itemwoodrotor", 1); + public static ItemStack rotorIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemironrotor", 1); + public static ItemStack rotorIC3 = ItemUtils.getItemStackFromFQRN("IC2:itemsteelrotor", 1); + public static ItemStack rotorIC4 = ItemUtils.getItemStackFromFQRN("IC2:itemwcarbonrotor", 1); + public static ItemStack rotorBlade1 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 7, 1); + public static ItemStack rotorBlade2 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 8, 1); + public static ItemStack rotorBlade3 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 10, 1); + public static ItemStack rotorBlade4 = ItemUtils.simpleMetaStack("IC2:itemRecipePart", 9, 1); + + // Plates + public static String plateTier1 = "ore:plateMagnalium"; + public static String plateTier2 = "ore:plateStainlessSteel"; + public static String plateTier3 = "ore:plateTitanium"; + public static String plateTier4 = "ore:plateTungstenSteel"; + public static String plateTier5 = "ore:plateNichrome"; + public static String plateCarbon = "ore:plateAlloyCarbon"; + public static String plateAlloy = "ore:plateAlloyAdvanced"; + + // Circuits + public static String circuitTier1 = "ore:circuitGood"; + public static String circuitTier2 = "ore:circuitAdvanced"; + public static String circuitTier3 = "ore:circuitData"; + public static String circuitTier4 = "ore:circuitElite"; + public static String circuitTier5 = "ore:circuitMaster"; + + // Wooden Rotor + public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject( + rotorBlade1, + "ore:plateAnyIron", + "ore:plateAnyIron", + "ore:screwAluminium", + rotorIC1, + "ore:screwAluminium", + rotorBlade1, + "plateAnyIron", + rotorBlade1, + rotor1); + // Alloy Rotor + public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject( + plateAlloy, + plateAlloy, + plateAlloy, + plateAlloy, + rotorIC3, + plateAlloy, + plateAlloy, + plateAlloy, + plateAlloy, + rotor3); + // Carbon Rotor + public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject( + plateCarbon, + rotorBlade4, + plateCarbon, + rotorBlade4, + rotor3, + rotorBlade4, + plateCarbon, + rotorBlade4, + plateCarbon, + rotor4); + + // Kinetic Wind Turbine + public static ShapedRecipeObject KWT = new ShapedRecipeObject( + plateCarbon, + shaftIron, + plateCarbon, + cableCopper, + mvCasing, + cableCopper, + plateRubber, + plateCarbon, + plateRubber, + kineticWind); + + // ELV Windmill + public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject( + circuitTier1, + elvTransformer, + circuitTier1, + plateTier1, + lvCasing, + plateTier1, + plateTier1, + rotor1, + plateTier1, + elvWindmill); + + // LV Windmill + public static ShapedRecipeObject WM_LV = new ShapedRecipeObject( + circuitTier2, + lvTransformer, + circuitTier2, + plateTier2, + mvCasing, + plateTier2, + plateTier2, + rotor2, + plateTier2, + lvWindmill); + + // MV Windmill + public static ShapedRecipeObject WM_MV = new ShapedRecipeObject( + circuitTier3, + mvTransformer, + circuitTier3, + plateTier3, + hvCasing, + plateTier3, + plateTier3, + rotor3, + plateTier3, + mvWindmill); + + // HV Windmill + public static ShapedRecipeObject WM_HV = new ShapedRecipeObject( + circuitTier4, + hvTransformer, + circuitTier4, + plateTier4, + evCasing, + plateTier4, + plateTier4, + rotor4, + plateTier4, + hvWindmill); + + // EV Windmill + public static ShapedRecipeObject WM_EV = new ShapedRecipeObject( + circuitTier5, + evTransformer, + circuitTier5, + plateTier5, + ivCasing, + plateTier5, + plateTier5, + rotor5, + plateTier5, + evWindmill); + + public static void OreDict() { + run(); + } + + private static final void run() { + // RemoveRecipeQueue.add("CompactWindmills:WOOL"); + // RemoveRecipeQueue.add("CompactWindmills:WOOD"); + // RemoveRecipeQueue.add("CompactWindmills:ALLOY"); + // RemoveRecipeQueue.add("CompactWindmills:CARBON"); + // RemoveRecipeQueue.add("CompactWindmills:IRIDIUM"); + + // Remove Recipes + RemoveRecipeQueue.add(kineticWind); + RemoveRecipeQueue.add(elvWindmill); + RemoveRecipeQueue.add(lvWindmill); + RemoveRecipeQueue.add(mvWindmill); + RemoveRecipeQueue.add(hvWindmill); + RemoveRecipeQueue.add(evWindmill); + RemoveRecipeQueue.add(rotor1); + RemoveRecipeQueue.add(rotor3); + RemoveRecipeQueue.add(rotor4); + + // Add Recipes + AddRecipeQueue.add(Wooden_Rotor); + AddRecipeQueue.add(Alloy_Rotor); + AddRecipeQueue.add(Carbon_Rotor); + AddRecipeQueue.add(KWT); + AddRecipeQueue.add(WM_ELV); + AddRecipeQueue.add(WM_LV); + AddRecipeQueue.add(WM_MV); + AddRecipeQueue.add(WM_HV); + AddRecipeQueue.add(WM_EV); + } } d