diff options
| author | Jakub <53441451+kuba6000@users.noreply.github.com> | 2022-08-29 16:04:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-29 16:04:28 +0200 |
| commit | 7d1f51a8937e0a86486267437d444696e81e8aa0 (patch) | |
| tree | a5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/core/common | |
| parent | 5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff) | |
| download | GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2 GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip | |
Buildscript + Spotless (#318)
* Convert AES.java to readable class
* Buildscript
* Spotless
Diffstat (limited to 'src/main/java/gtPlusPlus/core/common')
18 files changed, 967 insertions, 947 deletions
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<Pair<Item, IItemRenderer>> mItemRenderMappings = new AutoMap<Pair<Item, IItemRenderer>>(); - - - 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<Item, IItemRenderer>(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."); |
