From 4f435ae75b176a9d90c7afa6b1ff40e9ba9c286a Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Thu, 28 Feb 2019 20:06:01 +0000 Subject: + Added a new debug tool. + Added support for Crops++. + Added Custom Crops & framework to support more in future. + Added basic support for all GT++ Materials within Tinkers Construct. [WIP] + Moderately bad attempt at generating custom Plasma Cooling recipes in the Adv. Vacuum Freezer. [WIP #424] % Reworked logic for Material.java handling Durability, Tool Quality & Harvest Level. % Adjusted frequency of structural checks on the Cyclotron, Now 100x less frequent. % Cleaned up ReflectionUtils.java and made all getters cache their results, for much faster access. % Attempted to adjust logic of FFPP, but I probably broke it. [WIP] % Moved static array of Element Names from IonParticles.java -> ELEMENT.java. $ Greatly improved reflective performance across the mod. --- .../galacticraft/handler/HandlerTooltip_GC.java | 5 ++- .../core/world/gen/ChunkProviderGalactic.java | 46 +++++++++++++++------- .../xmod/galacticraft/util/GalacticUtils.java | 10 ++--- 3 files changed, 39 insertions(+), 22 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/galacticraft') diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java index 9075666b8b..58331c4300 100644 --- a/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java +++ b/src/Java/gtPlusPlus/xmod/galacticraft/handler/HandlerTooltip_GC.java @@ -8,6 +8,7 @@ import net.minecraft.item.Item; import gtPlusPlus.core.item.chemistry.RocketFuels; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.preloader.asm.AsmConfig; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fluids.Fluid; @@ -21,11 +22,11 @@ public class HandlerTooltip_GC { @SubscribeEvent public void onItemTooltip(ItemTooltipEvent event) { - if (LoadedMods.GalacticraftCore) { + if (LoadedMods.GalacticraftCore && AsmConfig.enableGcFuelChanges) { if (mBlock == null) { try { - Class GCBlocks = Class.forName("micdoodle8.mods.galacticraft.core.blocks.GCBlocks"); + Class GCBlocks = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.blocks.GCBlocks"); if (GCBlocks != null) { oMainClass = GCBlocks; diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java index 3b9633b21d..aafa9ef9a1 100644 --- a/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java +++ b/src/Java/gtPlusPlus/xmod/galacticraft/system/core/world/gen/ChunkProviderGalactic.java @@ -4,12 +4,11 @@ import java.util.List; import com.google.common.collect.Lists; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import micdoodle8.mods.galacticraft.api.prefab.core.BlockMetaPair; import micdoodle8.mods.galacticraft.api.prefab.world.gen.BiomeDecoratorSpace; import micdoodle8.mods.galacticraft.api.prefab.world.gen.MapGenBaseMeta; -import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedCreeper; -import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSkeleton; -import micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSpider; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -46,20 +45,37 @@ public abstract class ChunkProviderGalactic extends ChunkProviderGalaxyLakes { } protected SpawnListEntry[] getMonsters() { - SpawnListEntry skele = new SpawnListEntry(EntityEvolvedSkeleton.class, 100, 4, 4); - SpawnListEntry creeper = new SpawnListEntry(EntityEvolvedCreeper.class, 100, 4, 4); - SpawnListEntry spider = new SpawnListEntry(EntityEvolvedSpider.class, 100, 4, 4); + + Class aSkele = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSkeleton"); + Class aCreeper = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.entities.EntityEvolvedCreeper"); + Class aSpider = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.entities.EntityEvolvedSpider"); + Class aEnderman = ReflectionUtils.getClass("galaxyspace.SolarSystem.planets.pluto.entities.EntityEvolvedEnderman"); + + SpawnListEntry skele; + SpawnListEntry creeper; + SpawnListEntry spider; + SpawnListEntry enderman; - Class aEnderman; - try { - aEnderman = Class.forName("galaxyspace.SolarSystem.planets.pluto.entities.EntityEvolvedEnderman"); - if (aEnderman != null) { - SpawnListEntry enderman = new SpawnListEntry(aEnderman, 100, 4, 4); - return new SpawnListEntry[] { skele, creeper, spider, enderman }; - } - } catch (ClassNotFoundException e) {} + AutoMap aMobs = new AutoMap(); - return new SpawnListEntry[] { skele, creeper, spider }; + if (aSkele != null) { + skele = new SpawnListEntry(aSkele, 100, 4, 4); + aMobs.put(skele); + } + if (aCreeper != null) { + creeper = new SpawnListEntry(aCreeper, 100, 4, 4); + aMobs.put(creeper); + } + if (aSpider != null) { + spider = new SpawnListEntry(aSpider, 100, 4, 4); + aMobs.put(spider); + } + if (aEnderman != null) { + enderman = new SpawnListEntry(aEnderman, 100, 4, 4); + aMobs.put(enderman); + } + + return aMobs.toArray(); } public void onPopulate(IChunkProvider arg0, int arg1, int arg2) { diff --git a/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java b/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java index 94dc2d0cc0..f237aed335 100644 --- a/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java +++ b/src/Java/gtPlusPlus/xmod/galacticraft/util/GalacticUtils.java @@ -26,11 +26,11 @@ public class GalacticUtils { Class a1, a2, a3, a4, a5; Method m1, m2, m3; try { - a1 = Class.forName("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket"); - a2 = Class.forName("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad"); - a3 = Class.forName("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler"); - a4 = Class.forName("micdoodle8.mods.galacticraft.api.entity.IDockable"); - a5 = Class.forName("micdoodle8.mods.galacticraft.api.entity.IFuelable"); + a1 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket"); + a2 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad"); + a3 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.core.tile.TileEntityBuggyFueler"); + a4 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IDockable"); + a5 = ReflectionUtils.getClass("micdoodle8.mods.galacticraft.api.entity.IFuelable"); m1 = ReflectionUtils.getMethod(a1, "getRocketTier"); m2 = ReflectionUtils.getMethod(a2, "getDockedEntity"); m3 = ReflectionUtils.getMethod(a3, "getDockedEntity"); -- cgit