diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index d41af6091..f3bd325b1 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,21 +2,13 @@ package com.hbm.items.tool; import java.util.List; -import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.lib.Library; -import com.hbm.util.BobMathUtil; -import com.hbm.util.TrackerUtil; -import com.hbm.world.gen.component.CivilianFeatures.RuralHouse1; -import com.hbm.world.gen.component.Component; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -30,17 +22,6 @@ public class ItemWandD extends Item { if(pos != null) { - /*for(int x = 0; x <= 14; x++) { - for(int y = 0; y <= 8; y++) { - for(int z = 0; z <= 14; z++) { - System.out.print("a"); - Block block = world.getBlock(pos.blockX + x, pos.blockY + y, pos.blockZ + z); - int meta = world.getBlockMetadata(pos.blockX + x, pos.blockY + y, pos.blockZ + z); - world.setBlock(pos.blockX + x, pos.blockY + y, pos.blockZ + z + 32, block, meta, 2); - } - } - }*/ - /*ExplosionVNT vnt = new ExplosionVNT(world, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 7); vnt.setBlockAllocator(new BlockAllocatorBulkie(60)); vnt.setBlockProcessor(new BlockProcessorStandard().withBlockEffect(new BlockMutatorBulkie(ModBlocks.block_slag)).setNoDrop()); @@ -51,21 +32,13 @@ public class ItemWandD extends Item { //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); - int i = pos.blockX >> 4; + /*int i = pos.blockX >> 4; int j = pos.blockZ >> 4; i = (i << 4) + 8; j = (j << 4) + 8; Component comp = new RuralHouse1(world.rand, i, j); - comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32)); - - /*int i = pos.blockX >> 4; - int j = pos.blockZ >> 4; - - MapGenNTMFeatures.Start start = new MapGenNTMFeatures.Start(world, world.rand, i, j); - i = (i << 4) + 8; - j = (j << 4) + 8; - start.generateStructure(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32)); + comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32));*/ /*TimeAnalyzer.startCount("setBlock"); world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt); diff --git a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java index dc5487eb3..018da9c7f 100644 --- a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -13,6 +13,7 @@ import com.hbm.world.gen.component.CivilianFeatures.NTMHouse2; import com.hbm.world.gen.component.CivilianFeatures.NTMLab1; import com.hbm.world.gen.component.CivilianFeatures.NTMLab2; import com.hbm.world.gen.component.CivilianFeatures.NTMWorkshop1; +import com.hbm.world.gen.component.CivilianFeatures.RuralHouse1; import com.hbm.world.gen.component.OfficeFeatures.LargeOffice; import com.hbm.world.gen.component.OfficeFeatures.LargeOfficeCorner; import com.hbm.world.gen.component.RuinFeatures.NTMRuin1; @@ -111,8 +112,10 @@ public class MapGenNTMFeatures extends MapGenStructure { public Start(World world, Random rand, int chunkX, int chunkZ) { super(chunkX, chunkZ); - BiomeGenBase biome = world.getBiomeGenForCoords(chunkX * 16 + 8, chunkZ * 16 + 8); //Only gets the biome in the corner of the chunk. - final int posY = 64; // Terrain *does not exist* at this stage - at least, for vanilla. Here it has to be called after, but better safe than sorry. + int i = (chunkX << 4) + 8; + int j = (chunkZ << 4) + 8; + + BiomeGenBase biome = world.getBiomeGenForCoords(i, j); //Only gets the biome in the corner of the chunk. /* * 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 @@ -124,53 +127,57 @@ public class MapGenNTMFeatures extends MapGenStructure { if(rand.nextInt(3) == 0) { //Empty Ruin Structures switch(rand.nextInt(4)) { case 0: - NTMRuin1 ruin1 = new NTMRuin1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin1 ruin1 = new NTMRuin1(rand, i, j); this.components.add(ruin1); break; case 1: - NTMRuin2 ruin2 = new NTMRuin2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin2 ruin2 = new NTMRuin2(rand, i, j); this.components.add(ruin2); break; case 2: - NTMRuin3 ruin3 = new NTMRuin3(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin3 ruin3 = new NTMRuin3(rand, i, j); this.components.add(ruin3); break; case 3: - NTMRuin4 ruin4 = new NTMRuin4(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMRuin4 ruin4 = new NTMRuin4(rand, i, j); this.components.add(ruin4); } } else if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah if(rand.nextBoolean()) { - NTMHouse1 house1 = new NTMHouse1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMHouse1 house1 = new NTMHouse1(rand, i, j); this.components.add(house1); } else { - NTMHouse2 house2 = new NTMHouse2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMHouse2 house2 = new NTMHouse2(rand, i, j); this.components.add(house2); } } else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9 && rand.nextBoolean()) { //Taiga & Mega Taiga - NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, i, j); //TODO replace this this.components.add(workshop1); } else { //Everything else - switch(rand.nextInt(4)) { + switch(rand.nextInt(6)) { case 0: - NTMLab2 lab2 = new NTMLab2(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMLab2 lab2 = new NTMLab2(rand, i, j); //and these, too this.components.add(lab2); break; case 1: - NTMLab1 lab1 = new NTMLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + NTMLab1 lab1 = new NTMLab1(rand, i, j); this.components.add(lab1); break; case 2: - LargeOffice office = new LargeOffice(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + LargeOffice office = new LargeOffice(rand, i, j); this.components.add(office); break; case 3: - LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); + LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, i, j); this.components.add(officeCorner); break; + case 4: + case 5: + RuralHouse1 ruralHouse = new RuralHouse1(rand, i, j); + this.components.add(ruralHouse); break; } } if(GeneralConfig.enableDebugMode) { - System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + posY + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); + System.out.print("[Debug] StructureStart at " + i + ", 64, " + j + "\n[Debug] Components: "); this.components.forEach((component) -> { System.out.print(MapGenStructureIO.func_143036_a((StructureComponent) component) + " "); }); diff --git a/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java index db31dd3cc..c6f3c67f4 100644 --- a/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java @@ -44,8 +44,8 @@ public class CivilianFeatures { } /** Constructor for this feature; takes coordinates for bounding box */ - public NTMHouse1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 9, 4, 6); + public NTMHouse1(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 9, 4, 6); this.hasPlacedChest = false; } @@ -141,8 +141,8 @@ public class CivilianFeatures { super(); } - public NTMHouse2(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 15, 5, 9); + public NTMHouse2(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 15, 5, 9); this.hasPlacedLoot[0] = false; this.hasPlacedLoot[1] = false; } @@ -287,8 +287,8 @@ public class CivilianFeatures { } /** Constructor for this feature; takes coordinates for bounding box */ - public NTMLab1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 9, 4, 7); + public NTMLab1(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 9, 4, 7); this.hasPlacedLoot[0] = false; this.hasPlacedLoot[1] = false; } @@ -414,8 +414,8 @@ public class CivilianFeatures { super(); } - public NTMLab2(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 12, 11, 8); + public NTMLab2(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 12, 11, 8); this.hasPlacedLoot[0] = false; this.hasPlacedLoot[1] = false; } @@ -588,8 +588,8 @@ public class CivilianFeatures { super(); } - public NTMWorkshop1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 10, 6, 8); + public NTMWorkshop1(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 10, 6, 8); this.hasPlacedLoot = false; } @@ -730,7 +730,6 @@ public class CivilianFeatures { public static class RuralHouse1 extends Component { - public RuralHouse1() { super(); } @@ -746,6 +745,12 @@ public class CivilianFeatures { return false; } + //FillWithAir + fillWithAir(world, box, 9, 1, 3, 12, 4, 8); + fillWithAir(world, box, 5, 1, 2, 8, 3, 8); + fillWithAir(world, box, 2, 1, 5, 4, 3, 8); + fillWithAir(world, box, 2, 1, 10, 7, 3, 12); + //Foundations fillWithBlocks(world, box, 1, 0, 4, 4, 0, 4, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 4, 0, 2, 4, 0, 3, ModBlocks.concrete_colored_ext); @@ -1067,7 +1072,7 @@ public class CivilianFeatures { placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 7, 2, 8, box); fillWithMetadataBlocks(world, box, 7, 3, 8, 9, 3, 8, Blocks.wooden_slab, 1); placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 4, 1, 5, box); //kitchen - placeBlockAtCurrentPosition(world, ModBlocks.machine_electric_furnace_off, metaN, 3, 1, 5, box); + placeBlockAtCurrentPosition(world, rand.nextBoolean() ? ModBlocks.machine_electric_furnace_off : Blocks.furnace, metaN, 3, 1, 5, box); //idk why the meta is off between all these blocks and idc fillWithBlocks(world, box, 2, 1, 5, 2, 1, 6, Blocks.double_stone_slab); placeBlockAtCurrentPosition(world, Blocks.cauldron, 2, 2, 1, 7, box); placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 2, 1, 8, box); diff --git a/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java index 244c1c8f4..724323390 100644 --- a/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java @@ -30,8 +30,8 @@ public class OfficeFeatures { super(); } - public LargeOffice(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 14, 5, 12); + public LargeOffice(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 14, 5, 12); this.hasPlacedLoot[0] = false; this.hasPlacedLoot[1] = false; } @@ -231,8 +231,8 @@ public class OfficeFeatures { super(); } - public LargeOfficeCorner(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 11, 15, 14); + public LargeOfficeCorner(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 11, 15, 14); } @Override diff --git a/src/main/java/com/hbm/world/gen/component/RuinFeatures.java b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java index 914b01b7e..9204e7b0e 100644 --- a/src/main/java/com/hbm/world/gen/component/RuinFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java @@ -26,8 +26,8 @@ public class RuinFeatures { super(); } - public NTMRuin1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 8, 6, 10); + public NTMRuin1(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 8, 6, 10); } @Override @@ -98,8 +98,8 @@ public class RuinFeatures { super(); } - public NTMRuin2(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 7, 5, 10); + public NTMRuin2(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 7, 5, 10); } @Override @@ -161,8 +161,8 @@ public class RuinFeatures { super(); } - public NTMRuin3(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 8, 3, 10); + public NTMRuin3(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 8, 3, 10); } @Override @@ -218,8 +218,8 @@ public class RuinFeatures { super(); } - public NTMRuin4(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 10, 2, 11); + public NTMRuin4(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 10, 2, 11); } @Override