From 9152678320bb7988c56eb3f1d4f102bd0e14107d Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 14 Apr 2022 21:04:06 -0700 Subject: [PATCH 01/18] mapgen fundamentals --- src/main/java/com/hbm/lib/HbmWorld.java | 10 +- .../world/worldgen/ComponentNTMFeatures.java | 185 ++++++++++++++++++ .../hbm/world/worldgen/MapGenNTMFeatures.java | 105 ++++++++++ .../hbm/world/worldgen/NTMWorldGenerator.java | 66 +++++++ 4 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java create mode 100644 src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java create mode 100644 src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index c749b4b0b..173bfa1e7 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -3,6 +3,9 @@ package com.hbm.lib; import com.hbm.world.test.StructureComponentTest; import com.hbm.world.test.StructureStartTest; import com.hbm.world.test.WorldGenTest; +import com.hbm.world.worldgen.ComponentNTMFeatures; +import com.hbm.world.worldgen.MapGenNTMFeatures; +import com.hbm.world.worldgen.NTMWorldGenerator; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; @@ -16,10 +19,13 @@ public class HbmWorld { public static void initWorldGen() { - MapGenStructureIO.registerStructure(StructureStartTest.class, "HFR_STRUCTURE"); - MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT"); + //MapGenStructureIO.registerStructure(StructureStartTest.class, "HFR_STRUCTURE"); + //MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT"); + MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); + ComponentNTMFeatures.registerNTMFeatures(); registerWorldGen(new HbmWorldGen(), 1); + registerWorldGen(new NTMWorldGenerator(), 1); //registerWorldGen(new WorldGenTest(), 1); } diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java new file mode 100644 index 000000000..1b1ef6068 --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -0,0 +1,185 @@ +package com.hbm.world.worldgen; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; + +//Probably one of the more difficult parts. +/** Base component file. For structure generation under 32x32 blocks, as Minecraft generates 2x2 chunks for structures. + * Larger non-procedural structures should be split up into several bounding boxes, which check if they intersect the chunk bounding box currently being loaded. Doing so will prevent + * cascading world generation. See + * TheMasterCaver's advice. */ +public class ComponentNTMFeatures { + + /** Register structures in MapGenStructureIO */ + public static void registerNTMFeatures() { + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse1.class, "NTMHouse1"); + + } + + /** Sandstone Ruin 1 */ + public static class NTMHouse1 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); + + /** Constructor for this feature; takes coordinates for bounding box */ + protected NTMHouse1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 9, 4, 6); + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + } + + /** + * Generates structures. + */ + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + /* + * Places block at current position. Dependent on coordinate mode, i.e. will allow for random rotation + * this.placeBlockAtCurrentPosition(world, block, minX, metadata, x, y, z, box); + * Fills an area with air, self-explanatory. + * this.fillWithAir(world, box, minX, minY, minZ, maxX, maxY, maxZ); + * Fills an area with blocks, self-explanatory. + * this.fillWithBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); + * Fills an area with metadata blocks, self-explanatory. + * this.fillWithMetadataBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockPlaceMeta, blockToReplace, replaceBlockMeta, alwaysReplace); + * Fills an area with randomized blocks, self-explanatory. + * this.fillWithRandomizedBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, alwaysReplace, rand, StructureComponent.blockSelector); + * (BlockSelector is basically a list of blocks that can be randomly picked, except that it can actually be weighted) + * Replaces any air or water blocks with this block down to a certain y. Useful for foundations + * this.func_151554_b(world, block, metadata, x, fillDownToY, z, box + * Fills an area with blocks randomly - look into randLimit? + * this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); + */ + + //TODO: func_74935_a is suspect. It seems to be necessary to prevent the structure from spawning at y 0, but it also prevents all spawns. + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("Hpos: " + this.hpos + "; minY:" + this.boundingBox.minY); + + for(byte i = 0; i < scatteredFeatureSizeX; i++) { + for(byte j = 0; j < scatteredFeatureSizeZ; j++) { + this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); + } + } + + this.fillWithBlocks(world, box, 0, 0, 0, scatteredFeatureSizeX, 0, scatteredFeatureSizeZ, Blocks.sandstone, Blocks.air, false); + + this.fillWithRandomizedBlocks(world, box, 0, 1, 0, scatteredFeatureSizeX, 3, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 0, 2, scatteredFeatureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 1, scatteredFeatureSizeZ, scatteredFeatureSizeX, 2, 0, false, rand, RandomSandstone); + + //System.out.println("Successful spawn"); + + return true; + } + + } + + static class Sandstone extends StructureComponent.BlockSelector { + + Sandstone() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + if(rand.nextFloat() < 0.6F) { + this.field_151562_a = Blocks.sandstone; + } else if (rand.nextFloat() < 0.4F ) { + this.field_151562_a = ModBlocks.reinforced_sand; + } + + this.field_151562_a = Blocks.sand; + } + + } + + abstract static class Feature extends StructureComponent { + /** The size of the bounding box for this feature in the X axis */ + protected int scatteredFeatureSizeX; + /** The size of the bounding box for this feature in the Y axis */ + protected int scatteredFeatureSizeY; + /** The size of the bounding box for this feature in the Z axis */ + protected int scatteredFeatureSizeZ; + /** Average height? */ + protected int hpos = -1; + + + protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { + super(0); + this.scatteredFeatureSizeX = maxX; + this.scatteredFeatureSizeY = maxY; + this.scatteredFeatureSizeZ = maxZ; + this.coordBaseMode = rand.nextInt(4); + + switch(this.coordBaseMode) { + case 0: + case 2: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX - 1, minY + maxY - 1, minZ + maxZ - 1); + break; + default: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ - 1, minY + maxY - 1, minZ + maxX - 1); + } + } + + /** Set to NBT */ + protected void func_143012_a(NBTTagCompound nbt) { + nbt.setInteger("Width", this.scatteredFeatureSizeX); + nbt.setInteger("Height", this.scatteredFeatureSizeY); + nbt.setInteger("Depth", this.scatteredFeatureSizeZ); + nbt.setInteger("HPos", this.hpos); + } + + /** Get from NBT */ + protected void func_143011_b(NBTTagCompound nbt) { + this.scatteredFeatureSizeX = nbt.getInteger("Width"); + this.scatteredFeatureSizeY = nbt.getInteger("Height"); + this.scatteredFeatureSizeZ = nbt.getInteger("Depth"); + this.hpos = nbt.getInteger("HPos"); + } + + protected boolean func_74935_a(World world, StructureBoundingBox box, int y) { + //System.out.println("original: " + hpos); + //System.out.println(y); + + int j = 0; + int k = 0; + + for(int l = this.boundingBox.minZ; l <= this.boundingBox.maxZ; l++) { + for(int i = this.boundingBox.minX; i <= this.boundingBox.maxX; i++) { + if(box.isVecInside(i, y, l)) { + j += Math.max(world.getTopSolidOrLiquidBlock(i, l), world.provider.getAverageGroundLevel()); + k++; + } + } + } + + if(k == 0) + return false; + + this.hpos = j / k; + this.boundingBox.offset(0, this.hpos - this.boundingBox.minY, 0); + //System.out.println("new: " + hpos); + //System.out.println(y); + return true; + } + } + +} diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java new file mode 100644 index 000000000..4c2c89bdf --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -0,0 +1,105 @@ +package com.hbm.world.worldgen; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.StructureStart; +import scala.actors.threadpool.Arrays; + +public class MapGenNTMFeatures extends MapGenStructure { + + private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean}); + /** Maximum distance between structures */ + private int maxDistanceBetweenScatteredFeatures; + /** Minimum distance between structures */ + private int minDistanceBetweenScatteredFeatures; + + public MapGenNTMFeatures() { + this.maxDistanceBetweenScatteredFeatures = 16; + this.minDistanceBetweenScatteredFeatures = 6; + } + + /** String ID for this MapGen */ + @Override + public String func_143025_a() { + return "NTMFeatures"; + } + + /** + * Checks if a structure can be spawned at coords, based off of chance and biome + * (Good approach would probably be to only exclude ocean biomes through biomelist and rely on temperature and rainfall instead of biomegenbase, would allow for biomes o' plenty compat) + */ + @Override + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { + + int k = chunkX; + int l = chunkZ; + + if(chunkX < 0) + chunkX -= this.maxDistanceBetweenScatteredFeatures - 1; + if(chunkZ < 0) + chunkZ -= this.maxDistanceBetweenScatteredFeatures - 1; + + int i1 = chunkX / this.maxDistanceBetweenScatteredFeatures; + int j1 = chunkZ / this.maxDistanceBetweenScatteredFeatures; + Random random = this.worldObj.setRandomSeed(i1, j1, 14357617); + i1 *= this.maxDistanceBetweenScatteredFeatures; + j1 *= this.maxDistanceBetweenScatteredFeatures; + i1 += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + j1 += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + + if(k == i1 && l == j1) { + BiomeGenBase biomegenbase = this.worldObj.getWorldChunkManager().getBiomeGenAt(k * 16 + 8, l * 16 + 8); + Iterator iterator = biomelist.iterator(); + + while(iterator.hasNext()) { + BiomeGenBase biomegenbase1 = (BiomeGenBase)iterator.next(); + + if(biomegenbase == biomegenbase1) + return false; + } + return true; + } + + return false; + } + + + //StructureStart Methods Class + + /** Returns new StructureStart if structure can be spawned at coords */ + @Override + protected StructureStart getStructureStart(int chunkX, int chunkZ) { + return new MapGenNTMFeatures.Start(this.worldObj, this.rand, chunkX, chunkZ); + } + + public static class Start extends StructureStart { + + public Start(World world, Random rand, int chunkX, int chunkZ) { + super(chunkX, chunkZ); + + BiomeGenBase biomegenbase = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); + int posY = world.getHeightValue(chunkX * 16 + 8, chunkZ * 16 + 8); + if(posY == 0) + posY = world.getTopSolidOrLiquidBlock(chunkX * 16 + 8, chunkZ * 16 + 8); + + /* + * Probably want to use nextInt() to increase the structures of rarity here. As a fallback, you could have generic stone brick/useless block ruins that will always be chosen if the + * chance/location fails for all other structures. Might not even be necessary, but whatever. + * Rainfall & Temperature Check + */ + + //if(biomegenbase.temperature < 0.1) { + ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(house1); + //} + + this.updateBoundingBox(); + } + } +} diff --git a/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java new file mode 100644 index 000000000..8685883ef --- /dev/null +++ b/src/main/java/com/hbm/world/worldgen/NTMWorldGenerator.java @@ -0,0 +1,66 @@ +package com.hbm.world.worldgen; + +import java.util.Random; + +import com.hbm.config.GeneralConfig; + +import cpw.mods.fml.common.IWorldGenerator; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.event.terraingen.ChunkProviderEvent.ReplaceBiomeBlocks; +import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +public class NTMWorldGenerator implements IWorldGenerator { + + private MapGenNTMFeatures NTMFeatureGenerator = new MapGenNTMFeatures(); + + { + NTMFeatureGenerator = (MapGenNTMFeatures) TerrainGen.getModdedMapGen(NTMFeatureGenerator, EventType.CUSTOM); + } + + @Override + public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { + + switch (world.provider.dimensionId) { + case -1: + generateNether(world, rand, chunkGenerator, chunkX, chunkZ); break; + case 0: + generateSurface(world, rand, chunkGenerator, chunkX, chunkZ); break; + case 1: + generateEnd(world, rand, chunkGenerator, chunkX, chunkZ); break; + } + } + + private void generateNether(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { + // TODO Auto-generated method stub + + } + + private void generateSurface(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { + Block[] ablock = new Block[65536]; + + //WorldConfig.enableStructures + /** Spawns structure starts. Utilizes canSpawnStructureAtCoords() + if else checks in Start constructor */ + if(GeneralConfig.enableDungeons) { + this.NTMFeatureGenerator.func_151539_a(chunkGenerator, world, chunkX, chunkZ, ablock); + } + + /** Actually generates structures in a given chunk. */ + if(GeneralConfig.enableDungeons) { + this.NTMFeatureGenerator.generateStructuresInChunk(world, rand, chunkX, chunkZ); + } + } + + private void generateEnd(World world, Random rand, IChunkProvider chunkGenerator, int chunkX, int chunkZ) { + // TODO Auto-generated method stub + + } + + + + +} From b32d6bb5a1cf44ab9edbe5f596fd1ad1d8d3d911 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 15 Apr 2022 21:14:11 -0700 Subject: [PATCH 02/18] a --- .../world/worldgen/ComponentNTMFeatures.java | 104 ++++++++++++------ .../hbm/world/worldgen/MapGenNTMFeatures.java | 5 +- 2 files changed, 74 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 1b1ef6068..743bd1a2f 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -3,6 +3,7 @@ package com.hbm.world.worldgen; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.lib.HbmChestContents; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; @@ -27,6 +28,8 @@ public class ComponentNTMFeatures { /** Sandstone Ruin 1 */ public static class NTMHouse1 extends ComponentNTMFeatures.Feature { + private boolean hasPlacedChest = false; + private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); /** Constructor for this feature; takes coordinates for bounding box */ @@ -37,11 +40,13 @@ public class ComponentNTMFeatures { @Override protected void func_143012_a(NBTTagCompound nbt) { super.func_143012_a(nbt); + nbt.setBoolean("hasChest", hasPlacedChest); } @Override protected void func_143011_b(NBTTagCompound nbt) { super.func_143011_b(nbt); + this.hasPlacedChest = nbt.getBoolean("hasChest"); } /** @@ -50,7 +55,7 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { /* - * Places block at current position. Dependent on coordinate mode, i.e. will allow for random rotation + * Places block at current position. Dependent on coordinate mode, i.e. will allow for random rotation, so use this instead of setBlock! * this.placeBlockAtCurrentPosition(world, block, minX, metadata, x, y, z, box); * Fills an area with air, self-explanatory. * this.fillWithAir(world, box, minX, minY, minZ, maxX, maxY, maxZ); @@ -61,32 +66,62 @@ public class ComponentNTMFeatures { * Fills an area with randomized blocks, self-explanatory. * this.fillWithRandomizedBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, alwaysReplace, rand, StructureComponent.blockSelector); * (BlockSelector is basically a list of blocks that can be randomly picked, except that it can actually be weighted) - * Replaces any air or water blocks with this block down to a certain y. Useful for foundations - * this.func_151554_b(world, block, metadata, x, fillDownToY, z, box + * Replaces any air or water blocks with this block down. Useful for foundations + * this.func_151554_b(world, block, metadata, x, startAtY, z, box * Fills an area with blocks randomly - look into randLimit? * this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); */ - //TODO: func_74935_a is suspect. It seems to be necessary to prevent the structure from spawning at y 0, but it also prevents all spawns. - //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } //System.out.println("Hpos: " + this.hpos + "; minY:" + this.boundingBox.minY); - for(byte i = 0; i < scatteredFeatureSizeX; i++) { - for(byte j = 0; j < scatteredFeatureSizeZ; j++) { + for(byte i = 0; i < this.featureSizeX + 1; i++) { + for(byte j = 0; j < this.featureSizeZ + 1; j++) { this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); } } - this.fillWithBlocks(world, box, 0, 0, 0, scatteredFeatureSizeX, 0, scatteredFeatureSizeZ, Blocks.sandstone, Blocks.air, false); + //this.fillWithBlocks(world, box, 0, 0, 0, scatteredFeatureSizeX, 0, scatteredFeatureSizeZ, Blocks.sandstone, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 0, 1, 0, scatteredFeatureSizeX, 3, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 0, 2, scatteredFeatureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 1, scatteredFeatureSizeZ, scatteredFeatureSizeX, 2, 0, false, rand, RandomSandstone); + System.out.print(this.coordBaseMode); + //Walls + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, featureSizeX, 0, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 1, 1, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 0, box); + this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 5, 1, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 6, 1, 0, box); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 7, 1, 0, box); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX, 1, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 2, 0, featureSizeX - 2, 2, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 1, featureSizeZ, false, rand, RandomSandstone); //Left Wall + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 0, 2, 1, box); + this.fillWithMetadataBlocks(world, box, 0, 2, 3, 0, 2, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 1, 1, featureSizeZ, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 3, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 1, 2, featureSizeZ, 3, 2, featureSizeZ, false, rand, RandomSandstone); + this.fillWithMetadataBlocks(world, box, 4, 2, featureSizeZ, 5, 2, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 2, 2, featureSizeZ, box); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 0, featureSizeZ, false, rand, RandomSandstone); //Right Wall + this.randomlyFillWithBlocks(world, box, rand, 0.65F, featureSizeX, 1, 1, featureSizeX, 1, featureSizeZ - 1, Blocks.sand, Blocks.air, false); - //System.out.println("Successful spawn"); + this.fillWithRandomizedBlocks(world, box, 4, 0, 1, 4, 1, 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, ModBlocks.reinforced_sand, 0, 4, 0, 4, box); + + //Loot/Sand + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 1, 0, 1, box); + if(!this.hasPlacedChest) + this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.getLoot(1), rand.nextInt(2) + 8); //Make sure to redo that class kek + this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); + if(rand.nextFloat() <= 0.075) + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, 7, 0, featureSizeX - 2, box); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); + + System.out.println("Successful spawn"); return true; } @@ -100,58 +135,61 @@ public class ComponentNTMFeatures { /** Selects blocks */ @Override public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { - if(rand.nextFloat() < 0.6F) { - this.field_151562_a = Blocks.sandstone; - } else if (rand.nextFloat() < 0.4F ) { - this.field_151562_a = ModBlocks.reinforced_sand; - } + float chance = rand.nextFloat(); - this.field_151562_a = Blocks.sand; + if(chance > 0.6F) { + this.field_151562_a = Blocks.sandstone; + } else if (chance < 0.5F ) { + this.field_151562_a = ModBlocks.reinforced_sand; + } else { + this.field_151562_a = Blocks.sand; + } } } abstract static class Feature extends StructureComponent { /** The size of the bounding box for this feature in the X axis */ - protected int scatteredFeatureSizeX; + protected int featureSizeX; /** The size of the bounding box for this feature in the Y axis */ - protected int scatteredFeatureSizeY; + protected int featureSizeY; /** The size of the bounding box for this feature in the Z axis */ - protected int scatteredFeatureSizeZ; + protected int featureSizeZ; /** Average height? */ protected int hpos = -1; protected Feature(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { super(0); - this.scatteredFeatureSizeX = maxX; - this.scatteredFeatureSizeY = maxY; - this.scatteredFeatureSizeZ = maxZ; + this.featureSizeX = maxX; + this.featureSizeY = maxY; + this.featureSizeZ = maxZ; this.coordBaseMode = rand.nextInt(4); switch(this.coordBaseMode) { - case 0: case 2: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX - 1, minY + maxY - 1, minZ + maxZ - 1); + //TODO: Temporary fix. For whatever reason, North (2) and East (3) seems to improperly mirror structures, but not having it will mess North up; must look into. + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ - 1, minY + maxY - 1, minZ + maxX - 1); break; default: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ - 1, minY + maxY - 1, minZ + maxX - 1); + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX - 1, minY + maxY - 1, minZ + maxZ - 1); + } } /** Set to NBT */ protected void func_143012_a(NBTTagCompound nbt) { - nbt.setInteger("Width", this.scatteredFeatureSizeX); - nbt.setInteger("Height", this.scatteredFeatureSizeY); - nbt.setInteger("Depth", this.scatteredFeatureSizeZ); + nbt.setInteger("Width", this.featureSizeX); + nbt.setInteger("Height", this.featureSizeY); + nbt.setInteger("Depth", this.featureSizeZ); nbt.setInteger("HPos", this.hpos); } /** Get from NBT */ protected void func_143011_b(NBTTagCompound nbt) { - this.scatteredFeatureSizeX = nbt.getInteger("Width"); - this.scatteredFeatureSizeY = nbt.getInteger("Height"); - this.scatteredFeatureSizeZ = nbt.getInteger("Depth"); + this.featureSizeX = nbt.getInteger("Width"); + this.featureSizeY = nbt.getInteger("Height"); + this.featureSizeZ = nbt.getInteger("Depth"); this.hpos = nbt.getInteger("HPos"); } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 4c2c89bdf..11f3e58fe 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -13,6 +13,7 @@ import scala.actors.threadpool.Arrays; public class MapGenNTMFeatures extends MapGenStructure { + //TODO: Figure out why structures spawn so close to eachother. Occasionally, four will spawn in the same orientation and position within a chunk of eachother. private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean}); /** Maximum distance between structures */ private int maxDistanceBetweenScatteredFeatures; @@ -20,8 +21,8 @@ public class MapGenNTMFeatures extends MapGenStructure { private int minDistanceBetweenScatteredFeatures; public MapGenNTMFeatures() { - this.maxDistanceBetweenScatteredFeatures = 16; - this.minDistanceBetweenScatteredFeatures = 6; + this.maxDistanceBetweenScatteredFeatures = 24; + this.minDistanceBetweenScatteredFeatures = 8; } /** String ID for this MapGen */ From 1addf7da9a51e2f644feb27611e7266017c37a1b Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 16 Apr 2022 13:57:04 -0700 Subject: [PATCH 03/18] mortal trolling --- src/main/java/com/hbm/lib/HbmWorld.java | 2 +- .../world/worldgen/ComponentNTMFeatures.java | 203 ++++++++++++++++-- .../hbm/world/worldgen/MapGenNTMFeatures.java | 11 +- 3 files changed, 191 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index 173bfa1e7..a446d0656 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -24,7 +24,7 @@ public class HbmWorld { MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); ComponentNTMFeatures.registerNTMFeatures(); - registerWorldGen(new HbmWorldGen(), 1); + //registerWorldGen(new HbmWorldGen(), 1); registerWorldGen(new NTMWorldGenerator(), 1); //registerWorldGen(new WorldGenTest(), 1); } diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 743bd1a2f..785eb803c 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -5,6 +5,7 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.lib.HbmChestContents; +import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -15,14 +16,15 @@ import net.minecraft.world.gen.structure.StructureComponent; //Probably one of the more difficult parts. /** Base component file. For structure generation under 32x32 blocks, as Minecraft generates 2x2 chunks for structures. * Larger non-procedural structures should be split up into several bounding boxes, which check if they intersect the chunk bounding box currently being loaded. Doing so will prevent - * cascading world generation. See + * cascading world generation. See + * * TheMasterCaver's advice. */ public class ComponentNTMFeatures { /** Register structures in MapGenStructureIO */ public static void registerNTMFeatures() { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse1.class, "NTMHouse1"); - + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab1.class, "NTMLab1"); } /** Sandstone Ruin 1 */ @@ -57,7 +59,7 @@ public class ComponentNTMFeatures { /* * Places block at current position. Dependent on coordinate mode, i.e. will allow for random rotation, so use this instead of setBlock! * this.placeBlockAtCurrentPosition(world, block, minX, metadata, x, y, z, box); - * Fills an area with air, self-explanatory. + * Fills an area with air, self-explanatory. Use to clear interiors of unwanted blocks. * this.fillWithAir(world, box, minX, minY, minZ, maxX, maxY, maxZ); * Fills an area with blocks, self-explanatory. * this.fillWithBlocks(world, box, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); @@ -116,8 +118,8 @@ public class ComponentNTMFeatures { this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.getLoot(1), rand.nextInt(2) + 8); //Make sure to redo that class kek this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); - if(rand.nextFloat() <= 0.075) - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, 7, 0, featureSizeX - 2, box); + if(rand.nextFloat() <= 0.1) + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, featureSizeX - 1, 0, 1, box); this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); @@ -128,23 +130,86 @@ public class ComponentNTMFeatures { } - static class Sandstone extends StructureComponent.BlockSelector { + public static class NTMLab1 extends ComponentNTMFeatures.Feature { - Sandstone() { } + private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); + private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); - /** Selects blocks */ - @Override - public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { - float chance = rand.nextFloat(); - - if(chance > 0.6F) { - this.field_151562_a = Blocks.sandstone; - } else if (chance < 0.5F ) { - this.field_151562_a = ModBlocks.reinforced_sand; - } else { - this.field_151562_a = Blocks.sand; - } + /** Constructor for this feature; takes coordinates for bounding box */ + protected NTMLab1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 9, 4, 7); } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + + for(byte i = 0; i < this.featureSizeX + 1; i++) { + for(byte j = 0; j < this.featureSizeZ - 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + for(byte i = 3; i < this.featureSizeX + 1; i++) { + for(byte j = 6; j < this.featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + int stairsMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 0); + if(this.getBlockAtCurrentPosition(world, 2, 0, featureSizeZ - 1, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, 2, 0, featureSizeZ - 1, box) == Blocks.air) { + this.func_151554_b(world, Blocks.stonebrick, 0, 2, -1, featureSizeZ - 1, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairsMeta, 2, 0, featureSizeZ - 1, box); + } + + this.fillWithAir(world, box, 1, 0, 1, featureSizeX - 1, featureSizeY, 4); + this.fillWithAir(world, box, 4, 0, 4, featureSizeX - 1, featureSizeY, featureSizeZ - 1); + + int northMeta = this.getMetadataForRotatable(8); + + //Pillars + this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 4, ModBlocks.concrete_pillar, northMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, ModBlocks.concrete_pillar, northMeta, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 0, 0, featureSizeZ - 2, 0, 3, featureSizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 0, featureSizeZ - 2, 3, 3, featureSizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 0, featureSizeZ, 3, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + + //Walls + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, featureSizeX - 1, featureSizeY - 1, 0, false, rand, RandomConcreteBricks); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, featureSizeY, 0, featureSizeX, featureSizeY, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, featureSizeY - 1, 4, false, rand, RandomConcreteBricks); //Left Wall + this.fillWithRandomizedBlocks(world, box, 0, featureSizeY, 0, 0, featureSizeY, featureSizeZ - 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ - 2, 2, featureSizeY, featureSizeZ - 2, false, rand, RandomConcreteBricks); //Front Wall Pt. 1 + this.placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete_broken, 0, 3, featureSizeY, featureSizeZ - 2, box); + this.fillWithRandomizedBlocks(world, box, 3, featureSizeY - 1, featureSizeZ - 1, 3, featureSizeY, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 0, featureSizeZ, featureSizeX - 1, 1, featureSizeZ, false, rand, RandomConcreteBricks); //Front Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 4, 2, featureSizeZ, 4, 3, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 2, featureSizeZ, featureSizeX - 1, 3, featureSizeZ, false, rand, RandomConcreteBricks); + this.randomlyFillWithBlocks(world, box, rand, 0.75F, 5, 2, featureSizeZ, featureSizeX - 2, 3, featureSizeZ, Blocks.glass_pane, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 3, featureSizeY, featureSizeZ, featureSizeX, featureSizeY, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 1, featureSizeX, featureSizeY, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Right Wall + + //Floor & Ceiling + this.fillWithRandomizedBlocks(world, box, 1, 0, 1, featureSizeX - 1, 0, 4, false, rand, RandomLabTiles); //Floor + this.fillWithRandomizedBlocks(world, box, 4, 0, featureSizeZ - 2, featureSizeX - 1, 0, featureSizeZ - 1, false, rand, RandomLabTiles); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 3, 0, featureSizeZ - 1, box); + + this.fillWithBlocks(world, box, 1, featureSizeY - 1, 1, 1, featureSizeY, 4, ModBlocks.reinforced_glass, Blocks.air, false); //Ceiling + this.fillWithBlocks(world, box, 2, featureSizeY, 1, featureSizeX - 1, featureSizeY, 4, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, 4, featureSizeY, featureSizeZ - 2, featureSizeX - 1, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); + + return true; + } + + } @@ -168,7 +233,7 @@ public class ComponentNTMFeatures { switch(this.coordBaseMode) { case 2: - //TODO: Temporary fix. For whatever reason, North (2) and East (3) seems to improperly mirror structures, but not having it will mess North up; must look into. + //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ - 1, minY + maxY - 1, minZ + maxX - 1); break; default: @@ -218,6 +283,104 @@ public class ComponentNTMFeatures { //System.out.println(y); return true; } + + /** + * Gets metadata for rotatable pillars. + * @param metadata (First two digits is equal to block metadata, other two are equal to orientation + * @return metadata adjusted for random orientation + */ + protected int getMetadataForRotatable(int metadata) { + int blockMeta = metadata & 3; + int rotationMeta = metadata & 12; + + if(rotationMeta == 0) + return metadata; + + if(this.coordBaseMode % 2 == 0) { //North & South + switch(rotationMeta) { + case 1: + rotationMeta = 4; + break; + case 2: + rotationMeta = 8; + break; + } + } else if(this.coordBaseMode != 0) { //East & West + switch(rotationMeta) { + case 1: + rotationMeta = 8; + break; + case 2: + rotationMeta = 4; + break; + } + } + + return blockMeta | rotationMeta; + } } + //Block Selectors + + static class Sandstone extends StructureComponent.BlockSelector { + + Sandstone() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + float chance = rand.nextFloat(); + + if(chance > 0.6F) { + this.field_151562_a = Blocks.sandstone; + } else if (chance < 0.5F ) { + this.field_151562_a = ModBlocks.reinforced_sand; + } else { + this.field_151562_a = Blocks.sand; + } + } + + } + + static class ConcreteBricks extends StructureComponent.BlockSelector { + + ConcreteBricks() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + float chance = rand.nextFloat(); + + if(chance < 0.2F) { + this.field_151562_a = ModBlocks.brick_concrete; + } else if (chance < 0.4F) { + this.field_151562_a = ModBlocks.brick_concrete_mossy; + } else if (chance < 0.8F) { + this.field_151562_a = ModBlocks.brick_concrete_cracked; + } else { + this.field_151562_a = ModBlocks.brick_concrete_broken; + } + } + + } + + static class LabTiles extends StructureComponent.BlockSelector { + + LabTiles() { } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + float chance = rand.nextFloat(); + + if(chance < 0.5F) { + this.field_151562_a = ModBlocks.tile_lab; + } else if (chance < 0.8F) { + this.field_151562_a = ModBlocks.tile_lab_cracked; + } else { + this.field_151562_a = ModBlocks.tile_lab_broken; + } + } + + } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 11f3e58fe..56ed90534 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -1,19 +1,19 @@ package com.hbm.world.worldgen; +import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Random; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenMesa; import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; import net.minecraft.world.gen.structure.MapGenStructure; import net.minecraft.world.gen.structure.StructureStart; -import scala.actors.threadpool.Arrays; public class MapGenNTMFeatures extends MapGenStructure { - //TODO: Figure out why structures spawn so close to eachother. Occasionally, four will spawn in the same orientation and position within a chunk of eachother. private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean}); /** Maximum distance between structures */ private int maxDistanceBetweenScatteredFeatures; @@ -95,10 +95,13 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ - //if(biomegenbase.temperature < 0.1) { + if(biomegenbase.temperature >= 1.2 && !(biomegenbase instanceof BiomeGenMesa)) { ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); - //} + } else { + ComponentNTMFeatures.NTMLab1 lab1 = new ComponentNTMFeatures.NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(lab1); + } this.updateBoundingBox(); } From 46eab51836aa204987451d606c480148bdf23044 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 16 Apr 2022 21:18:01 -0700 Subject: [PATCH 04/18] h --- .../world/worldgen/ComponentNTMFeatures.java | 113 ++++++++++++++++-- 1 file changed, 102 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 785eb803c..f9d897bb2 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -4,10 +4,14 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.lib.HbmChestContents; +import com.hbm.tileentity.machine.storage.TileEntityCrateIron; +import com.hbm.util.LootGenerator; import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; @@ -147,6 +151,7 @@ public class ComponentNTMFeatures { if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } + System.out.println(this.coordBaseMode); for(byte i = 0; i < this.featureSizeX + 1; i++) { for(byte j = 0; j < this.featureSizeZ - 1; j++) { @@ -170,13 +175,13 @@ public class ComponentNTMFeatures { this.fillWithAir(world, box, 1, 0, 1, featureSizeX - 1, featureSizeY, 4); this.fillWithAir(world, box, 4, 0, 4, featureSizeX - 1, featureSizeY, featureSizeZ - 1); - int northMeta = this.getMetadataForRotatable(8); + int pillarMeta = this.getMetadataForRotatablePillar(8); //Pillars this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 4, ModBlocks.concrete_pillar, northMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, ModBlocks.concrete_pillar, northMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 4, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); this.fillWithBlocks(world, box, 0, 0, featureSizeZ - 2, 0, 3, featureSizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); this.fillWithBlocks(world, box, 3, 0, featureSizeZ - 2, 3, 3, featureSizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); this.fillWithBlocks(world, box, 3, 0, featureSizeZ, 3, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); @@ -206,6 +211,36 @@ public class ComponentNTMFeatures { this.fillWithBlocks(world, box, 2, featureSizeY, 1, featureSizeX - 1, featureSizeY, 4, ModBlocks.brick_light, Blocks.air, false); this.fillWithBlocks(world, box, 4, featureSizeY, featureSizeZ - 2, featureSizeX - 1, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); + //Decorations & Loot + this.fillWithMetadataBlocks(world, box, 1, 1, 1, 1, 1, 4, Blocks.dirt, 2, Blocks.air, 0, false); + int westDecoMeta = this.getMetadataForRotatableDeco(5); + this.fillWithMetadataBlocks(world, box, 2, 1, 1, 2, 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, featureSizeY - 1, 1, 2, featureSizeY - 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); + for(byte i = 0; i < 4; i++) { + this.placeBlockAtCurrentPosition(world, ModBlocks.plant_flower, i, 1, 2, 1 + i, box); + } + + int doorMeta = this.getMetadataForRotatableDeco(5); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, featureSizeZ - 1, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, featureSizeZ - 1), doorMeta, ModBlocks.door_office); + + int northDecoMeta = this.getMetadataForRotatableDeco(3); + this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_scaffold, northDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 2, featureSizeX - 1, featureSizeY - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, northDecoMeta, 5, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_microwave, northDecoMeta, 5, 2, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, 6, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_shredder, 0, featureSizeX - 2, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, featureSizeX - 1, 1, 1, box); + this.fillWithBlocks(world, box, 5, 1, 3, featureSizeX - 1, 1, 3, ModBlocks.deco_titanium, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 6, 2, 3, box); + LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3)); + + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, featureSizeX - 1, 1, featureSizeZ - 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 1, 1, featureSizeZ - 1, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), + this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, featureSizeZ - 1)), 8); + return true; } @@ -289,14 +324,16 @@ public class ComponentNTMFeatures { * @param metadata (First two digits is equal to block metadata, other two are equal to orientation * @return metadata adjusted for random orientation */ - protected int getMetadataForRotatable(int metadata) { + protected int getMetadataForRotatablePillar(int metadata) { int blockMeta = metadata & 3; - int rotationMeta = metadata & 12; + int rotationMeta = metadata >> 2; + + System.out.println(rotationMeta); if(rotationMeta == 0) return metadata; - if(this.coordBaseMode % 2 == 0) { //North & South + if(this.coordBaseMode == 0 || this.coordBaseMode == 2) { //North & South switch(rotationMeta) { case 1: rotationMeta = 4; @@ -305,7 +342,7 @@ public class ComponentNTMFeatures { rotationMeta = 8; break; } - } else if(this.coordBaseMode != 0) { //East & West + } else if(this.coordBaseMode == 1 || this.coordBaseMode == 3) { //East & West switch(rotationMeta) { case 1: rotationMeta = 8; @@ -316,8 +353,65 @@ public class ComponentNTMFeatures { } } + System.out.println("OG: " + metadata + "; New: " + (blockMeta | rotationMeta)); + return blockMeta | rotationMeta; } + + /** + * Gets metadata for rotatable DecoBlock + * @param metadata (2 for facing South, 3 for facing North, 4 for facing East, 5 for facing West + * @return metadata adjusted for random orientation + */ + protected int getMetadataForRotatableDeco(int metadata) { + switch(this.coordBaseMode) { + case 0: //North + switch(metadata) { + case 2: + return 2; + case 3: + return 3; + case 4: + return 4; + case 5: + return 5; + } + case 1: //West + switch(metadata) { + case 2: + return 5; + case 3: + return 4; + case 4: + return 2; + case 5: + return 3; + } + case 2: //South + switch(metadata) { + case 2: + return 3; + case 3: + return 2; + case 4: + return 4; + case 5: + return 5; + } + case 3: //East + switch(metadata) { + case 2: + return 4; + case 3: + return 5; + case 4: + return 2; + case 5: + return 3; + } + } + return 0; + } } //Block Selectors @@ -339,7 +433,6 @@ public class ComponentNTMFeatures { this.field_151562_a = Blocks.sand; } } - } static class ConcreteBricks extends StructureComponent.BlockSelector { @@ -353,7 +446,7 @@ public class ComponentNTMFeatures { if(chance < 0.2F) { this.field_151562_a = ModBlocks.brick_concrete; - } else if (chance < 0.4F) { + } else if (chance < 0.5F) { this.field_151562_a = ModBlocks.brick_concrete_mossy; } else if (chance < 0.8F) { this.field_151562_a = ModBlocks.brick_concrete_cracked; @@ -361,7 +454,6 @@ public class ComponentNTMFeatures { this.field_151562_a = ModBlocks.brick_concrete_broken; } } - } static class LabTiles extends StructureComponent.BlockSelector { @@ -381,6 +473,5 @@ public class ComponentNTMFeatures { this.field_151562_a = ModBlocks.tile_lab_broken; } } - } } From 7a8dd5b06a4daf067641a941b784296b76fe3333 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sun, 17 Apr 2022 20:47:13 -0700 Subject: [PATCH 05/18] another day, another structure --- .../world/worldgen/ComponentNTMFeatures.java | 264 ++++++++++++++++-- .../hbm/world/worldgen/MapGenNTMFeatures.java | 11 +- 2 files changed, 246 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index f9d897bb2..0421fef2c 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -6,6 +6,7 @@ import com.hbm.blocks.ModBlocks; import com.hbm.lib.HbmChestContents; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; import com.hbm.util.LootGenerator; +import com.hbm.world.worldgen.ComponentNTMFeatures.LabTiles; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -29,6 +30,7 @@ public class ComponentNTMFeatures { public static void registerNTMFeatures() { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse1.class, "NTMHouse1"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab1.class, "NTMLab1"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab2.class, "NTMLab2"); } /** Sandstone Ruin 1 */ @@ -78,11 +80,11 @@ public class ComponentNTMFeatures { * this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); */ - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + System.out.print(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - //System.out.println("Hpos: " + this.hpos + "; minY:" + this.boundingBox.minY); + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < this.featureSizeX + 1; i++) { for(byte j = 0; j < this.featureSizeZ + 1; j++) { @@ -90,9 +92,6 @@ public class ComponentNTMFeatures { } } - //this.fillWithBlocks(world, box, 0, 0, 0, scatteredFeatureSizeX, 0, scatteredFeatureSizeZ, Blocks.sandstone, Blocks.air, false); - - System.out.print(this.coordBaseMode); //Walls this.fillWithRandomizedBlocks(world, box, 0, 0, 0, featureSizeX, 0, 0, false, rand, RandomSandstone); //Back Wall this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 1, 1, 0, false, rand, RandomSandstone); @@ -122,13 +121,11 @@ public class ComponentNTMFeatures { this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.getLoot(1), rand.nextInt(2) + 8); //Make sure to redo that class kek this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); - if(rand.nextFloat() <= 0.1) + if(rand.nextFloat() <= 0.25) this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, featureSizeX - 1, 0, 1, box); this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.sand, Blocks.air, false); - System.out.println("Successful spawn"); - return true; } @@ -139,19 +136,35 @@ public class ComponentNTMFeatures { private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); + private boolean[] hasPlacedLoot = new boolean[]{false, false}; + /** Constructor for this feature; takes coordinates for bounding box */ protected NTMLab1(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 9, 4, 7); } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); + } @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println(this.coordBaseMode); + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < this.featureSizeX + 1; i++) { for(byte j = 0; j < this.featureSizeZ - 1; j++) { @@ -174,6 +187,7 @@ public class ComponentNTMFeatures { this.fillWithAir(world, box, 1, 0, 1, featureSizeX - 1, featureSizeY, 4); this.fillWithAir(world, box, 4, 0, 4, featureSizeX - 1, featureSizeY, featureSizeZ - 1); + this.fillWithAir(world, box, 3, 1, featureSizeZ - 1, 3, 2, featureSizeZ - 1); int pillarMeta = this.getMetadataForRotatablePillar(8); @@ -220,7 +234,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.plant_flower, i, 1, 2, 1 + i, box); } - int doorMeta = this.getMetadataForRotatableDeco(5); + int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 2); this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, featureSizeZ - 1, box); ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, featureSizeZ - 1), doorMeta, ModBlocks.door_office); @@ -233,19 +247,206 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.machine_shredder, 0, featureSizeX - 2, 1, 1, box); this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, featureSizeX - 1, 1, 1, box); this.fillWithBlocks(world, box, 5, 1, 3, featureSizeX - 1, 1, 3, ModBlocks.deco_titanium, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 6, 2, 3, box); - LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3)); + if(!hasPlacedLoot[0]) { + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 6, 2, 3, box); + LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3)); + hasPlacedLoot[0] = true; + } this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, featureSizeX - 1, 1, featureSizeZ - 2, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 1, 1, featureSizeZ - 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), - this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, featureSizeZ - 1)), 8); + if(!hasPlacedLoot[1]) { + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 1, 1, featureSizeZ - 1, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), + this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, featureSizeZ - 1)), 8); + hasPlacedLoot[1] = true; + } return true; } + } + + public static class NTMLab2 extends ComponentNTMFeatures.Feature { + private static ComponentNTMFeatures.SuperConcrete RandomSuperConcrete = new ComponentNTMFeatures.SuperConcrete(); + private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); + private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); + private boolean[] hasPlacedLoot = new boolean[]{false, false}; + + protected NTMLab2(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 12, 11, 8); + } + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.println(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + this.boundingBox.offset(0, -7, 0); + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < featureSizeX + 1; i++) { + for(byte j = 0; j < featureSizeZ - 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, 6, j, box); + } + } + + for(byte i = 0; i < 7; i++) { + for(byte j = 7; j < featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, 6, j, box); + } + } + + if(this.getBlockAtCurrentPosition(world, featureSizeX - 3, featureSizeY - 4, 7, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, featureSizeX - 3, featureSizeY - 4, 7, box) == Blocks.air) { + int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 2); + this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeX - 3, featureSizeY - 4, 7, box); + this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeX - 2, featureSizeY - 4, 7, box); + this.fillWithMetadataBlocks(world, box, featureSizeX - 3, featureSizeY - 4, 7, featureSizeX - 2, featureSizeY - 4, 7, Blocks.stone_brick_stairs, stairMeta, Blocks.air, 0, false); + } + + + this.fillWithAir(world, box, 1, featureSizeY - 4, 1, featureSizeX - 1, featureSizeY, featureSizeZ - 3); + this.fillWithAir(world, box, 1, featureSizeY - 4, featureSizeZ - 2, 5, featureSizeY, featureSizeZ - 1); + this.fillWithAir(world, box, featureSizeX - 3, featureSizeY - 3, featureSizeZ - 2, featureSizeX - 2, featureSizeY - 2, featureSizeZ - 2); + this.fillWithAir(world, box, 5, 5, 1, 6, 6, 2); + this.fillWithAir(world, box, 2, 0, 2, featureSizeX - 2, 3, featureSizeZ - 2); + + //Walls + this.fillWithRandomizedBlocks(world, box, 0, featureSizeY - 4, 0, featureSizeX, featureSizeY, 0, false, rand, RandomSuperConcrete); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, featureSizeY - 4, 0, 0, featureSizeY, featureSizeZ, false, rand, RandomSuperConcrete); //Left Wall + this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 4, featureSizeZ, 5, featureSizeY - 4, featureSizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 1 + this.fillWithBlocks(world, box, 1, featureSizeY - 3, featureSizeZ, 1, featureSizeY - 1, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, featureSizeY - 4, featureSizeZ, 2, featureSizeY - 1, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, featureSizeY - 3, featureSizeZ, 3, featureSizeY - 1, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 4, featureSizeY - 4, featureSizeZ, 4, featureSizeY - 1, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 5, featureSizeY - 3, featureSizeZ, 5, featureSizeY - 1, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, featureSizeY, featureSizeZ, 5, featureSizeY, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 6, featureSizeY - 4, featureSizeZ - 1, 6, featureSizeY, featureSizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 2 + this.fillWithRandomizedBlocks(world, box, 6, featureSizeY - 4, featureSizeZ - 2, 7, featureSizeY - 2, featureSizeZ - 2, false, rand, RandomSuperConcrete); //Front Wall pt. 3 + this.fillWithBlocks(world, box, 6, featureSizeY - 1, featureSizeZ - 2, 7, featureSizeY - 1, featureSizeZ - 2, ModBlocks.concrete_super_broken, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, featureSizeY - 4, featureSizeZ - 2, featureSizeX, featureSizeY - 4, featureSizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, featureSizeY - 3, featureSizeZ - 2, featureSizeX - 4, featureSizeY, featureSizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, featureSizeY - 1, featureSizeZ - 2, featureSizeX - 2, featureSizeY, featureSizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, featureSizeY - 4, featureSizeZ - 2, featureSizeX, featureSizeY, featureSizeZ - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY - 4, 1, featureSizeX, featureSizeY - 4, featureSizeZ - 3, false, rand, RandomSuperConcrete); //Right Wall + this.fillWithBlocks(world, box, featureSizeX, featureSizeY - 3, featureSizeZ - 3, featureSizeX, featureSizeY - 1, featureSizeZ - 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY - 3, 4, featureSizeX, featureSizeY - 1, 4, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, featureSizeX, featureSizeY - 3, 3, featureSizeX, featureSizeY - 1, 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY - 3, 2, featureSizeX, featureSizeY - 1, 2, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, featureSizeX, featureSizeY - 3, 1, featureSizeX, featureSizeY - 1, 1, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, featureSizeY, 1, featureSizeX, featureSizeY, featureSizeZ - 3, false, rand, RandomSuperConcrete); + + this.fillWithBlocks(world, box, 1, 0, 1, featureSizeX - 1, 3, 1, ModBlocks.reinforced_stone, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, 1, 0, 2, 1, 3, featureSizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Left Wall + this.fillWithBlocks(world, box, 1, 0, featureSizeZ - 1, featureSizeX - 1, 3, featureSizeZ - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall + this.fillWithBlocks(world, box, featureSizeX - 1, 0, 2, featureSizeX - 1, 3, featureSizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); // Right Wall + this.fillWithBlocks(world, box, 6, 0, 3, 6, 3, featureSizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Internal Wall + + //Floors & Ceiling + this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 4, 1, 3, featureSizeY - 4, featureSizeZ - 1, false, rand, RandomLabTiles); //Left Floor + this.fillWithRandomizedBlocks(world, box, 4, featureSizeY - 4, featureSizeZ - 2, 5, featureSizeY - 4, featureSizeZ - 1, false, rand, RandomLabTiles); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, featureSizeY - 4, 1, featureSizeX - 1, featureSizeY - 4, featureSizeZ - 3, false, rand, RandomLabTiles); //Right Floor + this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, featureSizeY - 4, featureSizeZ - 2, featureSizeX - 2, featureSizeY - 4, featureSizeZ - 2, false, rand, RandomLabTiles); + this.fillWithBlocks(world, box, 4, featureSizeY - 4, 1, 7, featureSizeY - 4, 1, ModBlocks.tile_lab_broken, Blocks.air, false); //Center Floor (Pain) + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 4, featureSizeY - 4, 2, box); + this.fillWithBlocks(world, box, 4, featureSizeY - 4, 3, 4, featureSizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 5, featureSizeY - 4, 3, box); + this.fillWithBlocks(world, box, 5, featureSizeY - 4, 4, 5, featureSizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 6, featureSizeY - 4, 4, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 6, featureSizeY - 4, 5, box); + this.fillWithBlocks(world, box, 7, featureSizeY - 4, 2, 7, featureSizeY - 4, 3, ModBlocks.tile_lab_broken, Blocks.air, false); + this.fillWithBlocks(world, box, 7, featureSizeY - 4, 4, 7, featureSizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + + this.fillWithBlocks(world, box, 1, featureSizeY, 1, 2, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Left Ceiling + this.fillWithBlocks(world, box, 3, featureSizeY, featureSizeZ - 2, 4, featureSizeY, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, featureSizeX - 3, featureSizeY, 1, featureSizeX - 1, featureSizeY, featureSizeZ - 3, ModBlocks.brick_light, Blocks.air, false); //Right Ceiling + this.fillWithBlocks(world, box, 3, featureSizeY, 1, 8, featureSizeY, 1, ModBlocks.waste_planks, Blocks.air, false); //Center Ceiling (Pain) + this.fillWithBlocks(world, box, 3, featureSizeY, 2, 4, featureSizeY, 2, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 7, featureSizeY, 2, 8, featureSizeY, 2, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 3, featureSizeY, 3, 3, featureSizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 4, featureSizeY, 4, 4, featureSizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 5, featureSizeY, 6, 5, featureSizeY, featureSizeZ - 1, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 8, featureSizeY, 3, 8, featureSizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + + this.fillWithRandomizedBlocks(world, box, 2, 0, 2, 5, 0, featureSizeZ - 2, false, rand, RandomLabTiles); //Floor + this.fillWithRandomizedBlocks(world, box, 6, 0, 2, 6, 0, 3, false, rand, RandomLabTiles); + this.fillWithRandomizedBlocks(world, box, 7, 0, 2, featureSizeX - 2, 0, featureSizeZ - 2, false, rand, RandomLabTiles); + + this.fillWithRandomizedBlocks(world, box, 1, 4, 1, featureSizeX - 1, 4, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Ceiling + + //Decorations & Loot + int eastMeta = this.getMetadataForRotatableDeco(4); + int westMeta = this.getMetadataForRotatableDeco(5); + int northMeta = this.getMetadataForRotatableDeco(3); + int southMeta = this.getMetadataForRotatableDeco(2); + this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, featureSizeY - 2, 3, box); + + int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 1); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, featureSizeX - 3, featureSizeY - 3, featureSizeZ - 2, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(featureSizeX - 3, featureSizeZ - 2), this.getYWithOffset(featureSizeY - 3), this.getZWithOffset(featureSizeX - 3, featureSizeZ - 2), + doorMeta, ModBlocks.door_office); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, featureSizeX - 2, featureSizeY - 3, featureSizeZ - 2, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(featureSizeX - 2, featureSizeZ - 2), this.getYWithOffset(featureSizeY - 3), this.getZWithOffset(featureSizeX - 2, featureSizeZ - 2), + doorMeta, ModBlocks.door_office); + + this.fillWithBlocks(world, box, 1, featureSizeY - 3, 1, 1, featureSizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 1, featureSizeY - 3, 2, 1, featureSizeY - 2, 3, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, westMeta, 1, featureSizeY - 1, 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 1, featureSizeY - 1, 3, box); + this.fillWithBlocks(world, box, 1, featureSizeY - 3, 6, 1, featureSizeY - 1, 6, ModBlocks.deco_pipe_framed_rusted, Blocks.air, false); + + this.fillWithMetadataBlocks(world, box, featureSizeX - 4, featureSizeY - 3, 1, featureSizeX - 4, featureSizeY - 1, 1, ModBlocks.steel_wall, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX - 3, featureSizeY - 1, 1, featureSizeX - 2, featureSizeY - 1, 1, ModBlocks.steel_grate, 0, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX - 3, featureSizeY - 2, 1, featureSizeX - 2, featureSizeY - 2, 1, ModBlocks.tape_recorder, northMeta, Blocks.air, 0, false); + this.fillWithBlocks(world, box, featureSizeX - 3, featureSizeY - 3, 1, featureSizeX - 2, featureSizeY - 3, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, featureSizeX - 1, featureSizeY - 3, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + + this.fillWithMetadataBlocks(world, box, 2, 1, 2, 2, 1, featureSizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.vitrified_barrel, 0, 2, 2, 2, box); + this.fillWithBlocks(world, box, 2, 2, 4, 2, 3, featureSizeZ - 2, ModBlocks.vitrified_barrel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 3, 1, 2, 3, 3, 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, 1, 4, 3, 3, 4, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, 1, featureSizeZ - 2, 3, 3, featureSizeZ - 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 5, 1, 5, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, featureSizeZ - 2, box); + if(!hasPlacedLoot[0]) { + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 5, 1, featureSizeZ - 2, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(5), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(5, featureSizeZ - 2), + this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 8); + hasPlacedLoot[0] = true; + } + this.fillWithBlocks(world, box, 4, 2, featureSizeZ - 2, 5, 2, featureSizeZ - 2, ModBlocks.crate_lead, Blocks.air, false); + + this.fillWithBlocks(world, box, featureSizeX - 5, 1, featureSizeZ - 2, featureSizeX - 5, 3, featureSizeZ - 2, ModBlocks.deco_steel, Blocks.air, false);; + this.fillWithMetadataBlocks(world, box, featureSizeX - 4, 1, featureSizeZ - 2, featureSizeX - 2, 1, featureSizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX - 4, 2, featureSizeZ - 2, featureSizeX - 3, 2, featureSizeZ - 2, ModBlocks.tape_recorder, southMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, featureSizeX - 2, 2, featureSizeZ - 2, box); + this.fillWithBlocks(world, box, featureSizeX - 4, 3, featureSizeZ - 2, featureSizeX - 2, 3, featureSizeZ - 2, ModBlocks.steel_roof, Blocks.air, false); + if(!hasPlacedLoot[1]) { + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 2, 1, 3, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(4), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 2, 3), + this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 2, 3)), 8); + } + + return true; + } } abstract static class Feature extends StructureComponent { @@ -328,8 +529,6 @@ public class ComponentNTMFeatures { int blockMeta = metadata & 3; int rotationMeta = metadata >> 2; - System.out.println(rotationMeta); - if(rotationMeta == 0) return metadata; @@ -353,8 +552,6 @@ public class ComponentNTMFeatures { } } - System.out.println("OG: " + metadata + "; New: " + (blockMeta | rotationMeta)); - return blockMeta | rotationMeta; } @@ -365,7 +562,7 @@ public class ComponentNTMFeatures { */ protected int getMetadataForRotatableDeco(int metadata) { switch(this.coordBaseMode) { - case 0: //North + case 0: //South switch(metadata) { case 2: return 2; @@ -387,7 +584,7 @@ public class ComponentNTMFeatures { case 5: return 3; } - case 2: //South + case 2: //North switch(metadata) { case 2: return 3; @@ -422,7 +619,7 @@ public class ComponentNTMFeatures { /** Selects blocks */ @Override - public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { float chance = rand.nextFloat(); if(chance > 0.6F) { @@ -441,7 +638,7 @@ public class ComponentNTMFeatures { /** Selects blocks */ @Override - public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { float chance = rand.nextFloat(); if(chance < 0.2F) { @@ -462,16 +659,31 @@ public class ComponentNTMFeatures { /** Selects blocks */ @Override - public void selectBlocks(Random rand, int p_75062_2_, int p_75062_3_, int p_75062_4_, boolean p_75062_5_) { + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { float chance = rand.nextFloat(); if(chance < 0.5F) { this.field_151562_a = ModBlocks.tile_lab; - } else if (chance < 0.8F) { + } else if (chance < 0.9F) { this.field_151562_a = ModBlocks.tile_lab_cracked; } else { this.field_151562_a = ModBlocks.tile_lab_broken; } } } + + static class SuperConcrete extends StructureComponent.BlockSelector { + + SuperConcrete() { + this.field_151562_a = ModBlocks.concrete_super; + } + + /** Selects blocks */ + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean p_75062_5_) { + this.selectedBlockMetaData = rand.nextInt(6) + 10; + + + } + } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 56ed90534..efe81f2b5 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -95,12 +95,17 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ - if(biomegenbase.temperature >= 1.2 && !(biomegenbase instanceof BiomeGenMesa)) { + if(biomegenbase.temperature >= 1.2 && biomegenbase.rainfall == 0 && !(biomegenbase instanceof BiomeGenMesa)) { ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); } else { - ComponentNTMFeatures.NTMLab1 lab1 = new ComponentNTMFeatures.NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(lab1); + if(rand.nextInt(2) == 0) { + ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(lab2); + } else { + ComponentNTMFeatures.NTMLab1 lab1 = new ComponentNTMFeatures.NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(lab1); + } } this.updateBoundingBox(); From 3d80d62f2bacdd5a222b2c6ddb0f294c3c40cc23 Mon Sep 17 00:00:00 2001 From: Vaern Date: Mon, 18 Apr 2022 19:47:05 -0700 Subject: [PATCH 06/18] arg --- .../java/com/hbm/lib/HbmChestContents.java | 92 ++++++------------- src/main/java/com/hbm/lib/HbmWorldGen.java | 24 ++--- .../java/com/hbm/world/dungeon/Antenna.java | 2 +- .../java/com/hbm/world/dungeon/Barrel.java | 2 +- .../java/com/hbm/world/dungeon/Bunker.java | 12 +-- .../hbm/world/dungeon/CrashedVertibird.java | 4 +- .../com/hbm/world/dungeon/DesertAtom001.java | 2 +- .../com/hbm/world/dungeon/DesertAtom002.java | 8 +- .../com/hbm/world/dungeon/DesertAtom003.java | 2 +- .../java/com/hbm/world/dungeon/Factory.java | 8 +- .../java/com/hbm/world/dungeon/Radio01.java | 10 +- .../java/com/hbm/world/dungeon/Relay.java | 6 +- .../java/com/hbm/world/dungeon/Satellite.java | 8 +- src/main/java/com/hbm/world/dungeon/Silo.java | 6 +- .../java/com/hbm/world/dungeon/Spaceship.java | 10 +- .../java/com/hbm/world/dungeon/Vertibird.java | 4 +- .../world/worldgen/ComponentNTMFeatures.java | 40 ++++---- .../hbm/world/worldgen/MapGenNTMFeatures.java | 5 +- 18 files changed, 109 insertions(+), 136 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index c7243aee6..b0b2411a2 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -13,9 +13,7 @@ import net.minecraft.util.WeightedRandomChestContent; public class HbmChestContents { - static Random rand = new Random(); - - private static WeightedRandomChestContent[] modGeneric = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] modGeneric = new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.bread, 0, 1, 5, 8), new WeightedRandomChestContent(ModItems.twinkie, 0, 1, 3, 6), new WeightedRandomChestContent(Items.iron_ingot, 0, 2, 6, 10), @@ -47,7 +45,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 2), new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 3) }; - private static WeightedRandomChestContent[] antenna = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] antenna = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.twinkie, 0, 1, 3, 4), new WeightedRandomChestContent(ModItems.ingot_steel, 0, 1, 2, 7), new WeightedRandomChestContent(ModItems.ingot_red_copper, 0, 1, 1, 4), @@ -73,7 +71,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.bomb_caller, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 2) }; - private static WeightedRandomChestContent[] expensive = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] expensive = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.chlorine_pinwheel, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.circuit_targeting_tier3, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.circuit_gold, 0, 1, 2, 3), @@ -109,7 +107,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.journal_pip, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.journal_bj, 0, 1, 1, 1) }; - private static WeightedRandomChestContent[] nukeTrash = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] nukeTrash = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.nugget_u238, 0, 3, 12, 5), new WeightedRandomChestContent(ModItems.nugget_pu240, 0, 3, 8, 5), new WeightedRandomChestContent(ModItems.nugget_neptunium, 0, 1, 4, 3), @@ -125,8 +123,22 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.hazmat_kit, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 1, 2) }; + + public static WeightedRandomChestContent[] nuclearFuel = new WeightedRandomChestContent[] { + new WeightedRandomChestContent(ModItems.nugget_uranium, 0, 2, 12, 3), + new WeightedRandomChestContent(ModItems.nugget_mox_fuel, 0, 2, 12, 3), + new WeightedRandomChestContent(ModItems.nugget_uranium_fuel, 0, 2, 12, 5), + new WeightedRandomChestContent(ModItems.nugget_plutonium_fuel, 0, 2, 12, 4), + new WeightedRandomChestContent(ModItems.nugget_thorium_fuel, 0, 2, 12, 3), + new WeightedRandomChestContent(ModItems.billet_ra226be, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.rod_zirnox_empty, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.pile_rod_uranium, 0, 2, 6, 4), + new WeightedRandomChestContent(ModItems.pile_rod_source, 0, 1, 2, 3), + new WeightedRandomChestContent(ModItems.reacher, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.screwdriver, 0, 1, 1, 2) + }; - private static WeightedRandomChestContent[] nuclear = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] nuclear = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.nugget_u235, 0, 3, 12, 5), new WeightedRandomChestContent(ModItems.nugget_pu238, 0, 3, 12, 5), new WeightedRandomChestContent(ModItems.nugget_pu239, 0, 3, 12, 5), @@ -156,7 +168,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 3, 3) }; - private static WeightedRandomChestContent[] vertibird = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] vertibird = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.t45_helmet, 0, 1, 1, 15), new WeightedRandomChestContent(ModItems.t45_plate, 0, 1, 1, 15), new WeightedRandomChestContent(ModItems.t45_legs, 0, 1, 1, 15), @@ -184,7 +196,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.bomb_caller, 1, 1, 1, 1), new WeightedRandomChestContent(ModItems.bomb_caller, 2, 1, 1, 2) }; - private static WeightedRandomChestContent[] missile = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] missile = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.missile_generic, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.missile_incendiary, 0, 1, 1, 4), new WeightedRandomChestContent(ModItems.gas_mask_m65, 0, 1, 1, 5), @@ -199,7 +211,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.bomb_caller, 3, 1, 1, 1), new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 10) }; - private static WeightedRandomChestContent[] spaceship = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] spaceship = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.battery_advanced, 0, 1, 1, 5), new WeightedRandomChestContent(ModItems.ingot_advanced_alloy, 0, 2, 16, 5), new WeightedRandomChestContent(ModItems.wire_advanced_alloy, 0, 8, 32, 5), @@ -216,7 +228,7 @@ public class HbmChestContents { new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.red_wire_coated), 0, 4, 8, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.red_cable), 0, 8, 16, 5) }; - private static WeightedRandomChestContent[] powder = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] powder = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.powder_neptunium, 0, 1, 32, 1), new WeightedRandomChestContent(ModItems.powder_iodine, 0, 1, 32, 1), new WeightedRandomChestContent(ModItems.powder_thorium, 0, 1, 32, 1), @@ -230,7 +242,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.powder_tennessine, 0, 1, 32, 1), new WeightedRandomChestContent(ModItems.powder_cerium, 0, 1, 32, 1) }; - private static WeightedRandomChestContent[] vault1 = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] vault1 = new WeightedRandomChestContent[] { new WeightedRandomChestContent(Items.gold_ingot, 0, 3, 14, 1), new WeightedRandomChestContent(ModItems.pin, 0, 8, 8, 1), new WeightedRandomChestContent(ModItems.gun_calamity, 0, 1, 1, 1), @@ -243,7 +255,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.grenade_if_incendiary, 0, 1, 1, 1), new WeightedRandomChestContent(Items.diamond, 0, 1, 2, 1) }; - private static WeightedRandomChestContent[] vault2 = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] vault2 = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.ingot_desh, 0, 2, 6, 1), new WeightedRandomChestContent(ModItems.battery_advanced_cell_4, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_desh_mix, 0, 1, 5, 1), @@ -259,7 +271,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.circuit_red_copper, 0, 12, 16, 1), new WeightedRandomChestContent(ModItems.circuit_gold, 0, 2, 6, 1) }; - private static WeightedRandomChestContent[] vault3 = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] vault3 = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.ingot_desh, 0, 6, 16, 1), new WeightedRandomChestContent(ModItems.battery_lithium, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.powder_power, 0, 1, 5, 1), @@ -278,7 +290,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.circuit_red_copper, 0, 18, 32, 1), new WeightedRandomChestContent(ModItems.circuit_gold, 0, 6, 12, 1) }; - private static WeightedRandomChestContent[] vault4 = new WeightedRandomChestContent[] { + public static WeightedRandomChestContent[] vault4 = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.ammo_container, 0, 3, 6, 1), new WeightedRandomChestContent(ModItems.clip_fatman, 0, 2, 3, 1), new WeightedRandomChestContent(ModItems.gun_mirv_ammo, 0, 2, 3, 1), @@ -293,53 +305,5 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.weaponized_starblaster_cell, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.warhead_mirv, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.battery_schrabidium_cell, 0, 1, 1, 1), - new WeightedRandomChestContent(ModItems.powder_nitan_mix, 0, 16, 32, 1) }; - - /** - * @param i - * @return WeightedRandomChestContent array with custom loot - * - * case 1: modGeneric loot (ingots, few blocks) - * case 2: antenna loot (spare parts, electronics) - * case 3: expensive loot (revolers, circuits, schrabidium nuggets) - * case 4: nukeTrash loot (U238 and Pu240 nuggets and rods) - * case 5: nuclear loot (U235 and Pu239 nuggets and rods, fuel rods) - * case 6: vertibrid loot (T45 power armor, fusion cores, circuits, nuclear material) - * case 7: missile loot (missiles, designators, missile parts) - * case 8: spaceship loot (reactor elements, super conductors) - * case 9: powder loot (secret chest with the five powders for NITAN) - **/ - //what kind of drugs did i take that made me thing this was supposed to be an acceptable way of doing things? what the hell? - public static WeightedRandomChestContent[] getLoot(int i) { - switch (i) { - case 1: - return modGeneric; - case 2: - return antenna; - case 3: - return expensive; - case 4: - return nukeTrash; - case 5: - return nuclear; - case 6: - return vertibird; - case 7: - return missile; - case 8: - return spaceship; - case 9: - return powder; - case 10: - return vault1; - case 11: - return vault2; - case 12: - return vault3; - case 13: - return vault4; - } - - return null; - } + new WeightedRandomChestContent(ModItems.powder_nitan_mix, 0, 16, 32, 1) }; } diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index bbf7e0e18..d1f20b3b6 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -465,7 +465,7 @@ public class HbmWorldGen implements IWorldGenerator { ((TileEntitySafe)world.getTileEntity(x, y, z)).setPins(rand.nextInt(999) + 1); ((TileEntitySafe)world.getTileEntity(x, y, z)).setMod(1); ((TileEntitySafe)world.getTileEntity(x, y, z)).lock(); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(10), (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(4) + 3); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vault1, (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(4) + 3); break; case 4: case 5: @@ -473,20 +473,20 @@ public class HbmWorldGen implements IWorldGenerator { ((TileEntitySafe)world.getTileEntity(x, y, z)).setPins(rand.nextInt(999) + 1); ((TileEntitySafe)world.getTileEntity(x, y, z)).setMod(0.1); ((TileEntitySafe)world.getTileEntity(x, y, z)).lock(); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(11), (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(3) + 2); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vault2, (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(3) + 2); break; case 7: case 8: ((TileEntitySafe)world.getTileEntity(x, y, z)).setPins(rand.nextInt(999) + 1); ((TileEntitySafe)world.getTileEntity(x, y, z)).setMod(0.02); ((TileEntitySafe)world.getTileEntity(x, y, z)).lock(); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(12), (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(3) + 1); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vault3, (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(3) + 1); break; case 9: ((TileEntitySafe)world.getTileEntity(x, y, z)).setPins(rand.nextInt(999) + 1); ((TileEntitySafe)world.getTileEntity(x, y, z)).setMod(0.0); ((TileEntitySafe)world.getTileEntity(x, y, z)).lock(); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(13), (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(2) + 1); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vault4, (TileEntitySafe)world.getTileEntity(x, y, z), rand.nextInt(2) + 1); break; } @@ -598,7 +598,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(10000, 250, 10000) == Blocks.air) { world.setBlock(10000, 250, 10000, Blocks.chest); if (world.getBlock(10000, 250, 10000) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(10000, 250, 10000), 29); } } @@ -607,7 +607,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(0, 250, 10000) == Blocks.air) { world.setBlock(0, 250, 10000, Blocks.chest); if (world.getBlock(0, 250, 10000) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(0, 250, 10000), 29); } } @@ -616,7 +616,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(-10000, 250, 10000) == Blocks.air) { world.setBlock(-10000, 250, 10000, Blocks.chest); if (world.getBlock(-10000, 250, 10000) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(-10000, 250, 10000), 29); } } @@ -625,7 +625,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(10000, 250, 0) == Blocks.air) { world.setBlock(10000, 250, 0, Blocks.chest); if (world.getBlock(10000, 250, 0) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(10000, 250, 0), 29); } } @@ -634,7 +634,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(-10000, 250, 0) == Blocks.air) { world.setBlock(-10000, 250, 0, Blocks.chest); if (world.getBlock(-10000, 250, 0) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(-10000, 250, 0), 29); } } @@ -643,7 +643,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(10000, 250, -10000) == Blocks.air) { world.setBlock(10000, 250, -10000, Blocks.chest); if (world.getBlock(10000, 250, -10000) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(10000, 250, -10000), 29); } } @@ -652,7 +652,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(0, 250, -10000) == Blocks.air) { world.setBlock(0, 250, -10000, Blocks.chest); if (world.getBlock(0, 250, -10000) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(0, 250, -10000), 29); } } @@ -661,7 +661,7 @@ public class HbmWorldGen implements IWorldGenerator { if (world.getBlock(-10000, 250, -10000) == Blocks.air) { world.setBlock(-10000, 250, -10000, Blocks.chest); if (world.getBlock(-10000, 250, -10000) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(9), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.powder, (TileEntityChest) world.getTileEntity(-10000, 250, -10000), 29); } } diff --git a/src/main/java/com/hbm/world/dungeon/Antenna.java b/src/main/java/com/hbm/world/dungeon/Antenna.java index f107f0e6f..d33529077 100644 --- a/src/main/java/com/hbm/world/dungeon/Antenna.java +++ b/src/main/java/com/hbm/world/dungeon/Antenna.java @@ -90,7 +90,7 @@ public class Antenna extends WorldGenerator world.setBlock(x + 1, y + 0, z + 2, ModBlocks.steel_poles, 3, 3); world.setBlock(x + 2, y + 0, z + 2, Blocks.chest, 0, 3); world.setBlockMetadataWithNotify(x + 2, y + 0, z + 2, 5, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityChest)world.getTileEntity(x + 2, y, z + 2), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(x + 2, y, z + 2), 8); world.setBlock(x + 0, y + 1, z + 0, Blocks.air, 0, 3); world.setBlock(x + 1, y + 1, z + 0, ModBlocks.steel_poles, 2, 3); world.setBlock(x + 2, y + 1, z + 0, Blocks.air, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Barrel.java b/src/main/java/com/hbm/world/dungeon/Barrel.java index 59d3c49c1..e4b347734 100644 --- a/src/main/java/com/hbm/world/dungeon/Barrel.java +++ b/src/main/java/com/hbm/world/dungeon/Barrel.java @@ -159,7 +159,7 @@ public class Barrel extends WorldGenerator { if(world.getBlock(x + 2, y + 1, z + 2) == ModBlocks.crate_steel) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityCrateSteel)world.getTileEntity(x + 2, y + 1, z + 2), 16); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityCrateSteel)world.getTileEntity(x + 2, y + 1, z + 2), 16); } world.setBlock(x + 3, y + 1, z + 2, Block4, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Bunker.java b/src/main/java/com/hbm/world/dungeon/Bunker.java index bd7deef2b..35b897e0f 100644 --- a/src/main/java/com/hbm/world/dungeon/Bunker.java +++ b/src/main/java/com/hbm/world/dungeon/Bunker.java @@ -281,7 +281,7 @@ public class Bunker extends WorldGenerator { world.setBlock(x + 2, y + -24, z + 1, Blocks.chest, 3, 3); world.setBlockMetadataWithNotify(x + 2, y + -24, z + 1, 3, 3); if(world.getBlock(x + 2, y + -24, z + 1) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest) world.getTileEntity(x + 2, y + -24, z + 1), rand.nextInt(2) + 6); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest) world.getTileEntity(x + 2, y + -24, z + 1), rand.nextInt(2) + 6); } if(world.rand.nextInt(10) > 0) { @@ -303,12 +303,12 @@ public class Bunker extends WorldGenerator { world.setBlock(x + 1, y + -24, z + 2, Blocks.chest, 5, 3); world.setBlockMetadataWithNotify(x + 1, y + -24, z + 5, 3, 3); if(world.getBlock(x + 2, y + -24, z + 1) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest) world.getTileEntity(x + 1, y + -24, z + 2), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 1, y + -24, z + 2), 8); } world.setBlock(x + 3, y + -24, z + 2, Blocks.chest, 4, 3); world.setBlockMetadataWithNotify(x + 3, y + -24, z + 2, 4, 3); if(world.getBlock(x + 3, y + -24, z + 2) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest) world.getTileEntity(x + 3, y + -24, z + 2), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 3, y + -24, z + 2), 8); } world.setBlock(x + 4, y + -24, z + 2, Block1, 0, 3); world.setBlock(x + 11, y + -24, z + 2, Block1, 0, 3); @@ -316,12 +316,12 @@ public class Bunker extends WorldGenerator { world.setBlock(x + 1, y + -24, z + 3, Blocks.chest, 5, 3); world.setBlockMetadataWithNotify(x + 1, y + -24, z + 3, 5, 3); if(world.getBlock(x + 1, y + -24, z + 3) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest) world.getTileEntity(x + 1, y + -24, z + 3), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 1, y + -24, z + 3), 8); } world.setBlock(x + 3, y + -24, z + 3, Blocks.chest, 4, 3); world.setBlockMetadataWithNotify(x + 3, y + -24, z + 3, 5, 3); if(world.getBlock(x + 3, y + -24, z + 3) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest) world.getTileEntity(x + 3, y + -24, z + 3), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 3, y + -24, z + 3), 8); } world.setBlock(x + 4, y + -24, z + 3, Block1, 0, 3); world.setBlock(x + 7, y + -24, z + 3, Block1, 0, 3); @@ -807,7 +807,7 @@ public class Bunker extends WorldGenerator { world.setBlock(x + 4, y + -20, z + 1, Blocks.chest, 5, 3); world.setBlockMetadataWithNotify(x + 4, y + -20, z + 1, 5, 3); if(world.getBlock(x + 4, y + -20, z + 1) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityChest) world.getTileEntity(x + 4, y + -20, z + 1), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest) world.getTileEntity(x + 4, y + -20, z + 1), 12); } world.setBlock(x + 8, y + -20, z + 1, Block4, 0, 3); world.setBlock(x + 9, y + -20, z + 1, Block4, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java b/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java index 255d6671b..5364d5fc3 100644 --- a/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java +++ b/src/main/java/com/hbm/world/dungeon/CrashedVertibird.java @@ -160,7 +160,7 @@ public class CrashedVertibird extends WorldGenerator world.setBlock(x + 6, y + 4 - yOffset, z + 7, Blocks.chest, 2, 3); if(world.getBlock(x + 6, y + 4 - yOffset, z + 7) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(6), (TileEntityChest)world.getTileEntity(x + 6, y + 4 - yOffset, z + 7), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vertibird, (TileEntityChest)world.getTileEntity(x + 6, y + 4 - yOffset, z + 7), 8); } world.setBlock(x + 7, y + 4 - yOffset, z + 7, Block1, 0, 3); world.setBlock(x + 4, y + 4 - yOffset, z + 8, Block1, 0, 3); @@ -289,7 +289,7 @@ public class CrashedVertibird extends WorldGenerator world.setBlock(x + 5, y + 8 - yOffset, z + 6, Blocks.chest, 2, 3); if(world.getBlock(x + 5, y + 8 - yOffset, z + 6) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 5, y + 8 - yOffset, z + 6), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest)world.getTileEntity(x + 5, y + 8 - yOffset, z + 6), 8); } world.setBlock(x + 6, y + 8 - yOffset, z + 6, Block1, 0, 3); world.setBlock(x + 7, y + 8 - yOffset, z + 6, Block1, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/DesertAtom001.java b/src/main/java/com/hbm/world/dungeon/DesertAtom001.java index 124fd3bd7..598f30699 100644 --- a/src/main/java/com/hbm/world/dungeon/DesertAtom001.java +++ b/src/main/java/com/hbm/world/dungeon/DesertAtom001.java @@ -214,7 +214,7 @@ public class DesertAtom001 extends WorldGenerator world.setBlock(x + 9, y + -4, z + 14, Blocks.chest, 2, 3); if(world.getBlock(x + 9, y + -4, z + 14) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(5), (TileEntityChest)world.getTileEntity(x + 9, y + -4, z + 14), 10); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nuclear, (TileEntityChest)world.getTileEntity(x + 9, y + -4, z + 14), 10); } world.setBlock(x + 10, y + -4, z + 14, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 11, y + -4, z + 14, Library.getRandomConcrete(), 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/DesertAtom002.java b/src/main/java/com/hbm/world/dungeon/DesertAtom002.java index 6f668f55d..5f1415e99 100644 --- a/src/main/java/com/hbm/world/dungeon/DesertAtom002.java +++ b/src/main/java/com/hbm/world/dungeon/DesertAtom002.java @@ -1162,7 +1162,7 @@ public class DesertAtom002 world.setBlock(x + 36, y + 0, z + 12, Blocks.chest, 3, 3); if(world.getBlock(x + 36, y + 0, z + 12) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 36, y + 0, z + 12), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 36, y + 0, z + 12), 8); } world.setBlock(x + 37, y + 0, z + 12, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 40, y + 0, z + 12, ModBlocks.fence_metal, 0, 3); @@ -1183,7 +1183,7 @@ public class DesertAtom002 world.setBlock(x + 22, y + 0, z + 13, Blocks.chest, 4, 3); if(world.getBlock(x + 22, y + 0, z + 13) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 22, y + 0, z + 13), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 22, y + 0, z + 13), 8); } world.setBlock(x + 23, y + 0, z + 13, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 24, y + 0, z + 13, Block9, 5, 3); @@ -1375,7 +1375,7 @@ public class DesertAtom002 world.setBlock(x + 24, y + 0, z + 26, Blocks.chest, 2, 3); if(world.getBlock(x + 24, y + 0, z + 26) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(4), (TileEntityChest)world.getTileEntity(x + 24, y + 0, z + 26), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nukeTrash, (TileEntityChest)world.getTileEntity(x + 24, y + 0, z + 26), 8); } world.setBlock(x + 25, y + 0, z + 26, Block2, 0, 3); world.setBlock(x + 30, y + 0, z + 26, Block2, 0, 3); @@ -1754,7 +1754,7 @@ public class DesertAtom002 world.setBlock(x + 18, y + 1, z + 16, ModBlocks.crate_steel, 0, 3); if(world.getBlock(x + 18, y + 1, z + 16) == ModBlocks.crate_steel) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityCrateSteel)world.getTileEntity(x + 18, y + 1, z + 16), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityCrateSteel)world.getTileEntity(x + 18, y + 1, z + 16), 12); } world.setBlock(x + 19, y + 1, z + 16, Library.getRandomConcrete(), 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/DesertAtom003.java b/src/main/java/com/hbm/world/dungeon/DesertAtom003.java index c648ba0c7..f04ccb06d 100644 --- a/src/main/java/com/hbm/world/dungeon/DesertAtom003.java +++ b/src/main/java/com/hbm/world/dungeon/DesertAtom003.java @@ -440,7 +440,7 @@ public class DesertAtom003 world.setBlock(x + 36, y + 4, z + 9, Blocks.chest, 2, 3); if(world.getBlock(x + 36, y + 4, z + 9) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(5), (TileEntityChest)world.getTileEntity(x + 36, y + 4, z + 9), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nuclear, (TileEntityChest)world.getTileEntity(x + 36, y + 4, z + 9), 12); } world.setBlock(x + 37, y + 4, z + 9, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 40, y + 4, z + 9, Block5, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Factory.java b/src/main/java/com/hbm/world/dungeon/Factory.java index 1dbb756dc..970f789fe 100644 --- a/src/main/java/com/hbm/world/dungeon/Factory.java +++ b/src/main/java/com/hbm/world/dungeon/Factory.java @@ -601,7 +601,7 @@ public class Factory extends WorldGenerator world.setBlockMetadataWithNotify(x + 9, y + 0, z + 4, 5, 3); if(world.getBlock(x + 9, y + 0, z + 4) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 9, y + 0, z + 4), rand.nextInt(2)+ 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 9, y + 0, z + 4), rand.nextInt(2)+ 8); } world.setBlock(x + 13, y + 0, z + 4, Blocks.hopper, 3, 3); world.setBlock(x + 14, y + 0, z + 4, Blocks.stonebrick, 0, 3); @@ -637,7 +637,7 @@ public class Factory extends WorldGenerator world.setBlockMetadataWithNotify(x + 9, y + 0, z + 10, 5, 3); if(world.getBlock(x + 9, y + 0, z + 10) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 9, y + 0, z + 10), rand.nextInt(2)+ 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 9, y + 0, z + 10), rand.nextInt(2)+ 8); } world.setBlock(x + 13, y + 0, z + 10, Blocks.hopper, 3, 3); world.setBlock(x + 14, y + 0, z + 10, Blocks.stonebrick, 0, 3); @@ -673,7 +673,7 @@ public class Factory extends WorldGenerator world.setBlockMetadataWithNotify(x + 9, y + 0, z + 16, 5, 3); if(world.getBlock(x + 9, y + 0, z + 16) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 9, y + 0, z + 16), rand.nextInt(2)+ 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 9, y + 0, z + 16), rand.nextInt(2)+ 8); } world.setBlock(x + 13, y + 0, z + 16, Blocks.hopper, 3, 3); world.setBlock(x + 14, y + 0, z + 16, Blocks.stonebrick, 0, 3); @@ -736,7 +736,7 @@ public class Factory extends WorldGenerator world.setBlockMetadataWithNotify(x + 4, y + 0, z + 25, 3, 3); if(world.getBlock(x + 4, y + 0, z + 25) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 4, y + 0, z + 25), rand.nextInt(2)+ 6); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest)world.getTileEntity(x + 4, y + 0, z + 25), rand.nextInt(2)+ 6); } world.setBlock(x + 5, y + 0, z + 25, Blocks.lava, 0, 3); world.setBlock(x + 6, y + 0, z + 25, Blocks.stonebrick, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Radio01.java b/src/main/java/com/hbm/world/dungeon/Radio01.java index 7aea2227e..4257fd171 100644 --- a/src/main/java/com/hbm/world/dungeon/Radio01.java +++ b/src/main/java/com/hbm/world/dungeon/Radio01.java @@ -499,7 +499,7 @@ public class Radio01 extends WorldGenerator world.setBlock(x + 5, y + 0, z + 11, Blocks.flower_pot, 0, 3); world.setBlock(x + 6, y + 0, z + 11, Blocks.chest, 3, 3); world.setBlockMetadataWithNotify(x + 6, y + 0, z + 11, 5, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 6, y + 0, z + 11), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 6, y + 0, z + 11), 8); world.setBlock(x + 7, y + 0, z + 11, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 8, y + 0, z + 11, Blocks.air, 0, 3); world.setBlock(x + 9, y + 0, z + 11, Blocks.air, 0, 3); @@ -651,7 +651,7 @@ public class Radio01 extends WorldGenerator world.setBlock(x + 6, y + 0, z + 24, ModBlocks.deco_steel, 0, 3); world.setBlock(x + 7, y + 0, z + 24, Blocks.chest, 2, 3); world.setBlockMetadataWithNotify(x + 7, y + 0, z + 24, 5, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityChest)world.getTileEntity(x + 7, y + 0, z + 24), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(x + 7, y + 0, z + 24), 8); world.setBlock(x + 8, y + 0, z + 24, ModBlocks.deco_steel, 0, 3); world.setBlock(x + 9, y + 0, z + 24, ModBlocks.deco_steel, 0, 3); world.setBlock(x + 10, y + 0, z + 24, Library.getRandomConcrete(), 0, 3); @@ -1607,7 +1607,7 @@ public class Radio01 extends WorldGenerator world.setBlock(x + 6, y + 4, z + 6, Blocks.air, 0, 3); world.setBlock(x + 7, y + 4, z + 6, Blocks.chest, 4, 3); world.setBlockMetadataWithNotify(x + 7, y + 4, z + 6, 5, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 7, y + 4, z + 6), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 7, y + 4, z + 6), 8); world.setBlock(x + 8, y + 4, z + 6, ModBlocks.deco_steel, 0, 3); world.setBlock(x + 9, y + 4, z + 6, ModBlocks.deco_steel, 0, 3); world.setBlock(x + 10, y + 4, z + 6, Library.getRandomConcrete(), 0, 3); @@ -1697,7 +1697,7 @@ public class Radio01 extends WorldGenerator world.setBlock(x + 3, y + 4, z + 14, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 4, y + 4, z + 14, Blocks.chest, 2, 3); world.setBlockMetadataWithNotify(x + 4, y + 4, z + 14, 5, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 4, y + 4, z + 14), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 4, y + 4, z + 14), 8); world.setBlock(x + 5, y + 4, z + 14, Blocks.air, 0, 3); world.setBlock(x + 6, y + 4, z + 14, ModBlocks.tape_recorder, 4, 3); world.setBlock(x + 7, y + 4, z + 14, Blocks.oak_stairs, 5, 3); @@ -2817,7 +2817,7 @@ public class Radio01 extends WorldGenerator WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 5, y + 8, z + 11), 16);*/ world.setBlock(x + 5, y + 8, z + 11, ModBlocks.crate_steel, 0, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityCrateSteel)world.getTileEntity(x + 5, y + 8, z + 11), 16); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityCrateSteel)world.getTileEntity(x + 5, y + 8, z + 11), 16); world.setBlock(x + 6, y + 8, z + 11, ModBlocks.deco_steel, 0, 3); world.setBlock(x + 7, y + 8, z + 11, Blocks.air, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Relay.java b/src/main/java/com/hbm/world/dungeon/Relay.java index 996713360..44d15b963 100644 --- a/src/main/java/com/hbm/world/dungeon/Relay.java +++ b/src/main/java/com/hbm/world/dungeon/Relay.java @@ -655,7 +655,7 @@ public class Relay extends WorldGenerator world.setBlock(x + 4, y + 0, z + 10, Blocks.brick_block, 0, 3); world.setBlock(x + 6, y + 0, z + 10, ModBlocks.crate_iron, 0, 3); world.setBlockMetadataWithNotify(x + 6, y + 0, z + 10, 3, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityCrateIron)world.getTileEntity(x + 6, y + 0, z + 10), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityCrateIron)world.getTileEntity(x + 6, y + 0, z + 10), 8); if(world.rand.nextInt(5) == 0) { ((TileEntityCrateIron)world.getTileEntity(x + 6, y + 0, z + 10)).setInventorySlotContents(11, new ItemStack(ModItems.morning_glory)); @@ -1292,7 +1292,7 @@ public class Relay extends WorldGenerator world.setBlock(x + 7, y + 14, z + 6, Block4, 2, 3); world.setBlock(x + 8, y + 14, z + 6, ModBlocks.crate_iron, 0, 3); world.setBlockMetadataWithNotify(x + 8, y + 14, z + 6, 3, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityCrateIron)world.getTileEntity(x + 8, y + 14, z + 6), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityCrateIron)world.getTileEntity(x + 8, y + 14, z + 6), 8); world.setBlock(x + 9, y + 14, z + 6, ModBlocks.fence_metal, 0, 3); world.setBlock(x + 10, y + 14, z + 6, Block6, 0, 3); world.setBlock(x + 9, y + 14, z + 7, ModBlocks.fence_metal, 0, 3); @@ -1512,7 +1512,7 @@ public class Relay extends WorldGenerator world.setBlock(x + 5, y + 32, z + 2, Block6, 0, 3); world.setBlock(x + 6, y + 32, z + 2, ModBlocks.crate_iron, 0, 3); world.setBlockMetadataWithNotify(x + 6, y + 32, z + 2, 2, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityCrateIron)world.getTileEntity(x + 6, y + 32, z + 2), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityCrateIron)world.getTileEntity(x + 6, y + 32, z + 2), 8); world.setBlock(x + 7, y + 32, z + 2, Block6, 0, 3); world.setBlock(x + 5, y + 32, z + 3, Block4, 3, 3); world.setBlock(x + 6, y + 32, z + 3, Block2, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Satellite.java b/src/main/java/com/hbm/world/dungeon/Satellite.java index f8d0647f4..784579797 100644 --- a/src/main/java/com/hbm/world/dungeon/Satellite.java +++ b/src/main/java/com/hbm/world/dungeon/Satellite.java @@ -972,7 +972,7 @@ public class Satellite extends WorldGenerator world.setBlock(x + 7, y + 14, z + 19, dSteel, 0, 3); world.setBlock(x + 10, y + 14, z + 19, Blocks.chest, 3, 3); world.setBlockMetadataWithNotify(x + 10, y + 14, z + 19, 3, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 10, y + 14, z + 19), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 10, y + 14, z + 19), 8); world.setBlock(x + 19, y + 14, z + 19, dSteel, 0, 3); world.setBlock(x + 20, y + 14, z + 19, dSteel, 0, 3); world.setBlock(x + 21, y + 14, z + 19, dSteel, 0, 3); @@ -1001,7 +1001,7 @@ public class Satellite extends WorldGenerator world.setBlock(x + 7, y + 14, z + 27, dSteel, 0, 3); world.setBlock(x + 16, y + 14, z + 27, Blocks.chest, 2, 3); world.setBlockMetadataWithNotify(x + 16, y + 14, z + 27, 3, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityChest)world.getTileEntity(x + 16, y + 14, z + 27), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(x + 16, y + 14, z + 27), 8); world.setBlock(x + 19, y + 14, z + 27, dSteel, 0, 3); world.setBlock(x + 5, y + 14, z + 28, ModBlocks.fence_metal, 0, 3); world.setBlock(x + 6, y + 14, z + 28, ModBlocks.fence_metal, 0, 3); @@ -1419,7 +1419,7 @@ public class Satellite extends WorldGenerator world.setBlock(x + 18, y + 19, z + 12, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 19, y + 19, z + 12, Blocks.chest, 4, 3); world.setBlockMetadataWithNotify(x + 19, y + 19, z + 12, 4, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 19, y + 19, z + 12), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest)world.getTileEntity(x + 19, y + 19, z + 12), 12); world.setBlock(x + 20, y + 19, z + 12, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 21, y + 19, z + 12, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 17, y + 19, z + 13, Library.getRandomConcrete(), 0, 3); @@ -2436,7 +2436,7 @@ public class Satellite extends WorldGenerator //world.setBlock(x + 5, y + 39, z + 12, Block7, 0, 3); world.setBlock(x + 5, y + 39, z + 12, Blocks.chest, 4, 3); world.setBlockMetadataWithNotify(x + 5, y + 39, z + 12, 4, 3); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 5, y + 39, z + 12), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest)world.getTileEntity(x + 5, y + 39, z + 12), 12); world.setBlock(x + 6, y + 39, z + 12, Block7, 0, 3); world.setBlock(x + 7, y + 39, z + 12, Block4, 0, 3); world.setBlock(x + 8, y + 39, z + 12, Block4, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Silo.java b/src/main/java/com/hbm/world/dungeon/Silo.java index 81ed05e93..5a96b2169 100644 --- a/src/main/java/com/hbm/world/dungeon/Silo.java +++ b/src/main/java/com/hbm/world/dungeon/Silo.java @@ -390,7 +390,7 @@ public class Silo extends WorldGenerator world.setBlockMetadataWithNotify(x + 19, y + -20, z + 10, 5, 3); if(world.getBlock(x + 19, y + -20, z + 10) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 19, y + -20, z + 10), rand.nextInt(2)+ 6); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest)world.getTileEntity(x + 19, y + -20, z + 10), rand.nextInt(2)+ 6); } world.setBlock(x + 20, y + -20, z + 10, Library.getRandomConcrete(), 0, 3); world.setBlock(x + 0, y + -20, z + 11, Library.getRandomConcrete(), 0, 3); @@ -858,7 +858,7 @@ public class Silo extends WorldGenerator world.setBlockMetadataWithNotify(x + 8, y + -17, z + 2, 3, 3); if(world.getBlock(x + 8, y + -17, z + 2) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(7), (TileEntityChest)world.getTileEntity(x + 8, y + -17, z + 2), rand.nextInt(2)+ 6); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.missile, (TileEntityChest)world.getTileEntity(x + 8, y + -17, z + 2), rand.nextInt(2)+ 6); } world.setBlock(x + 10, y + -17, z + 2, Blocks.air, 0, 3); world.setBlock(x + 11, y + -17, z + 2, Library.getRandomConcrete(), 0, 3); @@ -1642,7 +1642,7 @@ public class Silo extends WorldGenerator world.setBlockMetadataWithNotify(x + 8, y + -9, z + 5, 3, 3); if(world.getBlock(x + 8, y + -9, z + 5) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(1), (TileEntityChest)world.getTileEntity(x + 8, y + -9, z + 5), rand.nextInt(2)+ 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityChest)world.getTileEntity(x + 8, y + -9, z + 5), rand.nextInt(2)+ 8); } world.setBlock(x + 8, y + -10, z + 5, Blocks.stone_slab, 8, 3); world.setBlock(x + 9, y + -9, z + 5, Blocks.planks, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Spaceship.java b/src/main/java/com/hbm/world/dungeon/Spaceship.java index 6f04b3f41..c5f4cc5e2 100644 --- a/src/main/java/com/hbm/world/dungeon/Spaceship.java +++ b/src/main/java/com/hbm/world/dungeon/Spaceship.java @@ -455,7 +455,7 @@ public class Spaceship extends WorldGenerator world.setBlockMetadataWithNotify(x + 5, y + -2, z + 25, 5, 3); if(world.getBlock(x + 5, y + -2, z + 25) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(8), (TileEntityChest)world.getTileEntity(x + 5, y + -2, z + 25), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.spaceship, (TileEntityChest)world.getTileEntity(x + 5, y + -2, z + 25), 12); } world.setBlock(x + 6, y + -2, z + 25, Blocks.air, 0, 3); world.setBlock(x + 7, y + -2, z + 25, Blocks.air, 0, 3); @@ -463,7 +463,7 @@ public class Spaceship extends WorldGenerator world.setBlockMetadataWithNotify(x + 8, y + -2, z + 25, 4, 3); if(world.getBlock(x + 8, y + -2, z + 25) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(8), (TileEntityChest)world.getTileEntity(x + 8, y + -2, z + 25), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.spaceship, (TileEntityChest)world.getTileEntity(x + 8, y + -2, z + 25), 12); } world.setBlock(x + 9, y + -2, z + 25, Block3, 0, 3); world.setBlock(x + 10, y + -2, z + 25, Block2, 0, 3); @@ -477,7 +477,7 @@ public class Spaceship extends WorldGenerator world.setBlockMetadataWithNotify(x + 5, y + -2, z + 26, 5, 3); if(world.getBlock(x + 5, y + -2, z + 26) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(8), (TileEntityChest)world.getTileEntity(x + 5, y + -2, z + 26), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.spaceship, (TileEntityChest)world.getTileEntity(x + 5, y + -2, z + 26), 12); } world.setBlock(x + 6, y + -2, z + 26, Blocks.air, 0, 3); world.setBlock(x + 7, y + -2, z + 26, Blocks.air, 0, 3); @@ -485,7 +485,7 @@ public class Spaceship extends WorldGenerator world.setBlockMetadataWithNotify(x + 8, y + -2, z + 26, 4, 3); if(world.getBlock(x + 8, y + -2, z + 26) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(8), (TileEntityChest)world.getTileEntity(x + 8, y + -2, z + 26), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.spaceship, (TileEntityChest)world.getTileEntity(x + 8, y + -2, z + 26), 12); } world.setBlock(x + 9, y + -2, z + 26, Block3, 0, 3); world.setBlock(x + 10, y + -2, z + 26, Block3, 0, 3); @@ -623,7 +623,7 @@ public class Spaceship extends WorldGenerator world.setBlockMetadataWithNotify(x + 8, y + -2, z + 38, 2, 3); if(world.getBlock(x + 8, y + -2, z + 38) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 8, y + -2, z + 38), 12); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.expensive, (TileEntityChest)world.getTileEntity(x + 8, y + -2, z + 38), 12); } world.setBlock(x + 9, y + -2, z + 38, Block3, 0, 3); world.setBlock(x + 4, y + -2, z + 39, Block3, 0, 3); diff --git a/src/main/java/com/hbm/world/dungeon/Vertibird.java b/src/main/java/com/hbm/world/dungeon/Vertibird.java index 0daf81917..fd44ba091 100644 --- a/src/main/java/com/hbm/world/dungeon/Vertibird.java +++ b/src/main/java/com/hbm/world/dungeon/Vertibird.java @@ -143,7 +143,7 @@ public class Vertibird extends WorldGenerator world.setBlock(x + 14, y + 2 - yOffset, z + 7, Blocks.chest, 2, 3); if(world.getBlock(x + 14, y + 2 - yOffset, z + 7) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(6), (TileEntityChest)world.getTileEntity(x + 14, y + 2 - yOffset, z + 7), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vertibird, (TileEntityChest)world.getTileEntity(x + 14, y + 2 - yOffset, z + 7), 8); } world.setBlock(x + 15, y + 2 - yOffset, z + 7, Block2, 0, 3); world.setBlock(x + 12, y + 2 - yOffset, z + 8, Block2, 0, 3); @@ -393,7 +393,7 @@ public class Vertibird extends WorldGenerator world.setBlock(x + 13, y + 6 - yOffset, z + 6, Blocks.chest, 2, 3); if(world.getBlock(x + 13, y + 6 - yOffset, z + 6) == Blocks.chest) { - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(3), (TileEntityChest)world.getTileEntity(x + 13, y + 6 - yOffset, z + 6), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.vertibird, (TileEntityChest)world.getTileEntity(x + 13, y + 6 - yOffset, z + 6), 8); } world.setBlock(x + 14, y + 6 - yOffset, z + 6, Block2, 0, 3); world.setBlock(x + 15, y + 6 - yOffset, z + 6, Block2, 0, 3); diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 0421fef2c..945d02c35 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -36,19 +36,20 @@ public class ComponentNTMFeatures { /** Sandstone Ruin 1 */ public static class NTMHouse1 extends ComponentNTMFeatures.Feature { - private boolean hasPlacedChest = false; + private boolean hasPlacedChest; private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); /** Constructor for this feature; takes coordinates for bounding box */ protected NTMHouse1(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 9, 4, 6); + this.hasPlacedChest = false; } @Override protected void func_143012_a(NBTTagCompound nbt) { super.func_143012_a(nbt); - nbt.setBoolean("hasChest", hasPlacedChest); + nbt.setBoolean("hasChest", this.hasPlacedChest); } @Override @@ -118,7 +119,7 @@ public class ComponentNTMFeatures { //Loot/Sand this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 1, 0, 1, box); if(!this.hasPlacedChest) - this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.getLoot(1), rand.nextInt(2) + 8); //Make sure to redo that class kek + this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.modGeneric, rand.nextInt(2) + 8); //Make sure to redo that class kek this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); if(rand.nextFloat() <= 0.25) @@ -136,18 +137,20 @@ public class ComponentNTMFeatures { private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); - private boolean[] hasPlacedLoot = new boolean[]{false, false}; + private boolean[] hasPlacedLoot = new boolean[2]; /** Constructor for this feature; takes coordinates for bounding box */ protected NTMLab1(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 9, 4, 7); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; } @Override protected void func_143012_a(NBTTagCompound nbt) { super.func_143012_a(nbt); - nbt.setBoolean("hasLoot1", hasPlacedLoot[0]); - nbt.setBoolean("hasLoot2", hasPlacedLoot[1]); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); } @Override @@ -239,7 +242,7 @@ public class ComponentNTMFeatures { ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, featureSizeZ - 1), doorMeta, ModBlocks.door_office); int northDecoMeta = this.getMetadataForRotatableDeco(3); - this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_scaffold, northDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 1, featureSizeX - 1, featureSizeY - 1, 1, ModBlocks.steel_scaffold, westDecoMeta, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 5, featureSizeY - 1, 2, featureSizeX - 1, featureSizeY - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false); this.placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, northDecoMeta, 5, 1, 1, box); this.placeBlockAtCurrentPosition(world, ModBlocks.machine_microwave, northDecoMeta, 5, 2, 1, box); @@ -250,15 +253,15 @@ public class ComponentNTMFeatures { if(!hasPlacedLoot[0]) { this.placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 6, 2, 3, box); LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3)); - hasPlacedLoot[0] = true; + this.hasPlacedLoot[0] = true; } this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, featureSizeX - 1, 1, featureSizeZ - 2, box); if(!hasPlacedLoot[1]) { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 1, 1, featureSizeZ - 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(2), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, featureSizeZ - 1)), 8); - hasPlacedLoot[1] = true; + this.hasPlacedLoot[1] = true; } return true; @@ -271,17 +274,19 @@ public class ComponentNTMFeatures { private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); private static ComponentNTMFeatures.LabTiles RandomLabTiles = new ComponentNTMFeatures.LabTiles(); - private boolean[] hasPlacedLoot = new boolean[]{false, false}; + private boolean[] hasPlacedLoot = new boolean[2]; protected NTMLab2(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 12, 11, 8); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; } @Override protected void func_143012_a(NBTTagCompound nbt) { super.func_143012_a(nbt); - nbt.setBoolean("hasLoot1", hasPlacedLoot[0]); - nbt.setBoolean("hasLoot2", hasPlacedLoot[1]); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); } @Override @@ -428,9 +433,9 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, featureSizeZ - 2, box); if(!hasPlacedLoot[0]) { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 5, 1, featureSizeZ - 2, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(5), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(5, featureSizeZ - 2), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nuclearFuel, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(5, featureSizeZ - 2), this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 8); - hasPlacedLoot[0] = true; + this.hasPlacedLoot[0] = true; } this.fillWithBlocks(world, box, 4, 2, featureSizeZ - 2, 5, 2, featureSizeZ - 2, ModBlocks.crate_lead, Blocks.air, false); @@ -441,8 +446,9 @@ public class ComponentNTMFeatures { this.fillWithBlocks(world, box, featureSizeX - 4, 3, featureSizeZ - 2, featureSizeX - 2, 3, featureSizeZ - 2, ModBlocks.steel_roof, Blocks.air, false); if(!hasPlacedLoot[1]) { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 2, 1, 3, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.getLoot(4), (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 2, 3), - this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 2, 3)), 8); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nukeTrash, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 2, 3), + this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 2, 3)), 9); + this.hasPlacedLoot[1] = true; } return true; diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index efe81f2b5..697dec869 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -84,6 +84,9 @@ public class MapGenNTMFeatures extends MapGenStructure { public Start(World world, Random rand, int chunkX, int chunkZ) { super(chunkX, chunkZ); + //annoying predetermination angre + rand.setSeed((chunkX + chunkZ) * 31); + BiomeGenBase biomegenbase = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); int posY = world.getHeightValue(chunkX * 16 + 8, chunkZ * 16 + 8); if(posY == 0) @@ -99,7 +102,7 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); } else { - if(rand.nextInt(2) == 0) { + if(rand.nextBoolean()) { ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab2); } else { From bdef28d482e3fb2e957e9524566b732159dc5f9e Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 19 Apr 2022 19:51:30 -0700 Subject: [PATCH 07/18] mmmmmmm mmmmm mmmmmmmmmmmmmmmmmm mmmmmmmm mmmmmmmmmm mmmmmmmmmmmmmmmmmmm sandstone structure number 2 also why the hell can commit names be this long??? --- .../world/worldgen/ComponentNTMFeatures.java | 90 ++++++++++++++++++- .../hbm/world/worldgen/MapGenNTMFeatures.java | 3 - 2 files changed, 88 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 945d02c35..4c0164fe7 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -132,6 +132,91 @@ public class ComponentNTMFeatures { } + public static class NTMHouse2 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); + + protected NTMHouse2(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 15, 5, 9); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.print(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + this.fillWithAir(world, box, 1, 0, 1, 5, featureSizeY, featureSizeZ - 1); + + //House 1 + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 6, 1, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 2, 0, 1, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, 3, 2, 0, 3, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 4, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, 5, 2, 0, 6, 2, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 3, 0, 6, 3, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 3, featureSizeZ, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 6, 1, featureSizeZ, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 1, 2, featureSizeZ, 1, 2, featureSizeZ, false, rand, RandomSandstone); + this.fillWithBlocks(world, box, 2, 2, featureSizeZ, 4, 2, featureSizeZ, Blocks.fence, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 5, 2, featureSizeZ, 6, 2, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 1, 3, featureSizeZ, 6, 3, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 0, featureSizeZ - 1, 6, 3, featureSizeZ - 1, false, rand, RandomSandstone); //Right Wall + this.fillWithRandomizedBlocks(world, box, 6, 0, featureSizeZ - 2, 6, 0, featureSizeZ - 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 3, featureSizeZ - 2, 6, 3, featureSizeZ - 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, featureSizeZ - 3, false, rand, RandomSandstone); + + this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, featureSizeZ - 1, null, null, false); //Floor + this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 1, 1, 5, featureSizeY - 1, featureSizeZ - 1, false, rand, RandomSandstone); //Ceiling + this.fillWithMetadataBlocks(world, box, 0, featureSizeY - 1, 0, 0, featureSizeY - 1, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); //Roof + this.fillWithMetadataBlocks(world, box, 6, featureSizeY - 1, 0, 6, featureSizeY - 1, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, featureSizeY, 0, 4, featureSizeY, 0, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, featureSizeY, 1, 3, featureSizeY, 2, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, featureSizeY, 4, 3, featureSizeY, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 3, featureSizeY, featureSizeZ - 1, box); + this.fillWithMetadataBlocks(world, box, 2, featureSizeY, featureSizeZ, 4, featureSizeY, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + + //House 2 + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 0, featureSizeX, 0, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 1, 0, featureSizeX - 2, 1, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 0, featureSizeX - 6, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 6, 2, 0, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 3, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 1, featureSizeX - 6, 3, 1, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 2, featureSizeX - 6, 0, 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 3, 2, featureSizeX - 6, 3, featureSizeZ - 1, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX - 6, featureSizeY - 1, 2, box); + this.fillWithMetadataBlocks(world, box, featureSizeX - 6, featureSizeY - 1, 4, featureSizeX - 6, featureSizeY - 1, featureSizeZ - 2, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 3, featureSizeX - 6, 1, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 0, 2, featureSizeX - 6, 0, 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 3, featureSizeX - 6, 2, 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, featureSizeX - 6, 2, 4, box); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 5, featureSizeX - 6, 2, 5, false, rand, RandomSandstone); + this.fillWithBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 3, featureSizeX - 6, 2, featureSizeZ - 2, Blocks.fence, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 1, featureSizeX - 6, 1, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 2, featureSizeZ, featureSizeX - 5, 2, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 2, featureSizeZ, featureSizeX, 2, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomSandstone); //Right Wall + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 3, featureSizeX, 1, 3, false, rand, RandomSandstone); + this.fillWithMetadataBlocks(world, box, featureSizeX, 1, 4, featureSizeX, 1, 5, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, featureSizeZ - 1, featureSizeX, 1, featureSizeZ - 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, featureSizeX, 1, featureSizeZ - 1, box); + + this.fillWithBlocks(world, box, featureSizeX - 5, 0, 1, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor + + //Loot & Decorations + //House 1 + + + return true; + } + } + public static class NTMLab1 extends ComponentNTMFeatures.Feature { private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); @@ -476,10 +561,11 @@ public class ComponentNTMFeatures { switch(this.coordBaseMode) { case 2: //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ - 1, minY + maxY - 1, minZ + maxX - 1); + //-1 for the maxX, maxY, and maxZ box cstors, they might be unnecessary. + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); break; default: - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX - 1, minY + maxY - 1, minZ + maxZ - 1); + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); } } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 697dec869..8763529bb 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -84,9 +84,6 @@ public class MapGenNTMFeatures extends MapGenStructure { public Start(World world, Random rand, int chunkX, int chunkZ) { super(chunkX, chunkZ); - //annoying predetermination angre - rand.setSeed((chunkX + chunkZ) * 31); - BiomeGenBase biomegenbase = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); int posY = world.getHeightValue(chunkX * 16 + 8, chunkZ * 16 + 8); if(posY == 0) From c0fe1e74430a81c6439db49f88122ac0912a1919 Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 20 Apr 2022 09:51:13 -0700 Subject: [PATCH 08/18] lovely --- .../java/com/hbm/lib/HbmChestContents.java | 23 ++++++ .../world/worldgen/ComponentNTMFeatures.java | 76 ++++++++++++++++++- .../hbm/world/worldgen/MapGenNTMFeatures.java | 9 ++- 3 files changed, 102 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index b0b2411a2..9caafcea6 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -44,6 +44,28 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.canister_full, Fluids.BIOFUEL.getID(), 1, 2, 3), new WeightedRandomChestContent(ModItems.gas_mask_m65, 60, 1, 1, 2), new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 3) }; + + public static WeightedRandomChestContent[] machineParts = new WeightedRandomChestContent[] { + new WeightedRandomChestContent(ModItems.plate_steel, 0, 1, 5, 5), + new WeightedRandomChestContent(ModItems.hull_big_steel, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.hull_small_steel, 0, 1, 3, 3), + new WeightedRandomChestContent(ModItems.plate_polymer, 0, 1, 6, 5), + new WeightedRandomChestContent(ModItems.bolt_tungsten, 0, 1, 4, 3), + new WeightedRandomChestContent(ModItems.board_copper, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.coil_tungsten, 0, 1, 2, 5), + new WeightedRandomChestContent(ModItems.motor, 0, 1, 2, 4), + new WeightedRandomChestContent(ModItems.tank_steel, 0, 1, 2, 3), + new WeightedRandomChestContent(ModItems.coil_copper, 0, 1, 3, 4), + new WeightedRandomChestContent(ModItems.coil_copper_torus, 0, 1, 2, 3), + new WeightedRandomChestContent(ModItems.wire_red_copper, 0, 1, 8, 5), + new WeightedRandomChestContent(ModItems.piston_selenium, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.battery_advanced_cell, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.circuit_raw, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.circuit_aluminium, 0, 1, 2, 4), + new WeightedRandomChestContent(ModItems.circuit_copper, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.circuit_red_copper, 0, 1, 1, 2), + new WeightedRandomChestContent(ModItems.blade_titanium, 0, 1, 8, 1) + }; public static WeightedRandomChestContent[] antenna = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.twinkie, 0, 1, 3, 4), @@ -124,6 +146,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 1, 2) }; + //Expand to make it not seem as weird and limited public static WeightedRandomChestContent[] nuclearFuel = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.nugget_uranium, 0, 2, 12, 3), new WeightedRandomChestContent(ModItems.nugget_mox_fuel, 0, 2, 12, 3), diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 4c0164fe7..da9bafe19 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -3,6 +3,8 @@ package com.hbm.world.worldgen; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.blocks.generic.BlockBobble.BobbleType; +import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; import com.hbm.lib.HbmChestContents; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; import com.hbm.util.LootGenerator; @@ -12,6 +14,7 @@ import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; @@ -29,6 +32,7 @@ public class ComponentNTMFeatures { /** Register structures in MapGenStructureIO */ public static void registerNTMFeatures() { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse1.class, "NTMHouse1"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse2.class, "NTMHouse2"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab1.class, "NTMLab1"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab2.class, "NTMLab2"); } @@ -136,8 +140,26 @@ public class ComponentNTMFeatures { private static ComponentNTMFeatures.Sandstone RandomSandstone = new ComponentNTMFeatures.Sandstone(); + private boolean[] hasPlacedLoot = new boolean[2]; + protected NTMHouse2(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 15, 5, 9); + this.hasPlacedLoot[0] = false; + this.hasPlacedLoot[1] = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]); + nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1"); + this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2"); } @Override @@ -149,6 +171,18 @@ public class ComponentNTMFeatures { } System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + for(byte i = 0; i < 7; i++) { + for(byte j = 0; j < this.featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); + } + } + + for(byte i = 10; i < this.featureSizeX + 1; i++) { + for(byte j = 0; j < this.featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); + } + } + this.fillWithAir(world, box, 1, 0, 1, 5, featureSizeY, featureSizeZ - 1); //House 1 @@ -170,8 +204,9 @@ public class ComponentNTMFeatures { this.fillWithRandomizedBlocks(world, box, 6, 3, featureSizeZ - 2, 6, 3, featureSizeZ - 2, false, rand, RandomSandstone); this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, featureSizeZ - 3, false, rand, RandomSandstone); - this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, featureSizeZ - 1, null, null, false); //Floor - this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 1, 1, 5, featureSizeY - 1, featureSizeZ - 1, false, rand, RandomSandstone); //Ceiling + this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, featureSizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor + //this.fillWithRandomizedBlocks(world, box, 1, featureSizeY - 1, 0, 5, featureSizeY - 1, featureSizeZ, false, rand, RandomSandstone); //Ceiling + this.fillWithBlocks(world, box, 1, featureSizeY - 1, 0, 5, featureSizeY - 1, featureSizeZ, Blocks.sandstone, Blocks.air, false); this.fillWithMetadataBlocks(world, box, 0, featureSizeY - 1, 0, 0, featureSizeY - 1, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); //Roof this.fillWithMetadataBlocks(world, box, 6, featureSizeY - 1, 0, 6, featureSizeY - 1, featureSizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 2, featureSizeY, 0, 4, featureSizeY, 0, Blocks.stone_slab, 1, Blocks.air, 0, false); @@ -197,8 +232,8 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, featureSizeX - 6, 2, 4, box); this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, 5, featureSizeX - 6, 2, 5, false, rand, RandomSandstone); this.fillWithBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 3, featureSizeX - 6, 2, featureSizeZ - 2, Blocks.fence, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 1, featureSizeX - 6, 1, featureSizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 6, 2, featureSizeZ - 1, featureSizeX - 6, 2, featureSizeZ, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, false, rand, RandomSandstone); //Front Wall this.fillWithRandomizedBlocks(world, box, featureSizeX - 5, 2, featureSizeZ, featureSizeX - 5, 2, featureSizeZ, false, rand, RandomSandstone); this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 2, featureSizeZ, featureSizeX, 2, featureSizeZ, false, rand, RandomSandstone); this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomSandstone); //Right Wall @@ -211,7 +246,40 @@ public class ComponentNTMFeatures { //Loot & Decorations //House 1 + int eastMeta = this.getMetadataForRotatableDeco(4); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_boiler_off, 4, 1, 1, 1, box); + this.fillWithBlocks(world, box, 1, 2, 1, 1, 3, 1, ModBlocks.deco_pipe_quad_rusted, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, 0, 1, featureSizeY, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 2, 1, 3, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 1, 1, featureSizeZ - 4, box); + if(!hasPlacedLoot[0]) { + this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 1, 1, featureSizeZ - 2, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, featureSizeZ - 2), + this.getYWithOffset(1), this.getZWithOffset(1, featureSizeZ - 2)), 10); + this.hasPlacedLoot[0] = true; + } + this.fillWithBlocks(world, box, 4, 1, featureSizeZ - 1, 5, 1, featureSizeZ - 1, ModBlocks.crate, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 1, 4, 5, 3, 4, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, 1, 6, 5, 3, 6, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 1, 5, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 5, 2, 5, box); + //House 2 + if(!hasPlacedLoot[1]) { + this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), featureSizeX - 5, 1, 1, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(this.getXWithOffset(featureSizeX - 5, 1), + this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 5, 1)), 10); + this.hasPlacedLoot[1] = true; + } + this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureSizeX - 5, 1, 4, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(featureSizeX - 5, 4), this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 5, 4)); + + if(bobble != null) { + bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; + bobble.markDirty(); + } + + this.randomlyFillWithBlocks(world, box, rand, 0.25F, featureSizeX - 4, 1, 1, featureSizeX - 1, 1, featureSizeZ - 1, Blocks.sand, Blocks.air, false); return true; } diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index 8763529bb..f395e5ad0 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -96,8 +96,13 @@ public class MapGenNTMFeatures extends MapGenStructure { */ if(biomegenbase.temperature >= 1.2 && biomegenbase.rainfall == 0 && !(biomegenbase instanceof BiomeGenMesa)) { - ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(house1); + if(rand.nextBoolean()) { + ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(house1); + } else { + ComponentNTMFeatures.NTMHouse2 house2 = new ComponentNTMFeatures.NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(house2); + } } else { if(rand.nextBoolean()) { ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); From c70f4937b45a23136a679022dedfa1adcd079a1b Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 20 Apr 2022 17:47:58 -0700 Subject: [PATCH 09/18] a --- .../java/com/hbm/lib/HbmChestContents.java | 29 ++++++++++++------- .../world/worldgen/ComponentNTMFeatures.java | 8 ++--- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 9caafcea6..c0d2d003c 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -148,17 +148,24 @@ public class HbmChestContents { //Expand to make it not seem as weird and limited public static WeightedRandomChestContent[] nuclearFuel = new WeightedRandomChestContent[] { - new WeightedRandomChestContent(ModItems.nugget_uranium, 0, 2, 12, 3), - new WeightedRandomChestContent(ModItems.nugget_mox_fuel, 0, 2, 12, 3), - new WeightedRandomChestContent(ModItems.nugget_uranium_fuel, 0, 2, 12, 5), - new WeightedRandomChestContent(ModItems.nugget_plutonium_fuel, 0, 2, 12, 4), - new WeightedRandomChestContent(ModItems.nugget_thorium_fuel, 0, 2, 12, 3), - new WeightedRandomChestContent(ModItems.billet_ra226be, 0, 1, 1, 2), - new WeightedRandomChestContent(ModItems.rod_zirnox_empty, 0, 1, 3, 5), - new WeightedRandomChestContent(ModItems.pile_rod_uranium, 0, 2, 6, 4), - new WeightedRandomChestContent(ModItems.pile_rod_source, 0, 1, 2, 3), - new WeightedRandomChestContent(ModItems.reacher, 0, 1, 1, 4), - new WeightedRandomChestContent(ModItems.screwdriver, 0, 1, 1, 2) + new WeightedRandomChestContent(ModItems.billet_uranium, 0, 1, 4, 4), + new WeightedRandomChestContent(ModItems.billet_pu_mix, 0, 1, 2, 4), + new WeightedRandomChestContent(ModItems.billet_th232, 0, 1, 3, 3), + new WeightedRandomChestContent(ModItems.billet_uranium_fuel, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.billet_mox_fuel, 0, 1, 3, 5), + new WeightedRandomChestContent(ModItems.billet_plutonium_fuel, 0, 1, 3, 4), + new WeightedRandomChestContent(ModItems.billet_thorium_fuel, 0, 1, 3, 3), + new WeightedRandomChestContent(ModItems.billet_ra226be, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.billet_beryllium, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.nugget_u233, 0, 1, 2, 1), + new WeightedRandomChestContent(ModItems.nugget_u235, 0, 1, 2, 1), + new WeightedRandomChestContent(ModItems.nugget_pu239, 0, 1, 2, 1), + new WeightedRandomChestContent(ModItems.rod_zirnox_empty, 0, 1, 3, 3), + new WeightedRandomChestContent(ModItems.ingot_graphite, 0, 1, 4, 3), + new WeightedRandomChestContent(ModItems.pile_rod_uranium, 0, 2, 5, 3), + new WeightedRandomChestContent(ModItems.pile_rod_source, 0, 1, 2, 2), + new WeightedRandomChestContent(ModItems.reacher, 0, 1, 1, 3), + new WeightedRandomChestContent(ModItems.screwdriver, 0, 1, 1, 2), }; public static WeightedRandomChestContent[] nuclear = new WeightedRandomChestContent[] { diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index da9bafe19..c398afd5b 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -412,7 +412,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, featureSizeX - 1, 1, featureSizeZ - 2, box); if(!hasPlacedLoot[1]) { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 1, 1, featureSizeZ - 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, featureSizeZ - 1)), 8); this.hasPlacedLoot[1] = true; } @@ -582,15 +582,15 @@ public class ComponentNTMFeatures { this.fillWithMetadataBlocks(world, box, 3, 1, 2, 3, 3, 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 3, 1, 4, 3, 3, 4, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 3, 1, featureSizeZ - 2, 3, 3, featureSizeZ - 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 5, 1, 5, box); this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, featureSizeZ - 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 2, featureSizeZ - 2, box); if(!hasPlacedLoot[0]) { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 5, 1, featureSizeZ - 2, box); WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nuclearFuel, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(5, featureSizeZ - 2), - this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 8); + this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 11); this.hasPlacedLoot[0] = true; } - this.fillWithBlocks(world, box, 4, 2, featureSizeZ - 2, 5, 2, featureSizeZ - 2, ModBlocks.crate_lead, Blocks.air, false); + this.fillWithBlocks(world, box, 4, 1, featureSizeZ - 3, 5, 1, featureSizeZ - 3, ModBlocks.crate_lead, Blocks.air, false); this.fillWithBlocks(world, box, featureSizeX - 5, 1, featureSizeZ - 2, featureSizeX - 5, 3, featureSizeZ - 2, ModBlocks.deco_steel, Blocks.air, false);; this.fillWithMetadataBlocks(world, box, featureSizeX - 4, 1, featureSizeZ - 2, featureSizeX - 2, 1, featureSizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); From ab007b9ab6422898c24f99cbc45d7ea02d68b661 Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 20 Apr 2022 19:43:34 -0700 Subject: [PATCH 10/18] ar --- src/main/java/com/hbm/lib/HbmChestContents.java | 2 +- src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index c0d2d003c..d85406461 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -51,7 +51,7 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.hull_small_steel, 0, 1, 3, 3), new WeightedRandomChestContent(ModItems.plate_polymer, 0, 1, 6, 5), new WeightedRandomChestContent(ModItems.bolt_tungsten, 0, 1, 4, 3), - new WeightedRandomChestContent(ModItems.board_copper, 0, 1, 1, 4), + new WeightedRandomChestContent(ModItems.board_copper, 0, 1, 2, 4), new WeightedRandomChestContent(ModItems.coil_tungsten, 0, 1, 2, 5), new WeightedRandomChestContent(ModItems.motor, 0, 1, 2, 4), new WeightedRandomChestContent(ModItems.tank_steel, 0, 1, 2, 3), diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index c398afd5b..fe37a78ad 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -177,7 +177,7 @@ public class ComponentNTMFeatures { } } - for(byte i = 10; i < this.featureSizeX + 1; i++) { + for(byte i = 9; i < this.featureSizeX + 1; i++) { for(byte j = 0; j < this.featureSizeZ + 1; j++) { this.func_151554_b(world, Blocks.sandstone, 0, i, -1, j, box); } From 115431ae00f3c6fa13da409480fedb83f36b3cbe Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 21 Apr 2022 20:06:38 -0700 Subject: [PATCH 11/18] mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm yes, workshop --- .../hbm/blocks/generic/BlockUberConcrete.java | 4 +- .../world/worldgen/ComponentNTMFeatures.java | 164 +++++++++++++++++- .../hbm/world/worldgen/MapGenNTMFeatures.java | 13 +- 3 files changed, 173 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java b/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java index c98ec21d2..fafd66c64 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java +++ b/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java @@ -59,7 +59,7 @@ public class BlockUberConcrete extends BlockBase { if(rand.nextInt(meta + 1) > 0) return; - if(meta < 15) { + /*if(meta < 15) { world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); } else { world.setBlockToAir(x, y, z); @@ -86,6 +86,6 @@ public class BlockUberConcrete extends BlockBase { } world.setBlock(x, y, z, ModBlocks.concrete_super_broken); - } + }*/ } } diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index fe37a78ad..0b6533a58 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -35,6 +35,7 @@ public class ComponentNTMFeatures { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMHouse2.class, "NTMHouse2"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab1.class, "NTMLab1"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab2.class, "NTMLab2"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMWorkshop1.class, "NTMWorkshop1"); } /** Sandstone Ruin 1 */ @@ -587,7 +588,7 @@ public class ComponentNTMFeatures { if(!hasPlacedLoot[0]) { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 5, 1, featureSizeZ - 2, box); WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nuclearFuel, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(5, featureSizeZ - 2), - this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 11); + this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 10); this.hasPlacedLoot[0] = true; } this.fillWithBlocks(world, box, 4, 1, featureSizeZ - 3, 5, 1, featureSizeZ - 3, ModBlocks.crate_lead, Blocks.air, false); @@ -608,6 +609,165 @@ public class ComponentNTMFeatures { } } + public static class NTMWorkshop1 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.SuperConcrete RandomSuperConcrete = new ComponentNTMFeatures.SuperConcrete(); + + private boolean hasPlacedLoot; + + protected NTMWorkshop1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 10, 6, 8); + this.hasPlacedLoot = false; + } + + @Override + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setBoolean("hasLoot", this.hasPlacedLoot); + } + + @Override + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.hasPlacedLoot = nbt.getBoolean("hasLoot"); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.println(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + this.boundingBox.offset(0, -7, 0); + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 1; i < featureSizeX - 2; i++) { + for(byte j = 0; j < featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + for(byte i = 8; i < featureSizeX + 1; i++) { + for(byte j = 1; j < 7; j++) { + this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, box); + } + } + + this.fillWithAir(world, box, 1, 0, 0, featureSizeX - 3, featureSizeY - 1, featureSizeZ); + this.fillWithAir(world, box, featureSizeX - 2, 0, 2, featureSizeX - 1, 2, 5); + + if(this.getBlockAtCurrentPosition(world, 0, 0, 5, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, 0, 0, 5, box) == Blocks.air) { + int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 1); + this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairMeta, 0, 0, 5, box); + + for(byte i = 1; 1 < featureSizeZ; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); + } + + this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, featureSizeZ - 1, Blocks.stone_slab, 5, Blocks.air, 0, false); + } + + //Walls + int pillarMetaWE = this.getMetadataForRotatablePillar(4); + int pillarMetaNS = this.getMetadataForRotatablePillar(8); + this.fillWithBlocks(world, box, 1, 0, 0, 1, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 0, box); + this.fillWithMetadataBlocks(world, box, 2, 4, 0, featureSizeX - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, featureSizeX - 3, 4, 0, box); + this.fillWithBlocks(world, box, featureSizeX - 3, 0, 0, featureSizeX - 3, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 0, 0, featureSizeX - 4, 1, 0, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 2, 0, 2, 2, 0, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, 2, 0, 5, 2, 0, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, 2, 0, featureSizeX - 4, 2, 0, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 3, 0, featureSizeX - 4, 3, 0, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 1, 4, 1, 1, 4, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, featureSizeZ, box); + this.fillWithBlocks(world, box, 1, 0, featureSizeZ, 1, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 1, 1, 1, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 2, 1, 1, 2, 1, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 1, 2, 2, 1, 2, 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 2, 4, 1, 2, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 3, 1, 1, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ - 2, 1, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 2, 4, featureSizeZ, featureSizeX - 4, 4, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, featureSizeX - 3, 4, featureSizeZ, box); + this.fillWithBlocks(world, box, featureSizeX - 3, 0, featureSizeZ, featureSizeX - 3, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 0, featureSizeZ, featureSizeX - 4, 1, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 2, featureSizeZ, 2, 2, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, 2, featureSizeZ, 5, 2, featureSizeZ, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 4, 2, featureSizeZ, featureSizeX - 4, 2, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 3, featureSizeZ, featureSizeX - 4, 3, featureSizeZ, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, featureSizeX - 3, 4, 1, featureSizeX - 3, 4, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithRandomizedBlocks(world, box, featureSizeX - 3, 0, 1, featureSizeX - 3, 3, featureSizeZ - 1, false, rand, RandomSuperConcrete); + + pillarMetaWE = this.getMetadataForRotatablePillar(5); + pillarMetaNS = this.getMetadataForRotatablePillar(9); + this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 2, 1, featureSizeX - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall + this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 2, 1, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX, 2, 2, featureSizeX, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 2, 6, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 3, featureSizeX, 1, 5, Blocks.planks, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 2, 6, featureSizeX - 1, 2, 6, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 6, featureSizeX - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false); + + //Floor & Ceiling + this.fillWithBlocks(world, box, 2, 0, 2, 6, 0, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Floor + this.placeBlockAtCurrentPosition(world, ModBlocks.brick_light, 0, 1, 0, 5, box); + this.fillWithRandomizedBlocks(world, box, 2, 4, 1, 6, 4, 3, false, rand, RandomSuperConcrete); //Ceiling + this.fillWithRandomizedBlocks(world, box, 2, 4, 4, 2, 4, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 5, 4, 4, 6, 4, 4, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 4, featureSizeZ - 3, 6, 4, featureSizeZ - 1, false, rand, RandomSuperConcrete); + + this.fillWithBlocks(world, box, featureSizeX - 2, 2, 2, featureSizeX - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false); + + //Loot & Decorations + int southMeta = this.getMetadataForRotatableDeco(2); + int eastMeta = this.getMetadataForRotatableDeco(5); + this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, featureSizeY - 1, 1, box); + this.fillWithBlocks(world, box, 3, featureSizeY - 1, 1, 4, featureSizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 2, featureSizeY - 1, 2, 4, featureSizeY - 1, 2, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 2, featureSizeY, 1, 4, featureSizeY, 2, ModBlocks.steel_roof, Blocks.air, false); + this.fillWithBlocks(world, box, 2, 1, 1, 2, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 1, 1, 3, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_generator, 0, 4, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_detector, 0, 4, 1, 2, box); + this.fillWithBlocks(world, box, 5, 1, 1, 5, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false); + this.fillWithBlocks(world, box, 6, 1, 1, 6, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 1, 4, 4, 1, 4, ModBlocks.concrete_super_broken, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 6, 1, 4, 6, 3, 4, ModBlocks.steel_scaffold, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 6, 1, 5, 6, 1, 7, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.radiorec, eastMeta, 6, 2, featureSizeZ - 1, box); + this.fillWithMetadataBlocks(world, box, 2, 1, featureSizeZ - 1, 3, 1, featureSizeZ - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false); + if(!hasPlacedLoot) { + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 4, 1, featureSizeZ - 1, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(4, featureSizeZ - 1), + this.getYWithOffset(1), this.getZWithOffset(4, featureSizeZ - 1)), 11); + this.hasPlacedLoot = true; + } + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 5, 3, 1, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 2, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 2, 5, box); + + this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 5, featureSizeX - 1, 0, 5, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, southMeta, featureSizeX - 2, 1, 5, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), featureSizeX - 1, 1, 5, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(featureSizeX - 1, 5), this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, 5)); + + if(bobble != null) { + bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; + bobble.markDirty(); + } + this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 2, featureSizeX - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, featureSizeX - 2, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, featureSizeX - 2, 1, 2, box); + + return true; + } + } + abstract static class Feature extends StructureComponent { /** The size of the bounding box for this feature in the X axis */ protected int featureSizeX; @@ -682,7 +842,7 @@ public class ComponentNTMFeatures { /** * Gets metadata for rotatable pillars. - * @param metadata (First two digits is equal to block metadata, other two are equal to orientation + * @param metadata (First two digits are equal to block metadata, other two are equal to orientation * @return metadata adjusted for random orientation */ protected int getMetadataForRotatablePillar(int metadata) { diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index f395e5ad0..b49727dbb 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -84,7 +84,7 @@ public class MapGenNTMFeatures extends MapGenStructure { public Start(World world, Random rand, int chunkX, int chunkZ) { super(chunkX, chunkZ); - BiomeGenBase biomegenbase = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); + BiomeGenBase biome = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); int posY = world.getHeightValue(chunkX * 16 + 8, chunkZ * 16 + 8); if(posY == 0) posY = world.getTopSolidOrLiquidBlock(chunkX * 16 + 8, chunkZ * 16 + 8); @@ -95,7 +95,7 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ - if(biomegenbase.temperature >= 1.2 && biomegenbase.rainfall == 0 && !(biomegenbase instanceof BiomeGenMesa)) { + /*if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah if(rand.nextBoolean()) { ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); @@ -103,7 +103,12 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMHouse2 house2 = new ComponentNTMFeatures.NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house2); } - } else { + } else if(biome.temperature >= 0.2 && biome.temperature <= 0.4 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga + if(rand.nextBoolean()) {*/ + ComponentNTMFeatures.NTMWorkshop1 workshop1 = new ComponentNTMFeatures.NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(workshop1); + /*} + } else { //Everything else if(rand.nextBoolean()) { ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab2); @@ -111,7 +116,7 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMLab1 lab1 = new ComponentNTMFeatures.NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab1); } - } + }*/ this.updateBoundingBox(); } From d3fe07f0dfbd26fc15703ff0046781e87e4925b7 Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 21 Apr 2022 20:07:11 -0700 Subject: [PATCH 12/18] goddamn you --- src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java b/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java index fafd66c64..c98ec21d2 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java +++ b/src/main/java/com/hbm/blocks/generic/BlockUberConcrete.java @@ -59,7 +59,7 @@ public class BlockUberConcrete extends BlockBase { if(rand.nextInt(meta + 1) > 0) return; - /*if(meta < 15) { + if(meta < 15) { world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); } else { world.setBlockToAir(x, y, z); @@ -86,6 +86,6 @@ public class BlockUberConcrete extends BlockBase { } world.setBlock(x, y, z, ModBlocks.concrete_super_broken); - }*/ + } } } From 1a444c0b82646c1b2962f30967e48e16044e9379 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 22 Apr 2022 22:18:05 -0700 Subject: [PATCH 13/18] AAAAAAAAAAAAAAAAAA --- .../java/com/hbm/lib/HbmChestContents.java | 7 +- src/main/java/com/hbm/lib/HbmWorld.java | 4 +- .../world/worldgen/ComponentNTMFeatures.java | 256 ++++++++++++++++-- .../hbm/world/worldgen/MapGenNTMFeatures.java | 27 +- 4 files changed, 264 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index d85406461..0b5b3d295 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -146,7 +146,6 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.gas_mask_filter, 0, 1, 1, 5), new WeightedRandomChestContent(Item.getItemFromBlock(ModBlocks.yellow_barrel), 0, 1, 1, 2) }; - //Expand to make it not seem as weird and limited public static WeightedRandomChestContent[] nuclearFuel = new WeightedRandomChestContent[] { new WeightedRandomChestContent(ModItems.billet_uranium, 0, 1, 4, 4), new WeightedRandomChestContent(ModItems.billet_pu_mix, 0, 1, 2, 4), @@ -157,9 +156,9 @@ public class HbmChestContents { new WeightedRandomChestContent(ModItems.billet_thorium_fuel, 0, 1, 3, 3), new WeightedRandomChestContent(ModItems.billet_ra226be, 0, 1, 2, 2), new WeightedRandomChestContent(ModItems.billet_beryllium, 0, 1, 1, 1), - new WeightedRandomChestContent(ModItems.nugget_u233, 0, 1, 2, 1), - new WeightedRandomChestContent(ModItems.nugget_u235, 0, 1, 2, 1), - new WeightedRandomChestContent(ModItems.nugget_pu239, 0, 1, 2, 1), + new WeightedRandomChestContent(ModItems.nugget_u233, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.nugget_u235, 0, 1, 1, 1), + new WeightedRandomChestContent(ModItems.nugget_pu239, 0, 1, 1, 1), new WeightedRandomChestContent(ModItems.rod_zirnox_empty, 0, 1, 3, 3), new WeightedRandomChestContent(ModItems.ingot_graphite, 0, 1, 4, 3), new WeightedRandomChestContent(ModItems.pile_rod_uranium, 0, 2, 5, 3), diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index a446d0656..eb6556b39 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -24,8 +24,8 @@ public class HbmWorld { MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); ComponentNTMFeatures.registerNTMFeatures(); - //registerWorldGen(new HbmWorldGen(), 1); - registerWorldGen(new NTMWorldGenerator(), 1); + registerWorldGen(new HbmWorldGen(), 1); + registerWorldGen(new NTMWorldGenerator(), 1); //Ideally, move everything over from HbmWorldGen to NTMWorldGenerator //registerWorldGen(new WorldGenTest(), 1); } diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 0b6533a58..b8c5c6e87 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -6,6 +6,7 @@ import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; import com.hbm.lib.HbmChestContents; +import com.hbm.tileentity.machine.TileEntityLockableBase; import com.hbm.tileentity.machine.storage.TileEntityCrateIron; import com.hbm.util.LootGenerator; import com.hbm.world.worldgen.ComponentNTMFeatures.LabTiles; @@ -36,6 +37,9 @@ public class ComponentNTMFeatures { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab1.class, "NTMLab1"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMLab2.class, "NTMLab2"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMWorkshop1.class, "NTMWorkshop1"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin1.class, "NTMRuin1"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin2.class, "NTMRuin2"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin3.class, "NTMRuin3"); } /** Sandstone Ruin 1 */ @@ -124,7 +128,7 @@ public class ComponentNTMFeatures { //Loot/Sand this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 1, 0, 1, box); if(!this.hasPlacedChest) - this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.modGeneric, rand.nextInt(2) + 8); //Make sure to redo that class kek + this.hasPlacedChest = this.generateStructureChestContents(world, box, rand, 3, 0, 1, HbmChestContents.modGeneric, rand.nextInt(2) + 8); this.fillWithBlocks(world, box, 5, 0, 1, 6, 0, 1, ModBlocks.crate, Blocks.air, false); this.placeBlockAtCurrentPosition(world, Blocks.sand, 0, 7, 0, 1, box); if(rand.nextFloat() <= 0.25) @@ -412,10 +416,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, featureSizeX - 1, 1, featureSizeZ - 2, box); if(!hasPlacedLoot[1]) { - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 1, 1, featureSizeZ - 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.modGeneric, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 1, featureSizeZ - 1), - this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 1, featureSizeZ - 1)), 8); - this.hasPlacedLoot[1] = true; + this.hasPlacedLoot[1] = this.generateIronCrateContents(world, box, rand, featureSizeX - 1, 1, featureSizeZ - 1, HbmChestContents.modGeneric, 8); } return true; @@ -586,10 +587,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, featureSizeZ - 2, box); this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 2, featureSizeZ - 2, box); if(!hasPlacedLoot[0]) { - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 5, 1, featureSizeZ - 2, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nuclearFuel, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(5, featureSizeZ - 2), - this.getYWithOffset(1), this.getZWithOffset(5, featureSizeZ - 2)), 10); - this.hasPlacedLoot[0] = true; + this.hasPlacedLoot[0] = this.generateIronCrateContents(world, box, rand, 5, 1, featureSizeZ - 2, HbmChestContents.nuclearFuel, 10); } this.fillWithBlocks(world, box, 4, 1, featureSizeZ - 3, 5, 1, featureSizeZ - 3, ModBlocks.crate_lead, Blocks.air, false); @@ -599,10 +597,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, featureSizeX - 2, 2, featureSizeZ - 2, box); this.fillWithBlocks(world, box, featureSizeX - 4, 3, featureSizeZ - 2, featureSizeX - 2, 3, featureSizeZ - 2, ModBlocks.steel_roof, Blocks.air, false); if(!hasPlacedLoot[1]) { - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureSizeX - 2, 1, 3, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.nukeTrash, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(featureSizeX - 2, 3), - this.getYWithOffset(1), this.getZWithOffset(featureSizeX - 2, 3)), 9); - this.hasPlacedLoot[1] = true; + this.hasPlacedLoot[1] = this.generateIronCrateContents(world, box, rand, featureSizeX - 2, 1, 3, HbmChestContents.nukeTrash, 9); } return true; @@ -654,7 +649,7 @@ public class ComponentNTMFeatures { } } - this.fillWithAir(world, box, 1, 0, 0, featureSizeX - 3, featureSizeY - 1, featureSizeZ); + this.fillWithAir(world, box, 1, 0, 0, featureSizeX - 3, featureSizeY - 2, featureSizeZ); this.fillWithAir(world, box, featureSizeX - 2, 0, 2, featureSizeX - 1, 2, 5); if(this.getBlockAtCurrentPosition(world, 0, 0, 5, box).getMaterial().isReplaceable() @@ -706,6 +701,7 @@ public class ComponentNTMFeatures { pillarMetaNS = this.getMetadataForRotatablePillar(9); this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 2, 1, featureSizeX - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 2, 1, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 1, featureSizeX - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, featureSizeX, 2, 2, featureSizeX, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 2, 6, Blocks.log, 1, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, featureSizeX, 0, 3, featureSizeX, 1, 5, Blocks.planks, 1, Blocks.air, 0, false); @@ -741,10 +737,7 @@ public class ComponentNTMFeatures { this.placeBlockAtCurrentPosition(world, ModBlocks.radiorec, eastMeta, 6, 2, featureSizeZ - 1, box); this.fillWithMetadataBlocks(world, box, 2, 1, featureSizeZ - 1, 3, 1, featureSizeZ - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false); if(!hasPlacedLoot) { - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, 4, 1, featureSizeZ - 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityCrateIron)world.getTileEntity(this.getXWithOffset(4, featureSizeZ - 1), - this.getYWithOffset(1), this.getZWithOffset(4, featureSizeZ - 1)), 11); - this.hasPlacedLoot = true; + this.hasPlacedLoot = this.generateIronCrateContents(world, box, rand, 4, 1, featureSizeZ - 1, HbmChestContents.machineParts, 11); } this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 5, 3, 1, box); this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 2, 1, 2, box); @@ -762,12 +755,204 @@ public class ComponentNTMFeatures { } this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 2, featureSizeX - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false); this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, featureSizeX - 2, 1, 2, box); - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, featureSizeX - 2, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, featureSizeX - 2, 1, 3, box); return true; } } + public static class NTMRuin1 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); + + protected NTMRuin1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 8, 6, 10); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.println(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < featureSizeX + 1; i++) { + for(byte j = 0; j < featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + int pillarMetaWE = this.getMetadataForRotatablePillar(4); + int pillarMetaNS = this.getMetadataForRotatablePillar(8); + + this.fillWithBlocks(world, box, 0, 0, 0, 0, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithMetadataBlocks(world, box, 1, 3, 0, 3, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 4, 0, 0, 4, featureSizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 3, 0, featureSizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, featureSizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 3, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 0, featureSizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 3, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 0, 5, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX - 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 4, 0, 3, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 4, 0, featureSizeX - 1, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.fillWithBlocks(world, box, 0, 0, featureSizeZ, 0, featureSizeY - 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 2, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 2, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, featureSizeZ - 2, 0, 2, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 4, 1, 0, 4, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 5, 1, 0, 5, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 4, featureSizeZ - 2, 0, 4, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 1, 3, featureSizeZ, 3, 3, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithBlocks(world, box, 4, 0, featureSizeZ, 4, featureSizeY - 2, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 3, featureSizeZ, featureSizeX - 1, 3, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, featureSizeY - 2, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 3, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, featureSizeZ, 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, featureSizeZ, 3, 2, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, featureSizeZ, 5, 2, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, featureSizeZ, featureSizeX - 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, featureSizeX, 3, 1, featureSizeX, 3, 2, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithMetadataBlocks(world, box, featureSizeX, 3, featureSizeZ - 1, featureSizeX, 3, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 1, featureSizeX, 2, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, featureSizeZ - 2, featureSizeX, 1, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 2, featureSizeZ - 1, featureSizeX, 2, featureSizeZ - 1, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + + public static class NTMRuin2 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); + + protected NTMRuin2(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 7, 5, 10); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.println(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < featureSizeX + 1; i++) { + for(byte j = 0; j < featureSizeZ + 1; j++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, j, box); + } + } + + int pillarMetaWE = this.getMetadataForRotatablePillar(4); + int pillarMetaNS = this.getMetadataForRotatablePillar(8); + + this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithMetadataBlocks(world, box, 1, 3, 0, featureSizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, featureSizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, 0, 4, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX - 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 4, 0, featureSizeX - 1, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, featureSizeY, 0, featureSizeX - 1, featureSizeY, 0, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.fillWithBlocks(world, box, 0, 0, 5, 0, 0, 5, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 0, 0, featureSizeZ, 0, 2, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 2, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, featureSizeZ - 3, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, featureSizeZ - 1, 0, 1, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, featureSizeX - 1, 3, featureSizeZ, featureSizeX - 1, 3, featureSizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 3, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, featureSizeZ, 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, featureSizeZ, featureSizeX - 1, 2, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, featureSizeX, 3, 1, featureSizeX, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 4, 5, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, featureSizeX, 3, featureSizeZ - 2, featureSizeX, 3, featureSizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 1, featureSizeX, 2, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 3, featureSizeX, 2, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 4, featureSizeX, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 6, featureSizeX, 1, 7, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, featureSizeZ - 1, featureSizeX, 2, featureSizeZ - 1, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + + public static class NTMRuin3 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); + + protected NTMRuin3(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 8, 3, 10); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + System.out.println(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < featureSizeZ + 1; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); + this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeZ, -1, i, box); + } + + for(byte i = 1; i < featureSizeX; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, 0, box); + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, 4, box); + } + + this.fillWithBlocks(world, box, 0, 0, 0, 0, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, featureSizeX, 0, 0, featureSizeX, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, featureSizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 0, 1, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 1, 0, 4, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 1, 0, featureSizeX - 1, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 2, 0, featureSizeX - 2, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 0, 0, 4, 0, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Left Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 0, 0, featureSizeZ, box); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 5, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 5, 0, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 7, 0, 1, 7, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, featureSizeX, 0, 4, featureSizeX, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall + this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 1, featureSizeX, 1, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 0, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, featureSizeZ - 1, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 4, 0, 4, 4, 2, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Center Wall + this.fillWithRandomizedBlocks(world, box, 3, 0, 4, 3, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 4, featureSizeX - 1, 1, 4, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, featureSizeX - 1, 0, 3, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } + } + abstract static class Feature extends StructureComponent { /** The size of the bounding box for this feature in the X axis */ protected int featureSizeX; @@ -786,11 +971,22 @@ public class ComponentNTMFeatures { this.featureSizeZ = maxZ; this.coordBaseMode = rand.nextInt(4); + //What the fuck is going on here? Why are the structures just randomly cut off? + //This might fix it, no fuckin clue switch(this.coordBaseMode) { + case 0: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + break; + case 1: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); + break; case 2: //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. //-1 for the maxX, maxY, and maxZ box cstors, they might be unnecessary. - this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxZ, minY + maxY, minZ + maxX); + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); + break; + case 3: + this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); break; default: this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); @@ -929,6 +1125,26 @@ public class ComponentNTMFeatures { } return 0; } + + /** + * it feels disgusting to make a method with this many parameters but fuck it, it's easier + * @return iron crate with generated content + */ + protected boolean generateIronCrateContents(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ, WeightedRandomChestContent[] content, int amount) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_iron, 0, featureX, featureY, featureZ, box); + TileEntityCrateIron crate = (TileEntityCrateIron)world.getTileEntity(posX, posY, posZ); + + if(crate != null) { + WeightedRandomChestContent.generateChestContents(rand, content, crate, posZ); + return true; + } + + return false; + } } //Block Selectors diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index b49727dbb..c6ed9619c 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -95,7 +95,26 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ - /*if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah + //if(rand.nextBoolean()) { //Empty Ruin Structures + switch(rand.nextInt(3)) { + case 0: + ComponentNTMFeatures.NTMRuin1 ruin1 = new ComponentNTMFeatures.NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(ruin1); + break; + case 1: + ComponentNTMFeatures.NTMRuin2 ruin2 = new ComponentNTMFeatures.NTMRuin2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(ruin2); + break; + case 2: + ComponentNTMFeatures.NTMRuin3 ruin3 = new ComponentNTMFeatures.NTMRuin3(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(ruin3); + break; + } + /*case 3: + + }*/ + + /*} else if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah if(rand.nextBoolean()) { ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); @@ -103,11 +122,11 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMHouse2 house2 = new ComponentNTMFeatures.NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house2); } - } else if(biome.temperature >= 0.2 && biome.temperature <= 0.4 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga - if(rand.nextBoolean()) {*/ + } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9) { //Taiga & Mega Taiga + if(rand.nextBoolean()) { ComponentNTMFeatures.NTMWorkshop1 workshop1 = new ComponentNTMFeatures.NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(workshop1); - /*} + } } else { //Everything else if(rand.nextBoolean()) { ComponentNTMFeatures.NTMLab2 lab2 = new ComponentNTMFeatures.NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); From ad504471c86eda4e5547b416d8a50ec6a899c8b9 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 23 Apr 2022 14:28:41 -0700 Subject: [PATCH 14/18] merci --- .../world/worldgen/ComponentNTMFeatures.java | 101 ++++++++++++++---- .../hbm/world/worldgen/MapGenNTMFeatures.java | 19 ++-- 2 files changed, 92 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index b8c5c6e87..68981c684 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -12,6 +12,7 @@ import com.hbm.util.LootGenerator; import com.hbm.world.worldgen.ComponentNTMFeatures.LabTiles; import net.minecraft.block.Block; +import net.minecraft.block.BlockSandStone; import net.minecraft.init.Blocks; import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; @@ -40,6 +41,7 @@ public class ComponentNTMFeatures { MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin1.class, "NTMRuin1"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin2.class, "NTMRuin2"); MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin3.class, "NTMRuin3"); + MapGenStructureIO.func_143031_a(ComponentNTMFeatures.NTMRuin4.class, "NTMRuin4"); } /** Sandstone Ruin 1 */ @@ -90,11 +92,11 @@ public class ComponentNTMFeatures { * this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace); */ - System.out.print(this.coordBaseMode); + //System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < this.featureSizeX + 1; i++) { for(byte j = 0; j < this.featureSizeZ + 1; j++) { @@ -170,11 +172,11 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.print(this.coordBaseMode); + //System.out.print(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < 7; i++) { for(byte j = 0; j < this.featureSizeZ + 1; j++) { @@ -321,11 +323,11 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println(this.coordBaseMode); + //System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < this.featureSizeX + 1; i++) { for(byte j = 0; j < this.featureSizeZ - 1; j++) { @@ -454,12 +456,12 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println(this.coordBaseMode); + //System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } this.boundingBox.offset(0, -7, 0); - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < featureSizeX + 1; i++) { for(byte j = 0; j < featureSizeZ - 1; j++) { @@ -630,12 +632,11 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println(this.coordBaseMode); + ////System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - this.boundingBox.offset(0, -7, 0); - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 1; i < featureSizeX - 2; i++) { for(byte j = 0; j < featureSizeZ + 1; j++) { @@ -709,7 +710,7 @@ public class ComponentNTMFeatures { this.fillWithMetadataBlocks(world, box, featureSizeX - 2, 0, 6, featureSizeX - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false); //Floor & Ceiling - this.fillWithBlocks(world, box, 2, 0, 2, 6, 0, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Floor + this.fillWithBlocks(world, box, 2, 0, 1, 6, 0, featureSizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Floor this.placeBlockAtCurrentPosition(world, ModBlocks.brick_light, 0, 1, 0, 5, box); this.fillWithRandomizedBlocks(world, box, 2, 4, 1, 6, 4, 3, false, rand, RandomSuperConcrete); //Ceiling this.fillWithRandomizedBlocks(world, box, 2, 4, 4, 2, 4, 4, false, rand, RandomSuperConcrete); @@ -772,11 +773,11 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println(this.coordBaseMode); + //System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < featureSizeX + 1; i++) { for(byte j = 0; j < featureSizeZ + 1; j++) { @@ -844,11 +845,11 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println(this.coordBaseMode); + //System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < featureSizeX + 1; i++) { for(byte j = 0; j < featureSizeZ + 1; j++) { @@ -907,15 +908,15 @@ public class ComponentNTMFeatures { @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - System.out.println(this.coordBaseMode); + //System.out.println(this.coordBaseMode); if(!this.func_74935_a(world, box, this.boundingBox.minY)) { return false; } - System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); for(byte i = 0; i < featureSizeZ + 1; i++) { this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); - this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeZ, -1, i, box); + this.func_151554_b(world, Blocks.stonebrick, 0, featureSizeX, -1, i, box); } for(byte i = 1; i < featureSizeX; i++) { @@ -953,6 +954,64 @@ public class ComponentNTMFeatures { } } + public static class NTMRuin4 extends ComponentNTMFeatures.Feature { + + private static ComponentNTMFeatures.ConcreteBricks RandomConcreteBricks = new ComponentNTMFeatures.ConcreteBricks(); + + protected NTMRuin4(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 10, 2, 11); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + //System.out.println(this.coordBaseMode); + if(!this.func_74935_a(world, box, this.boundingBox.minY)) { + return false; + } + //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); + + for(byte i = 0; i < featureSizeZ + 1; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); + this.func_151554_b(world, Blocks.stonebrick, 0, i >= 5 ? featureSizeZ : 5, -1, i, box); //elegant solution + } + + for(byte i = 1; i < featureSizeX; i++) { + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, featureSizeZ, box); + this.func_151554_b(world, Blocks.stonebrick, 0, i, -1, i > 4 ? 5 : 0, box); //ternary operators my beloved + } + + this.fillWithBlocks(world, box, 0, 0, 0, 0, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 1 + this.fillWithBlocks(world, box, 5, 0, 0, 5, featureSizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 4, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 1, 0, 4, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 5, 0, 5, 5, featureSizeY, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 1 + this.fillWithRandomizedBlocks(world, box, 5, 0, 1, 5, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 1, 5, 1, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 4, 5, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 2, 1, 5, 2, 4, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 1, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 6, 0, 5, featureSizeX - 1, 0, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 6, 1, 5, 6, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 5, featureSizeX, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 6, featureSizeX, 1, featureSizeZ - 3, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 0, 0, featureSizeZ, 0, 0, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Front Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, featureSizeZ, 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 6, 0, featureSizeZ, 7, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX - 1, 0, featureSizeZ, featureSizeX - 1, 0, featureSizeZ, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); //Left Wall + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 1, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 1, 7, false, rand, RandomConcreteBricks); + + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 4, 0, 5, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 6, featureSizeX - 1, 0, featureSizeZ - 1, Blocks.gravel, Blocks.air, false); + + return true; + } +} + abstract static class Feature extends StructureComponent { /** The size of the bounding box for this feature in the X axis */ protected int featureSizeX; @@ -1179,9 +1238,9 @@ public class ComponentNTMFeatures { if(chance < 0.2F) { this.field_151562_a = ModBlocks.brick_concrete; - } else if (chance < 0.5F) { + } else if (chance < 0.55F) { this.field_151562_a = ModBlocks.brick_concrete_mossy; - } else if (chance < 0.8F) { + } else if (chance < 0.75F) { this.field_151562_a = ModBlocks.brick_concrete_cracked; } else { this.field_151562_a = ModBlocks.brick_concrete_broken; diff --git a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java index c6ed9619c..e63794cca 100644 --- a/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/MapGenNTMFeatures.java @@ -5,6 +5,8 @@ import java.util.Iterator; import java.util.List; import java.util.Random; +import com.hbm.config.GeneralConfig; + import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenMesa; @@ -95,8 +97,8 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ - //if(rand.nextBoolean()) { //Empty Ruin Structures - switch(rand.nextInt(3)) { + if(rand.nextBoolean()) { //Empty Ruin Structures + switch(rand.nextInt(4)) { case 0: ComponentNTMFeatures.NTMRuin1 ruin1 = new ComponentNTMFeatures.NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(ruin1); @@ -109,12 +111,12 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMRuin3 ruin3 = new ComponentNTMFeatures.NTMRuin3(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(ruin3); break; + case 3: + ComponentNTMFeatures.NTMRuin4 ruin4 = new ComponentNTMFeatures.NTMRuin4(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + this.components.add(ruin4); } - /*case 3: - - }*/ - /*} else if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah + } else if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah if(rand.nextBoolean()) { ComponentNTMFeatures.NTMHouse1 house1 = new ComponentNTMFeatures.NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(house1); @@ -135,7 +137,10 @@ public class MapGenNTMFeatures extends MapGenStructure { ComponentNTMFeatures.NTMLab1 lab1 = new ComponentNTMFeatures.NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(lab1); } - }*/ + } + + if(GeneralConfig.enableDebugMode) + System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + posY + ", " + (chunkZ * 16 + 8) + "\n"); this.updateBoundingBox(); } From cd7650fdda35e649b987e443865c53a5b9ada75b Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 23 Apr 2022 14:32:50 -0700 Subject: [PATCH 15/18] a --- .../java/com/hbm/world/worldgen/ComponentNTMFeatures.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index 68981c684..cd14d91fa 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -1030,8 +1030,6 @@ public class ComponentNTMFeatures { this.featureSizeZ = maxZ; this.coordBaseMode = rand.nextInt(4); - //What the fuck is going on here? Why are the structures just randomly cut off? - //This might fix it, no fuckin clue switch(this.coordBaseMode) { case 0: this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); @@ -1041,7 +1039,6 @@ public class ComponentNTMFeatures { break; case 2: //North (2) and East (3) will result in mirrored structures. Not an issue, but keep in mind. - //-1 for the maxX, maxY, and maxZ box cstors, they might be unnecessary. this.boundingBox = new StructureBoundingBox(minX, minY, minZ, minX + maxX, minY + maxY, minZ + maxZ); break; case 3: @@ -1070,8 +1067,6 @@ public class ComponentNTMFeatures { } protected boolean func_74935_a(World world, StructureBoundingBox box, int y) { - //System.out.println("original: " + hpos); - //System.out.println(y); int j = 0; int k = 0; @@ -1090,8 +1085,6 @@ public class ComponentNTMFeatures { this.hpos = j / k; this.boundingBox.offset(0, this.hpos - this.boundingBox.minY, 0); - //System.out.println("new: " + hpos); - //System.out.println(y); return true; } From 0ba3b93e56838b6df4d0ca91bf7c7f69c5e392e1 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 23 Apr 2022 20:11:53 -0700 Subject: [PATCH 16/18] argh --- .../java/com/hbm/hazard/HazardRegistry.java | 5 +++ .../hbm/inventory/recipes/SILEXRecipes.java | 35 +------------------ src/main/java/com/hbm/items/ModItems.java | 17 ++++++--- .../com/hbm/items/machine/ItemRBMKPellet.java | 17 ++++++--- .../com/hbm/items/machine/ItemRBMKRod.java | 6 ++++ 5 files changed, 36 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/hbm/hazard/HazardRegistry.java b/src/main/java/com/hbm/hazard/HazardRegistry.java index dd8962f13..6f672cf45 100644 --- a/src/main/java/com/hbm/hazard/HazardRegistry.java +++ b/src/main/java/com/hbm/hazard/HazardRegistry.java @@ -5,6 +5,7 @@ import static com.hbm.items.ModItems.*; import static com.hbm.inventory.OreDictManager.*; import com.hbm.blocks.ModBlocks; +import com.hbm.config.GeneralConfig; import com.hbm.hazard.modifier.*; import com.hbm.hazard.transformer.*; import com.hbm.hazard.type.*; @@ -333,6 +334,10 @@ public class HazardRegistry { registerRTGPellet(pellet_rtg_americium, am241 * rtg, 0); HazardSystem.register(new ItemStack(pellet_rtg_depleted, 1, DepletedRTGMaterial.NEPTUNIUM.ordinal()), makeData(RADIATION, np237 * rtg)); + HazardSystem.register(pile_rod_uranium, makeData(RADIATION, u * billet * 3)); + HazardSystem.register(pile_rod_plutonium, makeData(RADIATION, !GeneralConfig.enable528 ? purg * billet * 3 : purg * billet * 2 + wst * billet)); + HazardSystem.register(pile_rod_source, makeData(RADIATION, rabe * billet * 3)); + registerBreedingRodRadiation(BreedingRodType.TRITIUM, 0.001F); registerBreedingRodRadiation(BreedingRodType.CO60, co60); registerBreedingRodRadiation(BreedingRodType.RA226, ra226); diff --git a/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java b/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java index 2b21c3bb8..82d9708b6 100644 --- a/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/SILEXRecipes.java @@ -247,21 +247,11 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 90 - i * 20)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i + 5), new SILEXRecipe(400, 100, 3) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 89 - i * 20)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i)) ); - // FLASHGOLD // recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 90 - 20 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 10 + 20 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i + 5), new SILEXRecipe(600, 100, 2) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 89 - 20 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 10 + 20 * i)) ); - // FLASHLEAD // recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i), new SILEXRecipe(600, 100, 2) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 44 - 10 * i)) @@ -270,14 +260,6 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mercury), 1 + 6 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i)) ); //Reimumunch - recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i + 5), new SILEXRecipe(600, 100, 2) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 2)) //literal how - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 43 - 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 43 - 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 1 + 6 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mercury), 1 + 6 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i)) ); - // POBE // recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 45 - 10 * i)) @@ -285,13 +267,6 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 5 + 10 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i + 5), new SILEXRecipe(600, 100, 1) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 44 - 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 5 + 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - // PUBE // recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i), new SILEXRecipe(600, 100, 1) .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 45 - 10 * i)) @@ -316,15 +291,7 @@ public class SILEXRecipes { .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 2 + 5 * i)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i + 5), new SILEXRecipe(600, 100, 1) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_ra226), 44 - 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 3 + 5 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 2 + 5 * i)) - .addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) ); - - // FLASHGOLD // + // DRX // recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i), new SILEXRecipe(600, 100, 4) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) .addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index d7a767f00..75c02bbfa 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -3630,12 +3630,12 @@ public class ModItems { rbmk_pellet_hes = (ItemRBMKPellet) new ItemRBMKPellet("Highly Enriched Schrabidium-326").setUnlocalizedName("rbmk_pellet_hes").setTextureName(RefStrings.MODID + ":rbmk_pellet_hes"); rbmk_pellet_leaus = (ItemRBMKPellet) new ItemRBMKPellet("Low Enriched Australium (Tasmanite)").setUnlocalizedName("rbmk_pellet_leaus").setTextureName(RefStrings.MODID + ":rbmk_pellet_leaus"); rbmk_pellet_heaus = (ItemRBMKPellet) new ItemRBMKPellet("Highly Enriched Australium (Ayerite)").setUnlocalizedName("rbmk_pellet_heaus").setTextureName(RefStrings.MODID + ":rbmk_pellet_heaus"); - rbmk_pellet_po210be = (ItemRBMKPellet) new ItemRBMKPellet("Polonium-210 & Beryllium Neutron Source").setUnlocalizedName("rbmk_pellet_po210be").setTextureName(RefStrings.MODID + ":rbmk_pellet_po210be"); - rbmk_pellet_ra226be = (ItemRBMKPellet) new ItemRBMKPellet("Radium-226 & Beryllium Neutron Source").setUnlocalizedName("rbmk_pellet_ra226be").setTextureName(RefStrings.MODID + ":rbmk_pellet_ra226be"); + rbmk_pellet_po210be = (ItemRBMKPellet) new ItemRBMKPellet("Polonium-210 & Beryllium Neutron Source").disableXenon().setUnlocalizedName("rbmk_pellet_po210be").setTextureName(RefStrings.MODID + ":rbmk_pellet_po210be"); + rbmk_pellet_ra226be = (ItemRBMKPellet) new ItemRBMKPellet("Radium-226 & Beryllium Neutron Source").disableXenon().setUnlocalizedName("rbmk_pellet_ra226be").setTextureName(RefStrings.MODID + ":rbmk_pellet_ra226be"); rbmk_pellet_pu238be = (ItemRBMKPellet) new ItemRBMKPellet("Plutonium-238 & Beryllium Neutron Source").setUnlocalizedName("rbmk_pellet_pu238be").setTextureName(RefStrings.MODID + ":rbmk_pellet_pu238be"); - rbmk_pellet_balefire_gold = (ItemRBMKPellet) new ItemRBMKPellet("Antihydrogen in a Magnetized Gold-198 Lattice").setUnlocalizedName("rbmk_pellet_balefire_gold").setTextureName(RefStrings.MODID + ":rbmk_pellet_balefire_gold"); - rbmk_pellet_flashlead = (ItemRBMKPellet) new ItemRBMKPellet("Antihydrogen confined by a Magnetized Gold-198 and Lead-209 Lattice").setUnlocalizedName("rbmk_pellet_flashlead").setTextureName(RefStrings.MODID + ":rbmk_pellet_flashlead"); - rbmk_pellet_balefire = (ItemRBMKPellet) new ItemRBMKPellet("Draconic Flames").setUnlocalizedName("rbmk_pellet_balefire").setTextureName(RefStrings.MODID + ":rbmk_pellet_balefire"); + rbmk_pellet_balefire_gold = (ItemRBMKPellet) new ItemRBMKPellet("Antihydrogen in a Magnetized Gold-198 Lattice").disableXenon().setUnlocalizedName("rbmk_pellet_balefire_gold").setTextureName(RefStrings.MODID + ":rbmk_pellet_balefire_gold"); + rbmk_pellet_flashlead = (ItemRBMKPellet) new ItemRBMKPellet("Antihydrogen confined by a Magnetized Gold-198 and Lead-209 Lattice").disableXenon().setUnlocalizedName("rbmk_pellet_flashlead").setTextureName(RefStrings.MODID + ":rbmk_pellet_flashlead"); + rbmk_pellet_balefire = (ItemRBMKPellet) new ItemRBMKPellet("Draconic Flames").disableXenon().setUnlocalizedName("rbmk_pellet_balefire").setTextureName(RefStrings.MODID + ":rbmk_pellet_balefire"); rbmk_pellet_zfb_bismuth = (ItemRBMKPellet) new ItemRBMKPellet("Zirconium Fast Breeder - LEU/HEP-241#Bi").setUnlocalizedName("rbmk_pellet_zfb_bismuth").setTextureName(RefStrings.MODID + ":rbmk_pellet_zfb_bismuth"); rbmk_pellet_zfb_pu241 = (ItemRBMKPellet) new ItemRBMKPellet("Zirconium Fast Breeder - HEU-235/HEP-240#Pu-241").setUnlocalizedName("rbmk_pellet_zfb_pu241").setTextureName(RefStrings.MODID + ":rbmk_pellet_zfb_pu241"); rbmk_pellet_zfb_am_mix = (ItemRBMKPellet) new ItemRBMKPellet("Zirconium Fast Breeder - HEP-241#MEA").setUnlocalizedName("rbmk_pellet_zfb_am_mix").setTextureName(RefStrings.MODID + ":rbmk_pellet_zfb_am_mix"); @@ -3775,18 +3775,21 @@ public class ModItems { .setYield(100000000D) .setStats(30) .setFunction(EnumBurnFunc.SIGMOID) + .setXenon(0.05D, 50D) .setHeat(1.5D) .setMeltingPoint(7029).setUnlocalizedName("rbmk_fuel_leaus").setTextureName(RefStrings.MODID + ":rbmk_fuel_leaus"); rbmk_fuel_heaus = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_heaus) .setYield(100000000D) .setStats(35) .setFunction(EnumBurnFunc.SQUARE_ROOT) + .setXenon(0.05D, 50D) .setHeat(2D) .setMeltingPoint(5211).setUnlocalizedName("rbmk_fuel_heaus").setTextureName(RefStrings.MODID + ":rbmk_fuel_heaus"); rbmk_fuel_po210be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_po210be) .setYield(25000000D) .setStats(15, 40) .setFunction(EnumBurnFunc.SQUARE_ROOT) + .setXenon(0.0D, 50D) .setHeat(0.1D) .setDiffusion(0.05D) .setMeltingPoint(1287) @@ -3795,6 +3798,7 @@ public class ModItems { .setYield(100000000D) .setStats(0D, 20) .setFunction(EnumBurnFunc.PASSIVE) + .setXenon(0.0D, 50D) .setHeat(0.035D) .setDiffusion(0.5D) .setMeltingPoint(700) @@ -3811,18 +3815,21 @@ public class ModItems { .setYield(100000000D) .setStats(50, 10) .setFunction(EnumBurnFunc.ARCH) + .setXenon(0.0D, 50D) .setMeltingPoint(2000) .setUnlocalizedName("rbmk_fuel_balefire_gold").setTextureName(RefStrings.MODID + ":rbmk_fuel_balefire_gold"); rbmk_fuel_flashlead = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_flashlead) .setYield(250000000D) .setStats(40, 50) .setFunction(EnumBurnFunc.ARCH) + .setXenon(0.0D, 50D) .setMeltingPoint(2050) .setUnlocalizedName("rbmk_fuel_flashlead").setTextureName(RefStrings.MODID + ":rbmk_fuel_flashlead"); rbmk_fuel_balefire = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_balefire) .setYield(100000000D) .setStats(100, 35) .setFunction(EnumBurnFunc.LINEAR) + .setXenon(0.0D, 50D) .setHeat(3D) .setMeltingPoint(3652) .setUnlocalizedName("rbmk_fuel_balefire").setTextureName(RefStrings.MODID + ":rbmk_fuel_balefire"); diff --git a/src/main/java/com/hbm/items/machine/ItemRBMKPellet.java b/src/main/java/com/hbm/items/machine/ItemRBMKPellet.java index 5c416e640..e50dbcd66 100644 --- a/src/main/java/com/hbm/items/machine/ItemRBMKPellet.java +++ b/src/main/java/com/hbm/items/machine/ItemRBMKPellet.java @@ -18,6 +18,7 @@ import net.minecraft.util.IIcon; public class ItemRBMKPellet extends ItemNuclearWaste { public String fullName = ""; + protected boolean hasXenon = true; public ItemRBMKPellet(String fullName) { this.fullName = fullName; @@ -25,11 +26,16 @@ public class ItemRBMKPellet extends ItemNuclearWaste { this.setMaxDamage(0); this.setCreativeTab(MainRegistry.controlTab); } + + public ItemRBMKPellet disableXenon() { + this.hasXenon = false; + return this; + } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list) { - for(int i = 0; i < 10; ++i) { + for(int i = 0; i < (this.hasXenon ? 10 : 5); ++i) { list.add(new ItemStack(item, 1, i)); } } @@ -42,16 +48,17 @@ public class ItemRBMKPellet extends ItemNuclearWaste { @Override @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister p_94581_1_) { - super.registerIcons(p_94581_1_); + public void registerIcons(IIconRegister iconRegister) { + super.registerIcons(iconRegister); this.enrichmentOverlays = new IIcon[5]; for(int i = 0; i < enrichmentOverlays.length; i++) { - enrichmentOverlays[i] = p_94581_1_.registerIcon("hbm:rbmk_pellet_overlay_e" + i); + enrichmentOverlays[i] = iconRegister.registerIcon("hbm:rbmk_pellet_overlay_e" + i); } - xenonOverlay = p_94581_1_.registerIcon("hbm:rbmk_pellet_overlay_xenon"); + if(this.hasXenon) + xenonOverlay = iconRegister.registerIcon("hbm:rbmk_pellet_overlay_xenon"); } @Override diff --git a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java index 8fc4735c5..f1c21471b 100644 --- a/src/main/java/com/hbm/items/machine/ItemRBMKRod.java +++ b/src/main/java/com/hbm/items/machine/ItemRBMKRod.java @@ -92,6 +92,12 @@ public class ItemRBMKRod extends Item { this.depFunc = func; return this; } + + public ItemRBMKRod setXenon(double gen, double burn) { + this.xGen = gen; + this.xBurn = burn; + return this; + } public ItemRBMKRod setHeat(double heat) { this.heat = heat; From aa59eedf7d2e4c03c11d8c0250ba7b3bef8c0207 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 23 Apr 2022 20:58:16 -0700 Subject: [PATCH 17/18] well that's annoying --- .../java/com/hbm/world/worldgen/ComponentNTMFeatures.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index cd14d91fa..d202b1b1b 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -973,7 +973,7 @@ public class ComponentNTMFeatures { for(byte i = 0; i < featureSizeZ + 1; i++) { this.func_151554_b(world, Blocks.stonebrick, 0, 0, -1, i, box); - this.func_151554_b(world, Blocks.stonebrick, 0, i >= 5 ? featureSizeZ : 5, -1, i, box); //elegant solution + this.func_151554_b(world, Blocks.stonebrick, 0, i >= 5 ? featureSizeX : 5, -1, i, box); //elegant solution } for(byte i = 1; i < featureSizeX; i++) { @@ -993,7 +993,7 @@ public class ComponentNTMFeatures { this.fillWithBlocks(world, box, featureSizeX, 0, 5, featureSizeX, 1, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 2 this.fillWithRandomizedBlocks(world, box, 6, 0, 5, featureSizeX - 1, 0, 5, false, rand, RandomConcreteBricks); this.fillWithRandomizedBlocks(world, box, 6, 1, 5, 6, 1, 5, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 5, featureSizeX, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, featureSizeX + 1, 1, 5, featureSizeX + 1, 1, 5, false, rand, RandomConcreteBricks); this.fillWithBlocks(world, box, featureSizeX, 0, featureSizeZ, featureSizeX, 1, featureSizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 2 this.fillWithRandomizedBlocks(world, box, featureSizeX, 0, 6, featureSizeX, 0, featureSizeZ - 1, false, rand, RandomConcreteBricks); this.fillWithRandomizedBlocks(world, box, featureSizeX, 1, 6, featureSizeX, 1, featureSizeZ - 3, false, rand, RandomConcreteBricks); From fc3f779408fe89bd95e6e3a637f5d30a1c5e1e2d Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 23 Apr 2022 21:02:32 -0700 Subject: [PATCH 18/18] dude --- src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java index d202b1b1b..e32bdaa4e 100644 --- a/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java +++ b/src/main/java/com/hbm/world/worldgen/ComponentNTMFeatures.java @@ -1191,7 +1191,7 @@ public class ComponentNTMFeatures { TileEntityCrateIron crate = (TileEntityCrateIron)world.getTileEntity(posX, posY, posZ); if(crate != null) { - WeightedRandomChestContent.generateChestContents(rand, content, crate, posZ); + WeightedRandomChestContent.generateChestContents(rand, content, crate, amount); return true; }