diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-12-20 23:39:49 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-12-20 23:39:49 +1000 |
commit | 5715a32d2901922503fd850f3a68503fb77467c3 (patch) | |
tree | 7e12520fbc23844e99493d55af4410a785538e35 /src/Java/gtPlusPlus/core/world | |
parent | 2a4795f65d98ff60a177d7d6a5552fd687d9f6e8 (diff) | |
download | GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.gz GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.tar.bz2 GT5-Unofficial-5715a32d2901922503fd850f3a68503fb77467c3.zip |
- Disabled some logging.
% Minor Project Clean-up, added missing Override annotations to 100+ methods & removed pointless casts.
% Moved Logging to it's own class.
$ Fixed Multi-block handling of Pollution.
$ Fixed the GT 5.09 material enabler system. (From My Side, it's still borked on GTs).
+ Added a Dynamic Proxy invocation for IMaterialHandler.
+ Added an AutoMap data type, which is a Auto-incremental ID'd Hashmap wrapper.
Diffstat (limited to 'src/Java/gtPlusPlus/core/world')
6 files changed, 44 insertions, 45 deletions
diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java index 7bb47e4e24..0dc84b8aa3 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java @@ -1,5 +1,8 @@ package gtPlusPlus.core.world.darkworld.biome; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; + import java.util.Random; import gtPlusPlus.core.block.ModBlocks; @@ -11,23 +14,8 @@ import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.WorldGenAbstractTree; -import net.minecraft.world.gen.feature.WorldGenBigMushroom; -import net.minecraft.world.gen.feature.WorldGenCactus; -import net.minecraft.world.gen.feature.WorldGenClay; -import net.minecraft.world.gen.feature.WorldGenDeadBush; -import net.minecraft.world.gen.feature.WorldGenFlowers; -import net.minecraft.world.gen.feature.WorldGenLiquids; -import net.minecraft.world.gen.feature.WorldGenMinable; -import net.minecraft.world.gen.feature.WorldGenPumpkin; -import net.minecraft.world.gen.feature.WorldGenReed; -import net.minecraft.world.gen.feature.WorldGenSand; -import net.minecraft.world.gen.feature.WorldGenWaterlily; -import net.minecraft.world.gen.feature.WorldGenerator; - -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; -import net.minecraftforge.common.*; +import net.minecraft.world.gen.feature.*; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.*; public class BiomeGenerator_Custom extends BiomeDecorator { @@ -144,7 +132,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { this.generateLakes = true; } - public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) + @Override + public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) { if (this.currentWorld != null) { @@ -162,7 +151,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } } - protected void genDecorations(BiomeGenBase p_150513_1_) + @Override + protected void genDecorations(BiomeGenBase p_150513_1_) { MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); this.generateOres(); @@ -373,7 +363,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { /** * Standard ore generation helper. Generates most ores. */ - protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) + @Override + protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) { for (int l = 0; l < p_76795_1_; ++l) { @@ -387,7 +378,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { /** * Standard ore generation helper. Generates Lapis Lazuli. */ - protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) + @Override + protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) { for (int l = 0; l < p_76793_1_; ++l) { @@ -401,7 +393,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { /** * Generates ores in the current chunk */ - protected void generateOres() + @Override + protected void generateOres() { MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT)) diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java index ccd977a87e..f90966714e 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java @@ -6,10 +6,10 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityCaveSpider; @@ -66,7 +66,7 @@ public class Biome_DarkWorld { public BiomeGenbiomeDarkWorld() { super(CORE.DARKBIOME_ID); this.theBiomeDecorator = new BiomeGenerator_Custom(); - Utils.LOG_INFO("Dark World Temperature Category: "+getTempCategory()); + Logger.INFO("Dark World Temperature Category: "+getTempCategory()); this.setBiomeName("Dark World"); this.topBlock = Dimension_DarkWorld.blockTopLayer; this.fillerBlock = Dimension_DarkWorld.blockSecondLayer; diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java index 2168677d56..5f3f7e0bfd 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java @@ -5,7 +5,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import net.minecraft.block.BlockDirt; -import net.minecraft.block.BlockGrass; import net.minecraft.world.ColorizerGrass; import net.minecraft.world.IBlockAccess; @@ -19,6 +18,7 @@ public class blockDarkWorldPollutedDirt extends BlockDirt { LanguageRegistry.addName(this, "Polluted Soil"); } + @Override @SideOnly(Side.CLIENT) public int getBlockColor() { @@ -30,6 +30,7 @@ public class blockDarkWorldPollutedDirt extends BlockDirt { /** * Returns the color this block should be rendered. Used by leaves. */ + @Override @SideOnly(Side.CLIENT) public int getRenderColor(int p_149741_1_) { @@ -40,6 +41,7 @@ public class blockDarkWorldPollutedDirt extends BlockDirt { * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */ + @Override @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { diff --git a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java index 2e5ce4510e..1695714eff 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.world.darkworld.chunk; import java.util.List; import java.util.Random; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; @@ -391,7 +391,7 @@ public class ChunkProviderModded implements IChunkProvider { } catch (NullPointerException n){ n.getStackTrace(); (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); - Utils.LOG_INFO("Error while generating DarkWorld Lake."); + Logger.INFO("Error while generating DarkWorld Lake."); } } @@ -406,7 +406,7 @@ public class ChunkProviderModded implements IChunkProvider { try{ (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); } catch (NullPointerException n){ - Utils.LOG_INFO("Error while generating DarkWorld Lake. [2]"); + Logger.INFO("Error while generating DarkWorld Lake. [2]"); } } } diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java index 292eff3289..22c3b5a090 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java @@ -1,13 +1,15 @@ package gtPlusPlus.core.world.darkworld.gen; import java.util.Random; + import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenWaterlily; public class WorldGenDeadLilly extends WorldGenWaterlily { - public boolean generate(World world, Random rand, int x, int y, int z) + @Override + public boolean generate(World world, Random rand, int x, int y, int z) { for (int l = 0; l < 10; ++l) { diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java index 4dc033214f..f78ace8a16 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.world.darkworld.gen; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; @@ -34,24 +35,25 @@ public class WorldGenMinable_Custom extends WorldGenMinable this.mineableBlockMeta = meta; } - public boolean generate(World world, Random rand, int x, int y, int z) + @Override + public boolean generate(World world, Random rand, int x, int y, int z) { float f = rand.nextFloat() * (float)Math.PI; - double d0 = (double)((float)(x + 16) + MathHelper.sin(f) * (float)this.numberOfBlocks / 4.0F); - double d1 = (double)((float)(x + 16) - MathHelper.sin(f) * (float)this.numberOfBlocks / 4.0F); - double d2 = (double)((float)(z + 16) + MathHelper.cos(f) * (float)this.numberOfBlocks / 4.0F); - double d3 = (double)((float)(z + 16) - MathHelper.cos(f) * (float)this.numberOfBlocks / 4.0F); - double d4 = (double)(y + rand.nextInt(5) - 2); - double d5 = (double)(y + rand.nextInt(5) - 2); + double d0 = x + 16 + MathHelper.sin(f) * this.numberOfBlocks / 4.0F; + double d1 = x + 16 - MathHelper.sin(f) * this.numberOfBlocks / 4.0F; + double d2 = z + 16 + MathHelper.cos(f) * this.numberOfBlocks / 4.0F; + double d3 = z + 16 - MathHelper.cos(f) * this.numberOfBlocks / 4.0F; + double d4 = y + rand.nextInt(5) - 2; + double d5 = y + rand.nextInt(5) - 2; for (int l = 0; l <= this.numberOfBlocks; ++l) { - double d6 = d0 + (d1 - d0) * (double)l / (double)this.numberOfBlocks; - double d7 = d4 + (d5 - d4) * (double)l / (double)this.numberOfBlocks; - double d8 = d2 + (d3 - d2) * (double)l / (double)this.numberOfBlocks; - double d9 = rand.nextDouble() * (double)this.numberOfBlocks / 8.0D; - double d10 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D; - double d11 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D; + double d6 = d0 + (d1 - d0) * l / this.numberOfBlocks; + double d7 = d4 + (d5 - d4) * l / this.numberOfBlocks; + double d8 = d2 + (d3 - d2) * l / this.numberOfBlocks; + double d9 = rand.nextDouble() * this.numberOfBlocks / 8.0D; + double d10 = (MathHelper.sin(l * (float)Math.PI / this.numberOfBlocks) + 1.0F) * d9 + 1.0D; + double d11 = (MathHelper.sin(l * (float)Math.PI / this.numberOfBlocks) + 1.0F) * d9 + 1.0D; int i1 = MathHelper.floor_double(d6 - d10 / 2.0D); int j1 = MathHelper.floor_double(d7 - d11 / 2.0D); int k1 = MathHelper.floor_double(d8 - d10 / 2.0D); @@ -61,19 +63,19 @@ public class WorldGenMinable_Custom extends WorldGenMinable for (int k2 = i1; k2 <= l1; ++k2) { - double d12 = ((double)k2 + 0.5D - d6) / (d10 / 2.0D); + double d12 = (k2 + 0.5D - d6) / (d10 / 2.0D); if (d12 * d12 < 1.0D) { for (int l2 = j1; l2 <= i2; ++l2) { - double d13 = ((double)l2 + 0.5D - d7) / (d11 / 2.0D); + double d13 = (l2 + 0.5D - d7) / (d11 / 2.0D); if (d12 * d12 + d13 * d13 < 1.0D) { for (int i3 = k1; i3 <= j2; ++i3) { - double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); + double d14 = (i3 + 0.5D - d8) / (d10 / 2.0D); if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && world.getBlock(k2, l2, i3).isReplaceableOreGen(world, k2, l2, i3, blockToReplace)) { |