From b0d2d86fdc28a55bb114e3c74640c096055cded6 Mon Sep 17 00:00:00 2001 From: Vaern Date: Mon, 31 Jul 2023 22:39:11 -0700 Subject: [PATCH 01/18] hehe --- .../gen/component/BrutalistFeatures.java | 291 ++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java diff --git a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java new file mode 100644 index 000000000..294c713fb --- /dev/null +++ b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java @@ -0,0 +1,291 @@ +package com.hbm.world.gen.component; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +//civilian features is fucking cringe :P +public class BrutalistFeatures { + + public static void registerComponents() { + MapGenStructureIO.func_143031_a(ElevatedLab1.class, "NTMElevatedLab1"); + } + + //might be other than a lab, placeholder :P + public static class ElevatedLab1 extends Component { + + public ElevatedLab1() { super(); } + + public ElevatedLab1(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 11, 15, 14); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + + final int stairMetaW = getStairMeta(0); + final int stairMetaE = getStairMeta(1); + final int stairMetaN = getStairMeta(2); + final int stairMetaS = getStairMeta(3); + + //greater pillars + for(int i = 2; i < 12; i+=5) { + fillWithBlocks(world, box, i, 0, 2, i, 1, 4, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, i, 4, 2, i, 5, 4, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, i+1, 0, 2, i+1, 5, 4, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, i+2, 0, 2, i+2, 1, 4, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, i+2, 4, 2, i+2, 5, 4, ModBlocks.concrete_smooth); + + for(int j = 0; j <= 1; j++) { + final int u = j * 4; + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i, 2 + j, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i+=2, 2 + j, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW | u, i, 2 + j, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | u, i+=2, 2 + j, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i, 2 + j, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i+=2, 2 + j, 4, box); + } + + placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i, 2, i, 4, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+=1, 2, i+=1, 4, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+=2, 2, i+=2, 4, -1, box); + } + + //lesser pillars + for(int i = 2; i < 12; i+=5) { + fillWithBlocks(world, box, i, 0, 10, i, 1, 12, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, i, 3, 10, i, 3, 12, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, i+1, 0, 10, i+1, 3, 12, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, i+2, 0, 10, i+2, 1, 12, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, i+2, 3, 10, i+2, 3, 12, ModBlocks.concrete_smooth); + + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i, 2, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i+=2, 2, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW, i, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE, i+=2, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i, 2, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i+=2, 2, 4, box); + + placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i, 10, i, 12, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+=1, 10, i+=1, 12, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+=2, 10, i+=2, 12, -1, box); + } + + fillWithAir(world, box, 1, 5, 9, 15, 7, 13); + fillWithAir(world, box, 13, 6, 8, 14, 6, 8); + fillWithAir(world, box, 13, 7, 6, 14, 8, 8); + fillWithAir(world, box, 1, 7, 1, 15, 9, 5); + + /* lower floor */ + //lower slabs + fillWithMetadataBlocks(world, box, 0, 3, 9, 16, 3, 9, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 1, 3, 10, 1, 3, 12, ModBlocks.concrete_slab, 8); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 0, 3, 11, box); + fillWithMetadataBlocks(world, box, 0, 3, 13, 16, 3, 13, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 5, 3, 10, 6, 3, 12, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 10, 3, 10, 11, 3, 12, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 15, 3, 10, 15, 3, 12, ModBlocks.concrete_slab, 8); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 16, 3, 11, box); + //floor & lining + fillWithBlocks(world, box, 1, 4, 9, 15, 4, 13, ModBlocks.deco_titanium); + fillWithMetadataBlocks(world, box, 0, 4, 8, 16, 4, 8, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); + fillWithBlocks(world, box, 0, 4, 9, 0, 4, 13, ModBlocks.concrete_smooth); + fillWithMetadataBlocks(world, box, 0, 4, 14, 16, 4, 14, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); + fillWithBlocks(world, box, 16, 4, 9, 16, 4, 13, ModBlocks.concrete_smooth); + //walls + fillWithBlocks(world, box, 0, 5, 8, 1, 6, 8, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 4, 5, 8, 12, 6, 8, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 0, 7, 8, 12, 7, 8, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, 15, 5, 8, 16, 5, 8, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 15, 7, 8, 16, 7, 8, ModBlocks.concrete_smooth); + + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 5, 9, box); + fillWithBlocks(world, box, 0, 5, 11, 0, 6, 11, ModBlocks.concrete_colored_ext); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 5, 13, box); + fillWithBlocks(world, box, 0, 5, 14, 0, 6, 14, ModBlocks.concrete_colored_ext); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 0, 7, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 0, 7, 11, box); + fillWithBlocks(world, box, 0, 7, 13, 0, 7, 14, ModBlocks.concrete_smooth); + + fillWithBlocks(world, box, 4, 5, 14, 4, 6, 14, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 6, 5, 14, 6, 6, 14, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 8, 5, 14, 8, 6, 14, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 10, 5, 14, 10, 6, 14, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 12, 5, 14, 12, 6, 14, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 16, 5, 14, 16, 6, 14, ModBlocks.concrete_colored_ext); + fillWithMetadataBlocks(world, box, 1, 7, 14, 3, 7, 14, ModBlocks.concrete_smooth_stairs, 7); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 4, 7, 14, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 6, 7, 14, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 8, 7, 14, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 10, 7, 14, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 7, 14, box); + fillWithMetadataBlocks(world, box, 13, 7, 14, 15, 7, 14, ModBlocks.concrete_smooth_stairs, 7); + + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 5, 13, box); + fillWithBlocks(world, box, 16, 5, 11, 16, 6, 11, ModBlocks.concrete_colored_ext); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 5, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 16, 7, 13, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 16, 7, 11, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 16, 7, 9, box); + //windows + final float limit = 0.9F; + randomlyFillWithBlocks(world, box, rand, limit, 0, 6, 9, 0, 6, 9, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 0, 5, 10, 0, 7, 10, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 0, 5, 12, 0, 7, 12, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 0, 6, 13, 0, 6, 13, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 1, 5, 14, 3, 6, 14, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 5, 5, 14, 5, 7, 14, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 7, 5, 14, 7, 7, 14, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 9, 5, 14, 9, 7, 14, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 11, 5, 14, 11, 7, 14, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 13, 5, 14, 15, 6, 14, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 6, 13, 16, 6, 13, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 5, 12, 16, 7, 12, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 5, 10, 16, 7, 10, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 6, 9, 16, 6, 9, Blocks.glass_pane); + //ceiling with liner + fillWithMetadataBlocks(world, box, 1, 8, 9, 15, 8, 13, ModBlocks.vinyl_tile, 1); + fillWithMetadataBlocks(world, box, 0, 8, 8, 11, 8, 8, ModBlocks.concrete_smooth_stairs, 2); + fillWithBlocks(world, box, 12, 8, 8, 12, 8, 9, ModBlocks.concrete_smooth); + fillWithMetadataBlocks(world, box, 13, 8, 9, 14, 8, 9, ModBlocks.concrete_smooth_stairs, 6); + fillWithBlocks(world, box, 15, 8, 8, 15, 8, 9, ModBlocks.concrete_smooth); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, 2, 16, 8, 8, box); + fillWithBlocks(world, box, 16, 8, 9, 16, 8, 13, ModBlocks.concrete_smooth); + fillWithMetadataBlocks(world, box, 0, 8, 14, 16, 8, 14, ModBlocks.concrete_smooth_stairs, 3); + fillWithBlocks(world, box, 0, 8, 9, 0, 8, 13, ModBlocks.concrete_smooth); + //upper slabs + fillWithBlocks(world, box, 0, 9, 9, 16, 9, 9, ModBlocks.concrete_slab); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 0, 9, 11, box); + fillWithBlocks(world, box, 0, 9, 13, 16, 9, 13, ModBlocks.concrete_slab); + fillWithBlocks(world, box, 1, 9, 10, 15, 9, 12, ModBlocks.concrete_slab); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 16, 9, 11, box); + fillWithBlocks(world, box, 12, 9, 8, 15, 9, 8, ModBlocks.concrete_slab); + + /* middle stairs */ + //stairs + fillWithMetadataBlocks(world, box, 13, 5, 8, 14, 5, 8, ModBlocks.concrete_smooth_stairs, 3); + fillWithMetadataBlocks(world, box, 13, 6, 7, 14, 6, 7, ModBlocks.concrete_smooth_stairs, 3); + fillWithMetadataBlocks(world, box, 12, 5, 7, 15, 5, 7, ModBlocks.concrete_smooth_stairs, 6); + //walls + fillWithBlocks(world, box, 12, 6, 7, 12, 8, 7, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, 15, 6, 7, 15, 8, 7, ModBlocks.concrete_smooth); + //ceiling + fillWithMetadataBlocks(world, box, 12, 9, 7, 15, 9, 7, ModBlocks.concrete_smooth_stairs, 3); + fillWithMetadataBlocks(world, box, 13, 9, 6, 14, 9, 6, ModBlocks.concrete_slab, 8); + + /* upper floor */ + //lower slabs + fillWithMetadataBlocks(world, box, 0, 5, 1, 16, 5, 1, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 1, 5, 2, 1, 5, 4, ModBlocks.concrete_slab, 8); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 0, 5, 3, box); + fillWithMetadataBlocks(world, box, 0, 5, 5, 16, 5, 5, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 12, 5, 6, 15, 5, 6, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 5, 5, 2, 6, 5, 4, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 10, 5, 2, 11, 5, 4, ModBlocks.concrete_slab, 8); + fillWithMetadataBlocks(world, box, 15, 5, 2, 15, 5, 4, ModBlocks.concrete_slab, 8); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 16, 5, 3, box); + //floor and lining + fillWithBlocks(world, box, 1, 6, 1, 15, 6, 5, ModBlocks.deco_titanium); + fillWithBlocks(world, box, 13, 6, 6, 14, 6, 6, ModBlocks.deco_titanium); + fillWithMetadataBlocks(world, box, 0, 6, 0, 16, 6, 0, ModBlocks.concrete_smooth_stairs, 6); + fillWithBlocks(world, box, 0, 6, 1, 0, 6, 5, ModBlocks.concrete_smooth); + fillWithMetadataBlocks(world, box, 0, 6, 6, 11, 6, 6, ModBlocks.concrete_smooth_stairs, 7); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 6, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 15, 6, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, 7, 16, 6, 6, box); + fillWithBlocks(world, box, 16, 6, 1, 16, 6, 5, ModBlocks.concrete_smooth); + //walls + fillWithBlocks(world, box, 0, 7, 0, 0, 8, 0, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 4, 7, 0, 4, 8, 0, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 6, 7, 0, 6, 8, 0, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 10, 7, 0, 10, 8, 0, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 12, 7, 0, 12, 8, 0, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 16, 7, 0, 16, 8, 0, ModBlocks.concrete_colored_ext); + fillWithMetadataBlocks(world, box, 1, 9, 0, 3, 9, 0, ModBlocks.concrete_smooth_stairs, 6); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 4, 9, 0, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 6, 9, 0, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 10, 9, 0, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 9, 0, box); + fillWithMetadataBlocks(world, box, 13, 9, 0, 15, 9, 0, ModBlocks.concrete_smooth_stairs, 6); + + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 7, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 7, 5, box); + fillWithBlocks(world, box, 0, 9, 0, 0, 9, 1, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, 0, 9, 5, 0, 9, 6, ModBlocks.concrete_smooth); + + fillWithBlocks(world, box, 0, 7, 6, 12, 8, 6, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 15, 7, 6, 16, 8, 6, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 1, 9, 6, 12, 9, 6, ModBlocks.concrete_smooth); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 15, 9, 6, box); + + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 7, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 7, 1, box); + fillWithBlocks(world, box, 16, 9, 5, 16, 9, 6, ModBlocks.concrete_smooth); + fillWithBlocks(world, box, 16, 9, 0, 16, 9, 1, ModBlocks.concrete_smooth); + //windows + randomlyFillWithBlocks(world, box, rand, limit, 1, 7, 0, 3, 8, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 5, 7, 0, 5, 9, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 7, 7, 0, 9, 9, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 11, 7, 0, 11, 9, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 13, 7, 0, 15, 8, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 0, 8, 1, 0, 8, 1, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 0, 7, 2, 0, 9, 4, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 0, 8, 5, 0, 8, 5, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 8, 5, 16, 8, 5, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 7, 2, 16, 9, 4, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, limit, 16, 8, 1, 16, 8, 1, Blocks.glass_pane); + //ceiling with liner + fillWithMetadataBlocks(world, box, 1, 10, 1, 15, 10, 5, ModBlocks.vinyl_tile, 1); + fillWithMetadataBlocks(world, box, 0, 10, 0, 16, 10, 0, ModBlocks.concrete_smooth_stairs, 2); + fillWithBlocks(world, box, 0, 10, 1, 0, 10, 5, ModBlocks.concrete_smooth); + fillWithMetadataBlocks(world, box, 0, 10, 6, 16, 10, 6, ModBlocks.concrete_smooth_stairs, 3); + fillWithBlocks(world, box, 16, 10, 1, 16, 10, 5, ModBlocks.concrete_smooth); + //slabs + fillWithBlocks(world, box, 0, 11, 1, 16, 11, 1, ModBlocks.concrete_slab); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 0, 11, 3, box); + fillWithBlocks(world, box, 1, 11, 2, 15, 11, 4, ModBlocks.concrete_slab); + fillWithBlocks(world, box, 0, 11, 5, 16, 11, 5, ModBlocks.concrete_slab); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 16, 11, 3, box); + + //stairs (probably wip) + fillWithMetadataBlocks(world, box, 2, 4, 7, 3, 4, 7, ModBlocks.steel_grate, 7); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 4, 4, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 3, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 6, 3, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 7, 2, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 8, 2, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 9, 1, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 10, 1, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 11, 0, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 12, 0, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, 4, 1, 5, 7, box); + final int decoMetaS = getDecoMeta(2); + final int decoMetaN = getDecoMeta(3); + fillWithMetadataBlocks(world, box, 2, 4, 6, 3, 5, 6, ModBlocks.steel_wall, decoMetaS); + fillWithMetadataBlocks(world, box, 4, 4, 6, 5, 4, 6, ModBlocks.steel_wall, decoMetaS); + fillWithMetadataBlocks(world, box, 5, 3, 6, 7, 3, 6, ModBlocks.steel_wall, decoMetaS); + fillWithMetadataBlocks(world, box, 7, 2, 6, 9, 2, 6, ModBlocks.steel_wall, decoMetaS); + fillWithMetadataBlocks(world, box, 9, 1, 6, 11, 1, 6, ModBlocks.steel_wall, decoMetaS); + fillWithMetadataBlocks(world, box, 11, 0, 6, 12, 0, 6, ModBlocks.steel_wall, decoMetaS); + fillWithMetadataBlocks(world, box, 5, 3, 8, 7, 3, 8, ModBlocks.steel_wall, decoMetaN); + fillWithMetadataBlocks(world, box, 7, 2, 8, 9, 2, 8, ModBlocks.steel_wall, decoMetaN); + fillWithMetadataBlocks(world, box, 9, 1, 8, 11, 1, 8, ModBlocks.steel_wall, decoMetaN); + fillWithMetadataBlocks(world, box, 11, 0, 8, 12, 0, 8, ModBlocks.steel_wall, decoMetaN); + + + + + return true; + } + + } +} From b677214381b6a47f4a837f97de3d1c28af714a9b Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 2 Aug 2023 14:44:52 -0700 Subject: [PATCH 02/18] argh --- src/main/java/com/hbm/lib/HbmWorld.java | 2 + .../com/hbm/world/gen/MapGenNTMFeatures.java | 8 +- .../gen/component/BrutalistFeatures.java | 260 +++++++++++++----- .../hbm/world/gen/component/Component.java | 36 --- 4 files changed, 205 insertions(+), 101 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index 4a24a192f..bc1226544 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -2,6 +2,7 @@ package com.hbm.lib; import com.hbm.world.gen.MapGenNTMFeatures; import com.hbm.world.gen.NTMWorldGenerator; +import com.hbm.world.gen.component.BrutalistFeatures; import com.hbm.world.gen.component.BunkerComponents; import com.hbm.world.gen.component.CivilianFeatures; import com.hbm.world.gen.component.OfficeFeatures; @@ -45,5 +46,6 @@ public class HbmWorld { OfficeFeatures.registerComponents(); RuinFeatures.registerComponents(); BunkerComponents.registerComponents(); + BrutalistFeatures.registerComponents(); } } diff --git a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java index c5383cca0..fe211813e 100644 --- a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -7,6 +7,7 @@ import java.util.Random; import com.hbm.config.GeneralConfig; import com.hbm.config.StructureConfig; +import com.hbm.world.gen.component.BrutalistFeatures.*; import com.hbm.world.gen.component.BunkerComponents.BunkerStart; import com.hbm.world.gen.component.CivilianFeatures.*; import com.hbm.world.gen.component.OfficeFeatures.*; @@ -112,7 +113,8 @@ public class MapGenNTMFeatures extends MapGenStructure { * Rainfall & Temperature Check */ //TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP - if(rand.nextInt(3) == 0) { //Empty Ruin Structures + + /*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); @@ -158,7 +160,9 @@ public class MapGenNTMFeatures extends MapGenStructure { LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(officeCorner); break; } - } + }*/ + ElevatedLab1 lab1 = new ElevatedLab1(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[Debug] Components: "); diff --git a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java index 294c713fb..a84db6e61 100644 --- a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java @@ -3,11 +3,19 @@ package com.hbm.world.gen.component; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.world.gen.NTMWorldGenerator; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenShrub; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.BiomeDictionary.Type; //civilian features is fucking cringe :P public class BrutalistFeatures { @@ -22,7 +30,7 @@ public class BrutalistFeatures { public ElevatedLab1() { super(); } public ElevatedLab1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 11, 15, 14); + super(rand, minX, minY, minZ, 16, 11, 14); } @Override @@ -32,13 +40,16 @@ public class BrutalistFeatures { return false; } + BiomeGenBase biome = world.getBiomeGenForCoords(this.boundingBox.minX, this.boundingBox.maxX); + DirtyGlass glass = new DirtyGlass(biome, 0.1F, true); + final int stairMetaW = getStairMeta(0); final int stairMetaE = getStairMeta(1); final int stairMetaN = getStairMeta(2); final int stairMetaS = getStairMeta(3); //greater pillars - for(int i = 2; i < 12; i+=5) { + for(int i = 2; i <= 12; i+=5) { fillWithBlocks(world, box, i, 0, 2, i, 1, 4, ModBlocks.concrete_smooth); fillWithBlocks(world, box, i, 4, 2, i, 5, 4, ModBlocks.concrete_smooth); fillWithBlocks(world, box, i+1, 0, 2, i+1, 5, 4, ModBlocks.concrete_pillar); @@ -48,36 +59,36 @@ public class BrutalistFeatures { for(int j = 0; j <= 1; j++) { final int u = j * 4; placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i, 2 + j, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i+=2, 2 + j, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i+2, 2 + j, 2, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW | u, i, 2 + j, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | u, i+=2, 2 + j, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | u, i+2, 2 + j, 3, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i, 2 + j, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i+=2, 2 + j, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i+2, 2 + j, 4, box); } placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i, 2, i, 4, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+=1, 2, i+=1, 4, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+=2, 2, i+=2, 4, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+1, 2, i+1, 4, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+2, 2, i+2, 4, -1, box); } //lesser pillars - for(int i = 2; i < 12; i+=5) { + for(int i = 2; i <= 12; i+=5) { fillWithBlocks(world, box, i, 0, 10, i, 1, 12, ModBlocks.concrete_smooth); fillWithBlocks(world, box, i, 3, 10, i, 3, 12, ModBlocks.concrete_smooth); fillWithBlocks(world, box, i+1, 0, 10, i+1, 3, 12, ModBlocks.concrete_pillar); fillWithBlocks(world, box, i+2, 0, 10, i+2, 1, 12, ModBlocks.concrete_smooth); fillWithBlocks(world, box, i+2, 3, 10, i+2, 3, 12, ModBlocks.concrete_smooth); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i, 2, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i+=2, 2, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW, i, 2, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE, i+=2, 2, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i, 2, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i+=2, 2, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i, 2, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i+2, 2, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW, i, 2, 11, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE, i+2, 2, 11, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i, 2, 12, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i+2, 2, 12, box); placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i, 10, i, 12, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+=1, 10, i+=1, 12, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+=2, 10, i+=2, 12, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+1, 10, i+1, 12, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+2, 10, i+2, 12, -1, box); } fillWithAir(world, box, 1, 5, 9, 15, 7, 13); @@ -105,7 +116,7 @@ public class BrutalistFeatures { fillWithBlocks(world, box, 0, 5, 8, 1, 6, 8, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 4, 5, 8, 12, 6, 8, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 0, 7, 8, 12, 7, 8, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, 15, 5, 8, 16, 5, 8, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 15, 5, 8, 16, 6, 8, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 15, 7, 8, 16, 7, 8, ModBlocks.concrete_smooth); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 5, 9, box); @@ -122,45 +133,44 @@ public class BrutalistFeatures { fillWithBlocks(world, box, 10, 5, 14, 10, 6, 14, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 12, 5, 14, 12, 6, 14, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 16, 5, 14, 16, 6, 14, ModBlocks.concrete_colored_ext); - fillWithMetadataBlocks(world, box, 1, 7, 14, 3, 7, 14, ModBlocks.concrete_smooth_stairs, 7); + fillWithMetadataBlocks(world, box, 1, 7, 14, 3, 7, 14, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 4, 7, 14, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 6, 7, 14, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 8, 7, 14, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 10, 7, 14, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 7, 14, box); - fillWithMetadataBlocks(world, box, 13, 7, 14, 15, 7, 14, ModBlocks.concrete_smooth_stairs, 7); + fillWithMetadataBlocks(world, box, 13, 7, 14, 15, 7, 14, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 5, 13, box); fillWithBlocks(world, box, 16, 5, 11, 16, 6, 11, ModBlocks.concrete_colored_ext); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 5, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 16, 7, 13, box); + fillWithBlocks(world, box, 16, 7, 13, 16, 7, 14, ModBlocks.concrete_smooth); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 16, 7, 11, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 16, 7, 9, box); //windows - final float limit = 0.9F; - randomlyFillWithBlocks(world, box, rand, limit, 0, 6, 9, 0, 6, 9, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 0, 5, 10, 0, 7, 10, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 0, 5, 12, 0, 7, 12, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 0, 6, 13, 0, 6, 13, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 1, 5, 14, 3, 6, 14, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 5, 5, 14, 5, 7, 14, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 7, 5, 14, 7, 7, 14, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 9, 5, 14, 9, 7, 14, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 11, 5, 14, 11, 7, 14, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 13, 5, 14, 15, 6, 14, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 6, 13, 16, 6, 13, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 5, 12, 16, 7, 12, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 5, 10, 16, 7, 10, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 6, 9, 16, 6, 9, Blocks.glass_pane); + fillWithRandomizedBlocks(world, box, 0, 6, 9, 0, 6, 9, rand, glass); + fillWithRandomizedBlocks(world, box, 0, 5, 10, 0, 7, 10, rand, glass); + fillWithRandomizedBlocks(world, box, 0, 5, 12, 0, 7, 12, rand, glass); + fillWithRandomizedBlocks(world, box, 0, 6, 13, 0, 6, 13, rand, glass); + fillWithRandomizedBlocks(world, box, 1, 5, 14, 3, 6, 14, rand, glass); + fillWithRandomizedBlocks(world, box, 5, 5, 14, 5, 7, 14, rand, glass); + fillWithRandomizedBlocks(world, box, 7, 5, 14, 7, 7, 14, rand, glass); + fillWithRandomizedBlocks(world, box, 9, 5, 14, 9, 7, 14, rand, glass); + fillWithRandomizedBlocks(world, box, 11, 5, 14, 11, 7, 14, rand, glass); + fillWithRandomizedBlocks(world, box, 13, 5, 14, 15, 6, 14, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 6, 13, 16, 6, 13, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 5, 12, 16, 7, 12, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 5, 10, 16, 7, 10, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 6, 9, 16, 6, 9, rand, glass); //ceiling with liner fillWithMetadataBlocks(world, box, 1, 8, 9, 15, 8, 13, ModBlocks.vinyl_tile, 1); - fillWithMetadataBlocks(world, box, 0, 8, 8, 11, 8, 8, ModBlocks.concrete_smooth_stairs, 2); + fillWithMetadataBlocks(world, box, 0, 8, 8, 11, 8, 8, ModBlocks.concrete_smooth_stairs, stairMetaN); fillWithBlocks(world, box, 12, 8, 8, 12, 8, 9, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 13, 8, 9, 14, 8, 9, ModBlocks.concrete_smooth_stairs, 6); + fillWithMetadataBlocks(world, box, 13, 8, 9, 14, 8, 9, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); fillWithBlocks(world, box, 15, 8, 8, 15, 8, 9, ModBlocks.concrete_smooth); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, 2, 16, 8, 8, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, 16, 8, 8, box); fillWithBlocks(world, box, 16, 8, 9, 16, 8, 13, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 8, 14, 16, 8, 14, ModBlocks.concrete_smooth_stairs, 3); + fillWithMetadataBlocks(world, box, 0, 8, 14, 16, 8, 14, ModBlocks.concrete_smooth_stairs, stairMetaS); fillWithBlocks(world, box, 0, 8, 9, 0, 8, 13, ModBlocks.concrete_smooth); //upper slabs fillWithBlocks(world, box, 0, 9, 9, 16, 9, 9, ModBlocks.concrete_slab); @@ -172,14 +182,14 @@ public class BrutalistFeatures { /* middle stairs */ //stairs - fillWithMetadataBlocks(world, box, 13, 5, 8, 14, 5, 8, ModBlocks.concrete_smooth_stairs, 3); - fillWithMetadataBlocks(world, box, 13, 6, 7, 14, 6, 7, ModBlocks.concrete_smooth_stairs, 3); - fillWithMetadataBlocks(world, box, 12, 5, 7, 15, 5, 7, ModBlocks.concrete_smooth_stairs, 6); + fillWithMetadataBlocks(world, box, 13, 5, 8, 14, 5, 8, ModBlocks.concrete_smooth_stairs, stairMetaS); + fillWithMetadataBlocks(world, box, 13, 6, 7, 14, 6, 7, ModBlocks.concrete_smooth_stairs, stairMetaS); + fillWithMetadataBlocks(world, box, 12, 5, 7, 15, 5, 7, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); //walls fillWithBlocks(world, box, 12, 6, 7, 12, 8, 7, ModBlocks.concrete_smooth); fillWithBlocks(world, box, 15, 6, 7, 15, 8, 7, ModBlocks.concrete_smooth); //ceiling - fillWithMetadataBlocks(world, box, 12, 9, 7, 15, 9, 7, ModBlocks.concrete_smooth_stairs, 3); + fillWithMetadataBlocks(world, box, 12, 9, 7, 15, 9, 7, ModBlocks.concrete_smooth_stairs, stairMetaS); fillWithMetadataBlocks(world, box, 13, 9, 6, 14, 9, 6, ModBlocks.concrete_slab, 8); /* upper floor */ @@ -196,12 +206,12 @@ public class BrutalistFeatures { //floor and lining fillWithBlocks(world, box, 1, 6, 1, 15, 6, 5, ModBlocks.deco_titanium); fillWithBlocks(world, box, 13, 6, 6, 14, 6, 6, ModBlocks.deco_titanium); - fillWithMetadataBlocks(world, box, 0, 6, 0, 16, 6, 0, ModBlocks.concrete_smooth_stairs, 6); + fillWithMetadataBlocks(world, box, 0, 6, 0, 16, 6, 0, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); fillWithBlocks(world, box, 0, 6, 1, 0, 6, 5, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 6, 6, 11, 6, 6, ModBlocks.concrete_smooth_stairs, 7); + fillWithMetadataBlocks(world, box, 0, 6, 6, 11, 6, 6, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 6, 6, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 15, 6, 6, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, 7, 16, 6, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 16, 6, 6, box); fillWithBlocks(world, box, 16, 6, 1, 16, 6, 5, ModBlocks.concrete_smooth); //walls fillWithBlocks(world, box, 0, 7, 0, 0, 8, 0, ModBlocks.concrete_colored_ext); @@ -210,12 +220,12 @@ public class BrutalistFeatures { fillWithBlocks(world, box, 10, 7, 0, 10, 8, 0, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 12, 7, 0, 12, 8, 0, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 16, 7, 0, 16, 8, 0, ModBlocks.concrete_colored_ext); - fillWithMetadataBlocks(world, box, 1, 9, 0, 3, 9, 0, ModBlocks.concrete_smooth_stairs, 6); + fillWithMetadataBlocks(world, box, 1, 9, 0, 3, 9, 0, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 4, 9, 0, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 6, 9, 0, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 10, 9, 0, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 9, 0, box); - fillWithMetadataBlocks(world, box, 13, 9, 0, 15, 9, 0, ModBlocks.concrete_smooth_stairs, 6); + fillWithMetadataBlocks(world, box, 13, 9, 0, 15, 9, 0, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 7, 1, box); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 7, 5, box); @@ -232,22 +242,22 @@ public class BrutalistFeatures { fillWithBlocks(world, box, 16, 9, 5, 16, 9, 6, ModBlocks.concrete_smooth); fillWithBlocks(world, box, 16, 9, 0, 16, 9, 1, ModBlocks.concrete_smooth); //windows - randomlyFillWithBlocks(world, box, rand, limit, 1, 7, 0, 3, 8, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 5, 7, 0, 5, 9, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 7, 7, 0, 9, 9, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 11, 7, 0, 11, 9, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 13, 7, 0, 15, 8, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 0, 8, 1, 0, 8, 1, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 0, 7, 2, 0, 9, 4, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 0, 8, 5, 0, 8, 5, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 8, 5, 16, 8, 5, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 7, 2, 16, 9, 4, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, limit, 16, 8, 1, 16, 8, 1, Blocks.glass_pane); + fillWithRandomizedBlocks(world, box, 1, 7, 0, 3, 8, 0, rand, glass); + fillWithRandomizedBlocks(world, box, 5, 7, 0, 5, 9, 0, rand, glass); + fillWithRandomizedBlocks(world, box, 7, 7, 0, 9, 9, 0, rand, glass); + fillWithRandomizedBlocks(world, box, 11, 7, 0, 11, 9, 0, rand, glass); + fillWithRandomizedBlocks(world, box, 13, 7, 0, 15, 8, 0, rand, glass); + fillWithRandomizedBlocks(world, box, 0, 8, 1, 0, 8, 1, rand, glass); + fillWithRandomizedBlocks(world, box, 0, 7, 2, 0, 9, 4, rand, glass); + fillWithRandomizedBlocks(world, box, 0, 8, 5, 0, 8, 5, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 8, 5, 16, 8, 5, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 7, 2, 16, 9, 4, rand, glass); + fillWithRandomizedBlocks(world, box, 16, 8, 1, 16, 8, 1, rand, glass); //ceiling with liner fillWithMetadataBlocks(world, box, 1, 10, 1, 15, 10, 5, ModBlocks.vinyl_tile, 1); - fillWithMetadataBlocks(world, box, 0, 10, 0, 16, 10, 0, ModBlocks.concrete_smooth_stairs, 2); + fillWithMetadataBlocks(world, box, 0, 10, 0, 16, 10, 0, ModBlocks.concrete_smooth_stairs, stairMetaN); fillWithBlocks(world, box, 0, 10, 1, 0, 10, 5, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 10, 6, 16, 10, 6, ModBlocks.concrete_smooth_stairs, 3); + fillWithMetadataBlocks(world, box, 0, 10, 6, 16, 10, 6, ModBlocks.concrete_smooth_stairs, stairMetaS); fillWithBlocks(world, box, 16, 10, 1, 16, 10, 5, ModBlocks.concrete_smooth); //slabs fillWithBlocks(world, box, 0, 11, 1, 16, 11, 1, ModBlocks.concrete_slab); @@ -267,9 +277,10 @@ public class BrutalistFeatures { placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 10, 1, 7, box); placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 11, 0, 7, box); placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 12, 0, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, 4, 1, 5, 7, box); final int decoMetaS = getDecoMeta(2); final int decoMetaN = getDecoMeta(3); + final int decoMetaE = getDecoMeta(4); + placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaE, 1, 5, 7, box); fillWithMetadataBlocks(world, box, 2, 4, 6, 3, 5, 6, ModBlocks.steel_wall, decoMetaS); fillWithMetadataBlocks(world, box, 4, 4, 6, 5, 4, 6, ModBlocks.steel_wall, decoMetaS); fillWithMetadataBlocks(world, box, 5, 3, 6, 7, 3, 6, ModBlocks.steel_wall, decoMetaS); @@ -281,11 +292,134 @@ public class BrutalistFeatures { fillWithMetadataBlocks(world, box, 9, 1, 8, 11, 1, 8, ModBlocks.steel_wall, decoMetaN); fillWithMetadataBlocks(world, box, 11, 0, 8, 12, 0, 8, ModBlocks.steel_wall, decoMetaN); + /* Deco */ + //webs + randomlyFillWithBlocks(world, box, rand, 0.15F, 0, 6, 7, 10, 8, 7, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.4F, 11, 5, 7, 11, 9, 7, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.4F, 16, 5, 7, 16, 9, 7, Blocks.web); + + placeWebs(world, box, rand, 1, 5, 9, 15, 7, 13, 0.10F, 0.025F); + placeWebs(world, box, rand, 13, 7, 6, 14, 8, 8, 0.20F, 0F); + placeWebs(world, box, rand, 1, 7, 1, 15, 9, 5, 0.10F, 0.025F); + + //test + //plan is: biome-dependent overgrowth, integrated neatly + /*generateShrubs(world, box, rand, 0, 0, 16, 1, 4); + generateShrubs(world, box, rand, 0, 13, 16, 14, 2); + generateShrubs(world, box, rand, 0, 4, 16, 8, 2);*/ return true; } + protected void placeWebs(World world, StructureBoundingBox box, Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, float chance, float bigWebChance) { + if(getYWithOffset(minY) < box.minY || getYWithOffset(maxY) > box.maxY) + return; + + for(int x = minX; x <= maxX; x++) { + + for(int z = minZ; z <= maxZ; z++) { + int posX = getXWithOffset(x, z); + int posZ = getZWithOffset(x, z); + + if(posX >= box.minX && posX <= box.maxX && posZ >= box.minZ && posZ <= box.maxZ) { + for(int y = minY; y <= maxY; y++) { + int posY = getYWithOffset(y); + + if(world.getBlock(posX, posY, posZ) == Blocks.web) continue; + + boolean onWall = (x == minX || x == maxX || z == minZ || z == maxZ); + boolean onCeiling = (y == minY || y == maxY); //floor or ceiling, really + //this will go over the subchunk boundaries, but trees already do that all the time; it's only really an issue if it causes updates or + //goes over the 2x2 chunk area entirely + if(onWall && onCeiling && rand.nextFloat() <= bigWebChance) { + + for(int j = Math.max(minY, y - 1); j <= Math.min(maxY, y + 1); j++) { //on one hand, eugh. on the other, good-looking webs! + int fac = 2 - Math.abs(j - y); //rounds out the edges with distance from starting block + + int maxI = Math.min(maxX, x + 1); + for(int i = Math.max(minX, x - 1); i <= maxI; i++) { + + int maxK = Math.min(maxZ, z + 1); + for(int k = Math.max(minZ, z - 1); k <= maxK; k++) { + int posI = getXWithOffset(i, k); + int posJ = getYWithOffset(j); + int posK = getZWithOffset(i, k); + + if(world.isAirBlock(posI, posJ, posK) && (Math.abs(i - x) != fac || Math.abs(k - z) != fac || rand.nextInt(2) == 0)) + world.setBlock(posI, posJ, posK, Blocks.web, 0, 2); + + } + } + } + } else if((onWall || onCeiling) && rand.nextFloat() <= chance) + world.setBlock(posX, posY, posZ, Blocks.web, 0, 2); + } + } + } + } + } + + /*protected void generateShrubs(World world, StructureBoundingBox box, Random rand, int minX, int minZ, int maxX, int maxZ, int startY) { + int startX = Math.min(this.getXWithOffset(minX, minZ), this.getXWithOffset(maxX, maxZ)); + int startZ = Math.min(this.getZWithOffset(minX, minZ), this.getZWithOffset(maxX, maxZ)); + int endX = Math.max(this.getXWithOffset(minX, minZ), this.getXWithOffset(maxX, maxZ)) - startX; + int endZ = Math.max(this.getZWithOffset(minX, minZ), this.getZWithOffset(maxX, maxZ)) - startZ; + + int attempts = rand.nextInt(2); + WorldGenShrub shrub = new WorldGenShrub(0, 0); + + for(int i = 0; i < attempts; i++) { + int posX = startX + rand.nextInt(endX <= 0 ? 1 : endX); + int posY = this.getYWithOffset(startY); + int posZ = startZ + rand.nextInt(endZ <= 0 ? 1 : endZ); + + if(box.isVecInside(posX, posY, posZ)) { + int brake = 0; + + do { + Block block = world.getBlock(posX, posY, posZ); + + if(!((block.isAir(world, posX, posY, posZ) || block.isFoliage(world, posX, posY, posZ) || block.isLeaves(world, posX, posY, posZ)) && posY > 0)) { + shrub.generate(world, rand, posX, posY, posZ); + break; + } + + posY--; + } while(brake++ <= 15); + } + } + }*/ } -} + + //the block selector in general is kinda mid, i might just replace it entirely + public static class DirtyGlass extends StructureComponent.BlockSelector { + protected boolean webs; + protected float chance; + + public DirtyGlass(BiomeGenBase biome, float chance, boolean webs) { + if(NTMWorldGenerator.isBiomeOfTypes(biome, Type.WASTELAND, Type.JUNGLE, Type.SANDY, Type.SAVANNA)) + this.selectedBlockMetaData = 12; //super dirty + else if(BiomeDictionary.isBiomeOfType(biome, Type.COLD)) + this.selectedBlockMetaData = 8; //fogged-up + else + this.selectedBlockMetaData = 7; //dirty + + this.field_151562_a = Blocks.stained_glass_pane; + this.chance = chance; + this.webs = webs; + } + + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { + if(rand.nextFloat() <= chance) { + if(webs && rand.nextInt(3) == 0) + this.field_151562_a = Blocks.web; + else + this.field_151562_a = Blocks.air; + } else + this.field_151562_a = Blocks.stained_glass_pane; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index 8ffa1292e..848af4d28 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -520,42 +520,6 @@ abstract public class Component extends StructureComponent { } } - /** Fills an area with cobwebs. Cobwebs will concentrate on corners and surfaces without floating cobwebs. */ - protected void fillWithCobwebs(World world, StructureBoundingBox box, Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { - - if(getYWithOffset(minY) < box.minY || getYWithOffset(maxY) > box.maxY) - return; - - for(int x = minX; x <= maxX; x++) { - - for(int z = minZ; z <= maxZ; z++) { - int posX = getXWithOffset(x, z); - int posZ = getZWithOffset(x, z); - - if(posX >= box.minX && posX <= box.maxX && posZ >= box.minZ && posZ <= box.maxZ) { - for(int y = minY; y <= maxY; y++) { - int posY = getYWithOffset(y); - Block genTarget = world.getBlock(posX, posY, posZ); - - if(!genTarget.isAir(world, posX, posY, posZ)) - continue; - - int validNeighbors = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - Block neighbor = world.getBlock(posX + dir.offsetX, posY + dir.offsetY, posZ + dir.offsetZ); - - if(neighbor.getMaterial().blocksMovement() || neighbor instanceof BlockWeb) - validNeighbors++; - } - - if(validNeighbors > 5 || (validNeighbors > 1 && rand.nextInt(6 - validNeighbors) == 0)) - world.setBlock(posX, posY, posZ, Blocks.web); - } - } - } - } - } - /** getXWithOffset & getZWithOffset Methods that are actually fixed **/ //Turns out, this entire time every single minecraft structure is mirrored instead of rotated when facing East and North //Also turns out, it's a scarily easy fix that they somehow didn't see *entirely* From 65d4999989cf96f84e01faada8b2c09c1e0cbc44 Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 3 Aug 2023 22:13:24 -0700 Subject: [PATCH 03/18] decoration --- .../java/com/hbm/items/tool/ItemWandD.java | 8 +- .../java/com/hbm/lib/HbmChestContents.java | 34 +++-- .../com/hbm/world/gen/NTMWorldGenerator.java | 9 ++ .../gen/component/BrutalistFeatures.java | 139 ++++++++++++++++-- .../hbm/world/gen/component/Component.java | 2 +- 5 files changed, 167 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 4c80ccab4..68f1b404c 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -5,12 +5,15 @@ import java.util.List; import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.lib.Library; +import com.hbm.world.gen.MapGenNTMFeatures; +import com.hbm.world.gen.component.BrutalistFeatures.ElevatedLab1; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -32,7 +35,10 @@ public class ItemWandD extends Item { vnt.setSFX(new ExplosionEffectStandard()); vnt.explode();*/ - PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); + //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); + ElevatedLab1 lab = new ElevatedLab1(world.rand, pos.blockX, pos.blockY, pos.blockZ); + + lab.addComponentParts(world, world.rand, new StructureBoundingBox(pos.blockX, 1, pos.blockZ, pos.blockX + 32, 255, pos.blockZ + 32)); /*TimeAnalyzer.startCount("setBlock"); world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt); diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index cdd0a61cd..957b10940 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -415,7 +415,7 @@ public class HbmChestContents { public static ItemStack generateOfficeBook(Random rand) { //TODO rework this lore in general String key; int pages; - switch(rand.nextInt(10)) { + switch(rand.nextInt(5)) { case 0: key = "resignation_note"; pages = 3; break; case 1: @@ -426,20 +426,32 @@ public class HbmChestContents { key = "memo_schrab_rd"; pages = 4; break; case 4: key = "memo_schrab_nuke"; pages = 3; break; - case 5: - key = "bf_bomb_1"; pages = 4; break; - case 6: - key = "bf_bomb_2"; pages = 6; break; - case 7: - key = "bf_bomb_3"; pages = 6; break; - case 8: - key = "bf_bomb_4"; pages = 5; break; - case 9: - key = "bf_bomb_5"; pages = 9; break; default: return null; } return ItemBookLore.createBook(key, pages, 0x6BC8FF, 0x0A0A0A); } + + public static ItemStack generateLabBook(Random rand) { + String key; + int pages; + + switch(rand.nextInt(4)) { + case 0: + key = "bf_bomb_1"; pages = 4; break; + case 1: + key = "bf_bomb_2"; pages = 6; break; + case 2: + key = "bf_bomb_3"; pages = 6; break; + case 3: + key = "bf_bomb_4"; pages = 5; break; + case 4: + key = "bf_bomb_5"; pages = 9; break; + default: + return null; + } + + return ItemBookLore.createBook(key, pages, 0x1E1E1E, 0x46EA44); + } } diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index a672e32a3..a3b812d37 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -120,4 +120,13 @@ public class NTMWorldGenerator implements IWorldGenerator { return true; } + + /** utility method, same as above but inclusive. useful for catch-alls, like the dirty glass structures have */ + public static boolean doesBiomeHaveTypes(BiomeGenBase biome, Type... types) { + for(Type type : types) { + if(isBiomeOfType(biome, type)) return true; + } + + return false; + } } \ No newline at end of file diff --git a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java index a84db6e61..01c9252a4 100644 --- a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java @@ -3,11 +3,13 @@ package com.hbm.world.gen.component; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.lib.HbmChestContents; import com.hbm.world.gen.NTMWorldGenerator; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.feature.WorldGenShrub; @@ -27,20 +29,36 @@ public class BrutalistFeatures { //might be other than a lab, placeholder :P public static class ElevatedLab1 extends Component { + protected int type; + public ElevatedLab1() { super(); } public ElevatedLab1(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 16, 11, 14); + + this.type = rand.nextInt(1); + } + + /** Set to NBT */ + protected void func_143012_a(NBTTagCompound nbt) { + super.func_143012_a(nbt); + nbt.setInteger("type", type); + } + + /** Get from NBT */ + protected void func_143011_b(NBTTagCompound nbt) { + super.func_143011_b(nbt); + this.type = nbt.getInteger("type"); } @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + if(hpos == -1 && !this.setAverageHeight(world, box, this.boundingBox.minY)) { return false; } - BiomeGenBase biome = world.getBiomeGenForCoords(this.boundingBox.minX, this.boundingBox.maxX); + BiomeGenBase biome = world.getBiomeGenForCoords(this.boundingBox.minX, this.boundingBox.minZ); DirtyGlass glass = new DirtyGlass(biome, 0.1F, true); final int stairMetaW = getStairMeta(0); @@ -293,15 +311,108 @@ public class BrutalistFeatures { fillWithMetadataBlocks(world, box, 11, 0, 8, 12, 0, 8, ModBlocks.steel_wall, decoMetaN); /* Deco */ + //lights + for(int j = 4; j <= 12; j+=4) + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, j, 8, 11, box); + for(int j = 4; j <= 12; j+=4) + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, j, 10, 3, box); + //doors + placeDoor(world, box, ModBlocks.door_office, 1, false, false, 3, 5, 8); + placeDoor(world, box, ModBlocks.door_office, 1, true, false, 2, 5, 8); + + final int decoModelMetaN = getDecoModelMeta(0); + final int decoModelMetaS = getDecoModelMeta(1); + final int decoMetaW = getDecoMeta(5); + switch(this.type) { + default: + //lower floor + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 5, 9, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 1, 6, 11, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 1, 5, 13, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 2, 5, 13, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 1, 6, 13, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS | 4, 5, 5, 9, box); //desk 1 + fillWithMetadataBlocks(world, box, 5, 5, 10, 5, 5, 11, Blocks.spruce_stairs, stairMetaE | 4); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 6, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 7, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS, 7, 5, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaN, 6, 6, 11, box); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairMetaW | 4, 11, 5, 9, box); //desk 2 + fillWithMetadataBlocks(world, box, 9, 5, 9, 10, 5, 9, Blocks.dark_oak_stairs, stairMetaS | 4); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 13, 9, 5, 10, box); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairMetaN | 4, 9, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW, 11, 5, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaS, 10, 6, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 13, 5, 13, box); //desk 3 + fillWithMetadataBlocks(world, box, 14, 5, 13, 15, 5, 13, Blocks.wooden_slab, 9); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 15, 5, 12, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS | 4, 15, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE, 14, 5, 12, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaN, 14, 6, 13, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 15, 5, 10, box); + placeBlockAtCurrentPosition(world, Blocks.fence, 0, 15, 5, 9, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 15, 6, 9, box); + //loot + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaS, 8, 5, 9, HbmChestContents.officeTrash, 4); + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaN, 12, 5, 13, HbmChestContents.filingCabinet, 6); + //there were supposed to be paintings included, but i don't want to figure out how to + //force the art type on both the server and clientside + //upper floor + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 15, 7, 5, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 15, 7, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 14, 7, 1, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 14, 8, 1, box); + fillWithBlocks(world, box, 8, 7, 3, 11, 7, 3, ModBlocks.tile_lab); //central table + placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaW, 12, 7, 3, box); + fillWithMetadataBlocks(world, box, 8, 7, 2, 11, 7, 2, ModBlocks.steel_wall, decoMetaS); + placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaE, 7, 7, 3, box); + fillWithMetadataBlocks(world, box, 8, 7, 4, 11, 7, 4, ModBlocks.steel_wall, decoMetaN); + fillWithBlocks(world, box, 10, 7, 5, 12, 7, 5, ModBlocks.cm_sheet); //machine 1 + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 12, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 11, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 10, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 0, 12, 9, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_port, 0, 11, 9, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 0, 10, 9, 5, box); + placeBlockAtCurrentPosition(world, Blocks.stone_button, getButtonMeta(4), 11, 9, 4, box); + fillWithMetadataBlocks(world, box, 9, 7, 5, 9, 8, 5, ModBlocks.steel_wall, decoMetaW); //locker + placeBlockAtCurrentPosition(world, ModBlocks.steel_roof, decoMetaN, 8, 9, 5, box); + fillWithMetadataBlocks(world, box, 7, 7, 5, 7, 8, 5, ModBlocks.steel_wall, decoMetaE); + fillWithBlocks(world, box, 4, 7, 5, 6, 7, 5, ModBlocks.cm_block); //machine 2 + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 6, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_circuit, 0, 5, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 4, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_engine, 0, 6, 9, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 5, 9, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_engine, 0, 4, 9, 5, box); + placeLever(world, box, 4, false, 5, 8, 4); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 4, 7, 1, box); //table + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 5, 7, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 7, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 2, 7, 5, box); //desk + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 1, 7, 5, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, 2, 7, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaN, 2, 8, 5, box); + //loot + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaS, 13, 7, 1, HbmChestContents.filingCabinet, 4); + if(rand.nextInt(2) == 0) + generateLoreBook(world, box, 13, 7, 1, 4, HbmChestContents.generateLabBook(rand)); + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 8, 7, 5, HbmChestContents.labVault, 4); + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 8, 8, 5, HbmChestContents.machineParts, 5); + break; + case 1: + + } //webs randomlyFillWithBlocks(world, box, rand, 0.15F, 0, 6, 7, 10, 8, 7, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.4F, 11, 5, 7, 11, 9, 7, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.4F, 16, 5, 7, 16, 9, 7, Blocks.web); - placeWebs(world, box, rand, 1, 5, 9, 15, 7, 13, 0.10F, 0.025F); + placeWebs(world, box, rand, 1, 5, 9, 15, 7, 13, 0.10F, 0.01F); placeWebs(world, box, rand, 13, 7, 6, 14, 8, 8, 0.20F, 0F); - placeWebs(world, box, rand, 1, 7, 1, 15, 9, 5, 0.10F, 0.025F); + placeWebs(world, box, rand, 1, 7, 1, 15, 9, 5, 0.10F, 0.01F); //test //plan is: biome-dependent overgrowth, integrated neatly @@ -347,13 +458,13 @@ public class BrutalistFeatures { int posJ = getYWithOffset(j); int posK = getZWithOffset(i, k); - if(world.isAirBlock(posI, posJ, posK) && (Math.abs(i - x) != fac || Math.abs(k - z) != fac || rand.nextInt(2) == 0)) + if(world.isAirBlock(posI, posJ, posK) && (Math.abs(i - x) != fac || Math.abs(k - z) != fac || rand.nextInt(3) == 0)) world.setBlock(posI, posJ, posK, Blocks.web, 0, 2); } } } - } else if((onWall || onCeiling) && rand.nextFloat() <= chance) + } else if((onWall || onCeiling) && world.isAirBlock(posX, posY, posZ) && rand.nextFloat() <= chance) world.setBlock(posX, posY, posZ, Blocks.web, 0, 2); } } @@ -397,14 +508,15 @@ public class BrutalistFeatures { public static class DirtyGlass extends StructureComponent.BlockSelector { protected boolean webs; protected float chance; + protected int meta; //argh public DirtyGlass(BiomeGenBase biome, float chance, boolean webs) { - if(NTMWorldGenerator.isBiomeOfTypes(biome, Type.WASTELAND, Type.JUNGLE, Type.SANDY, Type.SAVANNA)) - this.selectedBlockMetaData = 12; //super dirty - else if(BiomeDictionary.isBiomeOfType(biome, Type.COLD)) - this.selectedBlockMetaData = 8; //fogged-up + if(BiomeDictionary.isBiomeOfType(biome, Type.COLD)) + this.meta = 12; //super dirty + else if(NTMWorldGenerator.doesBiomeHaveTypes(biome, Type.WASTELAND, Type.JUNGLE, Type.SANDY, Type.SAVANNA, Type.SWAMP)) + this.meta = 8; //fogged-up else - this.selectedBlockMetaData = 7; //dirty + this.meta = 7; //dirty this.field_151562_a = Blocks.stained_glass_pane; this.chance = chance; @@ -414,12 +526,15 @@ public class BrutalistFeatures { @Override public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { if(rand.nextFloat() <= chance) { + this.selectedBlockMetaData = 0; if(webs && rand.nextInt(3) == 0) this.field_151562_a = Blocks.web; else this.field_151562_a = Blocks.air; - } else + } else { this.field_151562_a = Blocks.stained_glass_pane; + this.selectedBlockMetaData = meta; + } } } } \ No newline at end of file diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index 848af4d28..b112e11a6 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -47,7 +47,7 @@ abstract public class Component extends StructureComponent { this.sizeX = maxX; this.sizeY = maxY; this.sizeZ = maxZ; - this.coordBaseMode = rand.nextInt(4); + this.coordBaseMode = 0;//rand.nextInt(4); switch(this.coordBaseMode) { case 0: From 034c74a55d4545c0515219776a05920580c12989 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 5 Aug 2023 18:59:07 -0700 Subject: [PATCH 04/18] boo womp --- .../gen/component/BrutalistFeatures.java | 93 ++++++++++++++++++- .../hbm/world/gen/component/Component.java | 1 + 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java index 01c9252a4..13d1c1c4e 100644 --- a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java @@ -36,7 +36,7 @@ public class BrutalistFeatures { public ElevatedLab1(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 16, 11, 14); - this.type = rand.nextInt(1); + this.type = rand.nextInt(2); } /** Set to NBT */ @@ -322,9 +322,11 @@ public class BrutalistFeatures { final int decoModelMetaN = getDecoModelMeta(0); final int decoModelMetaS = getDecoModelMeta(1); + final int decoModelMetaW = getDecoModelMeta(2); + final int decoModelMetaE = getDecoModelMeta(3); final int decoMetaW = getDecoMeta(5); switch(this.type) { - default: + default: //machinery lab //lower floor placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 5, 9, box); placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 5, 11, box); @@ -401,8 +403,89 @@ public class BrutalistFeatures { generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 8, 7, 5, HbmChestContents.labVault, 4); generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 8, 8, 5, HbmChestContents.machineParts, 5); break; - case 1: + case 1: //hazmat + //lower floor + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS | 4, 1, 5, 9, box); //table + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 10, 1, 5, 10, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaN | 4, 1, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 1, 6, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 5, 13, box); + fillWithMetadataBlocks(world, box, 5, 5, 9, 11, 5, 9, ModBlocks.concrete_asbestos_stairs, stairMetaS | 4); //con. desk + fillWithMetadataBlocks(world, box, 5, 5, 10, 7, 5, 10, ModBlocks.concrete_slab, 10); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_asbestos_stairs, stairMetaN | 4, 7, 5, 11, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 10, 11, 5, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_asbestos_stairs, stairMetaN | 4, 11, 5, 11, box); + fillWithMetadataBlocks(world, box, 4, 6, 9, 4, 7, 9, ModBlocks.steel_wall, decoMetaE); //bank of tape recorders + fillWithMetadataBlocks(world, box, 5, 6, 9, 5, 7, 9, ModBlocks.tape_recorder, decoMetaN); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 6, 6, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 7, 6, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 6, 7, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 7, 7, 9, box); + placeBlockAtCurrentPosition(world, Blocks.lever, 3, 6, 7, 10, box); + placeBlockAtCurrentPosition(world, Blocks.stone_button, 3, 7, 6, 10, box); + fillWithMetadataBlocks(world, box, 8, 6, 9, 8, 7, 9, ModBlocks.steel_corner, decoMetaW); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 9, 6, 9, box); + fillWithMetadataBlocks(world, box, 10, 6, 9, 10, 7, 9, ModBlocks.steel_corner, decoMetaN); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 11, 6, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 11, 7, 9, box); + fillWithMetadataBlocks(world, box, 12, 6, 9, 12, 7, 9, ModBlocks.steel_wall, decoMetaW); + placeBlockAtCurrentPosition(world, Blocks.stone_button, 3, 11, 6, 10, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 5, 5, 11, box); //chairs and computers + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 8, 5, 12, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 10, 5, 11, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 6, 6, 10, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 7, 5, 12, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 10, 5, 10, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaE, 7, 6, 11, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 11, 6, 11, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE | 4, 14, 5, 13, box); //table + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW | 4, 15, 5, 13, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 15, 5, 11, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 15, 5, 9, box); + //loot + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaS | 1, 9, 7, 9, HbmChestContents.filingCabinet, 3); + generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 14, 6, 13, HbmChestContents.modGeneric, 3); + //upper floor + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW | 4, 15, 7, 5, box); //desks + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE | 4, 15, 7, 4, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS | 4, 15, 7, 2, box); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW | 4, 15, 7, 1, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 13, 7, 2, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 14, 7, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 15, 8, 4, box); + for(int i = 3; i <= 9; i+=6) { //hazmat tables + fillWithMetadataBlocks(world, box, i, 7, 3, i, 7, 5, ModBlocks.concrete_asbestos_stairs, stairMetaW | 4); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_asbestos_stairs, stairMetaN | 4, i+1, 7, 3, box); + fillWithMetadataBlocks(world, box, i+2, 7, 3, i+2, 7, 5, ModBlocks.concrete_asbestos_stairs, stairMetaE | 4); + fillWithMetadataBlocks(world, box, i+1, 7, 4, i+1, 7, 5, ModBlocks.concrete_colored_ext, 5); + } + placeBlockAtCurrentPosition(world, ModBlocks.block_electrical_scrap, 0, 10, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 8, 4, box); + fillWithMetadataBlocks(world, box, 6, 7, 5, 8, 7, 5, ModBlocks.cm_block, 1); //machine + placeBlockAtCurrentPosition(world, ModBlocks.cm_circuit, 2, 6, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_port, 1, 7, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_circuit, 2, 8, 8, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 1, 6, 9, 5, box); + placeBlockAtCurrentPosition(world, Blocks.redstone_lamp, 0, 7, 9, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 1, 8, 9, 5, box); + placeBlockAtCurrentPosition(world, Blocks.lever, 4, 7, 8, 4, box); + placeBlockAtCurrentPosition(world, ModBlocks.geiger, decoMetaE, 6, 7, 4, box); //geiger + if(rand.nextInt(2) == 0) + placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, 6, 7, 1, box); + else + placeRandomBobble(world, box, rand, 6, 7, 1 ); + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS | 4, 1, 7, 1, box); //desk + placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE | 4, 2, 7, 1, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 1, 7, 3, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 2, 8, 1, box); + placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 1, 7, 5, box); + //loot + generateInvContents(world, box, rand, ModBlocks.crate_iron, 8, 7, 3, HbmChestContents.nuclearFuel, 8); + generateInvContents(world, box, rand, ModBlocks.crate_iron, 2, 7, 5, HbmChestContents.nukeTrash, 6); + //other crate + placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 2, 8, 5, box); + break; } //webs @@ -512,9 +595,9 @@ public class BrutalistFeatures { public DirtyGlass(BiomeGenBase biome, float chance, boolean webs) { if(BiomeDictionary.isBiomeOfType(biome, Type.COLD)) - this.meta = 12; //super dirty - else if(NTMWorldGenerator.doesBiomeHaveTypes(biome, Type.WASTELAND, Type.JUNGLE, Type.SANDY, Type.SAVANNA, Type.SWAMP)) this.meta = 8; //fogged-up + else if(NTMWorldGenerator.doesBiomeHaveTypes(biome, Type.WASTELAND, Type.JUNGLE, Type.SANDY, Type.SAVANNA, Type.SWAMP)) + this.meta = 12; //super dirty else this.meta = 7; //dirty diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index b112e11a6..338bcd959 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -377,6 +377,7 @@ abstract public class Component extends StructureComponent { return generateInvContents(world, box, rand, block, 0, featureX, featureY, featureZ, content, amount); } + //TODO: explore min / max item generations: e.g., between 3 and 5 separate items are generated protected boolean generateInvContents(World world, StructureBoundingBox box, Random rand, Block block, int meta, int featureX, int featureY, int featureZ, WeightedRandomChestContent[] content, int amount) { int posX = this.getXWithOffset(featureX, featureZ); int posY = this.getYWithOffset(featureY); From 4f7659a5dca1c5d33cd69b1d702f73a938dd44f1 Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 8 Aug 2023 21:48:44 -0700 Subject: [PATCH 05/18] funny --- .../java/com/hbm/items/tool/ItemWandD.java | 9 +- .../com/hbm/world/gen/MapGenNTMFeatures.java | 8 +- .../world/gen/component/CivilianFeatures.java | 530 +++++++++--------- .../hbm/world/gen/component/Component.java | 18 +- .../world/gen/component/OfficeFeatures.java | 118 ++-- .../hbm/world/gen/component/RuinFeatures.java | 190 +++---- 6 files changed, 432 insertions(+), 441 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 68f1b404c..fa0fe9bcc 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -36,9 +36,14 @@ public class ItemWandD extends Item { vnt.explode();*/ //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); - ElevatedLab1 lab = new ElevatedLab1(world.rand, pos.blockX, pos.blockY, pos.blockZ); - lab.addComponentParts(world, world.rand, new StructureBoundingBox(pos.blockX, 1, pos.blockZ, pos.blockX + 32, 255, pos.blockZ + 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)); /*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 fe211813e..79c863242 100644 --- a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -114,7 +114,7 @@ public class MapGenNTMFeatures extends MapGenStructure { */ //TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP - /*if(rand.nextInt(3) == 0) { //Empty Ruin Structures + 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); @@ -160,9 +160,9 @@ public class MapGenNTMFeatures extends MapGenStructure { LargeOfficeCorner officeCorner = new LargeOfficeCorner(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); this.components.add(officeCorner); break; } - }*/ - ElevatedLab1 lab1 = new ElevatedLab1(rand, chunkX * 16 + 8, posY, chunkZ * 16 + 8); - this.components.add(lab1); + } + //ElevatedLab1 lab1 = new ElevatedLab1(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[Debug] Components: "); 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 26d7faaba..66301f925 100644 --- a/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java @@ -88,27 +88,27 @@ public class CivilianFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.sandstone, 0, 0, 0, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.sandstone, 0, 0, 0, 9, 6, -1, box); //Walls - this.fillWithRandomizedBlocks(world, box, 0, 0, 0, sizeX, 0, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 9, 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, sizeX - 1, 1, 0, sizeX, 1, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 2, 0, sizeX - 2, 2, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 1, sizeZ, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, 9 - 1, 1, 0, 9, 1, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 2, 0, 9 - 2, 2, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 0, 1, 6, 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, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 1, 1, sizeZ, false, rand, RandomSandstone); //Front Wall - this.fillWithRandomizedBlocks(world, box, 3, 0, sizeZ, sizeX, 1, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 1, 2, sizeZ, 3, 2, sizeZ, false, rand, RandomSandstone); - this.fillWithMetadataBlocks(world, box, 4, 2, sizeZ, 5, 2, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 2, 2, sizeZ, box); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 0, sizeX, 0, sizeZ, false, rand, RandomSandstone); //Right Wall - this.randomlyFillWithBlocks(world, box, rand, 0.65F, sizeX, 1, 1, sizeX, 1, sizeZ - 1, Blocks.sand, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 0, 2, 3, 0, 2, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 6, 1, 1, 6, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 3, 0, 6, 9, 1, 6, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 1, 2, 6, 3, 2, 6, false, rand, RandomSandstone); + this.fillWithMetadataBlocks(world, box, 4, 2, 6, 5, 2, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 9 - 2, 2, 6, box); + this.fillWithRandomizedBlocks(world, box, 9, 0, 0, 9, 0, 6, false, rand, RandomSandstone); //Right Wall + this.randomlyFillWithBlocks(world, box, rand, 0.65F, 9, 1, 1, 9, 1, 6 - 1, Blocks.sand, Blocks.air, false); this.fillWithRandomizedBlocks(world, box, 4, 0, 1, 4, 1, 3, false, rand, RandomSandstone); this.placeBlockAtCurrentPosition(world, ModBlocks.reinforced_sand, 0, 4, 0, 4, box); @@ -120,9 +120,9 @@ public class CivilianFeatures { 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) - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, sizeX - 1, 0, 1, box); - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, sizeZ - 1, Blocks.sand, Blocks.air, false); - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, sizeX - 1, 0, sizeZ - 1, Blocks.sand, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, 9 - 1, 0, 1, box); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, 6 - 1, Blocks.sand, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, 9 - 1, 0, 6 - 1, Blocks.sand, Blocks.air, false); return true; } @@ -168,10 +168,10 @@ public class CivilianFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.sandstone, 0, 0, 0, 6, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.sandstone, 0, 9, 0, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.sandstone, 0, 0, 0, 6, 15, -1, box); + placeFoundationUnderneath(world, Blocks.sandstone, 0, 9, 0, 15, 9, -1, box); - this.fillWithAir(world, box, 1, 0, 1, 5, sizeY, sizeZ - 1); + this.fillWithAir(world, box, 1, 0, 1, 5, 5, 9 - 1); //House 1 this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 6, 1, 0, false, rand, RandomSandstone); //Back Wall @@ -181,72 +181,72 @@ public class CivilianFeatures { 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, sizeZ, false, rand, RandomSandstone); //Left Wall - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 6, 1, sizeZ, false, rand, RandomSandstone); //Front Wall - this.fillWithRandomizedBlocks(world, box, 1, 2, sizeZ, 1, 2, sizeZ, false, rand, RandomSandstone); - this.fillWithBlocks(world, box, 2, 2, sizeZ, 4, 2, sizeZ, Blocks.fence, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 5, 2, sizeZ, 6, 2, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 1, 3, sizeZ, 6, 3, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 6, 0, sizeZ - 1, 6, 3, sizeZ - 1, false, rand, RandomSandstone); //Right Wall - this.fillWithRandomizedBlocks(world, box, 6, 0, sizeZ - 2, 6, 0, sizeZ - 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 6, 3, sizeZ - 2, 6, 3, sizeZ - 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, sizeZ - 3, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 3, 9, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, 9, 6, 1, 9, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 1, 2, 9, 1, 2, 9, false, rand, RandomSandstone); + this.fillWithBlocks(world, box, 2, 2, 9, 4, 2, 9, Blocks.fence, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 5, 2, 9, 6, 2, 9, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 1, 3, 9, 6, 3, 9, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 0, 9 - 1, 6, 3, 9 - 1, false, rand, RandomSandstone); //Right Wall + this.fillWithRandomizedBlocks(world, box, 6, 0, 9 - 2, 6, 0, 9 - 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 3, 9 - 2, 6, 3, 9 - 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, 9 - 3, false, rand, RandomSandstone); - this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, sizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor - //this.fillWithRandomizedBlocks(world, box, 1, sizeY - 1, 0, 5, sizeY - 1, sizeZ, false, rand, RandomSandstone); //Ceiling - this.fillWithBlocks(world, box, 1, sizeY - 1, 0, 5, sizeY - 1, sizeZ, Blocks.sandstone, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 0, sizeY - 1, 0, 0, sizeY - 1, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); //Roof - this.fillWithMetadataBlocks(world, box, 6, sizeY - 1, 0, 6, sizeY - 1, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 2, sizeY, 0, 4, sizeY, 0, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 3, sizeY, 1, 3, sizeY, 2, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 3, sizeY, 4, 3, sizeY, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 3, sizeY, sizeZ - 1, box); - this.fillWithMetadataBlocks(world, box, 2, sizeY, sizeZ, 4, sizeY, sizeZ, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, 9 - 1, Blocks.sandstone, Blocks.air, false); //Floor + //this.fillWithRandomizedBlocks(world, box, 1, 5 - 1, 0, 5, 5 - 1, 9, false, rand, RandomSandstone); //Ceiling + this.fillWithBlocks(world, box, 1, 5 - 1, 0, 5, 5 - 1, 9, Blocks.sandstone, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 0, 5 - 1, 0, 0, 5 - 1, 9, Blocks.stone_slab, 1, Blocks.air, 0, false); //Roof + this.fillWithMetadataBlocks(world, box, 6, 5 - 1, 0, 6, 5 - 1, 9, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, 5, 0, 4, 5, 0, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, 5, 1, 3, 5, 2, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 3, 5, 4, 3, 5, 6, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 3, 5, 9 - 1, box); + this.fillWithMetadataBlocks(world, box, 2, 5, 9, 4, 5, 9, Blocks.stone_slab, 1, Blocks.air, 0, false); //House 2 - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 0, sizeX, 0, 0, false, rand, RandomSandstone); //Back Wall - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 1, 0, sizeX - 2, 1, 0, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, 0, sizeX - 6, 2, 0, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 6, 2, 0, box); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 3, 2, 0, box); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 1, sizeX - 6, 3, 1, false, rand, RandomSandstone); //Left Wall - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 2, sizeX - 6, 0, 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 3, 2, sizeX - 6, 3, sizeZ - 1, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX - 6, sizeY - 1, 2, box); - this.fillWithMetadataBlocks(world, box, sizeX - 6, sizeY - 1, 4, sizeX - 6, sizeY - 1, sizeZ - 2, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 3, sizeX - 6, 1, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 0, 2, sizeX - 6, 0, 2, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, 3, sizeX - 6, 2, 3, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, sizeX - 6, 2, 4, box); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, 5, sizeX - 6, 2, 5, false, rand, RandomSandstone); - this.fillWithBlocks(world, box, sizeX - 6, 2, sizeZ - 3, sizeX - 6, 2, sizeZ - 2, Blocks.fence, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX - 6, 2, sizeZ - 1, sizeX - 6, 2, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX - 5, 0, sizeZ, sizeX, 1, sizeZ, false, rand, RandomSandstone); //Front Wall - this.fillWithRandomizedBlocks(world, box, sizeX - 5, 2, sizeZ, sizeX - 5, 2, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 2, sizeZ, sizeX, 2, sizeZ, false, rand, RandomSandstone); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 0, sizeZ - 1, false, rand, RandomSandstone); //Right Wall - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 3, sizeX, 1, 3, false, rand, RandomSandstone); - this.fillWithMetadataBlocks(world, box, sizeX, 1, 4, sizeX, 1, 5, Blocks.stone_slab, 1, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, sizeZ - 1, sizeX, 1, sizeZ - 3, false, rand, RandomSandstone); - this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, sizeX, 1, sizeZ - 1, box); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 0, 0, 15, 0, 0, false, rand, RandomSandstone); //Back Wall + this.fillWithRandomizedBlocks(world, box, 15 - 6, 1, 0, 15 - 2, 1, 0, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 2, 0, 15 - 6, 2, 0, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 15 - 6, 2, 0, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 15 - 3, 2, 0, box); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 0, 1, 15 - 6, 3, 1, false, rand, RandomSandstone); //Left Wall + this.fillWithRandomizedBlocks(world, box, 15 - 6, 0, 2, 15 - 6, 0, 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 3, 2, 15 - 6, 3, 9 - 1, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 15 - 6, 5 - 1, 2, box); + this.fillWithMetadataBlocks(world, box, 15 - 6, 5 - 1, 4, 15 - 6, 5 - 1, 9 - 2, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 0, 3, 15 - 6, 1, 9, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 0, 2, 15 - 6, 0, 2, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 2, 3, 15 - 6, 2, 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 15 - 6, 2, 4, box); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 2, 5, 15 - 6, 2, 5, false, rand, RandomSandstone); + this.fillWithBlocks(world, box, 15 - 6, 2, 9 - 3, 15 - 6, 2, 9 - 2, Blocks.fence, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 15 - 6, 2, 9 - 1, 15 - 6, 2, 9, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15 - 5, 0, 9, 15, 1, 9, false, rand, RandomSandstone); //Front Wall + this.fillWithRandomizedBlocks(world, box, 15 - 5, 2, 9, 15 - 5, 2, 9, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15 - 1, 2, 9, 15, 2, 9, false, rand, RandomSandstone); + this.fillWithRandomizedBlocks(world, box, 15, 0, 1, 15, 0, 9 - 1, false, rand, RandomSandstone); //Right Wall + this.fillWithRandomizedBlocks(world, box, 15, 1, 3, 15, 1, 3, false, rand, RandomSandstone); + this.fillWithMetadataBlocks(world, box, 15, 1, 4, 15, 1, 5, Blocks.stone_slab, 1, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 15, 1, 9 - 1, 15, 1, 9 - 3, false, rand, RandomSandstone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 15, 1, 9 - 1, box); - this.fillWithBlocks(world, box, sizeX - 5, 0, 1, sizeX - 1, 0, sizeZ - 1, Blocks.sandstone, Blocks.air, false); //Floor + this.fillWithBlocks(world, box, 15 - 5, 0, 1, 15 - 1, 0, 9 - 1, Blocks.sandstone, Blocks.air, false); //Floor //Loot & Decorations //House 1 int eastMeta = this.getDecoMeta(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, sizeY, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim_rusted, 0, 1, 5, 1, box); this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 2, 1, 3, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 1, 1, sizeZ - 4, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 1, 1, 9 - 4, box); if(!hasPlacedLoot[0]) { - this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 1, 1, sizeZ - 2, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, sizeZ - 2), - this.getYWithOffset(1), this.getZWithOffset(1, sizeZ - 2)), 10); + this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 1, 1, 9 - 2, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.machineParts, (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, 9 - 2), + this.getYWithOffset(1), this.getZWithOffset(1, 9 - 2)), 10); this.hasPlacedLoot[0] = true; } - this.fillWithBlocks(world, box, 4, 1, sizeZ - 1, 5, 1, sizeZ - 1, ModBlocks.crate, Blocks.air, false); + this.fillWithBlocks(world, box, 4, 1, 9 - 1, 5, 1, 9 - 1, ModBlocks.crate, Blocks.air, false); this.fillWithMetadataBlocks(world, box, 5, 1, 4, 5, 3, 4, ModBlocks.steel_scaffold, eastMeta < 4 ? 0 : 8, Blocks.air, 0, false); this.fillWithMetadataBlocks(world, box, 5, 1, 6, 5, 3, 6, ModBlocks.steel_scaffold, eastMeta < 4 ? 0 : 8, Blocks.air, 0, false); this.placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 1, 5, box); @@ -254,20 +254,20 @@ public class CivilianFeatures { //House 2 if(!hasPlacedLoot[1]) { - this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), sizeX - 5, 1, 1, box); - WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(this.getXWithOffset(sizeX - 5, 1), - this.getYWithOffset(1), this.getZWithOffset(sizeX - 5, 1)), 10); + this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 15 - 5, 1, 1, box); + WeightedRandomChestContent.generateChestContents(rand, HbmChestContents.antenna, (TileEntityChest)world.getTileEntity(this.getXWithOffset(15 - 5, 1), + this.getYWithOffset(1), this.getZWithOffset(15 - 5, 1)), 10); this.hasPlacedLoot[1] = true; } - this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), sizeX - 5, 1, 4, box); - TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(sizeX - 5, 4), this.getYWithOffset(1), this.getZWithOffset(sizeX - 5, 4)); + this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), 15 - 5, 1, 4, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(15 - 5, 4), this.getYWithOffset(1), this.getZWithOffset(15 - 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, sizeX - 4, 1, 1, sizeX - 1, 1, sizeZ - 1, Blocks.sand, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 15 - 4, 1, 1, 15 - 1, 1, 9 - 1, Blocks.sand, Blocks.air, false); return true; } @@ -314,86 +314,86 @@ public class CivilianFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, sizeX, sizeZ - 2, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 3, 6, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 9, 7 - 2, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 3, 6, 9, 7, -1, box); - if(this.getBlockAtCurrentPosition(world, 2, 0, sizeZ - 1, box).getMaterial().isReplaceable() - || this.getBlockAtCurrentPosition(world, 2, 0, sizeZ - 1, box) == Blocks.air) { - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 2, sizeZ - 1, 2, sizeZ - 1, -1, box); - this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, getStairMeta(0), 2, 0, sizeZ - 1, box); + if(this.getBlockAtCurrentPosition(world, 2, 0, 7 - 1, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, 2, 0, 7 - 1, box) == Blocks.air) { + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 2, 7 - 1, 2, 7 - 1, -1, box); + this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, getStairMeta(0), 2, 0, 7 - 1, box); } - this.fillWithAir(world, box, 1, 0, 1, sizeX - 1, sizeY, 4); - this.fillWithAir(world, box, 4, 0, 4, sizeX - 1, sizeY, sizeZ - 1); - this.fillWithAir(world, box, 3, 1, sizeZ - 1, 3, 2, sizeZ - 1); + this.fillWithAir(world, box, 1, 0, 1, 9 - 1, 4, 4); + this.fillWithAir(world, box, 4, 0, 4, 9 - 1, 4, 7 - 1); + this.fillWithAir(world, box, 3, 1, 7 - 1, 3, 2, 7 - 1); int pillarMeta = this.getPillarMeta(8); //Pillars this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 9, 0, 0, 9, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 4, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX, 0, 1, sizeX, 0, sizeZ - 1, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); - this.fillWithBlocks(world, box, 0, 0, sizeZ - 2, 0, 3, sizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, 3, 0, sizeZ - 2, 3, 3, sizeZ - 2, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, 3, 0, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 9, 0, 1, 9, 0, 7 - 1, ModBlocks.concrete_pillar, pillarMeta, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 0, 0, 7 - 2, 0, 3, 7 - 2, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 0, 7 - 2, 3, 3, 7 - 2, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 0, 7, 3, 3, 7, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 9, 0, 7, 9, 3, 7, ModBlocks.concrete_pillar, Blocks.air, false); //Walls - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, sizeX - 1, sizeY - 1, 0, false, rand, RandomConcreteBricks); //Back Wall - this.fillWithRandomizedBlocks(world, box, 0, sizeY, 0, sizeX, sizeY, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, sizeY - 1, 4, false, rand, RandomConcreteBricks); //Left Wall - this.fillWithRandomizedBlocks(world, box, 0, sizeY, 0, 0, sizeY, sizeZ - 2, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ - 2, 2, sizeY, sizeZ - 2, false, rand, RandomConcreteBricks); //Front Wall Pt. 1 - this.placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete_broken, 0, 3, sizeY, sizeZ - 2, box); - this.fillWithRandomizedBlocks(world, box, 3, sizeY - 1, sizeZ - 1, 3, sizeY, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 4, 0, sizeZ, sizeX - 1, 1, sizeZ, false, rand, RandomConcreteBricks); //Front Wall Pt. 2 - this.fillWithRandomizedBlocks(world, box, 4, 2, sizeZ, 4, 3, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 2, sizeZ, sizeX - 1, 3, sizeZ, false, rand, RandomConcreteBricks); - this.randomlyFillWithBlocks(world, box, rand, 0.75F, 5, 2, sizeZ, sizeX - 2, 3, sizeZ, Blocks.glass_pane, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 3, sizeY, sizeZ, sizeX, sizeY, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 1, sizeX, sizeY, sizeZ - 1, false, rand, RandomConcreteBricks); //Right Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 9 - 1, 4 - 1, 0, false, rand, RandomConcreteBricks); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 4, 0, 9, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 4 - 1, 4, false, rand, RandomConcreteBricks); //Left Wall + this.fillWithRandomizedBlocks(world, box, 0, 4, 0, 0, 4, 7 - 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 0, 7 - 2, 2, 4, 7 - 2, false, rand, RandomConcreteBricks); //Front Wall Pt. 1 + this.placeBlockAtCurrentPosition(world, ModBlocks.brick_concrete_broken, 0, 3, 4, 7 - 2, box); + this.fillWithRandomizedBlocks(world, box, 3, 4 - 1, 7 - 1, 3, 4, 7 - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 4, 0, 7, 9 - 1, 1, 7, false, rand, RandomConcreteBricks); //Front Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 4, 2, 7, 4, 3, 7, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 9 - 1, 2, 7, 9 - 1, 3, 7, false, rand, RandomConcreteBricks); + this.randomlyFillWithBlocks(world, box, rand, 0.75F, 5, 2, 7, 9 - 2, 3, 7, Blocks.glass_pane, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 3, 4, 7, 9, 4, 7, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 9, 1, 1, 9, 4, 7 - 1, false, rand, RandomConcreteBricks); //Right Wall //Floor & Ceiling - this.fillWithRandomizedBlocks(world, box, 1, 0, 1, sizeX - 1, 0, 4, false, rand, RandomLabTiles); //Floor - this.fillWithRandomizedBlocks(world, box, 4, 0, sizeZ - 2, sizeX - 1, 0, sizeZ - 1, false, rand, RandomLabTiles); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 3, 0, sizeZ - 1, box); + this.fillWithRandomizedBlocks(world, box, 1, 0, 1, 9 - 1, 0, 4, false, rand, RandomLabTiles); //Floor + this.fillWithRandomizedBlocks(world, box, 4, 0, 7 - 2, 9 - 1, 0, 7 - 1, false, rand, RandomLabTiles); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 3, 0, 7 - 1, box); - this.fillWithBlocks(world, box, 1, sizeY - 1, 1, 1, sizeY, 4, ModBlocks.reinforced_glass, Blocks.air, false); //Ceiling - this.fillWithBlocks(world, box, 2, sizeY, 1, sizeX - 1, sizeY, 4, ModBlocks.brick_light, Blocks.air, false); - this.fillWithBlocks(world, box, 4, sizeY, sizeZ - 2, sizeX - 1, sizeY, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, 1, 4 - 1, 1, 1, 4, 4, ModBlocks.reinforced_glass, Blocks.air, false); //Ceiling + this.fillWithBlocks(world, box, 2, 4, 1, 9 - 1, 4, 4, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, 4, 4, 7 - 2, 9 - 1, 4, 7 - 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.getDecoMeta(5); this.fillWithMetadataBlocks(world, box, 2, 1, 1, 2, 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 2, sizeY - 1, 1, 2, sizeY - 1, 4, ModBlocks.steel_wall, westDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, 4 - 1, 1, 2, 4 - 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.getMetadataWithOffset(Blocks.wooden_door, 2); - this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, sizeZ - 1, box); - ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, sizeZ - 1), this.getYWithOffset(1), this.getZWithOffset(3, sizeZ - 1), doorMeta, ModBlocks.door_office); + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, 7 - 1, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, 7 - 1), this.getYWithOffset(1), this.getZWithOffset(3, 7 - 1), doorMeta, ModBlocks.door_office); int northDecoMeta = this.getDecoMeta(3); - this.fillWithMetadataBlocks(world, box, 5, sizeY - 1, 1, sizeX - 1, sizeY - 1, 1, ModBlocks.steel_scaffold, westDecoMeta < 4 ? 0 : 8, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 5, sizeY - 1, 2, sizeX - 1, sizeY - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, 4 - 1, 1, 9 - 1, 4 - 1, 1, ModBlocks.steel_scaffold, westDecoMeta < 4 ? 0 : 8, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 5, 4 - 1, 2, 9 - 1, 4 - 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, sizeX - 2, 1, 1, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, sizeX - 1, 1, 1, box); - this.fillWithBlocks(world, box, 5, 1, 3, sizeX - 1, 1, 3, ModBlocks.deco_titanium, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.machine_shredder, 0, 9 - 2, 1, 1, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.deco_titanium, 0, 9 - 1, 1, 1, box); + this.fillWithBlocks(world, box, 5, 1, 3, 9 - 1, 1, 3, ModBlocks.deco_titanium, Blocks.air, false); 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)); this.hasPlacedLoot[0] = true; } - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, sizeX - 1, 1, sizeZ - 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 9 - 1, 1, 7 - 2, box); if(!hasPlacedLoot[1]) { - this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, sizeX - 1, 1, sizeZ - 1, HbmChestContents.modGeneric, 8); + this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 9 - 1, 1, 7 - 1, HbmChestContents.modGeneric, 8); } return true; @@ -442,134 +442,134 @@ public class CivilianFeatures { this.boundingBox.offset(0, -7, 0); //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, sizeX, sizeZ - 2, 6, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 7, 6, sizeZ, 6, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 12, 8 - 2, 6, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 7, 6, 8, 6, box); - if(this.getBlockAtCurrentPosition(world, sizeX - 3, sizeY - 4, 7, box).getMaterial().isReplaceable() - || this.getBlockAtCurrentPosition(world, sizeX - 3, sizeY - 4, 7, box) == Blocks.air) { + if(this.getBlockAtCurrentPosition(world, 12 - 3, 11 - 4, 7, box).getMaterial().isReplaceable() + || this.getBlockAtCurrentPosition(world, 12 - 3, 11 - 4, 7, box) == Blocks.air) { int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 2); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, sizeX - 3, 7, sizeX - 2, 7, sizeY - 4, box); - this.fillWithMetadataBlocks(world, box, sizeX - 3, sizeY - 4, 7, sizeX - 2, sizeY - 4, 7, Blocks.stone_brick_stairs, stairMeta, Blocks.air, 0, false); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 12 - 3, 7, 12 - 2, 7, 11 - 4, box); + this.fillWithMetadataBlocks(world, box, 12 - 3, 11 - 4, 7, 12 - 2, 11 - 4, 7, Blocks.stone_brick_stairs, stairMeta, Blocks.air, 0, false); } - this.fillWithAir(world, box, 1, sizeY - 4, 1, sizeX - 1, sizeY, sizeZ - 3); - this.fillWithAir(world, box, 1, sizeY - 4, sizeZ - 2, 5, sizeY, sizeZ - 1); - this.fillWithAir(world, box, sizeX - 3, sizeY - 3, sizeZ - 2, sizeX - 2, sizeY - 2, sizeZ - 2); + this.fillWithAir(world, box, 1, 11 - 4, 1, 12 - 1, 11, 8 - 3); + this.fillWithAir(world, box, 1, 11 - 4, 8 - 2, 5, 11, 8 - 1); + this.fillWithAir(world, box, 12 - 3, 11 - 3, 8 - 2, 12 - 2, 11 - 2, 8 - 2); this.fillWithAir(world, box, 5, 5, 1, 6, 6, 2); - this.fillWithAir(world, box, 2, 0, 2, sizeX - 2, 3, sizeZ - 2); + this.fillWithAir(world, box, 2, 0, 2, 12 - 2, 3, 8 - 2); //Walls - this.fillWithRandomizedBlocks(world, box, 0, sizeY - 4, 0, sizeX, sizeY, 0, false, rand, RandomSuperConcrete); //Back Wall - this.fillWithRandomizedBlocks(world, box, 0, sizeY - 4, 0, 0, sizeY, sizeZ, false, rand, RandomSuperConcrete); //Left Wall - this.fillWithRandomizedBlocks(world, box, 1, sizeY - 4, sizeZ, 5, sizeY - 4, sizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 1 - this.fillWithBlocks(world, box, 1, sizeY - 3, sizeZ, 1, sizeY - 1, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, sizeY - 4, sizeZ, 2, sizeY - 1, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 3, sizeY - 3, sizeZ, 3, sizeY - 1, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 4, sizeY - 4, sizeZ, 4, sizeY - 1, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 5, sizeY - 3, sizeZ, 5, sizeY - 1, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, sizeY, sizeZ, 5, sizeY, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 6, sizeY - 4, sizeZ - 1, 6, sizeY, sizeZ, false, rand, RandomSuperConcrete); //Front Wall pt. 2 - this.fillWithRandomizedBlocks(world, box, 6, sizeY - 4, sizeZ - 2, 7, sizeY - 2, sizeZ - 2, false, rand, RandomSuperConcrete); //Front Wall pt. 3 - this.fillWithBlocks(world, box, 6, sizeY - 1, sizeZ - 2, 7, sizeY - 1, sizeZ - 2, ModBlocks.concrete_super_broken, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX - 4, sizeY - 4, sizeZ - 2, sizeX, sizeY - 4, sizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, sizeX - 4, sizeY - 3, sizeZ - 2, sizeX - 4, sizeY, sizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, sizeX - 3, sizeY - 1, sizeZ - 2, sizeX - 2, sizeY, sizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, sizeY - 4, sizeZ - 2, sizeX, sizeY, sizeZ - 2, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, sizeX, sizeY - 4, 1, sizeX, sizeY - 4, sizeZ - 3, false, rand, RandomSuperConcrete); //Right Wall - this.fillWithBlocks(world, box, sizeX, sizeY - 3, sizeZ - 3, sizeX, sizeY - 1, sizeZ - 3, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX, sizeY - 3, 4, sizeX, sizeY - 1, 4, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, sizeX, sizeY - 3, 3, sizeX, sizeY - 1, 3, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX, sizeY - 3, 2, sizeX, sizeY - 1, 2, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, sizeX, sizeY - 3, 1, sizeX, sizeY - 1, 1, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX, sizeY, 1, sizeX, sizeY, sizeZ - 3, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 0, 11 - 4, 0, 12, 11, 0, false, rand, RandomSuperConcrete); //Back Wall + this.fillWithRandomizedBlocks(world, box, 0, 11 - 4, 0, 0, 11, 8, false, rand, RandomSuperConcrete); //Left Wall + this.fillWithRandomizedBlocks(world, box, 1, 11 - 4, 8, 5, 11 - 4, 8, false, rand, RandomSuperConcrete); //Front Wall pt. 1 + this.fillWithBlocks(world, box, 1, 11 - 3, 8, 1, 11 - 1, 8, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 11 - 4, 8, 2, 11 - 1, 8, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, 11 - 3, 8, 3, 11 - 1, 8, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 4, 11 - 4, 8, 4, 11 - 1, 8, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 5, 11 - 3, 8, 5, 11 - 1, 8, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 11, 8, 5, 11, 8, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 6, 11 - 4, 8 - 1, 6, 11, 8, false, rand, RandomSuperConcrete); //Front Wall pt. 2 + this.fillWithRandomizedBlocks(world, box, 6, 11 - 4, 8 - 2, 7, 11 - 2, 8 - 2, false, rand, RandomSuperConcrete); //Front Wall pt. 3 + this.fillWithBlocks(world, box, 6, 11 - 1, 8 - 2, 7, 11 - 1, 8 - 2, ModBlocks.concrete_super_broken, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 12 - 4, 11 - 4, 8 - 2, 12, 11 - 4, 8 - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 12 - 4, 11 - 3, 8 - 2, 12 - 4, 11, 8 - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 12 - 3, 11 - 1, 8 - 2, 12 - 2, 11, 8 - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 12 - 1, 11 - 4, 8 - 2, 12, 11, 8 - 2, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 12, 11 - 4, 1, 12, 11 - 4, 8 - 3, false, rand, RandomSuperConcrete); //Right Wall + this.fillWithBlocks(world, box, 12, 11 - 3, 8 - 3, 12, 11 - 1, 8 - 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 12, 11 - 3, 4, 12, 11 - 1, 4, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 12, 11 - 3, 3, 12, 11 - 1, 3, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 12, 11 - 3, 2, 12, 11 - 1, 2, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 12, 11 - 3, 1, 12, 11 - 1, 1, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 12, 11, 1, 12, 11, 8 - 3, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 1, 0, 1, sizeX - 1, 3, 1, ModBlocks.reinforced_stone, Blocks.air, false); //Back Wall - this.fillWithBlocks(world, box, 1, 0, 2, 1, 3, sizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Left Wall - this.fillWithBlocks(world, box, 1, 0, sizeZ - 1, sizeX - 1, 3, sizeZ - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall - this.fillWithBlocks(world, box, sizeX - 1, 0, 2, sizeX - 1, 3, sizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); // Right Wall - this.fillWithBlocks(world, box, 6, 0, 3, 6, 3, sizeZ - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Internal Wall + this.fillWithBlocks(world, box, 1, 0, 1, 12 - 1, 3, 1, ModBlocks.reinforced_stone, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, 1, 0, 2, 1, 3, 8 - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Left Wall + this.fillWithBlocks(world, box, 1, 0, 8 - 1, 12 - 1, 3, 8 - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall + this.fillWithBlocks(world, box, 12 - 1, 0, 2, 12 - 1, 3, 8 - 2, ModBlocks.reinforced_stone, Blocks.air, false); // Right Wall + this.fillWithBlocks(world, box, 6, 0, 3, 6, 3, 8 - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Internal Wall //Floors & Ceiling - this.fillWithRandomizedBlocks(world, box, 1, sizeY - 4, 1, 3, sizeY - 4, sizeZ - 1, false, rand, RandomLabTiles); //Left Floor - this.fillWithRandomizedBlocks(world, box, 4, sizeY - 4, sizeZ - 2, 5, sizeY - 4, sizeZ - 1, false, rand, RandomLabTiles); - this.fillWithRandomizedBlocks(world, box, sizeX - 4, sizeY - 4, 1, sizeX - 1, sizeY - 4, sizeZ - 3, false, rand, RandomLabTiles); //Right Floor - this.fillWithRandomizedBlocks(world, box, sizeX - 3, sizeY - 4, sizeZ - 2, sizeX - 2, sizeY - 4, sizeZ - 2, false, rand, RandomLabTiles); - this.fillWithBlocks(world, box, 4, sizeY - 4, 1, 7, sizeY - 4, 1, ModBlocks.tile_lab_broken, Blocks.air, false); //Center Floor (Pain) - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 4, sizeY - 4, 2, box); - this.fillWithBlocks(world, box, 4, sizeY - 4, 3, 4, sizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 5, sizeY - 4, 3, box); - this.fillWithBlocks(world, box, 5, sizeY - 4, 4, 5, sizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 6, sizeY - 4, 4, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 6, sizeY - 4, 5, box); - this.fillWithBlocks(world, box, 7, sizeY - 4, 2, 7, sizeY - 4, 3, ModBlocks.tile_lab_broken, Blocks.air, false); - this.fillWithBlocks(world, box, 7, sizeY - 4, 4, 7, sizeY - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 11 - 4, 1, 3, 11 - 4, 8 - 1, false, rand, RandomLabTiles); //Left Floor + this.fillWithRandomizedBlocks(world, box, 4, 11 - 4, 8 - 2, 5, 11 - 4, 8 - 1, false, rand, RandomLabTiles); + this.fillWithRandomizedBlocks(world, box, 12 - 4, 11 - 4, 1, 12 - 1, 11 - 4, 8 - 3, false, rand, RandomLabTiles); //Right Floor + this.fillWithRandomizedBlocks(world, box, 12 - 3, 11 - 4, 8 - 2, 12 - 2, 11 - 4, 8 - 2, false, rand, RandomLabTiles); + this.fillWithBlocks(world, box, 4, 11 - 4, 1, 7, 11 - 4, 1, ModBlocks.tile_lab_broken, Blocks.air, false); //Center Floor (Pain) + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 4, 11 - 4, 2, box); + this.fillWithBlocks(world, box, 4, 11 - 4, 3, 4, 11 - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 5, 11 - 4, 3, box); + this.fillWithBlocks(world, box, 5, 11 - 4, 4, 5, 11 - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_broken, 0, 6, 11 - 4, 4, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 6, 11 - 4, 5, box); + this.fillWithBlocks(world, box, 7, 11 - 4, 2, 7, 11 - 4, 3, ModBlocks.tile_lab_broken, Blocks.air, false); + this.fillWithBlocks(world, box, 7, 11 - 4, 4, 7, 11 - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false); - this.fillWithBlocks(world, box, 1, sizeY, 1, 2, sizeY, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Left Ceiling - this.fillWithBlocks(world, box, 3, sizeY, sizeZ - 2, 4, sizeY, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); - this.fillWithBlocks(world, box, sizeX - 3, sizeY, 1, sizeX - 1, sizeY, sizeZ - 3, ModBlocks.brick_light, Blocks.air, false); //Right Ceiling - this.fillWithBlocks(world, box, 3, sizeY, 1, 8, sizeY, 1, ModBlocks.waste_planks, Blocks.air, false); //Center Ceiling (Pain) - this.fillWithBlocks(world, box, 3, sizeY, 2, 4, sizeY, 2, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 7, sizeY, 2, 8, sizeY, 2, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 3, sizeY, 3, 3, sizeY, 5, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 4, sizeY, 4, 4, sizeY, 5, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 5, sizeY, 6, 5, sizeY, sizeZ - 1, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithBlocks(world, box, 8, sizeY, 3, 8, sizeY, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 1, 11, 1, 2, 11, 8 - 1, ModBlocks.brick_light, Blocks.air, false); //Left Ceiling + this.fillWithBlocks(world, box, 3, 11, 8 - 2, 4, 11, 8 - 1, ModBlocks.brick_light, Blocks.air, false); + this.fillWithBlocks(world, box, 12 - 3, 11, 1, 12 - 1, 11, 8 - 3, ModBlocks.brick_light, Blocks.air, false); //Right Ceiling + this.fillWithBlocks(world, box, 3, 11, 1, 8, 11, 1, ModBlocks.waste_planks, Blocks.air, false); //Center Ceiling (Pain) + this.fillWithBlocks(world, box, 3, 11, 2, 4, 11, 2, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 7, 11, 2, 8, 11, 2, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 3, 11, 3, 3, 11, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 4, 11, 4, 4, 11, 5, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 5, 11, 6, 5, 11, 8 - 1, ModBlocks.waste_planks, Blocks.air, false); + this.fillWithBlocks(world, box, 8, 11, 3, 8, 11, 5, ModBlocks.waste_planks, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, 0, 2, 5, 0, sizeZ - 2, false, rand, RandomLabTiles); //Floor + this.fillWithRandomizedBlocks(world, box, 2, 0, 2, 5, 0, 8 - 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, sizeX - 2, 0, sizeZ - 2, false, rand, RandomLabTiles); + this.fillWithRandomizedBlocks(world, box, 7, 0, 2, 12 - 2, 0, 8 - 2, false, rand, RandomLabTiles); - this.fillWithRandomizedBlocks(world, box, 1, 4, 1, sizeX - 1, 4, sizeZ - 1, false, rand, RandomConcreteBricks); //Ceiling + this.fillWithRandomizedBlocks(world, box, 1, 4, 1, 12 - 1, 4, 8 - 1, false, rand, RandomConcreteBricks); //Ceiling //Decorations & Loot int eastMeta = this.getDecoMeta(4); int westMeta = this.getDecoMeta(5); int northMeta = this.getDecoMeta(3); int southMeta = this.getDecoMeta(2); - this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, sizeY - 2, 3, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, 11 - 2, 3, box); int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 1); - this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, sizeX - 3, sizeY - 3, sizeZ - 2, box); - ItemDoor.placeDoorBlock(world, this.getXWithOffset(sizeX - 3, sizeZ - 2), this.getYWithOffset(sizeY - 3), this.getZWithOffset(sizeX - 3, sizeZ - 2), + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 12 - 3, 11 - 3, 8 - 2, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(12 - 3, 8 - 2), this.getYWithOffset(11 - 3), this.getZWithOffset(12 - 3, 8 - 2), doorMeta, ModBlocks.door_office); - this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, sizeX - 2, sizeY - 3, sizeZ - 2, box); - ItemDoor.placeDoorBlock(world, this.getXWithOffset(sizeX - 2, sizeZ - 2), this.getYWithOffset(sizeY - 3), this.getZWithOffset(sizeX - 2, sizeZ - 2), + this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 12 - 2, 11 - 3, 8 - 2, box); + ItemDoor.placeDoorBlock(world, this.getXWithOffset(12 - 2, 8 - 2), this.getYWithOffset(11 - 3), this.getZWithOffset(12 - 2, 8 - 2), doorMeta, ModBlocks.door_office); - this.fillWithBlocks(world, box, 1, sizeY - 3, 1, 1, sizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 1, sizeY - 3, 2, 1, sizeY - 2, 3, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, westMeta, 1, sizeY - 1, 2, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 1, sizeY - 1, 3, box); - this.fillWithBlocks(world, box, 1, sizeY - 3, 6, 1, sizeY - 1, 6, ModBlocks.deco_pipe_framed_rusted, Blocks.air, false); + this.fillWithBlocks(world, box, 1, 11 - 3, 1, 1, 11 - 1, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 1, 11 - 3, 2, 1, 11 - 2, 3, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, westMeta, 1, 11 - 1, 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 1, 11 - 1, 3, box); + this.fillWithBlocks(world, box, 1, 11 - 3, 6, 1, 11 - 1, 6, ModBlocks.deco_pipe_framed_rusted, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, sizeX - 4, sizeY - 3, 1, sizeX - 4, sizeY - 1, 1, ModBlocks.steel_wall, eastMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX - 3, sizeY - 1, 1, sizeX - 2, sizeY - 1, 1, ModBlocks.steel_grate, 0, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX - 3, sizeY - 2, 1, sizeX - 2, sizeY - 2, 1, ModBlocks.tape_recorder, northMeta, Blocks.air, 0, false); - this.fillWithBlocks(world, box, sizeX - 3, sizeY - 3, 1, sizeX - 2, sizeY - 3, 1, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, sizeX - 1, sizeY - 3, 1, sizeX - 1, sizeY - 1, 1, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 12 - 4, 11 - 3, 1, 12 - 4, 11 - 1, 1, ModBlocks.steel_wall, eastMeta, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 12 - 3, 11 - 1, 1, 12 - 2, 11 - 1, 1, ModBlocks.steel_grate, 0, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 12 - 3, 11 - 2, 1, 12 - 2, 11 - 2, 1, ModBlocks.tape_recorder, northMeta, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 12 - 3, 11 - 3, 1, 12 - 2, 11 - 3, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 12 - 1, 11 - 3, 1, 12 - 1, 11 - 1, 1, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, 2, 1, 2, 2, 1, sizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 2, 1, 2, 2, 1, 8 - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); this.placeBlockAtCurrentPosition(world, ModBlocks.vitrified_barrel, 0, 2, 2, 2, box); 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, sizeZ - 2, 3, 3, sizeZ - 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, sizeZ - 2, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 2, sizeZ - 2, box); + this.fillWithMetadataBlocks(world, box, 3, 1, 8 - 2, 3, 3, 8 - 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 4, 1, 8 - 2, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 2, 8 - 2, box); if(!hasPlacedLoot[0]) { - this.hasPlacedLoot[0] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 5, 1, sizeZ - 2, HbmChestContents.nuclearFuel, 10); + this.hasPlacedLoot[0] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 5, 1, 8 - 2, HbmChestContents.nuclearFuel, 10); } - this.fillWithBlocks(world, box, 4, 1, sizeZ - 3, 5, 1, sizeZ - 3, ModBlocks.crate_lead, Blocks.air, false); + this.fillWithBlocks(world, box, 4, 1, 8 - 3, 5, 1, 8 - 3, ModBlocks.crate_lead, Blocks.air, false); - this.fillWithBlocks(world, box, sizeX - 5, 1, sizeZ - 2, sizeX - 5, 3, sizeZ - 2, ModBlocks.deco_steel, Blocks.air, false);; - this.fillWithMetadataBlocks(world, box, sizeX - 4, 1, sizeZ - 2, sizeX - 2, 1, sizeZ - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX - 4, 2, sizeZ - 2, sizeX - 3, 2, sizeZ - 2, ModBlocks.tape_recorder, southMeta, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, sizeX - 2, 2, sizeZ - 2, box); - this.fillWithBlocks(world, box, sizeX - 4, 3, sizeZ - 2, sizeX - 2, 3, sizeZ - 2, ModBlocks.steel_roof, Blocks.air, false); + this.fillWithBlocks(world, box, 12 - 5, 1, 8 - 2, 12 - 5, 3, 8 - 2, ModBlocks.deco_steel, Blocks.air, false);; + this.fillWithMetadataBlocks(world, box, 12 - 4, 1, 8 - 2, 12 - 2, 1, 8 - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 12 - 4, 2, 8 - 2, 12 - 3, 2, 8 - 2, ModBlocks.tape_recorder, southMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 12 - 2, 2, 8 - 2, box); + this.fillWithBlocks(world, box, 12 - 4, 3, 8 - 2, 12 - 2, 3, 8 - 2, ModBlocks.steel_roof, Blocks.air, false); if(!hasPlacedLoot[1]) { - this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, sizeX - 2, 1, 3, HbmChestContents.nukeTrash, 9); + this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 12 - 2, 1, 3, HbmChestContents.nukeTrash, 9); if(rand.nextInt(2) == 0) - generateLoreBook(world, box, sizeX - 2, 1, 3, 1, HbmChestContents.generateOfficeBook(rand)); + generateLoreBook(world, box, 12 - 2, 1, 3, 1, HbmChestContents.generateOfficeBook(rand)); } return true; @@ -612,20 +612,20 @@ public class CivilianFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, sizeX - 3, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.dirt, 0, 8, 1, sizeX, 6, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, 8 - 3, 11, -1, box); + placeFoundationUnderneath(world, Blocks.dirt, 0, 8, 1, 10, 6, -1, box); - this.fillWithAir(world, box, 1, 0, 0, sizeX - 3, sizeY - 2, sizeZ); - this.fillWithAir(world, box, sizeX - 2, 0, 2, sizeX - 1, 2, 5); + this.fillWithAir(world, box, 1, 0, 0, 10 - 3, 6 - 2, 8); + this.fillWithAir(world, box, 10 - 2, 0, 2, 10 - 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); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 1, 0, sizeZ - 1, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 1, 0, 8 - 1, -1, box); - this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, sizeZ - 1, Blocks.stone_slab, 5, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 8 - 1, Blocks.stone_slab, 5, Blocks.air, 0, false); } //Walls @@ -633,62 +633,62 @@ public class CivilianFeatures { int pillarMetaNS = this.getPillarMeta(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, sizeX - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, sizeX - 3, 4, 0, box); - this.fillWithBlocks(world, box, sizeX - 3, 0, 0, sizeX - 3, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, 0, 0, sizeX - 4, 1, 0, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 2, 4, 0, 10 - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 10 - 3, 4, 0, box); + this.fillWithBlocks(world, box, 10 - 3, 0, 0, 10 - 3, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 0, 0, 10 - 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, sizeX - 4, 2, 0, sizeX - 4, 2, 0, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 3, 0, sizeX - 4, 3, 0, false, rand, RandomSuperConcrete); - this.fillWithMetadataBlocks(world, box, 1, 4, 1, 1, 4, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, sizeZ, box); - this.fillWithBlocks(world, box, 1, 0, sizeZ, 1, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 10 - 4, 2, 0, 10 - 4, 2, 0, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 3, 0, 10 - 4, 3, 0, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 1, 4, 1, 1, 4, 8 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 8, box); + this.fillWithBlocks(world, box, 1, 0, 8, 1, 3, 8, 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, sizeZ - 1, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ - 2, 1, 3, sizeZ - 1, false, rand, RandomSuperConcrete); - this.fillWithMetadataBlocks(world, box, 2, 4, sizeZ, sizeX - 4, 4, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, sizeX - 3, 4, sizeZ, box); - this.fillWithBlocks(world, box, sizeX - 3, 0, sizeZ, sizeX - 3, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 2, 0, sizeZ, sizeX - 4, 1, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 2, sizeZ, 2, 2, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, 3, 2, sizeZ, 5, 2, sizeZ, ModBlocks.reinforced_glass, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX - 4, 2, sizeZ, sizeX - 4, 2, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithRandomizedBlocks(world, box, 2, 3, sizeZ, sizeX - 4, 3, sizeZ, false, rand, RandomSuperConcrete); - this.fillWithMetadataBlocks(world, box, sizeX - 3, 4, 1, sizeX - 3, 4, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithRandomizedBlocks(world, box, sizeX - 3, 0, 1, sizeX - 3, 3, sizeZ - 1, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 3, 1, 1, 3, 8 - 1, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 1, 0, 8 - 2, 1, 3, 8 - 1, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 2, 4, 8, 10 - 4, 4, 8, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 10 - 3, 4, 8, box); + this.fillWithBlocks(world, box, 10 - 3, 0, 8, 10 - 3, 3, 8, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 2, 0, 8, 10 - 4, 1, 8, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 2, 8, 2, 2, 8, false, rand, RandomSuperConcrete); + this.fillWithBlocks(world, box, 3, 2, 8, 5, 2, 8, ModBlocks.reinforced_glass, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 10 - 4, 2, 8, 10 - 4, 2, 8, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 3, 8, 10 - 4, 3, 8, false, rand, RandomSuperConcrete); + this.fillWithMetadataBlocks(world, box, 10 - 3, 4, 1, 10 - 3, 4, 8 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithRandomizedBlocks(world, box, 10 - 3, 0, 1, 10 - 3, 3, 8 - 1, false, rand, RandomSuperConcrete); pillarMetaWE = this.getPillarMeta(5); pillarMetaNS = this.getPillarMeta(9); - this.fillWithMetadataBlocks(world, box, sizeX - 2, 2, 1, sizeX - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall - this.fillWithMetadataBlocks(world, box, sizeX, 0, 1, sizeX, 2, 1, Blocks.log, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 1, sizeX - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX, 2, 2, sizeX, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithMetadataBlocks(world, box, sizeX, 0, 6, sizeX, 2, 6, Blocks.log, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX, 0, 3, sizeX, 1, 5, Blocks.planks, 1, Blocks.air, 0, false); - this.fillWithMetadataBlocks(world, box, sizeX - 2, 2, 6, sizeX - 1, 2, 6, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 6, sizeX - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 10 - 2, 2, 1, 10 - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall + this.fillWithMetadataBlocks(world, box, 10, 0, 1, 10, 2, 1, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 1, 10 - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 10, 2, 2, 10, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithMetadataBlocks(world, box, 10, 0, 6, 10, 2, 6, Blocks.log, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 10, 0, 3, 10, 1, 5, Blocks.planks, 1, Blocks.air, 0, false); + this.fillWithMetadataBlocks(world, box, 10 - 2, 2, 6, 10 - 1, 2, 6, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 6, 10 - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false); //Floor & Ceiling - this.fillWithBlocks(world, box, 2, 0, 1, 6, 0, sizeZ - 1, ModBlocks.brick_light, Blocks.air, false); //Floor + this.fillWithBlocks(world, box, 2, 0, 1, 6, 0, 8 - 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, sizeZ - 3, 6, 4, sizeZ - 1, false, rand, RandomSuperConcrete); + this.fillWithRandomizedBlocks(world, box, 2, 4, 8 - 3, 6, 4, 8 - 1, false, rand, RandomSuperConcrete); - this.fillWithBlocks(world, box, sizeX - 2, 2, 2, sizeX - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 10 - 2, 2, 2, 10 - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false); //Loot & Decorations int southMeta = this.getDecoMeta(2); int eastMeta = this.getDecoMeta(5); - this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, sizeY - 1, 1, box); - this.fillWithBlocks(world, box, 3, sizeY - 1, 1, 4, sizeY - 1, 1, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithBlocks(world, box, 2, sizeY - 1, 2, 4, sizeY - 1, 2, ModBlocks.deco_steel, Blocks.air, false); - this.fillWithBlocks(world, box, 2, sizeY, 1, 4, sizeY, 2, ModBlocks.steel_roof, Blocks.air, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, 6 - 1, 1, box); + this.fillWithBlocks(world, box, 3, 6 - 1, 1, 4, 6 - 1, 1, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 2, 6 - 1, 2, 4, 6 - 1, 2, ModBlocks.deco_steel, Blocks.air, false); + this.fillWithBlocks(world, box, 2, 6, 1, 4, 6, 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); @@ -698,28 +698,28 @@ public class CivilianFeatures { 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 < 4 ? 0 : 8, 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, sizeZ - 1, box); - this.fillWithMetadataBlocks(world, box, 2, 1, sizeZ - 1, 3, 1, sizeZ - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.radiorec, eastMeta, 6, 2, 8 - 1, box); + this.fillWithMetadataBlocks(world, box, 2, 1, 8 - 1, 3, 1, 8 - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false); if(!hasPlacedLoot) { - this.hasPlacedLoot = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 4, 1, sizeZ - 1, HbmChestContents.machineParts, 11); + this.hasPlacedLoot = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 4, 1, 8 - 1, HbmChestContents.machineParts, 11); } 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, sizeX - 2, 0, 5, sizeX - 1, 0, 5, ModBlocks.steel_grate, 7, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, southMeta, sizeX - 2, 1, 5, box); - this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), sizeX - 1, 1, 5, box); - TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(sizeX - 1, 5), this.getYWithOffset(1), this.getZWithOffset(sizeX - 1, 5)); + this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 5, 10 - 1, 0, 5, ModBlocks.steel_grate, 7, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, southMeta, 10 - 2, 1, 5, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), 10 - 1, 1, 5, box); + TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(10 - 1, 5), this.getYWithOffset(1), this.getZWithOffset(10 - 1, 5)); if(bobble != null) { bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1]; bobble.markDirty(); } - this.fillWithMetadataBlocks(world, box, sizeX - 2, 0, 2, sizeX - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false); - this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, sizeX - 2, 1, 2, box); - this.placeBlockAtCurrentPosition(world, Blocks.web, 0, sizeX - 2, 1, 3, box); + this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 2, 10 - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false); + this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, 10 - 2, 1, 2, box); + this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 10 - 2, 1, 3, box); return true; } diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index 338bcd959..0d86e2cac 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -25,12 +25,7 @@ import net.minecraft.world.gen.structure.StructureComponent; import net.minecraftforge.common.util.ForgeDirection; abstract public class Component extends StructureComponent { - /** The size of the bounding box for this feature in the X axis */ - protected int sizeX; - /** The size of the bounding box for this feature in the Y axis */ - protected int sizeY; - /** The size of the bounding box for this feature in the Z axis */ - protected int sizeZ; + /** Average height (Presumably stands for height position) */ protected int hpos = -1; @@ -44,10 +39,7 @@ abstract public class Component extends StructureComponent { protected Component(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { super(0); - this.sizeX = maxX; - this.sizeY = maxY; - this.sizeZ = maxZ; - this.coordBaseMode = 0;//rand.nextInt(4); + this.coordBaseMode = rand.nextInt(4); switch(this.coordBaseMode) { case 0: @@ -70,17 +62,11 @@ abstract public class Component extends StructureComponent { /** Set to NBT */ protected void func_143012_a(NBTTagCompound nbt) { - nbt.setInteger("Width", this.sizeX); - nbt.setInteger("Height", this.sizeY); - nbt.setInteger("Depth", this.sizeZ); nbt.setInteger("HPos", this.hpos); } /** Get from NBT */ protected void func_143011_b(NBTTagCompound nbt) { - this.sizeX = nbt.getInteger("Width"); - this.sizeY = nbt.getInteger("Height"); - this.sizeZ = nbt.getInteger("Depth"); this.hpos = nbt.getInteger("HPos"); } 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 e4a96eabb..7fcba838a 100644 --- a/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java @@ -59,60 +59,60 @@ public class OfficeFeatures { this.boundingBox.offset(0, -1, 0); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 0, sizeX, 1, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 2, sizeX, 7, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 8, 8, sizeZ, 0, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 9, 8, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 0, 14, 1, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 2, 14, 7, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 8, 8, 12, 0, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 9, 8, 14, 12, -1, box); fillWithAir(world, box, 1, 1, 3, 4, 3, 6); - fillWithAir(world, box, 6, 1, 1, sizeX - 1, 3, 6); - fillWithAir(world, box, 10, 1, 7, sizeX - 1, 3, sizeZ - 1); + fillWithAir(world, box, 6, 1, 1, 14 - 1, 3, 6); + fillWithAir(world, box, 10, 1, 7, 14 - 1, 3, 12 - 1); //Pillars //Back fillWithBlocks(world, box, 0, 0, 2, 0, 4, 2, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 5, 0, 0, 5, 4, 0, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 4, 0, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 14, 0, 0, 14, 4, 0, ModBlocks.concrete_pillar); //Front fillWithBlocks(world, box, 0, 0, 7, 0, 3, 7, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, 0, 0, sizeZ, 0, 3, sizeZ, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, 3, 0, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, 6, 0, sizeZ, 6, 3, sizeZ, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, 9, 0, sizeZ, 9, 3, sizeZ, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 0, 0, 12, 0, 3, 12, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 3, 0, 12, 3, 3, 12, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 6, 0, 12, 6, 3, 12, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 9, 0, 12, 9, 3, 12, ModBlocks.concrete_pillar); fillWithBlocks(world, box, 9, 0, 7, 9, 3, 7, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 4, sizeZ, ModBlocks.concrete_pillar); + fillWithBlocks(world, box, 14, 0, 12, 14, 4, 12, ModBlocks.concrete_pillar); //Walls //Back fillWithRandomizedBlocks(world, box, 1, 0, 2, 5, 4, 2, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 5, 0, 1, 5, 4, 1, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 6, 0, 0, sizeX - 1, 1, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 6, 0, 0, 14 - 1, 1, 0, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 6, 2, 0, 6, 2, 0, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 9, 2, 0, 10, 2, 0, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX - 1, 2, 0, sizeX - 1, 2, 0, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 6, 3, 0, sizeX - 1, 4, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14 - 1, 2, 0, 14 - 1, 2, 0, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 6, 3, 0, 14 - 1, 4, 0, rand, ConcreteBricks); //Right - fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 1, sizeZ - 1, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX, 2, 1, sizeX, 2, 2, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX, 2, 5, sizeX, 2, 7, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX, 2, sizeZ - 2, sizeX, 2, sizeZ - 1, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX, 3, 1, sizeX, 4, sizeZ - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14, 0, 1, 14, 1, 12 - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14, 2, 1, 14, 2, 2, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14, 2, 5, 14, 2, 7, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14, 2, 12 - 2, 14, 2, 12 - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14, 3, 1, 14, 4, 12 - 1, rand, ConcreteBricks); //Front - fillWithRandomizedBlocks(world, box, 0, 4, sizeZ, sizeX - 1, 4, sizeZ, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 10, 0, sizeZ, sizeX - 1, 1, sizeZ, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 10, 2, sizeZ, 10, 2, sizeZ, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, sizeX - 1, 2, sizeZ, sizeX - 1, 2, sizeZ, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 10, 3, sizeZ, sizeX - 1, 3, sizeZ, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 4, 12, 14 - 1, 4, 12, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 10, 0, 12, 14 - 1, 1, 12, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 10, 2, 12, 10, 2, 12, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 14 - 1, 2, 12, 14 - 1, 2, 12, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 10, 3, 12, 14 - 1, 3, 12, rand, ConcreteBricks); - fillWithRandomizedBlocks(world, box, 9, 0, 8, 9, 3, sizeZ - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 9, 0, 8, 9, 3, 12 - 1, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 1, 0, 7, 8, 0, 7, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 1, 1, 7, 1, 2, 7, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 4, 1, 7, 8, 3, 7, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 1, 3, 7, 3, 3, 7, rand, ConcreteBricks); //Left - fillWithRandomizedBlocks(world, box, 0, 4, 3, 0, 4, sizeZ - 1, rand, ConcreteBricks); + fillWithRandomizedBlocks(world, box, 0, 4, 3, 0, 4, 12 - 1, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 0, 0, 3, 0, 1, 6, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 0, 2, 3, 0, 3, 3, rand, ConcreteBricks); fillWithRandomizedBlocks(world, box, 0, 2, 6, 0, 3, 6, rand, ConcreteBricks); @@ -121,21 +121,21 @@ public class OfficeFeatures { fillWithRandomizedBlocks(world, box, 5, 3, 6, 5, 3, 6, rand, ConcreteBricks); //Trim - randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, 2, 5, sizeY, 2, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.85F, 5, sizeY, 1, 5, sizeY, 1, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.85F, 5, sizeY, 0, sizeX, sizeY, 0, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.85F, sizeX, sizeY, 1, sizeX, sizeY, sizeZ, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, sizeZ, sizeX - 1, sizeY, sizeZ, Blocks.stone_slab); - randomlyFillWithBlocks(world, box, rand, 0.85F, 0, sizeY, 3, 0, sizeY, sizeZ - 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, 5, 2, 5, 5, 2, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 5, 5, 1, 5, 5, 1, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 5, 5, 0, 14, 5, 0, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 14, 5, 1, 14, 5, 12, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, 5, 12, 14 - 1, 5, 12, Blocks.stone_slab); + randomlyFillWithBlocks(world, box, rand, 0.85F, 0, 5, 3, 0, 5, 12 - 1, Blocks.stone_slab); //Floor fillWithMetadataBlocks(world, box, 1, 0, 3, 4, 0, 6, Blocks.wool, 13); //Green Wool fillWithBlocks(world, box, 5, 0, 3, 5, 0, 6, ModBlocks.brick_light); - fillWithBlocks(world, box, 6, 0, 1, sizeX - 1, 0, 6, ModBlocks.brick_light); - fillWithBlocks(world, box, 10, 0, 7, sizeX - 1, 0, sizeZ - 1, ModBlocks.brick_light); + fillWithBlocks(world, box, 6, 0, 1, 14 - 1, 0, 6, ModBlocks.brick_light); + fillWithBlocks(world, box, 10, 0, 7, 14 - 1, 0, 12 - 1, ModBlocks.brick_light); //Ceiling - fillWithBlocks(world, box, 6, 4, 1, sizeX - 1, 4, 2, ModBlocks.brick_light); - fillWithBlocks(world, box, 1, 4, 3, sizeX - 1, 4, sizeZ - 1, ModBlocks.brick_light); + fillWithBlocks(world, box, 6, 4, 1, 14 - 1, 4, 2, ModBlocks.brick_light); + fillWithBlocks(world, box, 1, 4, 3, 14 - 1, 4, 12 - 1, ModBlocks.brick_light); //Decorations //Carpet @@ -143,10 +143,10 @@ public class OfficeFeatures { //Windows randomlyFillWithBlocks(world, box, rand, 0.75F, 0, 2, 4, 0, 3, 5, Blocks.glass_pane); randomlyFillWithBlocks(world, box, rand, 0.75F, 7, 2, 0, 8, 2, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, 0, sizeX - 2, 2, 0, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, 2, 3, sizeX, 2, 4, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX, 2, 8, sizeX, 2, 9, Blocks.glass_pane); - randomlyFillWithBlocks(world, box, rand, 0.75F, sizeX - 3, 2, sizeZ, sizeX - 2, 2, sizeZ, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, 14 - 3, 2, 0, 14 - 2, 2, 0, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, 14, 2, 3, 14, 2, 4, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, 14, 2, 8, 14, 2, 9, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.75F, 14 - 3, 2, 12, 14 - 2, 2, 12, Blocks.glass_pane); //Fuwnituwe >w< int stairMetaE = getStairMeta(1); //East int stairMetaN = getStairMeta(2); //*SHOULD* be north @@ -170,35 +170,35 @@ public class OfficeFeatures { placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 8, 2, 4, box); //Desk 3 :3 placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 1, box); - fillWithMetadataBlocks(world, box, 11, 1, 1, sizeX - 1, 1, 1, Blocks.spruce_stairs, stairMetaSU); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, sizeX - 1, 1, 2, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, sizeX - 1, 1, 3, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, sizeX - 1, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, sizeX - 1, 1, 5, box); + fillWithMetadataBlocks(world, box, 11, 1, 1, 14 - 1, 1, 1, Blocks.spruce_stairs, stairMetaSU); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 14 - 1, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, 14 - 1, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 14 - 1, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 14 - 1, 1, 5, box); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 11, 1, 2, box); //Chaiw ;3 - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, sizeX - 2, 1, 4, box); //Chaiw :333 - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), sizeX - 3, 2, 1, box); //South-facing Computer :3 - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, 5, box); //West-facing Computer ^w^ - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, sizeX - 1, 2, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(5), sizeX - 1, 2, 2, box); //Wadio + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 14 - 2, 1, 4, box); //Chaiw :333 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 14 - 3, 2, 1, box); //South-facing Computer :3 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), 14 - 1, 2, 5, box); //West-facing Computer ^w^ + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 14 - 1, 2, 3, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(5), 14 - 1, 2, 2, box); //Wadio //Desk 4 DX placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaEU, 10, 1, 8, box); placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 11, 1, 8, box); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 10, 1, 9, box); //Chaiw ;3 placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(1), 10, 2, 8, box); //South-facing Computer :33 //Desk 5 :333 - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, sizeX - 1, 1, sizeZ - 3, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, sizeX - 1, 1, sizeZ - 2, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, sizeX - 1, 1, sizeZ - 1, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, sizeX - 3, 1, sizeZ - 1, box); //UwU... Chaiw!!!! :333 I wove chaiws XD :333 OwO what's this?? chaiw???? :333333333333333333 - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), sizeX - 1, 2, sizeZ - 1, box); //West-facing Computer >w< + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaSU, 14 - 1, 1, 12 - 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaWU, 14 - 1, 1, 12 - 2, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaNU, 14 - 1, 1, 12 - 1, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 14 - 3, 1, 12 - 1, box); //UwU... Chaiw!!!! :333 I wove chaiws XD :333 OwO what's this?? chaiw???? :333333333333333333 + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(2), 14 - 1, 2, 12 - 1, box); //West-facing Computer >w< //Cobwebs pwobabwy //Maybe make a method for this eventually? //Something where the tops of ceilings + empty corners along walls get most cobwebs, //with no cobwebs hanging midair + it not being performance intensive randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 3, 3, 4, 3, 6, Blocks.web); - randomlyFillWithBlocks(world, box, rand, 0.25F, 6, 3, 1, sizeX - 1, 3, 6, Blocks.web); - randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, sizeX - 1, 3, sizeZ - 1, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.25F, 6, 3, 1, 14 - 1, 3, 6, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, 14 - 1, 3, 12 - 1, Blocks.web); //Doors placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 2, 1, 7); placeDoor(world, box, ModBlocks.door_office, 3, true, rand.nextBoolean(), 3, 1, 7); @@ -206,7 +206,7 @@ public class OfficeFeatures { //Woot if(!this.hasPlacedLoot[0]) - this.hasPlacedLoot[0] = generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 8); + this.hasPlacedLoot[0] = generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 14 - 4, 1, 12 - 1, HbmChestContents.officeTrash, 8); if(!this.hasPlacedLoot[1]) { this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, getDecoMeta(3), 6, 1, 1, HbmChestContents.machineParts, 10, 0.5D); if(rand.nextInt(2) == 0) 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 b5f5d141d..914b01b7e 100644 --- a/src/main/java/com/hbm/world/gen/component/RuinFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java @@ -39,52 +39,52 @@ public class RuinFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 8, 10, -1, box); int pillarMetaWE = this.getPillarMeta(4); int pillarMetaNS = this.getPillarMeta(8); - this.fillWithBlocks(world, box, 0, 0, 0, 0, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, 0, 0, 0, 0, 6, 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, sizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 5, 3, 0, sizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, sizeY - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 4, 0, 0, 4, 6 - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 3, 0, 8 - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 8, 0, 0, 8, 6 - 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, sizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 0, 8 - 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, sizeX - 1, 1, 0, sizeX - 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8 - 1, 1, 0, 8 - 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, sizeX - 1, 4, 0, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall - this.fillWithBlocks(world, box, 0, 0, sizeZ, 0, sizeY - 1, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 4, 0, 8 - 1, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 0, 3, 1, 0, 3, 10 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall + this.fillWithBlocks(world, box, 0, 0, 10, 0, 6 - 1, 10, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 10 - 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, sizeZ - 2, 0, 2, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 10 - 2, 0, 2, 10 - 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, sizeZ - 2, 0, 4, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, 1, 3, sizeZ, 3, 3, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.fillWithBlocks(world, box, 4, 0, sizeZ, 4, sizeY - 2, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, 5, 3, sizeZ, sizeX - 1, 3, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, sizeY - 2, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 3, 0, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, sizeZ, 1, 2, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 3, 1, sizeZ, 3, 2, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 5, 1, sizeZ, 5, 2, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, sizeZ, sizeX - 1, 2, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, sizeX, 3, 1, sizeX, 3, 2, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithMetadataBlocks(world, box, sizeX, 3, sizeZ - 1, sizeX, 3, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 0, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 1, sizeX, 2, 2, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 6, sizeX, 0, 6, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, sizeZ - 2, sizeX, 1, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 2, sizeZ - 1, sizeX, 2, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 4, 10 - 2, 0, 4, 10 - 1, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 1, 3, 10, 3, 3, 10, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithBlocks(world, box, 4, 0, 10, 4, 6 - 2, 10, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 5, 3, 10, 8 - 1, 3, 10, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 8, 0, 10, 8, 6 - 2, 10, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 10, 3, 0, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 10, 8 - 1, 0, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 10, 1, 2, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 1, 10, 3, 2, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 1, 10, 5, 2, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8 - 1, 1, 10, 8 - 1, 2, 10, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 8, 3, 1, 8, 3, 2, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithMetadataBlocks(world, box, 8, 3, 10 - 1, 8, 3, 10 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 8, 0, 1, 8, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8, 1, 1, 8, 2, 2, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8, 0, 6, 8, 0, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8, 0, 10 - 2, 8, 1, 10 - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8, 2, 10 - 1, 8, 2, 10 - 1, false, rand, RandomConcreteBricks); - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); return true; } @@ -111,43 +111,43 @@ public class RuinFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 7, 10, -1, box); int pillarMetaWE = this.getPillarMeta(4); int pillarMetaNS = this.getPillarMeta(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, sizeX - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); - this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, sizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 1, 3, 0, 7 - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); + this.fillWithBlocks(world, box, 7, 0, 0, 7, 5, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 7 - 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, sizeX - 1, 1, 0, sizeX - 1, 2, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 3, 4, 0, sizeX - 1, 4, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, sizeY, 0, sizeX - 1, sizeY, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7 - 1, 1, 0, 7 - 1, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 3, 4, 0, 7 - 1, 4, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7 - 1, 5, 0, 7 - 1, 5, 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, sizeZ, 0, 2, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 0, 0, 10, 0, 2, 10, 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, sizeZ - 3, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 1, sizeZ - 1, 0, 1, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, sizeX - 1, 3, sizeZ, sizeX - 1, 3, sizeZ, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall - this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 3, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 1, sizeZ, 1, 2, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, sizeZ, sizeX - 1, 2, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithMetadataBlocks(world, box, sizeX, 3, 1, sizeX, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall - this.fillWithBlocks(world, box, sizeX, 0, 5, sizeX, 4, 5, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithMetadataBlocks(world, box, sizeX, 3, sizeZ - 2, sizeX, 3, sizeZ - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 0, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 1, sizeX, 2, 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 3, sizeX, 2, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 4, sizeX, 1, 4, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 6, sizeX, 0, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 6, sizeX, 1, 7, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, sizeZ - 1, sizeX, 2, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 10 - 3, 0, 0, 10 - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 1, 10 - 1, 0, 1, 10 - 1, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 7 - 1, 3, 10, 7 - 1, 3, 10, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall + this.fillWithBlocks(world, box, 7, 0, 10, 7, 3, 10, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 10, 7 - 1, 0, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 1, 10, 1, 2, 10, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7 - 1, 1, 10, 7 - 1, 2, 10, false, rand, RandomConcreteBricks); + this.fillWithMetadataBlocks(world, box, 7, 3, 1, 7, 3, 4, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall + this.fillWithBlocks(world, box, 7, 0, 5, 7, 4, 5, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithMetadataBlocks(world, box, 7, 3, 10 - 2, 7, 3, 10 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); + this.fillWithRandomizedBlocks(world, box, 7, 0, 1, 7, 0, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7, 1, 1, 7, 2, 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7, 1, 3, 7, 2, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7, 1, 4, 7, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7, 0, 6, 7, 0, 10 - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7, 1, 6, 7, 1, 7, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 7, 1, 10 - 1, 7, 2, 10 - 1, false, rand, RandomConcreteBricks); - this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, 7 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); return true; } @@ -174,37 +174,37 @@ public class RuinFeatures { } //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 0, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, sizeX, 0, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 0, 10, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 8, 0, 8, 10, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, sizeX, 0, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 4, sizeX, 4, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, 8, 0, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 4, 8, 4, -1, box); - this.fillWithBlocks(world, box, 0, 0, 0, 0, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall - this.fillWithBlocks(world, box, sizeX, 0, 0, sizeX, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, 1, 0, 0, sizeX - 1, 0, 0, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall + this.fillWithBlocks(world, box, 8, 0, 0, 8, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 8 - 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, sizeX - 1, 1, 0, sizeX - 1, 1, 0, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 1, 2, 0, sizeX - 2, 2, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8 - 1, 1, 0, 8 - 1, 1, 0, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 1, 2, 0, 8 - 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, sizeZ, box); + this.placeBlockAtCurrentPosition(world, ModBlocks.concrete_pillar, 0, 0, 0, 10, box); this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 0, 5, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 5, 0, 0, 10 - 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, sizeX, 0, 4, sizeX, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall - this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 1, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 1, sizeX, 1, 3, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 5, sizeX, 0, 6, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 0, sizeZ - 1, sizeX, 0, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 8, 0, 4, 8, 1, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall + this.fillWithBlocks(world, box, 8, 0, 10, 8, 1, 10, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithRandomizedBlocks(world, box, 8, 0, 1, 8, 1, 3, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8, 0, 5, 8, 0, 6, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8, 0, 10 - 1, 8, 0, 10 - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 8 - 1, 0, 10, 8 - 1, 0, 10, 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, sizeX - 1, 1, 4, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 5, 0, 4, 8 - 1, 1, 4, false, rand, RandomConcreteBricks); - this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, sizeX - 1, 0, 3, Blocks.gravel, Blocks.air, false); - this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 8 - 1, 0, 3, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); return true; } @@ -232,40 +232,40 @@ public class RuinFeatures { //System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 0, sizeZ, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, sizeX, 5, sizeX, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 0, 11, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 10, 5, 10, 11, -1, box); placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 0, 5, 4, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, sizeZ, sizeX - 1, sizeZ, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 11, 10 - 1, 11, -1, box); placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, 4, 0, -1, box); - placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 5, sizeX - 1, 5, -1, box); + placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 5, 10 - 1, 5, -1, box); 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, sizeY, 0, ModBlocks.concrete_pillar, Blocks.air, false); + this.fillWithBlocks(world, box, 5, 0, 0, 5, 2, 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, sizeY, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 1 + this.fillWithBlocks(world, box, 5, 0, 5, 5, 2, 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, sizeX, 0, 5, sizeX, 1, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 2 - this.fillWithRandomizedBlocks(world, box, 6, 0, 5, sizeX - 1, 0, 5, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 10, 0, 5, 10, 1, 5, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 6, 0, 5, 10 - 1, 0, 5, false, rand, RandomConcreteBricks); this.fillWithRandomizedBlocks(world, box, 6, 1, 5, 6, 1, 5, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 1, 5, sizeX - 1, 1, 5, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, sizeX, 0, sizeZ, sizeX, 1, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 2 - this.fillWithRandomizedBlocks(world, box, sizeX, 0, 6, sizeX, 0, sizeZ - 1, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX, 1, 6, sizeX, 1, sizeZ - 3, false, rand, RandomConcreteBricks); - this.fillWithBlocks(world, box, 0, 0, sizeZ, 0, 0, sizeZ, ModBlocks.concrete_pillar, Blocks.air, false); //Front Wall - this.fillWithRandomizedBlocks(world, box, 1, 0, sizeZ, 1, 0, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 6, 0, sizeZ, 7, 0, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, sizeX - 1, 0, sizeZ, sizeX - 1, 0, sizeZ, false, rand, RandomConcreteBricks); - this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, sizeZ - 1, false, rand, RandomConcreteBricks); //Left Wall + this.fillWithRandomizedBlocks(world, box, 10 - 1, 1, 5, 10 - 1, 1, 5, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 10, 0, 11, 10, 1, 11, ModBlocks.concrete_pillar, Blocks.air, false); //Right Wall Pt. 2 + this.fillWithRandomizedBlocks(world, box, 10, 0, 6, 10, 0, 11 - 1, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 10, 1, 6, 10, 1, 11 - 3, false, rand, RandomConcreteBricks); + this.fillWithBlocks(world, box, 0, 0, 11, 0, 0, 11, ModBlocks.concrete_pillar, Blocks.air, false); //Front Wall + this.fillWithRandomizedBlocks(world, box, 1, 0, 11, 1, 0, 11, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 6, 0, 11, 7, 0, 11, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 10 - 1, 0, 11, 10 - 1, 0, 11, false, rand, RandomConcreteBricks); + this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 11 - 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, sizeX - 1, 0, sizeZ - 1, Blocks.gravel, Blocks.air, false); + this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 6, 10 - 1, 0, 11 - 1, Blocks.gravel, Blocks.air, false); return true; } From 10ab382cf6508ce6835a05ca6b09280537c41900 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 11 Aug 2023 22:22:11 -0700 Subject: [PATCH 06/18] shit --- .../com/hbm/inventory/gui/GUIBookLore.java | 4 +- src/main/java/com/hbm/lib/HbmWorld.java | 2 + .../hbm/world/gen/MapGenSpecialFeatures.java | 93 +++++++++++++++++++ .../com/hbm/world/gen/NTMWorldGenerator.java | 13 ++- 4 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java diff --git a/src/main/java/com/hbm/inventory/gui/GUIBookLore.java b/src/main/java/com/hbm/inventory/gui/GUIBookLore.java index dc628427a..4ac298bd0 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIBookLore.java +++ b/src/main/java/com/hbm/inventory/gui/GUIBookLore.java @@ -102,13 +102,13 @@ public class GUIBookLore extends GuiScreen { if(argTag.hasNoTags()) text = I18nUtil.resolveKey(k + defacto); - else { + else { //TODO consider caching the text per page List args = new ArrayList(); int index = 1; String arg = argTag.getString("a1"); while(!arg.isEmpty()) { - args.add(arg); + args.add(I18nUtil.resolveKey(arg)); //TODO check if this works fine index++; arg = argTag.getString("a" + index); } diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index bc1226544..dc8739707 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -2,6 +2,7 @@ package com.hbm.lib; import com.hbm.world.gen.MapGenNTMFeatures; import com.hbm.world.gen.NTMWorldGenerator; +import com.hbm.world.gen.MapGenSpecialFeatures.SpecialStart; import com.hbm.world.gen.component.BrutalistFeatures; import com.hbm.world.gen.component.BunkerComponents; import com.hbm.world.gen.component.CivilianFeatures; @@ -26,6 +27,7 @@ public class HbmWorld { //MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT"); MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); MapGenStructureIO.registerStructure(BunkerStart.class, "NTMBunker"); + MapGenStructureIO.registerStructure(SpecialStart.class, "NTMSpecialFeatures"); registerNTMFeatures(); registerWorldGen(new HbmWorldGen(), 1); diff --git a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java new file mode 100644 index 000000000..16d5ecd6d --- /dev/null +++ b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java @@ -0,0 +1,93 @@ +package com.hbm.world.gen; + +import java.util.HashSet; +import java.util.Random; +import java.util.Set; + +import com.hbm.config.GeneralConfig; +import com.hbm.world.gen.component.BrutalistFeatures.ElevatedLab1; + +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructure; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; + +//stuff like the exclusive n rare shipping containers. +//it's 'special' because it's not unique but also limited +public class MapGenSpecialFeatures extends MapGenStructure { + //suuuuuper efficient for .contains() + Set locs = new HashSet(); + + /** String ID for this MapGen */ + @Override + public String func_143025_a() { + return "NTMSpecialFeatures"; + } + + @Override + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { + + if(locs.isEmpty()) { + + Random rand = new Random(this.worldObj.getSeed()); + double theta = rand.nextDouble() * Math.PI * 2; + int ringMax = 4; //each ring of structures has more (and is farther) than the last + int ringDist = 1; + final int total = 16; //for now + //no biome checks necessary, underground caches can always be a backup + for(int i = 1; i <= total; i++) { + double dist = 312D * (1.25 * ringDist + rand.nextDouble() * 0.5); //5k blocks * random dist in the region of a ring + int cX = (int)Math.round(Math.cos(theta) * dist); + int cZ = (int)Math.round(Math.sin(theta) * dist); + + ChunkCoordIntPair pair = new ChunkCoordIntPair(cX, cZ); + locs.add(pair); + + theta += Math.PI * 2 / ringMax; + + if(i == (ringDist - 1) * 4 + ringMax) { + ringDist++; + + if(i + ringDist * 4 > total) //last ring may be sparser, but evenly spaced too + ringMax = total - i; + else + ringMax = ringDist * 4; + } + } + } + + return locs.contains(new ChunkCoordIntPair(chunkX, chunkZ)); + } + + @Override + protected StructureStart getStructureStart(int chunkX, int chunkZ) { + return new SpecialStart(this.worldObj, this.rand, chunkX, chunkZ); + } + + public static class SpecialStart extends StructureStart { + + public SpecialStart() {} + + public SpecialStart(World world, Random rand, int chunkX, int chunkZ) { + super(chunkX, chunkZ); + + //test + ElevatedLab1 lab1 = new ElevatedLab1(rand, chunkX * 16 + 8, 64, chunkZ * 16 + 8); + this.components.add(lab1); + + if(GeneralConfig.enableDebugMode) { + System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + 64 + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); + this.components.forEach((component) -> { + System.out.print(MapGenStructureIO.func_143036_a((StructureComponent) component) + " "); + }); + + System.out.print("\n"); + } + + this.updateBoundingBox(); + } + } + +} diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index a3b812d37..2adce05bf 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -18,14 +18,16 @@ import net.minecraftforge.event.world.WorldEvent; public class NTMWorldGenerator implements IWorldGenerator { - private MapGenNTMFeatures scatteredFeatureGenerator = new MapGenNTMFeatures(); + private MapGenNTMFeatures scatteredFeatureGen; //looks like it's based! thank god! + private MapGenSpecialFeatures specialFeatureGen; //change back if it's actually cringe and throws NPEs private final Random rand = new Random(); //A central random, used to cleanly generate our stuff without affecting vanilla or modded seeds. /** Inits all MapGen upon the loading of a new world. Hopefully clears out structureMaps and structureData when a different world is loaded. */ @SubscribeEvent public void onLoad(WorldEvent.Load event) { - scatteredFeatureGenerator = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); + scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); + specialFeatureGen = (MapGenSpecialFeatures) getModdedMapGen(new MapGenSpecialFeatures(), EventType.CUSTOM); hasPopulationEvent = false; } @@ -65,8 +67,11 @@ public class NTMWorldGenerator implements IWorldGenerator { protected void generateOverworldStructures(World world, IChunkProvider chunkProvider, int chunkX, int chunkZ) { Block[] ablock = new Block[65536]; //ablock isn't actually used for anything in MapGenStructure - this.scatteredFeatureGenerator.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock); - this.scatteredFeatureGenerator.generateStructuresInChunk(world, rand, chunkX, chunkZ); + this.scatteredFeatureGen.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock); + this.scatteredFeatureGen.generateStructuresInChunk(world, rand, chunkX, chunkZ); + + this.specialFeatureGen.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock); + this.specialFeatureGen.generateStructuresInChunk(world, rand, chunkX, chunkZ); } /* From ff85ddfb167575bc4c1d2ab8ec94a12f732e6273 Mon Sep 17 00:00:00 2001 From: Vaern Date: Tue, 15 Aug 2023 21:23:59 -0700 Subject: [PATCH 07/18] containrs!!! --- .../java/com/hbm/items/tool/ItemWandD.java | 2 +- src/main/java/com/hbm/lib/HbmWorld.java | 2 + .../hbm/world/gen/MapGenSpecialFeatures.java | 9 +- .../gen/component/BrutalistFeatures.java | 8 +- .../world/gen/component/SpecialFeatures.java | 89 +++++++++++++++++++ 5 files changed, 102 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/hbm/world/gen/component/SpecialFeatures.java diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index fa0fe9bcc..35f8c6537 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -6,7 +6,7 @@ import com.hbm.handler.pollution.PollutionHandler; import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.lib.Library; import com.hbm.world.gen.MapGenNTMFeatures; -import com.hbm.world.gen.component.BrutalistFeatures.ElevatedLab1; +import com.hbm.world.gen.component.BrutalistFeatures.ElevatedPrefab1; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index dc8739707..ceb91a336 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -8,6 +8,7 @@ import com.hbm.world.gen.component.BunkerComponents; import com.hbm.world.gen.component.CivilianFeatures; import com.hbm.world.gen.component.OfficeFeatures; import com.hbm.world.gen.component.RuinFeatures; +import com.hbm.world.gen.component.SpecialFeatures; import com.hbm.world.gen.component.BunkerComponents.BunkerStart; import cpw.mods.fml.common.IWorldGenerator; @@ -49,5 +50,6 @@ public class HbmWorld { RuinFeatures.registerComponents(); BunkerComponents.registerComponents(); BrutalistFeatures.registerComponents(); + SpecialFeatures.registerComponents(); } } diff --git a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java index 16d5ecd6d..5111a406f 100644 --- a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java @@ -5,7 +5,7 @@ import java.util.Random; import java.util.Set; import com.hbm.config.GeneralConfig; -import com.hbm.world.gen.component.BrutalistFeatures.ElevatedLab1; +import com.hbm.world.gen.component.SpecialFeatures.SpecialContainer; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; @@ -45,6 +45,9 @@ public class MapGenSpecialFeatures extends MapGenStructure { ChunkCoordIntPair pair = new ChunkCoordIntPair(cX, cZ); locs.add(pair); + if(GeneralConfig.enableDebugMode) + System.out.println("SpecialFeature: " + (pair.chunkXPos * 16 + 8) + ", Y, " + (pair.chunkZPos * 16 + 8)); + theta += Math.PI * 2 / ringMax; if(i == (ringDist - 1) * 4 + ringMax) { @@ -74,8 +77,8 @@ public class MapGenSpecialFeatures extends MapGenStructure { super(chunkX, chunkZ); //test - ElevatedLab1 lab1 = new ElevatedLab1(rand, chunkX * 16 + 8, 64, chunkZ * 16 + 8); - this.components.add(lab1); + SpecialContainer shipping = new SpecialContainer(rand, chunkX * 16 + 8, 64, chunkZ * 16 + 8); + this.components.add(shipping); if(GeneralConfig.enableDebugMode) { System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + 64 + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); diff --git a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java index 13d1c1c4e..9ba8696a7 100644 --- a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java @@ -23,17 +23,17 @@ import net.minecraftforge.common.BiomeDictionary.Type; public class BrutalistFeatures { public static void registerComponents() { - MapGenStructureIO.func_143031_a(ElevatedLab1.class, "NTMElevatedLab1"); + MapGenStructureIO.func_143031_a(ElevatedPrefab1.class, "NTMElevatedPrefab1"); } //might be other than a lab, placeholder :P - public static class ElevatedLab1 extends Component { + public static class ElevatedPrefab1 extends Component { protected int type; - public ElevatedLab1() { super(); } + public ElevatedPrefab1() { super(); } - public ElevatedLab1(Random rand, int minX, int minY, int minZ) { + public ElevatedPrefab1(Random rand, int minX, int minY, int minZ) { super(rand, minX, minY, minZ, 16, 11, 14); this.type = rand.nextInt(2); diff --git a/src/main/java/com/hbm/world/gen/component/SpecialFeatures.java b/src/main/java/com/hbm/world/gen/component/SpecialFeatures.java new file mode 100644 index 000000000..7664f2b6e --- /dev/null +++ b/src/main/java/com/hbm/world/gen/component/SpecialFeatures.java @@ -0,0 +1,89 @@ +package com.hbm.world.gen.component; + +import java.util.Random; + +import com.hbm.blocks.ModBlocks; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraft.world.gen.structure.StructureBoundingBox; + +public class SpecialFeatures { + + public static void registerComponents() { + MapGenStructureIO.func_143031_a(SpecialContainer.class, "NTMSpecialContainer"); + } + + public static class SpecialContainer extends Component { + + public SpecialContainer() { + + } + + public SpecialContainer(Random rand, int minX, int minY, int minZ) { + super(rand, minX, minY, minZ, 3, 3, 9); + + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + if(hpos == -1 && !this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + + fillWithAir(world, box, 1, 1, 1, 2, 2, 8); + + //floor + fillWithBlocks(world, box, 0, 0, 0, 3, 0, 1, ModBlocks.deco_steel); + fillWithBlocks(world, box, 1, 0, 2, 2, 0, 7, ModBlocks.deco_steel); + fillWithBlocks(world, box, 0, 0, 8, 3, 0, 9, ModBlocks.deco_steel); + fillWithBlocks(world, box, 1, 0, 1, 2, 0, 1, ModBlocks.cm_block); + fillWithBlocks(world, box, 1, 0, 8, 2, 0, 8, ModBlocks.cm_block); + //roof + fillWithBlocks(world, box, 0, 3, 0, 3, 3, 9, ModBlocks.deco_steel); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 0, 3, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 3, 3, 2, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 0, 3, 7, box); + placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 3, 3, 7, box); + //walls + fillWithBlocks(world, box, 0, 1, 0, 0, 2, 0, ModBlocks.deco_steel); + fillWithBlocks(world, box, 0, 1, 1, 0, 2, 8, ModBlocks.cm_sheet); + fillWithBlocks(world, box, 0, 1, 9, 0, 2, 9, ModBlocks.deco_steel); + fillWithBlocks(world, box, 1, 1, 9, 2, 2, 9, ModBlocks.cm_sheet); + fillWithBlocks(world, box, 3, 1, 9, 3, 2, 9, ModBlocks.deco_steel); + fillWithBlocks(world, box, 3, 1, 1, 3, 2, 8, ModBlocks.cm_sheet); + fillWithBlocks(world, box, 3, 1, 0, 3, 2, 0, ModBlocks.deco_steel); + //doors + placeDoor(world, box, ModBlocks.door_metal, 1, false, false, 2, 1, 0); + placeDoor(world, box, ModBlocks.door_metal, 1, true, false, 1, 1, 0); + + return true; + } + + @Override + protected boolean setAverageHeight(World world, StructureBoundingBox box, int y) { + + int total = 0; + int iterations = 0; + + for(int z = this.boundingBox.minZ; z <= this.boundingBox.maxZ; z++) { + for(int x = this.boundingBox.minX; x <= this.boundingBox.maxX; x++) { + if(box.isVecInside(x, y, z)) { + total += Math.max(world.getTopSolidOrLiquidBlock(x, z), 1); // underwater :3c + iterations++; + } + } + } + + if(iterations == 0) + return false; + + this.hpos = total / iterations; //finds mean of every block in bounding box + this.boundingBox.offset(0, this.hpos - this.boundingBox.minY, 0); + return true; + } + } +} From 40af290153ec7eb1340c7201a8a8f4636d12b905 Mon Sep 17 00:00:00 2001 From: Vaern Date: Wed, 16 Aug 2023 20:44:32 -0700 Subject: [PATCH 08/18] mhmm --- src/main/java/com/hbm/lib/HbmWorld.java | 4 +- .../hbm/world/gen/MapGenSpecialFeatures.java | 111 +++++++++++++----- .../com/hbm/world/gen/NTMWorldGenerator.java | 4 +- 3 files changed, 86 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index ceb91a336..b2ff4699c 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -22,6 +22,8 @@ public class HbmWorld { initWorldGen(); } + public static NTMWorldGenerator worldGenerator; + public static void initWorldGen() { //MapGenStructureIO.registerStructure(StructureStartTest.class, "HFR_STRUCTURE"); @@ -33,7 +35,7 @@ public class HbmWorld { registerWorldGen(new HbmWorldGen(), 1); - NTMWorldGenerator worldGenerator = new NTMWorldGenerator(); + worldGenerator = new NTMWorldGenerator(); registerWorldGen(worldGenerator, 1); //Ideally, move everything over from HbmWorldGen to NTMWorldGenerator MinecraftForge.EVENT_BUS.register(worldGenerator); //registerWorldGen(new WorldGenTest(), 1); diff --git a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java index 5111a406f..e10456e98 100644 --- a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java @@ -1,12 +1,15 @@ package com.hbm.world.gen; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Random; import java.util.Set; import com.hbm.config.GeneralConfig; import com.hbm.world.gen.component.SpecialFeatures.SpecialContainer; +import net.minecraft.util.Vec3; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructure; @@ -18,54 +21,102 @@ import net.minecraft.world.gen.structure.StructureStart; //it's 'special' because it's not unique but also limited public class MapGenSpecialFeatures extends MapGenStructure { //suuuuuper efficient for .contains() + //do i even need chunkcoordintpairs? idk Set locs = new HashSet(); + //efficient enough for books n shit + List bookLocs = new ArrayList(); /** String ID for this MapGen */ @Override public String func_143025_a() { return "NTMSpecialFeatures"; } - + @Override protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { + if(locs.isEmpty()) + generatePositions(); - if(locs.isEmpty()) { + return locs.contains(new ChunkCoordIntPair(chunkX, chunkZ)); + } + + //i'll probs make a system to predict which locations are what in advance + //seems like biomes can be cached/gen'd without creating the chunk, thankfully + //vec3 will be the angle + distance from provided coords, given in chunk coords + /*public Vec3 findClosestPosition(int chunkX, int chunkZ) { + createBookList(); + + long time = System.nanoTime(); + + ChunkCoordIntPair pair = new ChunkCoordIntPair(0, 0); + long dist = Long.MAX_VALUE; + for(ChunkCoordIntPair loc : bookLocs) { + int x = loc.chunkXPos - chunkX; + int z = loc.chunkZPos - chunkZ; + long cont = x * x + z * z; - Random rand = new Random(this.worldObj.getSeed()); - double theta = rand.nextDouble() * Math.PI * 2; - int ringMax = 4; //each ring of structures has more (and is farther) than the last - int ringDist = 1; - final int total = 16; //for now - //no biome checks necessary, underground caches can always be a backup - for(int i = 1; i <= total; i++) { - double dist = 312D * (1.25 * ringDist + rand.nextDouble() * 0.5); //5k blocks * random dist in the region of a ring - int cX = (int)Math.round(Math.cos(theta) * dist); - int cZ = (int)Math.round(Math.sin(theta) * dist); - - ChunkCoordIntPair pair = new ChunkCoordIntPair(cX, cZ); - locs.add(pair); - - if(GeneralConfig.enableDebugMode) - System.out.println("SpecialFeature: " + (pair.chunkXPos * 16 + 8) + ", Y, " + (pair.chunkZPos * 16 + 8)); - - theta += Math.PI * 2 / ringMax; - - if(i == (ringDist - 1) * 4 + ringMax) { - ringDist++; - - if(i + ringDist * 4 > total) //last ring may be sparser, but evenly spaced too - ringMax = total - i; - else - ringMax = ringDist * 4; - } + if(cont < dist) { + pair = loc; + dist = cont; } } - return locs.contains(new ChunkCoordIntPair(chunkX, chunkZ)); + System.out.print(System.nanoTime() - time); + + return Vec3.createVectorHelper(pair.chunkXPos - chunkX, 0, pair.chunkZPos - chunkZ); + } + + protected void createBookList() { + if(locs.isEmpty()) + generatePositions(); + + if(!bookLocs.isEmpty()) return; + + long time = System.nanoTime(); + + for(ChunkCoordIntPair loc : locs) { + bookLocs.add(loc); + } + + System.out.print(System.nanoTime() - time); + }*/ + + protected void generatePositions() { + //for safety: maybe mandate interactions with these methods to an outside class/wrapper who say "fuck you" + Random rand = new Random(this.worldObj.getSeed()); //TODO: worldObj is null until func_15139_a is called!! very bad!!! + double theta = rand.nextDouble() * Math.PI * 2; + int ringMax = 4; //each ring of structures has more (and is farther) than the last + int ringDist = 1; + final int total = 16; //for now + //no biome checks necessary, underground caches can always be a backup + for(int i = 1; i <= total; i++) { + double dist = 312D * (1.25 * ringDist + rand.nextDouble() * 0.5); //5k blocks * random dist in the region of a ring + int cX = (int)Math.round(Math.cos(theta) * dist); + int cZ = (int)Math.round(Math.sin(theta) * dist); + + ChunkCoordIntPair pair = new ChunkCoordIntPair(cX, cZ); + locs.add(pair); + + if(GeneralConfig.enableDebugMode) + System.out.println("SpecialFeature: " + (pair.chunkXPos * 16 + 8) + ", Y, " + (pair.chunkZPos * 16 + 8)); + + theta += Math.PI * 2 / ringMax; + + if(i == (ringDist - 1) * 4 + ringMax) { + ringDist++; + //maybe insert random theta each time? + if(i + ringDist * 4 > total) //last ring may be sparser, but evenly spaced too + ringMax = total - i; + else + ringMax = ringDist * 4; + } + } } @Override protected StructureStart getStructureStart(int chunkX, int chunkZ) { + locs.remove(new ChunkCoordIntPair(chunkX, chunkZ)); + return new SpecialStart(this.worldObj, this.rand, chunkX, chunkZ); } diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 2adce05bf..3f168c68d 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -26,8 +26,8 @@ public class NTMWorldGenerator implements IWorldGenerator { /** Inits all MapGen upon the loading of a new world. Hopefully clears out structureMaps and structureData when a different world is loaded. */ @SubscribeEvent public void onLoad(WorldEvent.Load event) { - scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); - specialFeatureGen = (MapGenSpecialFeatures) getModdedMapGen(new MapGenSpecialFeatures(), EventType.CUSTOM); + scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); //TODO: set worlds to a non-null value here. + specialFeatureGen = (MapGenSpecialFeatures) getModdedMapGen(new MapGenSpecialFeatures(), EventType.CUSTOM); //we've got access to it plain n simple here anyway hasPopulationEvent = false; } From b6eaf25b992e9a18ab299d2b032add0686e77462 Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 18 Aug 2023 18:13:00 -0700 Subject: [PATCH 09/18] i'm too tired dr kel larping --- .../java/com/hbm/items/tool/ItemWandD.java | 15 ++++++------- .../hbm/world/gen/MapGenSpecialFeatures.java | 18 +++++++--------- .../com/hbm/world/gen/NTMWorldGenerator.java | 8 ++++--- .../hbm/world/gen/component/Component.java | 21 +++++++++++++++++-- .../world/gen/component/OfficeFeatures.java | 11 ++++++++++ 5 files changed, 50 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 35f8c6537..984f849d5 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,18 +2,15 @@ package com.hbm.items.tool; import java.util.List; -import com.hbm.handler.pollution.PollutionHandler; -import com.hbm.handler.pollution.PollutionHandler.PollutionType; +import com.hbm.lib.HbmWorld; import com.hbm.lib.Library; -import com.hbm.world.gen.MapGenNTMFeatures; -import com.hbm.world.gen.component.BrutalistFeatures.ElevatedPrefab1; +import com.hbm.world.gen.component.OfficeFeatures.LargeOfficeCorner; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -37,13 +34,17 @@ public class ItemWandD extends Item { //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); + //HbmWorld.worldGenerator.specialFeatureGen.findClosestPosition(pos.blockX >> 4, pos.blockZ >> 4); + int i = pos.blockX >> 4; int j = pos.blockZ >> 4; - MapGenNTMFeatures.Start start = new MapGenNTMFeatures.Start(world, world.rand, i, j); + //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)); + LargeOfficeCorner corner = new LargeOfficeCorner(world.rand, i, 64, j); + corner.addComponentParts(world, world.rand, corner.getBoundingBox()); + //start.generateStructure(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/MapGenSpecialFeatures.java b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java index e10456e98..5cca710ce 100644 --- a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java @@ -32,6 +32,10 @@ public class MapGenSpecialFeatures extends MapGenStructure { return "NTMSpecialFeatures"; } + public void setWorld(World world) { + this.worldObj = world; + } + @Override protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { if(locs.isEmpty()) @@ -43,11 +47,9 @@ public class MapGenSpecialFeatures extends MapGenStructure { //i'll probs make a system to predict which locations are what in advance //seems like biomes can be cached/gen'd without creating the chunk, thankfully //vec3 will be the angle + distance from provided coords, given in chunk coords - /*public Vec3 findClosestPosition(int chunkX, int chunkZ) { + public Vec3 findClosestPosition(int chunkX, int chunkZ) { createBookList(); - long time = System.nanoTime(); - ChunkCoordIntPair pair = new ChunkCoordIntPair(0, 0); long dist = Long.MAX_VALUE; for(ChunkCoordIntPair loc : bookLocs) { @@ -61,8 +63,6 @@ public class MapGenSpecialFeatures extends MapGenStructure { } } - System.out.print(System.nanoTime() - time); - return Vec3.createVectorHelper(pair.chunkXPos - chunkX, 0, pair.chunkZPos - chunkZ); } @@ -72,18 +72,14 @@ public class MapGenSpecialFeatures extends MapGenStructure { if(!bookLocs.isEmpty()) return; - long time = System.nanoTime(); - for(ChunkCoordIntPair loc : locs) { bookLocs.add(loc); } - - System.out.print(System.nanoTime() - time); - }*/ + } protected void generatePositions() { //for safety: maybe mandate interactions with these methods to an outside class/wrapper who say "fuck you" - Random rand = new Random(this.worldObj.getSeed()); //TODO: worldObj is null until func_15139_a is called!! very bad!!! + Random rand = new Random(this.worldObj.getSeed()); double theta = rand.nextDouble() * Math.PI * 2; int ringMax = 4; //each ring of structures has more (and is farther) than the last int ringDist = 1; diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 3f168c68d..172c9bd2d 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -19,15 +19,17 @@ import net.minecraftforge.event.world.WorldEvent; public class NTMWorldGenerator implements IWorldGenerator { private MapGenNTMFeatures scatteredFeatureGen; //looks like it's based! thank god! - private MapGenSpecialFeatures specialFeatureGen; //change back if it's actually cringe and throws NPEs + public MapGenSpecialFeatures specialFeatureGen; //change back if it's actually cringe and throws NPEs private final Random rand = new Random(); //A central random, used to cleanly generate our stuff without affecting vanilla or modded seeds. /** Inits all MapGen upon the loading of a new world. Hopefully clears out structureMaps and structureData when a different world is loaded. */ @SubscribeEvent public void onLoad(WorldEvent.Load event) { - scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); //TODO: set worlds to a non-null value here. - specialFeatureGen = (MapGenSpecialFeatures) getModdedMapGen(new MapGenSpecialFeatures(), EventType.CUSTOM); //we've got access to it plain n simple here anyway + scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); + specialFeatureGen = (MapGenSpecialFeatures) getModdedMapGen(new MapGenSpecialFeatures(), EventType.CUSTOM); + specialFeatureGen.setWorld(event.world); //doesn't matter on the client so we're good anyway + hasPopulationEvent = false; } diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index 0d86e2cac..d64f95ef4 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -6,6 +6,7 @@ import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; +import com.hbm.blocks.generic.BlockLoot.TileEntityLoot; import com.hbm.config.StructureConfig; import com.hbm.handler.MultiblockHandlerXR; import com.hbm.tileentity.machine.TileEntityLockableBase; @@ -39,7 +40,7 @@ abstract public class Component extends StructureComponent { protected Component(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { super(0); - this.coordBaseMode = rand.nextInt(4); + this.coordBaseMode = 0;//rand.nextInt(4); switch(this.coordBaseMode) { case 0: @@ -435,6 +436,22 @@ abstract public class Component extends StructureComponent { } } + protected void placeLootBlock(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ, ItemStack stack) { + int posX = this.getXWithOffset(featureX, featureZ); + int posY = this.getYWithOffset(featureY); + int posZ = this.getZWithOffset(featureX, featureZ); + + if(!box.isVecInside(posX, posY, posZ)) return; + + world.setBlock(posX, posY, posZ, ModBlocks.deco_loot, 0, 2); + + TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(posX, posY, posZ); + + if(loot != null && loot.items.isEmpty()) { + loot.addItem(stack, rand.nextGaussian() * 0.02, 0, rand.nextGaussian() * 0.02); + } + } + /** * Places random bobblehead with a randomized orientation at specified location */ @@ -690,7 +707,7 @@ abstract public class Component extends StructureComponent { } } } - + //TODO replace the shitty block selector with something else. probably a lambda that returns a metablock for convenience protected void fillWithRandomizedBlocks(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Random rand, BlockSelector selector) { //so i don't have to replace shit if(getYWithOffset(minY) < box.minY || getYWithOffset(maxY) > box.maxY) 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 7fcba838a..a6322c4c6 100644 --- a/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java @@ -3,10 +3,16 @@ package com.hbm.world.gen.component; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.items.special.ItemBookLore; import com.hbm.lib.HbmChestContents; +import com.hbm.lib.HbmWorld; import com.hbm.util.LootGenerator; + import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Vec3; +import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; @@ -546,6 +552,11 @@ public class OfficeFeatures { placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 1, 10, 11, box); LootGenerator.lootMedicine(world, this.getXWithOffset(1, 11), this.getYWithOffset(10), this.getZWithOffset(1, 11)); + //if(rand.nextInt(3) == 0) { + Vec3 pair = HbmWorld.worldGenerator.specialFeatureGen.findClosestPosition(this.boundingBox.minX >> 4, this.boundingBox.minZ >> 4); + ItemStack book = ItemBookLore.createBook(pair.xCoord * 16 + ", " + pair.zCoord * 16, 1, 0x7F0037, 0xFFFFFF); + placeLootBlock(world, box, rand, 8, 10, 10, book); + //} //this hurt my soul return true; From bd06c6ec8b7bfa533335bd5f2b72435746e4ce60 Mon Sep 17 00:00:00 2001 From: Vaern Date: Mon, 28 Aug 2023 15:35:12 -0700 Subject: [PATCH 10/18] hh --- .../java/com/hbm/items/tool/ItemWandD.java | 23 +++++----------- .../java/com/hbm/lib/HbmChestContents.java | 25 ++++++++++++++++++ .../com/hbm/world/gen/MapGenNTMFeatures.java | 2 -- .../hbm/world/gen/MapGenSpecialFeatures.java | 25 ++++-------------- .../com/hbm/world/gen/NTMWorldGenerator.java | 6 ++--- .../hbm/world/gen/component/Component.java | 4 +-- .../world/gen/component/OfficeFeatures.java | 11 -------- .../hbm/world/gen/component/RuinFeatures.java | 26 +++++++++++++++++++ src/main/resources/assets/hbm/lang/en_US.lang | 6 +++++ 9 files changed, 74 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 1560b01d8..18fde60fa 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -3,21 +3,16 @@ package com.hbm.items.tool; import java.util.List; import com.hbm.entity.effect.EntityNukeTorex; -import com.hbm.handler.pollution.PollutionHandler; -import com.hbm.handler.pollution.PollutionHandler.PollutionType; import com.hbm.lib.Library; import com.hbm.util.TrackerUtil; +import com.hbm.world.gen.MapGenNTMFeatures; -import cpw.mods.fml.relauncher.ReflectionHelper; -import net.minecraft.entity.EntityTracker; -import net.minecraft.entity.EntityTrackerEntry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.IntHashMap; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraft.world.WorldServer; +import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -40,18 +35,14 @@ public class ItemWandD extends Item { vnt.explode();*/ //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); - - //HbmWorld.worldGenerator.specialFeatureGen.findClosestPosition(pos.blockX >> 4, pos.blockZ >> 4); - + int i = pos.blockX >> 4; int j = pos.blockZ >> 4; - //MapGenNTMFeatures.Start start = new MapGenNTMFeatures.Start(world, world.rand, i, j); + MapGenNTMFeatures.Start start = new MapGenNTMFeatures.Start(world, world.rand, i, j); i = (i << 4) + 8; j = (j << 4) + 8; - LargeOfficeCorner corner = new LargeOfficeCorner(world.rand, i, 64, j); - corner.addComponentParts(world, world.rand, corner.getBoundingBox()); - //start.generateStructure(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32)); + start.generateStructure(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32)); /*TimeAnalyzer.startCount("setBlock"); world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt); @@ -73,7 +64,7 @@ public class ItemWandD extends Item { tom.destructionRange = 600; world.spawnEntityInWorld(tom);*/ - EntityNukeTorex torex = new EntityNukeTorex(world); + /*EntityNukeTorex torex = new EntityNukeTorex(world); torex.setPositionAndRotation(pos.blockX, pos.blockY + 1, pos.blockZ, 0, 0); torex.getDataWatcher().updateObject(10, 1.5F); world.spawnEntityInWorld(torex); @@ -81,7 +72,7 @@ public class ItemWandD extends Item { IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c"); EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId()); entry.blocksDistanceThreshold = 1000;*/ - TrackerUtil.setTrackingRange(world, torex, 1000); + //TrackerUtil.setTrackingRange(world, torex, 1000); //world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, 150, pos.blockX, pos.blockY + 1, pos.blockZ)); //DungeonToolbox.generateBedrockOreWithChance(world, world.rand, pos.blockX, pos.blockZ, EnumBedrockOre.TITANIUM, new FluidStack(Fluids.SULFURIC_ACID, 500), 2, 1); diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 045896b42..d166e3bab 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -16,6 +16,7 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.ChunkCoordIntPair; public class HbmChestContents { @@ -452,4 +453,28 @@ public class HbmChestContents { return ItemBookLore.createBook(key, pages, 0x1E1E1E, 0x46EA44); } + + public static ItemStack generateRuinBook(Random rand, int chunkX, int chunkZ) { + ChunkCoordIntPair pair = HbmWorld.worldGenerator.specialFeatureGen.findClosestPosition(chunkX, chunkZ); + int[] vec = new int[] { pair.chunkXPos - chunkX, pair.chunkZPos - chunkZ }; + int dist = (int) Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]); + + String conf = "book_lore.ruin_special."; + if(dist > 128) { + dist -= dist * .5F * (.5F - rand.nextFloat()); + conf += "low"; + } else if(dist > 64) { + dist -= dist * .25F * (.5F - rand.nextFloat()); + conf += "med"; + } else { + conf += "high"; + } + + String angle = Math.round(Math.toDegrees(Math.atan2(vec[0], vec[1])) * 10000D) / 10000D + ""; + String res = (Math.round((dist * 16) / 1000D * 100D) / 100D) + ""; + + ItemStack book = ItemBookLore.createBook("ruin_special", 1, 0x770011, 0xFFFFFF); + ItemBookLore.addArgs(book, 0, res, angle, conf); + return book; + } } diff --git a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java index 79c863242..5b24ea05a 100644 --- a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -161,8 +161,6 @@ public class MapGenNTMFeatures extends MapGenStructure { this.components.add(officeCorner); break; } } - //ElevatedLab1 lab1 = new ElevatedLab1(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[Debug] Components: "); diff --git a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java index 5cca710ce..e6a104c8d 100644 --- a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java @@ -23,8 +23,6 @@ public class MapGenSpecialFeatures extends MapGenStructure { //suuuuuper efficient for .contains() //do i even need chunkcoordintpairs? idk Set locs = new HashSet(); - //efficient enough for books n shit - List bookLocs = new ArrayList(); /** String ID for this MapGen */ @Override @@ -46,13 +44,13 @@ public class MapGenSpecialFeatures extends MapGenStructure { //i'll probs make a system to predict which locations are what in advance //seems like biomes can be cached/gen'd without creating the chunk, thankfully - //vec3 will be the angle + distance from provided coords, given in chunk coords - public Vec3 findClosestPosition(int chunkX, int chunkZ) { - createBookList(); + public ChunkCoordIntPair findClosestPosition(int chunkX, int chunkZ) { + if(locs.isEmpty()) + generatePositions(); ChunkCoordIntPair pair = new ChunkCoordIntPair(0, 0); long dist = Long.MAX_VALUE; - for(ChunkCoordIntPair loc : bookLocs) { + for(ChunkCoordIntPair loc : locs) { int x = loc.chunkXPos - chunkX; int z = loc.chunkZPos - chunkZ; long cont = x * x + z * z; @@ -63,18 +61,7 @@ public class MapGenSpecialFeatures extends MapGenStructure { } } - return Vec3.createVectorHelper(pair.chunkXPos - chunkX, 0, pair.chunkZPos - chunkZ); - } - - protected void createBookList() { - if(locs.isEmpty()) - generatePositions(); - - if(!bookLocs.isEmpty()) return; - - for(ChunkCoordIntPair loc : locs) { - bookLocs.add(loc); - } + return pair; } protected void generatePositions() { @@ -111,8 +98,6 @@ public class MapGenSpecialFeatures extends MapGenStructure { @Override protected StructureStart getStructureStart(int chunkX, int chunkZ) { - locs.remove(new ChunkCoordIntPair(chunkX, chunkZ)); - return new SpecialStart(this.worldObj, this.rand, chunkX, chunkZ); } diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 172c9bd2d..45d7a24a2 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -17,9 +17,9 @@ import static net.minecraftforge.event.terraingen.TerrainGen.*; import net.minecraftforge.event.world.WorldEvent; public class NTMWorldGenerator implements IWorldGenerator { - - private MapGenNTMFeatures scatteredFeatureGen; //looks like it's based! thank god! - public MapGenSpecialFeatures specialFeatureGen; //change back if it's actually cringe and throws NPEs + //turns out minecraft is cringe and WorldEvent.Load can be/is called after chunks are provided + private MapGenNTMFeatures scatteredFeatureGen = new MapGenNTMFeatures(); + public MapGenSpecialFeatures specialFeatureGen = new MapGenSpecialFeatures(); private final Random rand = new Random(); //A central random, used to cleanly generate our stuff without affecting vanilla or modded seeds. diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index d64f95ef4..e11e5aca5 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -528,7 +528,7 @@ abstract public class Component extends StructureComponent { //Turns out, this entire time every single minecraft structure is mirrored instead of rotated when facing East and North //Also turns out, it's a scarily easy fix that they somehow didn't see *entirely* @Override - protected int getXWithOffset(int x, int z) { + public int getXWithOffset(int x, int z) { switch(this.coordBaseMode) { case 0: return this.boundingBox.minX + x; @@ -544,7 +544,7 @@ abstract public class Component extends StructureComponent { } @Override - protected int getZWithOffset(int x, int z) { + public int getZWithOffset(int x, int z) { switch(this.coordBaseMode) { case 0: return this.boundingBox.minZ + z; 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 a6322c4c6..244c1c8f4 100644 --- a/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/OfficeFeatures.java @@ -3,16 +3,11 @@ package com.hbm.world.gen.component; import java.util.Random; import com.hbm.blocks.ModBlocks; -import com.hbm.items.special.ItemBookLore; import com.hbm.lib.HbmChestContents; -import com.hbm.lib.HbmWorld; import com.hbm.util.LootGenerator; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; @@ -551,12 +546,6 @@ public class OfficeFeatures { LootGenerator.lootCapStash(world, this.getXWithOffset(6, 11), this.getYWithOffset(13), this.getZWithOffset(6, 11)); placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 1, 10, 11, box); LootGenerator.lootMedicine(world, this.getXWithOffset(1, 11), this.getYWithOffset(10), this.getZWithOffset(1, 11)); - - //if(rand.nextInt(3) == 0) { - Vec3 pair = HbmWorld.worldGenerator.specialFeatureGen.findClosestPosition(this.boundingBox.minX >> 4, this.boundingBox.minZ >> 4); - ItemStack book = ItemBookLore.createBook(pair.xCoord * 16 + ", " + pair.zCoord * 16, 1, 0x7F0037, 0xFFFFFF); - placeLootBlock(world, box, rand, 8, 10, 10, book); - //} //this hurt my soul return true; 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..ff494c6b0 100644 --- a/src/main/java/com/hbm/world/gen/component/RuinFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java @@ -3,8 +3,10 @@ package com.hbm.world.gen.component; import java.util.Random; import com.hbm.blocks.ModBlocks; +import com.hbm.lib.HbmChestContents; import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; @@ -18,6 +20,21 @@ public class RuinFeatures { MapGenStructureIO.func_143031_a(NTMRuin4.class, "NTMRuin4"); } + public static void placeBook(World world, StructureBoundingBox box, Random rand, int minX, int minZ, int maxX, int maxZ, Component com) { + int i = minX + rand.nextInt(maxX); + int j = minZ + rand.nextInt(maxZ); + + int posX = com.getXWithOffset(i, j); + int posZ = com.getZWithOffset(i, j); + + if(box.isVecInside(posX, 64, posZ)) { + int topHeight = world.getTopSolidOrLiquidBlock(posX, posZ); + + ItemStack book = HbmChestContents.generateRuinBook(rand, posX >> 4, posZ >> 4); + com.placeLootBlock(world, box, rand, i, topHeight - com.getBoundingBox().minY, j, book); + } + } + public static class NTMRuin1 extends Component { private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); @@ -86,6 +103,9 @@ public class RuinFeatures { this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); + if(rand.nextInt(3) == 0) //it's all in one chunk so it's fine + placeBook(world, box, rand, 1, 1, 7, 9, this); + return true; } } @@ -206,6 +226,9 @@ public class RuinFeatures { this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 8 - 1, 0, 3, Blocks.gravel, Blocks.air, false); this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); + if(rand.nextInt(3) == 0) + placeBook(world, box, rand, 1, 5, 7, 9, this); + return true; } } @@ -267,6 +290,9 @@ public class RuinFeatures { 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, 10 - 1, 0, 11 - 1, Blocks.gravel, Blocks.air, false); + if(rand.nextInt(3) == 0) + placeBook(world, box, rand, 1, 1, 4, 10, this); + return true; } } diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 87e424890..910f32ce9 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -446,6 +446,12 @@ book_lore.beacon.page.9=Once the desired peer has responded, give the "ACCEPT CO book_lore.beacon.page.10=using the FAR-5M standard. Communication will end immediately if no standard has been negotiated, serving as a "ping". Should communication continue, the connection can be ended using another long single tone "END CONNECTION". book_lore.beacon.page.11=Chapter 5: Warranty $ [ page intentionally left blank ] +book_lore.ruin_special.name=Detection Printout +book_lore.ruin_special.page.0=§lDETECTION $ ----------------- $ DIST: %1$s km $ THETA: %2$s° $ PROGNOSIS $ %3$s +book_lore.ruin_special.low=Low-confidence detection. Distance is large and imprecise; high chance of interference. +book_lore.ruin_special.med=Medium-confidence detection. Chance of interference is low; further investigation recommended. +book_lore.ruin_special.high=High-confidence detection. Location precisely triangulated by sensors; expedition urgently recommended. + cannery.f1=[ Press F1 for help ] cannery.centrifuge=Gas Centrifuge From 8a96acc190088d092195f45d2ce7738530ad99e9 Mon Sep 17 00:00:00 2001 From: Vaern Date: Thu, 31 Aug 2023 16:24:46 -0700 Subject: [PATCH 11/18] tests --- .../java/com/hbm/items/tool/ItemWandD.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 5f1e94b36..927a1bd12 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,12 +2,15 @@ package com.hbm.items.tool; import java.util.List; +import com.hbm.blocks.ModBlocks; import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.lib.Library; import com.hbm.util.TrackerUtil; import com.hbm.world.gen.MapGenNTMFeatures; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; @@ -35,8 +38,29 @@ public class ItemWandD extends Item { vnt.explode();*/ //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); + + for(int i = 0; i < 2; i++) { + for(int k = 0; k < 2; k++) { + for(int j = 0; j < 6; j++) { + double r = world.rand.nextGaussian(); - int i = pos.blockX >> 4; + Block b; + int meta = 0; + if(r < -1) { + b = ModBlocks.steel_beam; + } else if(r < .15) { + b = ModBlocks.brick_concrete_stairs; + meta = world.rand.nextInt(16); + } else { + b = ModBlocks.brick_concrete; + } + + world.setBlock(pos.blockX + i, pos.blockY + j + 1, pos.blockZ + k, b, meta, 2); + } + } + } + + /*int i = pos.blockX >> 4; int j = pos.blockZ >> 4; MapGenNTMFeatures.Start start = new MapGenNTMFeatures.Start(world, world.rand, i, j); From 43fafaccb18f84276c28b4b641b34105d8b9263d Mon Sep 17 00:00:00 2001 From: Vaern Date: Sun, 3 Sep 2023 20:41:20 -0700 Subject: [PATCH 12/18] :p --- .../java/com/hbm/items/tool/ItemWandD.java | 80 ++++++++++++++++--- 1 file changed, 71 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 927a1bd12..1a5fce43d 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -39,23 +39,85 @@ public class ItemWandD extends Item { //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); - for(int i = 0; i < 2; i++) { - for(int k = 0; k < 2; k++) { - for(int j = 0; j < 6; j++) { + int mI = 2; + int mK = 2; + + if(!player.isSneaking()) { + for(int i = 0; i < mI; i++) { + for(int k = 0; k < mK; k++) { + for(int j = 0; j < 6; j++) { + double r = world.rand.nextGaussian(); + + Block b; + int meta = 0; + if(r < -1) { + b = Blocks.iron_bars; + } else if(r < .1) { + + int h = world.rand.nextInt(20); + if(h < 5) + b = ModBlocks.brick_concrete_broken_stairs; + else if(h < 10) + b = ModBlocks.brick_concrete_cracked_stairs; + else + b = ModBlocks.brick_concrete_stairs; + + meta = world.rand.nextInt(16); + } else { + int h = world.rand.nextInt(20); + if(h < 5) + b = ModBlocks.brick_concrete_broken; + else if(h < 10) + b = ModBlocks.brick_concrete_cracked; + else + b = ModBlocks.brick_concrete; + } + + world.setBlock(pos.blockX + i, pos.blockY + j + 1, pos.blockZ + k, b, meta, 2); + } + } + } + } else { + for(int i = 0; i < mI; i++) { + for(int k = 0; k < mK; k++) { double r = world.rand.nextGaussian(); Block b; int meta = 0; - if(r < -1) { - b = ModBlocks.steel_beam; - } else if(r < .15) { - b = ModBlocks.brick_concrete_stairs; + if(r < -2) { + b = Blocks.iron_bars; + } else if(r < -1) { + b = ModBlocks.concrete_brick_slab; + meta = 8; + int h = world.rand.nextInt(20); + + if(h < 5) + meta |= 3; + else if(h < 10) + meta |= 2; + + } else if(r < .1) { + + int h = world.rand.nextInt(20); + if(h < 5) + b = ModBlocks.brick_concrete_broken_stairs; + else if(h < 10) + b = ModBlocks.brick_concrete_cracked_stairs; + else + b = ModBlocks.brick_concrete_stairs; + meta = world.rand.nextInt(16); } else { - b = ModBlocks.brick_concrete; + int h = world.rand.nextInt(20); + if(h < 5) + b = ModBlocks.brick_concrete_broken; + else if(h < 10) + b = ModBlocks.brick_concrete_cracked; + else + b = ModBlocks.brick_concrete; } - world.setBlock(pos.blockX + i, pos.blockY + j + 1, pos.blockZ + k, b, meta, 2); + world.setBlock(pos.blockX + i, pos.blockY + 1, pos.blockZ + k, b, meta, 2); } } } From 99372b478ffa0d6a0c0e027117bf98e6a9c98579 Mon Sep 17 00:00:00 2001 From: Vaern Date: Mon, 22 Jan 2024 16:41:25 -0800 Subject: [PATCH 13/18] lmoa --- .../java/com/hbm/items/tool/ItemWandD.java | 91 +-- .../java/com/hbm/lib/HbmChestContents.java | 24 - src/main/java/com/hbm/lib/HbmWorld.java | 8 +- .../com/hbm/world/gen/MapGenNTMFeatures.java | 15 +- .../hbm/world/gen/MapGenSpecialFeatures.java | 128 ---- .../com/hbm/world/gen/NTMWorldGenerator.java | 7 - .../gen/component/BrutalistFeatures.java | 623 ------------------ .../hbm/world/gen/component/Component.java | 16 - .../hbm/world/gen/component/RuinFeatures.java | 26 - .../world/gen/component/SpecialFeatures.java | 89 --- src/main/resources/assets/hbm/lang/en_US.lang | 6 - 11 files changed, 18 insertions(+), 1015 deletions(-) delete mode 100644 src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java delete mode 100644 src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java delete mode 100644 src/main/java/com/hbm/world/gen/component/SpecialFeatures.java diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 0cb61cc3c..c8dcbbe19 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -5,16 +5,12 @@ import java.util.List; import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.lib.Library; import com.hbm.util.TrackerUtil; -import com.hbm.world.WorldUtil; -import com.hbm.world.biome.BiomeGenCraterBase; -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.MovingObjectPosition; import net.minecraft.world.World; -import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -38,88 +34,13 @@ public class ItemWandD extends Item { //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); - int mI = 2; - int mK = 2; + /*int i = pos.blockX >> 4; + int j = pos.blockZ >> 4; - if(!player.isSneaking()) { - for(int i = 0; i < mI; i++) { - for(int k = 0; k < mK; k++) { - for(int j = 0; j < 6; j++) { - double r = world.rand.nextGaussian(); - - Block b; - int meta = 0; - if(r < -1) { - b = Blocks.iron_bars; - } else if(r < .1) { - - int h = world.rand.nextInt(20); - if(h < 5) - b = ModBlocks.brick_concrete_broken_stairs; - else if(h < 10) - b = ModBlocks.brick_concrete_cracked_stairs; - else - b = ModBlocks.brick_concrete_stairs; - - meta = world.rand.nextInt(16); - } else { - int h = world.rand.nextInt(20); - if(h < 5) - b = ModBlocks.brick_concrete_broken; - else if(h < 10) - b = ModBlocks.brick_concrete_cracked; - else - b = ModBlocks.brick_concrete; - } - - world.setBlock(pos.blockX + i, pos.blockY + j + 1, pos.blockZ + k, b, meta, 2); - } - } - } - } else { - for(int i = 0; i < mI; i++) { - for(int k = 0; k < mK; k++) { - double r = world.rand.nextGaussian(); - - Block b; - int meta = 0; - if(r < -2) { - b = Blocks.iron_bars; - } else if(r < -1) { - b = ModBlocks.concrete_brick_slab; - meta = 8; - int h = world.rand.nextInt(20); - - if(h < 5) - meta |= 3; - else if(h < 10) - meta |= 2; - - } else if(r < .1) { - - int h = world.rand.nextInt(20); - if(h < 5) - b = ModBlocks.brick_concrete_broken_stairs; - else if(h < 10) - b = ModBlocks.brick_concrete_cracked_stairs; - else - b = ModBlocks.brick_concrete_stairs; - - meta = world.rand.nextInt(16); - } else { - int h = world.rand.nextInt(20); - if(h < 5) - b = ModBlocks.brick_concrete_broken; - else if(h < 10) - b = ModBlocks.brick_concrete_cracked; - else - b = ModBlocks.brick_concrete; - } - - world.setBlock(pos.blockX + i, pos.blockY + 1, pos.blockZ + k, b, meta, 2); - } - } - } + i = (i << 4) + 8; + j = (j << 4) + 8; + Component comp = new ElevatedPrefab1(world.rand, i, 64, j); + comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32));*/ /*int i = pos.blockX >> 4; int j = pos.blockZ >> 4; diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 38eca93a0..964bfc4dc 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -459,28 +459,4 @@ public class HbmChestContents { return ItemBookLore.createBook(key, pages, 0x1E1E1E, 0x46EA44); } - - public static ItemStack generateRuinBook(Random rand, int chunkX, int chunkZ) { - ChunkCoordIntPair pair = HbmWorld.worldGenerator.specialFeatureGen.findClosestPosition(chunkX, chunkZ); - int[] vec = new int[] { pair.chunkXPos - chunkX, pair.chunkZPos - chunkZ }; - int dist = (int) Math.sqrt(vec[0] * vec[0] + vec[1] * vec[1]); - - String conf = "book_lore.ruin_special."; - if(dist > 128) { - dist -= dist * .5F * (.5F - rand.nextFloat()); - conf += "low"; - } else if(dist > 64) { - dist -= dist * .25F * (.5F - rand.nextFloat()); - conf += "med"; - } else { - conf += "high"; - } - - String angle = Math.round(Math.toDegrees(Math.atan2(vec[0], vec[1])) * 10000D) / 10000D + ""; - String res = (Math.round((dist * 16) / 1000D * 100D) / 100D) + ""; - - ItemStack book = ItemBookLore.createBook("ruin_special", 1, 0x770011, 0xFFFFFF); - ItemBookLore.addArgs(book, 0, res, angle, conf); - return book; - } } diff --git a/src/main/java/com/hbm/lib/HbmWorld.java b/src/main/java/com/hbm/lib/HbmWorld.java index b2ff4699c..e8c745f28 100644 --- a/src/main/java/com/hbm/lib/HbmWorld.java +++ b/src/main/java/com/hbm/lib/HbmWorld.java @@ -2,14 +2,11 @@ package com.hbm.lib; import com.hbm.world.gen.MapGenNTMFeatures; import com.hbm.world.gen.NTMWorldGenerator; -import com.hbm.world.gen.MapGenSpecialFeatures.SpecialStart; -import com.hbm.world.gen.component.BrutalistFeatures; import com.hbm.world.gen.component.BunkerComponents; +import com.hbm.world.gen.component.BunkerComponents.BunkerStart; import com.hbm.world.gen.component.CivilianFeatures; import com.hbm.world.gen.component.OfficeFeatures; import com.hbm.world.gen.component.RuinFeatures; -import com.hbm.world.gen.component.SpecialFeatures; -import com.hbm.world.gen.component.BunkerComponents.BunkerStart; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; @@ -30,7 +27,6 @@ public class HbmWorld { //MapGenStructureIO.func_143031_a(StructureComponentTest.class, "HFR_COMPONENT"); MapGenStructureIO.registerStructure(MapGenNTMFeatures.Start.class, "NTMFeatures"); MapGenStructureIO.registerStructure(BunkerStart.class, "NTMBunker"); - MapGenStructureIO.registerStructure(SpecialStart.class, "NTMSpecialFeatures"); registerNTMFeatures(); registerWorldGen(new HbmWorldGen(), 1); @@ -51,7 +47,5 @@ public class HbmWorld { OfficeFeatures.registerComponents(); RuinFeatures.registerComponents(); BunkerComponents.registerComponents(); - BrutalistFeatures.registerComponents(); - SpecialFeatures.registerComponents(); } } diff --git a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java index 5b24ea05a..dc5487eb3 100644 --- a/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java +++ b/src/main/java/com/hbm/world/gen/MapGenNTMFeatures.java @@ -7,11 +7,18 @@ import java.util.Random; import com.hbm.config.GeneralConfig; import com.hbm.config.StructureConfig; -import com.hbm.world.gen.component.BrutalistFeatures.*; import com.hbm.world.gen.component.BunkerComponents.BunkerStart; -import com.hbm.world.gen.component.CivilianFeatures.*; -import com.hbm.world.gen.component.OfficeFeatures.*; -import com.hbm.world.gen.component.RuinFeatures.*; +import com.hbm.world.gen.component.CivilianFeatures.NTMHouse1; +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.OfficeFeatures.LargeOffice; +import com.hbm.world.gen.component.OfficeFeatures.LargeOfficeCorner; +import com.hbm.world.gen.component.RuinFeatures.NTMRuin1; +import com.hbm.world.gen.component.RuinFeatures.NTMRuin2; +import com.hbm.world.gen.component.RuinFeatures.NTMRuin3; +import com.hbm.world.gen.component.RuinFeatures.NTMRuin4; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; diff --git a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java b/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java deleted file mode 100644 index e6a104c8d..000000000 --- a/src/main/java/com/hbm/world/gen/MapGenSpecialFeatures.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.hbm.world.gen; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Random; -import java.util.Set; - -import com.hbm.config.GeneralConfig; -import com.hbm.world.gen.component.SpecialFeatures.SpecialContainer; - -import net.minecraft.util.Vec3; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraft.world.World; -import net.minecraft.world.gen.structure.MapGenStructure; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraft.world.gen.structure.StructureComponent; -import net.minecraft.world.gen.structure.StructureStart; - -//stuff like the exclusive n rare shipping containers. -//it's 'special' because it's not unique but also limited -public class MapGenSpecialFeatures extends MapGenStructure { - //suuuuuper efficient for .contains() - //do i even need chunkcoordintpairs? idk - Set locs = new HashSet(); - - /** String ID for this MapGen */ - @Override - public String func_143025_a() { - return "NTMSpecialFeatures"; - } - - public void setWorld(World world) { - this.worldObj = world; - } - - @Override - protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { - if(locs.isEmpty()) - generatePositions(); - - return locs.contains(new ChunkCoordIntPair(chunkX, chunkZ)); - } - - //i'll probs make a system to predict which locations are what in advance - //seems like biomes can be cached/gen'd without creating the chunk, thankfully - public ChunkCoordIntPair findClosestPosition(int chunkX, int chunkZ) { - if(locs.isEmpty()) - generatePositions(); - - ChunkCoordIntPair pair = new ChunkCoordIntPair(0, 0); - long dist = Long.MAX_VALUE; - for(ChunkCoordIntPair loc : locs) { - int x = loc.chunkXPos - chunkX; - int z = loc.chunkZPos - chunkZ; - long cont = x * x + z * z; - - if(cont < dist) { - pair = loc; - dist = cont; - } - } - - return pair; - } - - protected void generatePositions() { - //for safety: maybe mandate interactions with these methods to an outside class/wrapper who say "fuck you" - Random rand = new Random(this.worldObj.getSeed()); - double theta = rand.nextDouble() * Math.PI * 2; - int ringMax = 4; //each ring of structures has more (and is farther) than the last - int ringDist = 1; - final int total = 16; //for now - //no biome checks necessary, underground caches can always be a backup - for(int i = 1; i <= total; i++) { - double dist = 312D * (1.25 * ringDist + rand.nextDouble() * 0.5); //5k blocks * random dist in the region of a ring - int cX = (int)Math.round(Math.cos(theta) * dist); - int cZ = (int)Math.round(Math.sin(theta) * dist); - - ChunkCoordIntPair pair = new ChunkCoordIntPair(cX, cZ); - locs.add(pair); - - if(GeneralConfig.enableDebugMode) - System.out.println("SpecialFeature: " + (pair.chunkXPos * 16 + 8) + ", Y, " + (pair.chunkZPos * 16 + 8)); - - theta += Math.PI * 2 / ringMax; - - if(i == (ringDist - 1) * 4 + ringMax) { - ringDist++; - //maybe insert random theta each time? - if(i + ringDist * 4 > total) //last ring may be sparser, but evenly spaced too - ringMax = total - i; - else - ringMax = ringDist * 4; - } - } - } - - @Override - protected StructureStart getStructureStart(int chunkX, int chunkZ) { - return new SpecialStart(this.worldObj, this.rand, chunkX, chunkZ); - } - - public static class SpecialStart extends StructureStart { - - public SpecialStart() {} - - public SpecialStart(World world, Random rand, int chunkX, int chunkZ) { - super(chunkX, chunkZ); - - //test - SpecialContainer shipping = new SpecialContainer(rand, chunkX * 16 + 8, 64, chunkZ * 16 + 8); - this.components.add(shipping); - - if(GeneralConfig.enableDebugMode) { - System.out.print("[Debug] StructureStart at " + (chunkX * 16 + 8) + ", " + 64 + ", " + (chunkZ * 16 + 8) + "\n[Debug] Components: "); - this.components.forEach((component) -> { - System.out.print(MapGenStructureIO.func_143036_a((StructureComponent) component) + " "); - }); - - System.out.print("\n"); - } - - this.updateBoundingBox(); - } - } - -} diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 45d7a24a2..cd29b0150 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -17,9 +17,7 @@ import static net.minecraftforge.event.terraingen.TerrainGen.*; import net.minecraftforge.event.world.WorldEvent; public class NTMWorldGenerator implements IWorldGenerator { - //turns out minecraft is cringe and WorldEvent.Load can be/is called after chunks are provided private MapGenNTMFeatures scatteredFeatureGen = new MapGenNTMFeatures(); - public MapGenSpecialFeatures specialFeatureGen = new MapGenSpecialFeatures(); private final Random rand = new Random(); //A central random, used to cleanly generate our stuff without affecting vanilla or modded seeds. @@ -27,8 +25,6 @@ public class NTMWorldGenerator implements IWorldGenerator { @SubscribeEvent public void onLoad(WorldEvent.Load event) { scatteredFeatureGen = (MapGenNTMFeatures) getModdedMapGen(new MapGenNTMFeatures(), EventType.CUSTOM); - specialFeatureGen = (MapGenSpecialFeatures) getModdedMapGen(new MapGenSpecialFeatures(), EventType.CUSTOM); - specialFeatureGen.setWorld(event.world); //doesn't matter on the client so we're good anyway hasPopulationEvent = false; } @@ -71,9 +67,6 @@ public class NTMWorldGenerator implements IWorldGenerator { this.scatteredFeatureGen.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock); this.scatteredFeatureGen.generateStructuresInChunk(world, rand, chunkX, chunkZ); - - this.specialFeatureGen.func_151539_a(chunkProvider, world, chunkX, chunkZ, ablock); - this.specialFeatureGen.generateStructuresInChunk(world, rand, chunkX, chunkZ); } /* diff --git a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java b/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java deleted file mode 100644 index 9ba8696a7..000000000 --- a/src/main/java/com/hbm/world/gen/component/BrutalistFeatures.java +++ /dev/null @@ -1,623 +0,0 @@ -package com.hbm.world.gen.component; - -import java.util.Random; - -import com.hbm.blocks.ModBlocks; -import com.hbm.lib.HbmChestContents; -import com.hbm.world.gen.NTMWorldGenerator; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.WorldGenShrub; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraft.world.gen.structure.StructureBoundingBox; -import net.minecraft.world.gen.structure.StructureComponent; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -//civilian features is fucking cringe :P -public class BrutalistFeatures { - - public static void registerComponents() { - MapGenStructureIO.func_143031_a(ElevatedPrefab1.class, "NTMElevatedPrefab1"); - } - - //might be other than a lab, placeholder :P - public static class ElevatedPrefab1 extends Component { - - protected int type; - - public ElevatedPrefab1() { super(); } - - public ElevatedPrefab1(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 16, 11, 14); - - this.type = rand.nextInt(2); - } - - /** Set to NBT */ - protected void func_143012_a(NBTTagCompound nbt) { - super.func_143012_a(nbt); - nbt.setInteger("type", type); - } - - /** Get from NBT */ - protected void func_143011_b(NBTTagCompound nbt) { - super.func_143011_b(nbt); - this.type = nbt.getInteger("type"); - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - if(hpos == -1 && !this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - - BiomeGenBase biome = world.getBiomeGenForCoords(this.boundingBox.minX, this.boundingBox.minZ); - DirtyGlass glass = new DirtyGlass(biome, 0.1F, true); - - final int stairMetaW = getStairMeta(0); - final int stairMetaE = getStairMeta(1); - final int stairMetaN = getStairMeta(2); - final int stairMetaS = getStairMeta(3); - - //greater pillars - for(int i = 2; i <= 12; i+=5) { - fillWithBlocks(world, box, i, 0, 2, i, 1, 4, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, i, 4, 2, i, 5, 4, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, i+1, 0, 2, i+1, 5, 4, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, i+2, 0, 2, i+2, 1, 4, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, i+2, 4, 2, i+2, 5, 4, ModBlocks.concrete_smooth); - - for(int j = 0; j <= 1; j++) { - final int u = j * 4; - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i, 2 + j, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN | u, i+2, 2 + j, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW | u, i, 2 + j, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE | u, i+2, 2 + j, 3, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i, 2 + j, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | u, i+2, 2 + j, 4, box); - } - - placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i, 2, i, 4, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+1, 2, i+1, 4, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+2, 2, i+2, 4, -1, box); - } - - //lesser pillars - for(int i = 2; i <= 12; i+=5) { - fillWithBlocks(world, box, i, 0, 10, i, 1, 12, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, i, 3, 10, i, 3, 12, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, i+1, 0, 10, i+1, 3, 12, ModBlocks.concrete_pillar); - fillWithBlocks(world, box, i+2, 0, 10, i+2, 1, 12, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, i+2, 3, 10, i+2, 3, 12, ModBlocks.concrete_smooth); - - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i, 2, 10, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, i+2, 2, 10, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaW, i, 2, 11, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaE, i+2, 2, 11, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i, 2, 12, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS, i+2, 2, 12, box); - - placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i, 10, i, 12, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_pillar, 0, i+1, 10, i+1, 12, -1, box); - placeFoundationUnderneath(world, ModBlocks.concrete_smooth, 0, i+2, 10, i+2, 12, -1, box); - } - - fillWithAir(world, box, 1, 5, 9, 15, 7, 13); - fillWithAir(world, box, 13, 6, 8, 14, 6, 8); - fillWithAir(world, box, 13, 7, 6, 14, 8, 8); - fillWithAir(world, box, 1, 7, 1, 15, 9, 5); - - /* lower floor */ - //lower slabs - fillWithMetadataBlocks(world, box, 0, 3, 9, 16, 3, 9, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 1, 3, 10, 1, 3, 12, ModBlocks.concrete_slab, 8); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 0, 3, 11, box); - fillWithMetadataBlocks(world, box, 0, 3, 13, 16, 3, 13, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 5, 3, 10, 6, 3, 12, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 10, 3, 10, 11, 3, 12, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 15, 3, 10, 15, 3, 12, ModBlocks.concrete_slab, 8); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 16, 3, 11, box); - //floor & lining - fillWithBlocks(world, box, 1, 4, 9, 15, 4, 13, ModBlocks.deco_titanium); - fillWithMetadataBlocks(world, box, 0, 4, 8, 16, 4, 8, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); - fillWithBlocks(world, box, 0, 4, 9, 0, 4, 13, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 4, 14, 16, 4, 14, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); - fillWithBlocks(world, box, 16, 4, 9, 16, 4, 13, ModBlocks.concrete_smooth); - //walls - fillWithBlocks(world, box, 0, 5, 8, 1, 6, 8, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 4, 5, 8, 12, 6, 8, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 0, 7, 8, 12, 7, 8, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, 15, 5, 8, 16, 6, 8, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 15, 7, 8, 16, 7, 8, ModBlocks.concrete_smooth); - - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 5, 9, box); - fillWithBlocks(world, box, 0, 5, 11, 0, 6, 11, ModBlocks.concrete_colored_ext); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 5, 13, box); - fillWithBlocks(world, box, 0, 5, 14, 0, 6, 14, ModBlocks.concrete_colored_ext); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 0, 7, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 0, 7, 11, box); - fillWithBlocks(world, box, 0, 7, 13, 0, 7, 14, ModBlocks.concrete_smooth); - - fillWithBlocks(world, box, 4, 5, 14, 4, 6, 14, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 6, 5, 14, 6, 6, 14, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 8, 5, 14, 8, 6, 14, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 10, 5, 14, 10, 6, 14, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 12, 5, 14, 12, 6, 14, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 16, 5, 14, 16, 6, 14, ModBlocks.concrete_colored_ext); - fillWithMetadataBlocks(world, box, 1, 7, 14, 3, 7, 14, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 4, 7, 14, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 6, 7, 14, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 8, 7, 14, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 10, 7, 14, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 7, 14, box); - fillWithMetadataBlocks(world, box, 13, 7, 14, 15, 7, 14, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); - - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 5, 13, box); - fillWithBlocks(world, box, 16, 5, 11, 16, 6, 11, ModBlocks.concrete_colored_ext); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 5, 9, box); - fillWithBlocks(world, box, 16, 7, 13, 16, 7, 14, ModBlocks.concrete_smooth); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 16, 7, 11, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 16, 7, 9, box); - //windows - fillWithRandomizedBlocks(world, box, 0, 6, 9, 0, 6, 9, rand, glass); - fillWithRandomizedBlocks(world, box, 0, 5, 10, 0, 7, 10, rand, glass); - fillWithRandomizedBlocks(world, box, 0, 5, 12, 0, 7, 12, rand, glass); - fillWithRandomizedBlocks(world, box, 0, 6, 13, 0, 6, 13, rand, glass); - fillWithRandomizedBlocks(world, box, 1, 5, 14, 3, 6, 14, rand, glass); - fillWithRandomizedBlocks(world, box, 5, 5, 14, 5, 7, 14, rand, glass); - fillWithRandomizedBlocks(world, box, 7, 5, 14, 7, 7, 14, rand, glass); - fillWithRandomizedBlocks(world, box, 9, 5, 14, 9, 7, 14, rand, glass); - fillWithRandomizedBlocks(world, box, 11, 5, 14, 11, 7, 14, rand, glass); - fillWithRandomizedBlocks(world, box, 13, 5, 14, 15, 6, 14, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 6, 13, 16, 6, 13, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 5, 12, 16, 7, 12, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 5, 10, 16, 7, 10, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 6, 9, 16, 6, 9, rand, glass); - //ceiling with liner - fillWithMetadataBlocks(world, box, 1, 8, 9, 15, 8, 13, ModBlocks.vinyl_tile, 1); - fillWithMetadataBlocks(world, box, 0, 8, 8, 11, 8, 8, ModBlocks.concrete_smooth_stairs, stairMetaN); - fillWithBlocks(world, box, 12, 8, 8, 12, 8, 9, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 13, 8, 9, 14, 8, 9, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); - fillWithBlocks(world, box, 15, 8, 8, 15, 8, 9, ModBlocks.concrete_smooth); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaN, 16, 8, 8, box); - fillWithBlocks(world, box, 16, 8, 9, 16, 8, 13, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 8, 14, 16, 8, 14, ModBlocks.concrete_smooth_stairs, stairMetaS); - fillWithBlocks(world, box, 0, 8, 9, 0, 8, 13, ModBlocks.concrete_smooth); - //upper slabs - fillWithBlocks(world, box, 0, 9, 9, 16, 9, 9, ModBlocks.concrete_slab); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 0, 9, 11, box); - fillWithBlocks(world, box, 0, 9, 13, 16, 9, 13, ModBlocks.concrete_slab); - fillWithBlocks(world, box, 1, 9, 10, 15, 9, 12, ModBlocks.concrete_slab); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 16, 9, 11, box); - fillWithBlocks(world, box, 12, 9, 8, 15, 9, 8, ModBlocks.concrete_slab); - - /* middle stairs */ - //stairs - fillWithMetadataBlocks(world, box, 13, 5, 8, 14, 5, 8, ModBlocks.concrete_smooth_stairs, stairMetaS); - fillWithMetadataBlocks(world, box, 13, 6, 7, 14, 6, 7, ModBlocks.concrete_smooth_stairs, stairMetaS); - fillWithMetadataBlocks(world, box, 12, 5, 7, 15, 5, 7, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); - //walls - fillWithBlocks(world, box, 12, 6, 7, 12, 8, 7, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, 15, 6, 7, 15, 8, 7, ModBlocks.concrete_smooth); - //ceiling - fillWithMetadataBlocks(world, box, 12, 9, 7, 15, 9, 7, ModBlocks.concrete_smooth_stairs, stairMetaS); - fillWithMetadataBlocks(world, box, 13, 9, 6, 14, 9, 6, ModBlocks.concrete_slab, 8); - - /* upper floor */ - //lower slabs - fillWithMetadataBlocks(world, box, 0, 5, 1, 16, 5, 1, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 1, 5, 2, 1, 5, 4, ModBlocks.concrete_slab, 8); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 0, 5, 3, box); - fillWithMetadataBlocks(world, box, 0, 5, 5, 16, 5, 5, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 12, 5, 6, 15, 5, 6, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 5, 5, 2, 6, 5, 4, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 10, 5, 2, 11, 5, 4, ModBlocks.concrete_slab, 8); - fillWithMetadataBlocks(world, box, 15, 5, 2, 15, 5, 4, ModBlocks.concrete_slab, 8); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 8, 16, 5, 3, box); - //floor and lining - fillWithBlocks(world, box, 1, 6, 1, 15, 6, 5, ModBlocks.deco_titanium); - fillWithBlocks(world, box, 13, 6, 6, 14, 6, 6, ModBlocks.deco_titanium); - fillWithMetadataBlocks(world, box, 0, 6, 0, 16, 6, 0, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); - fillWithBlocks(world, box, 0, 6, 1, 0, 6, 5, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 6, 6, 11, 6, 6, ModBlocks.concrete_smooth_stairs, stairMetaS | 4); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 6, 6, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 15, 6, 6, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth_stairs, stairMetaS | 4, 16, 6, 6, box); - fillWithBlocks(world, box, 16, 6, 1, 16, 6, 5, ModBlocks.concrete_smooth); - //walls - fillWithBlocks(world, box, 0, 7, 0, 0, 8, 0, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 4, 7, 0, 4, 8, 0, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 6, 7, 0, 6, 8, 0, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 10, 7, 0, 10, 8, 0, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 12, 7, 0, 12, 8, 0, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 16, 7, 0, 16, 8, 0, ModBlocks.concrete_colored_ext); - fillWithMetadataBlocks(world, box, 1, 9, 0, 3, 9, 0, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 4, 9, 0, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 6, 9, 0, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 1, 10, 9, 0, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 12, 9, 0, box); - fillWithMetadataBlocks(world, box, 13, 9, 0, 15, 9, 0, ModBlocks.concrete_smooth_stairs, stairMetaN | 4); - - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 7, 1, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 0, 7, 5, box); - fillWithBlocks(world, box, 0, 9, 0, 0, 9, 1, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, 0, 9, 5, 0, 9, 6, ModBlocks.concrete_smooth); - - fillWithBlocks(world, box, 0, 7, 6, 12, 8, 6, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 15, 7, 6, 16, 8, 6, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 1, 9, 6, 12, 9, 6, ModBlocks.concrete_smooth); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_smooth, 0, 15, 9, 6, box); - - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 7, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 16, 7, 1, box); - fillWithBlocks(world, box, 16, 9, 5, 16, 9, 6, ModBlocks.concrete_smooth); - fillWithBlocks(world, box, 16, 9, 0, 16, 9, 1, ModBlocks.concrete_smooth); - //windows - fillWithRandomizedBlocks(world, box, 1, 7, 0, 3, 8, 0, rand, glass); - fillWithRandomizedBlocks(world, box, 5, 7, 0, 5, 9, 0, rand, glass); - fillWithRandomizedBlocks(world, box, 7, 7, 0, 9, 9, 0, rand, glass); - fillWithRandomizedBlocks(world, box, 11, 7, 0, 11, 9, 0, rand, glass); - fillWithRandomizedBlocks(world, box, 13, 7, 0, 15, 8, 0, rand, glass); - fillWithRandomizedBlocks(world, box, 0, 8, 1, 0, 8, 1, rand, glass); - fillWithRandomizedBlocks(world, box, 0, 7, 2, 0, 9, 4, rand, glass); - fillWithRandomizedBlocks(world, box, 0, 8, 5, 0, 8, 5, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 8, 5, 16, 8, 5, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 7, 2, 16, 9, 4, rand, glass); - fillWithRandomizedBlocks(world, box, 16, 8, 1, 16, 8, 1, rand, glass); - //ceiling with liner - fillWithMetadataBlocks(world, box, 1, 10, 1, 15, 10, 5, ModBlocks.vinyl_tile, 1); - fillWithMetadataBlocks(world, box, 0, 10, 0, 16, 10, 0, ModBlocks.concrete_smooth_stairs, stairMetaN); - fillWithBlocks(world, box, 0, 10, 1, 0, 10, 5, ModBlocks.concrete_smooth); - fillWithMetadataBlocks(world, box, 0, 10, 6, 16, 10, 6, ModBlocks.concrete_smooth_stairs, stairMetaS); - fillWithBlocks(world, box, 16, 10, 1, 16, 10, 5, ModBlocks.concrete_smooth); - //slabs - fillWithBlocks(world, box, 0, 11, 1, 16, 11, 1, ModBlocks.concrete_slab); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 0, 11, 3, box); - fillWithBlocks(world, box, 1, 11, 2, 15, 11, 4, ModBlocks.concrete_slab); - fillWithBlocks(world, box, 0, 11, 5, 16, 11, 5, ModBlocks.concrete_slab); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 0, 16, 11, 3, box); - - //stairs (probably wip) - fillWithMetadataBlocks(world, box, 2, 4, 7, 3, 4, 7, ModBlocks.steel_grate, 7); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 4, 4, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 3, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 6, 3, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 7, 2, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 8, 2, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 9, 1, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 10, 1, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 11, 0, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 3, 12, 0, 7, box); - final int decoMetaS = getDecoMeta(2); - final int decoMetaN = getDecoMeta(3); - final int decoMetaE = getDecoMeta(4); - placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaE, 1, 5, 7, box); - fillWithMetadataBlocks(world, box, 2, 4, 6, 3, 5, 6, ModBlocks.steel_wall, decoMetaS); - fillWithMetadataBlocks(world, box, 4, 4, 6, 5, 4, 6, ModBlocks.steel_wall, decoMetaS); - fillWithMetadataBlocks(world, box, 5, 3, 6, 7, 3, 6, ModBlocks.steel_wall, decoMetaS); - fillWithMetadataBlocks(world, box, 7, 2, 6, 9, 2, 6, ModBlocks.steel_wall, decoMetaS); - fillWithMetadataBlocks(world, box, 9, 1, 6, 11, 1, 6, ModBlocks.steel_wall, decoMetaS); - fillWithMetadataBlocks(world, box, 11, 0, 6, 12, 0, 6, ModBlocks.steel_wall, decoMetaS); - fillWithMetadataBlocks(world, box, 5, 3, 8, 7, 3, 8, ModBlocks.steel_wall, decoMetaN); - fillWithMetadataBlocks(world, box, 7, 2, 8, 9, 2, 8, ModBlocks.steel_wall, decoMetaN); - fillWithMetadataBlocks(world, box, 9, 1, 8, 11, 1, 8, ModBlocks.steel_wall, decoMetaN); - fillWithMetadataBlocks(world, box, 11, 0, 8, 12, 0, 8, ModBlocks.steel_wall, decoMetaN); - - /* Deco */ - //lights - for(int j = 4; j <= 12; j+=4) - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, j, 8, 11, box); - for(int j = 4; j <= 12; j+=4) - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, j, 10, 3, box); - //doors - placeDoor(world, box, ModBlocks.door_office, 1, false, false, 3, 5, 8); - placeDoor(world, box, ModBlocks.door_office, 1, true, false, 2, 5, 8); - - final int decoModelMetaN = getDecoModelMeta(0); - final int decoModelMetaS = getDecoModelMeta(1); - final int decoModelMetaW = getDecoModelMeta(2); - final int decoModelMetaE = getDecoModelMeta(3); - final int decoMetaW = getDecoMeta(5); - switch(this.type) { - default: //machinery lab - //lower floor - placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 5, 9, box); - placeBlockAtCurrentPosition(world, Blocks.fence, 0, 1, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 1, 6, 11, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 1, 5, 13, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 2, 5, 13, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 1, 6, 13, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS | 4, 5, 5, 9, box); //desk 1 - fillWithMetadataBlocks(world, box, 5, 5, 10, 5, 5, 11, Blocks.spruce_stairs, stairMetaE | 4); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 6, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 7, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS, 7, 5, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaN, 6, 6, 11, box); - placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairMetaW | 4, 11, 5, 9, box); //desk 2 - fillWithMetadataBlocks(world, box, 9, 5, 9, 10, 5, 9, Blocks.dark_oak_stairs, stairMetaS | 4); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 13, 9, 5, 10, box); - placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairMetaN | 4, 9, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW, 11, 5, 10, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaS, 10, 6, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 13, 5, 13, box); //desk 3 - fillWithMetadataBlocks(world, box, 14, 5, 13, 15, 5, 13, Blocks.wooden_slab, 9); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 15, 5, 12, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaS | 4, 15, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE, 14, 5, 12, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaN, 14, 6, 13, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 15, 5, 10, box); - placeBlockAtCurrentPosition(world, Blocks.fence, 0, 15, 5, 9, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_pressure_plate, 0, 15, 6, 9, box); - //loot - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaS, 8, 5, 9, HbmChestContents.officeTrash, 4); - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaN, 12, 5, 13, HbmChestContents.filingCabinet, 6); - //there were supposed to be paintings included, but i don't want to figure out how to - //force the art type on both the server and clientside - //upper floor - placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 15, 7, 5, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 15, 7, 1, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 14, 7, 1, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 14, 8, 1, box); - fillWithBlocks(world, box, 8, 7, 3, 11, 7, 3, ModBlocks.tile_lab); //central table - placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaW, 12, 7, 3, box); - fillWithMetadataBlocks(world, box, 8, 7, 2, 11, 7, 2, ModBlocks.steel_wall, decoMetaS); - placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, decoMetaE, 7, 7, 3, box); - fillWithMetadataBlocks(world, box, 8, 7, 4, 11, 7, 4, ModBlocks.steel_wall, decoMetaN); - fillWithBlocks(world, box, 10, 7, 5, 12, 7, 5, ModBlocks.cm_sheet); //machine 1 - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 12, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 11, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 10, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 0, 12, 9, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_port, 0, 11, 9, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 0, 10, 9, 5, box); - placeBlockAtCurrentPosition(world, Blocks.stone_button, getButtonMeta(4), 11, 9, 4, box); - fillWithMetadataBlocks(world, box, 9, 7, 5, 9, 8, 5, ModBlocks.steel_wall, decoMetaW); //locker - placeBlockAtCurrentPosition(world, ModBlocks.steel_roof, decoMetaN, 8, 9, 5, box); - fillWithMetadataBlocks(world, box, 7, 7, 5, 7, 8, 5, ModBlocks.steel_wall, decoMetaE); - fillWithBlocks(world, box, 4, 7, 5, 6, 7, 5, ModBlocks.cm_block); //machine 2 - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 6, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_circuit, 0, 5, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaS, 4, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_engine, 0, 6, 9, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.reinforced_lamp_off, 0, 5, 9, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_engine, 0, 4, 9, 5, box); - placeLever(world, box, 4, false, 5, 8, 4); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 4, 7, 1, box); //table - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 5, 7, 1, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 7, 1, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaW | 4, 2, 7, 5, box); //desk - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairMetaE | 4, 1, 7, 5, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, 2, 7, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaN, 2, 8, 5, box); - //loot - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaS, 13, 7, 1, HbmChestContents.filingCabinet, 4); - if(rand.nextInt(2) == 0) - generateLoreBook(world, box, 13, 7, 1, 4, HbmChestContents.generateLabBook(rand)); - generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 8, 7, 5, HbmChestContents.labVault, 4); - generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 8, 8, 5, HbmChestContents.machineParts, 5); - break; - case 1: //hazmat - //lower floor - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS | 4, 1, 5, 9, box); //table - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 10, 1, 5, 10, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaN | 4, 1, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 1, 6, 10, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 1, 5, 13, box); - fillWithMetadataBlocks(world, box, 5, 5, 9, 11, 5, 9, ModBlocks.concrete_asbestos_stairs, stairMetaS | 4); //con. desk - fillWithMetadataBlocks(world, box, 5, 5, 10, 7, 5, 10, ModBlocks.concrete_slab, 10); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_asbestos_stairs, stairMetaN | 4, 7, 5, 11, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_slab, 10, 11, 5, 10, box); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_asbestos_stairs, stairMetaN | 4, 11, 5, 11, box); - fillWithMetadataBlocks(world, box, 4, 6, 9, 4, 7, 9, ModBlocks.steel_wall, decoMetaE); //bank of tape recorders - fillWithMetadataBlocks(world, box, 5, 6, 9, 5, 7, 9, ModBlocks.tape_recorder, decoMetaN); - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 6, 6, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 7, 6, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 6, 7, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 7, 7, 9, box); - placeBlockAtCurrentPosition(world, Blocks.lever, 3, 6, 7, 10, box); - placeBlockAtCurrentPosition(world, Blocks.stone_button, 3, 7, 6, 10, box); - fillWithMetadataBlocks(world, box, 8, 6, 9, 8, 7, 9, ModBlocks.steel_corner, decoMetaW); - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 9, 6, 9, box); - fillWithMetadataBlocks(world, box, 10, 6, 9, 10, 7, 9, ModBlocks.steel_corner, decoMetaN); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 11, 6, 9, box); - placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, decoMetaN, 11, 7, 9, box); - fillWithMetadataBlocks(world, box, 12, 6, 9, 12, 7, 9, ModBlocks.steel_wall, decoMetaW); - placeBlockAtCurrentPosition(world, Blocks.stone_button, 3, 11, 6, 10, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 5, 5, 11, box); //chairs and computers - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaN, 8, 5, 12, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaE, 10, 5, 11, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 6, 6, 10, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 7, 5, 12, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 10, 5, 10, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaE, 7, 6, 11, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 11, 6, 11, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE | 4, 14, 5, 13, box); //table - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW | 4, 15, 5, 13, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairMetaS, 15, 5, 11, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_pipe_rim, 0, 15, 5, 9, box); - //loot - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, decoModelMetaS | 1, 9, 7, 9, HbmChestContents.filingCabinet, 3); - generateInvContents(world, box, rand, Blocks.chest, decoMetaS, 14, 6, 13, HbmChestContents.modGeneric, 3); - //upper floor - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW | 4, 15, 7, 5, box); //desks - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE | 4, 15, 7, 4, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS | 4, 15, 7, 2, box); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaW | 4, 15, 7, 1, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 13, 7, 2, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 14, 7, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, decoModelMetaW, 15, 8, 4, box); - for(int i = 3; i <= 9; i+=6) { //hazmat tables - fillWithMetadataBlocks(world, box, i, 7, 3, i, 7, 5, ModBlocks.concrete_asbestos_stairs, stairMetaW | 4); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_asbestos_stairs, stairMetaN | 4, i+1, 7, 3, box); - fillWithMetadataBlocks(world, box, i+2, 7, 3, i+2, 7, 5, ModBlocks.concrete_asbestos_stairs, stairMetaE | 4); - fillWithMetadataBlocks(world, box, i+1, 7, 4, i+1, 7, 5, ModBlocks.concrete_colored_ext, 5); - } - placeBlockAtCurrentPosition(world, ModBlocks.block_electrical_scrap, 0, 10, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 4, 8, 4, box); - fillWithMetadataBlocks(world, box, 6, 7, 5, 8, 7, 5, ModBlocks.cm_block, 1); //machine - placeBlockAtCurrentPosition(world, ModBlocks.cm_circuit, 2, 6, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_port, 1, 7, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_circuit, 2, 8, 8, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 1, 6, 9, 5, box); - placeBlockAtCurrentPosition(world, Blocks.redstone_lamp, 0, 7, 9, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_sheet, 1, 8, 9, 5, box); - placeBlockAtCurrentPosition(world, Blocks.lever, 4, 7, 8, 4, box); - placeBlockAtCurrentPosition(world, ModBlocks.geiger, decoMetaE, 6, 7, 4, box); //geiger - if(rand.nextInt(2) == 0) - placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, 6, 7, 1, box); - else - placeRandomBobble(world, box, rand, 6, 7, 1 ); - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaS | 4, 1, 7, 1, box); //desk - placeBlockAtCurrentPosition(world, Blocks.birch_stairs, stairMetaE | 4, 2, 7, 1, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 1, 7, 3, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 2, 8, 1, box); - placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 1, 7, 5, box); - //loot - generateInvContents(world, box, rand, ModBlocks.crate_iron, 8, 7, 3, HbmChestContents.nuclearFuel, 8); - generateInvContents(world, box, rand, ModBlocks.crate_iron, 2, 7, 5, HbmChestContents.nukeTrash, 6); - //other crate - placeBlockAtCurrentPosition(world, ModBlocks.crate_lead, 0, 2, 8, 5, box); - - break; - } - - //webs - randomlyFillWithBlocks(world, box, rand, 0.15F, 0, 6, 7, 10, 8, 7, Blocks.web); - randomlyFillWithBlocks(world, box, rand, 0.4F, 11, 5, 7, 11, 9, 7, Blocks.web); - randomlyFillWithBlocks(world, box, rand, 0.4F, 16, 5, 7, 16, 9, 7, Blocks.web); - - placeWebs(world, box, rand, 1, 5, 9, 15, 7, 13, 0.10F, 0.01F); - placeWebs(world, box, rand, 13, 7, 6, 14, 8, 8, 0.20F, 0F); - placeWebs(world, box, rand, 1, 7, 1, 15, 9, 5, 0.10F, 0.01F); - - //test - //plan is: biome-dependent overgrowth, integrated neatly - /*generateShrubs(world, box, rand, 0, 0, 16, 1, 4); - generateShrubs(world, box, rand, 0, 13, 16, 14, 2); - generateShrubs(world, box, rand, 0, 4, 16, 8, 2);*/ - - - return true; - } - - protected void placeWebs(World world, StructureBoundingBox box, Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, float chance, float bigWebChance) { - if(getYWithOffset(minY) < box.minY || getYWithOffset(maxY) > box.maxY) - return; - - for(int x = minX; x <= maxX; x++) { - - for(int z = minZ; z <= maxZ; z++) { - int posX = getXWithOffset(x, z); - int posZ = getZWithOffset(x, z); - - if(posX >= box.minX && posX <= box.maxX && posZ >= box.minZ && posZ <= box.maxZ) { - for(int y = minY; y <= maxY; y++) { - int posY = getYWithOffset(y); - - if(world.getBlock(posX, posY, posZ) == Blocks.web) continue; - - boolean onWall = (x == minX || x == maxX || z == minZ || z == maxZ); - boolean onCeiling = (y == minY || y == maxY); //floor or ceiling, really - //this will go over the subchunk boundaries, but trees already do that all the time; it's only really an issue if it causes updates or - //goes over the 2x2 chunk area entirely - if(onWall && onCeiling && rand.nextFloat() <= bigWebChance) { - - for(int j = Math.max(minY, y - 1); j <= Math.min(maxY, y + 1); j++) { //on one hand, eugh. on the other, good-looking webs! - int fac = 2 - Math.abs(j - y); //rounds out the edges with distance from starting block - - int maxI = Math.min(maxX, x + 1); - for(int i = Math.max(minX, x - 1); i <= maxI; i++) { - - int maxK = Math.min(maxZ, z + 1); - for(int k = Math.max(minZ, z - 1); k <= maxK; k++) { - int posI = getXWithOffset(i, k); - int posJ = getYWithOffset(j); - int posK = getZWithOffset(i, k); - - if(world.isAirBlock(posI, posJ, posK) && (Math.abs(i - x) != fac || Math.abs(k - z) != fac || rand.nextInt(3) == 0)) - world.setBlock(posI, posJ, posK, Blocks.web, 0, 2); - - } - } - } - } else if((onWall || onCeiling) && world.isAirBlock(posX, posY, posZ) && rand.nextFloat() <= chance) - world.setBlock(posX, posY, posZ, Blocks.web, 0, 2); - } - } - } - } - } - - /*protected void generateShrubs(World world, StructureBoundingBox box, Random rand, int minX, int minZ, int maxX, int maxZ, int startY) { - int startX = Math.min(this.getXWithOffset(minX, minZ), this.getXWithOffset(maxX, maxZ)); - int startZ = Math.min(this.getZWithOffset(minX, minZ), this.getZWithOffset(maxX, maxZ)); - int endX = Math.max(this.getXWithOffset(minX, minZ), this.getXWithOffset(maxX, maxZ)) - startX; - int endZ = Math.max(this.getZWithOffset(minX, minZ), this.getZWithOffset(maxX, maxZ)) - startZ; - - int attempts = rand.nextInt(2); - WorldGenShrub shrub = new WorldGenShrub(0, 0); - - for(int i = 0; i < attempts; i++) { - int posX = startX + rand.nextInt(endX <= 0 ? 1 : endX); - int posY = this.getYWithOffset(startY); - int posZ = startZ + rand.nextInt(endZ <= 0 ? 1 : endZ); - - if(box.isVecInside(posX, posY, posZ)) { - int brake = 0; - - do { - Block block = world.getBlock(posX, posY, posZ); - - if(!((block.isAir(world, posX, posY, posZ) || block.isFoliage(world, posX, posY, posZ) || block.isLeaves(world, posX, posY, posZ)) && posY > 0)) { - shrub.generate(world, rand, posX, posY, posZ); - break; - } - - posY--; - } while(brake++ <= 15); - } - } - }*/ - } - - //the block selector in general is kinda mid, i might just replace it entirely - public static class DirtyGlass extends StructureComponent.BlockSelector { - protected boolean webs; - protected float chance; - protected int meta; //argh - - public DirtyGlass(BiomeGenBase biome, float chance, boolean webs) { - if(BiomeDictionary.isBiomeOfType(biome, Type.COLD)) - this.meta = 8; //fogged-up - else if(NTMWorldGenerator.doesBiomeHaveTypes(biome, Type.WASTELAND, Type.JUNGLE, Type.SANDY, Type.SAVANNA, Type.SWAMP)) - this.meta = 12; //super dirty - else - this.meta = 7; //dirty - - this.field_151562_a = Blocks.stained_glass_pane; - this.chance = chance; - this.webs = webs; - } - - @Override - public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { - if(rand.nextFloat() <= chance) { - this.selectedBlockMetaData = 0; - if(webs && rand.nextInt(3) == 0) - this.field_151562_a = Blocks.web; - else - this.field_151562_a = Blocks.air; - } else { - this.field_151562_a = Blocks.stained_glass_pane; - this.selectedBlockMetaData = meta; - } - } - } -} \ No newline at end of file diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index e11e5aca5..f1263b23a 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -436,22 +436,6 @@ abstract public class Component extends StructureComponent { } } - protected void placeLootBlock(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ, ItemStack stack) { - int posX = this.getXWithOffset(featureX, featureZ); - int posY = this.getYWithOffset(featureY); - int posZ = this.getZWithOffset(featureX, featureZ); - - if(!box.isVecInside(posX, posY, posZ)) return; - - world.setBlock(posX, posY, posZ, ModBlocks.deco_loot, 0, 2); - - TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(posX, posY, posZ); - - if(loot != null && loot.items.isEmpty()) { - loot.addItem(stack, rand.nextGaussian() * 0.02, 0, rand.nextGaussian() * 0.02); - } - } - /** * Places random bobblehead with a randomized orientation at specified location */ 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 ff494c6b0..914b01b7e 100644 --- a/src/main/java/com/hbm/world/gen/component/RuinFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/RuinFeatures.java @@ -3,10 +3,8 @@ package com.hbm.world.gen.component; import java.util.Random; import com.hbm.blocks.ModBlocks; -import com.hbm.lib.HbmChestContents; import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureBoundingBox; @@ -20,21 +18,6 @@ public class RuinFeatures { MapGenStructureIO.func_143031_a(NTMRuin4.class, "NTMRuin4"); } - public static void placeBook(World world, StructureBoundingBox box, Random rand, int minX, int minZ, int maxX, int maxZ, Component com) { - int i = minX + rand.nextInt(maxX); - int j = minZ + rand.nextInt(maxZ); - - int posX = com.getXWithOffset(i, j); - int posZ = com.getZWithOffset(i, j); - - if(box.isVecInside(posX, 64, posZ)) { - int topHeight = world.getTopSolidOrLiquidBlock(posX, posZ); - - ItemStack book = HbmChestContents.generateRuinBook(rand, posX >> 4, posZ >> 4); - com.placeLootBlock(world, box, rand, i, topHeight - com.getBoundingBox().minY, j, book); - } - } - public static class NTMRuin1 extends Component { private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks(); @@ -103,9 +86,6 @@ public class RuinFeatures { this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); - if(rand.nextInt(3) == 0) //it's all in one chunk so it's fine - placeBook(world, box, rand, 1, 1, 7, 9, this); - return true; } } @@ -226,9 +206,6 @@ public class RuinFeatures { this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 8 - 1, 0, 3, Blocks.gravel, Blocks.air, false); this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false); - if(rand.nextInt(3) == 0) - placeBook(world, box, rand, 1, 5, 7, 9, this); - return true; } } @@ -290,9 +267,6 @@ public class RuinFeatures { 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, 10 - 1, 0, 11 - 1, Blocks.gravel, Blocks.air, false); - if(rand.nextInt(3) == 0) - placeBook(world, box, rand, 1, 1, 4, 10, this); - return true; } } diff --git a/src/main/java/com/hbm/world/gen/component/SpecialFeatures.java b/src/main/java/com/hbm/world/gen/component/SpecialFeatures.java deleted file mode 100644 index 7664f2b6e..000000000 --- a/src/main/java/com/hbm/world/gen/component/SpecialFeatures.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.hbm.world.gen.component; - -import java.util.Random; - -import com.hbm.blocks.ModBlocks; - -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraft.world.gen.structure.StructureBoundingBox; - -public class SpecialFeatures { - - public static void registerComponents() { - MapGenStructureIO.func_143031_a(SpecialContainer.class, "NTMSpecialContainer"); - } - - public static class SpecialContainer extends Component { - - public SpecialContainer() { - - } - - public SpecialContainer(Random rand, int minX, int minY, int minZ) { - super(rand, minX, minY, minZ, 3, 3, 9); - - } - - @Override - public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { - - if(hpos == -1 && !this.setAverageHeight(world, box, this.boundingBox.minY)) { - return false; - } - - fillWithAir(world, box, 1, 1, 1, 2, 2, 8); - - //floor - fillWithBlocks(world, box, 0, 0, 0, 3, 0, 1, ModBlocks.deco_steel); - fillWithBlocks(world, box, 1, 0, 2, 2, 0, 7, ModBlocks.deco_steel); - fillWithBlocks(world, box, 0, 0, 8, 3, 0, 9, ModBlocks.deco_steel); - fillWithBlocks(world, box, 1, 0, 1, 2, 0, 1, ModBlocks.cm_block); - fillWithBlocks(world, box, 1, 0, 8, 2, 0, 8, ModBlocks.cm_block); - //roof - fillWithBlocks(world, box, 0, 3, 0, 3, 3, 9, ModBlocks.deco_steel); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 0, 3, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 3, 3, 2, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 0, 3, 7, box); - placeBlockAtCurrentPosition(world, ModBlocks.cm_block, 0, 3, 3, 7, box); - //walls - fillWithBlocks(world, box, 0, 1, 0, 0, 2, 0, ModBlocks.deco_steel); - fillWithBlocks(world, box, 0, 1, 1, 0, 2, 8, ModBlocks.cm_sheet); - fillWithBlocks(world, box, 0, 1, 9, 0, 2, 9, ModBlocks.deco_steel); - fillWithBlocks(world, box, 1, 1, 9, 2, 2, 9, ModBlocks.cm_sheet); - fillWithBlocks(world, box, 3, 1, 9, 3, 2, 9, ModBlocks.deco_steel); - fillWithBlocks(world, box, 3, 1, 1, 3, 2, 8, ModBlocks.cm_sheet); - fillWithBlocks(world, box, 3, 1, 0, 3, 2, 0, ModBlocks.deco_steel); - //doors - placeDoor(world, box, ModBlocks.door_metal, 1, false, false, 2, 1, 0); - placeDoor(world, box, ModBlocks.door_metal, 1, true, false, 1, 1, 0); - - return true; - } - - @Override - protected boolean setAverageHeight(World world, StructureBoundingBox box, int y) { - - int total = 0; - int iterations = 0; - - for(int z = this.boundingBox.minZ; z <= this.boundingBox.maxZ; z++) { - for(int x = this.boundingBox.minX; x <= this.boundingBox.maxX; x++) { - if(box.isVecInside(x, y, z)) { - total += Math.max(world.getTopSolidOrLiquidBlock(x, z), 1); // underwater :3c - iterations++; - } - } - } - - if(iterations == 0) - return false; - - this.hpos = total / iterations; //finds mean of every block in bounding box - this.boundingBox.offset(0, this.hpos - this.boundingBox.minY, 0); - return true; - } - } -} diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 3f50734d1..05365875c 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -451,12 +451,6 @@ book_lore.beacon.page.9=Once the desired peer has responded, give the "ACCEPT CO book_lore.beacon.page.10=using the FAR-5M standard. Communication will end immediately if no standard has been negotiated, serving as a "ping". Should communication continue, the connection can be ended using another long single tone "END CONNECTION". book_lore.beacon.page.11=Chapter 5: Warranty $ [ page intentionally left blank ] -book_lore.ruin_special.name=Detection Printout -book_lore.ruin_special.page.0=§lDETECTION $ ----------------- $ DIST: %1$s km $ THETA: %2$s° $ PROGNOSIS $ %3$s -book_lore.ruin_special.low=Low-confidence detection. Distance is large and imprecise; high chance of interference. -book_lore.ruin_special.med=Medium-confidence detection. Chance of interference is low; further investigation recommended. -book_lore.ruin_special.high=High-confidence detection. Location precisely triangulated by sensors; expedition urgently recommended. - cannery.f1=[ Press F1 for help ] cannery.centrifuge=Gas Centrifuge From 1bd5efe0a78a2aa734206a957977148a6a14a69b Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 9 Feb 2024 23:19:34 -0800 Subject: [PATCH 14/18] added rural house, few additions don't think i've ever needed the pattern tool but at least it works now --- .../hbm/items/tool/ItemStructurePattern.java | 2 +- .../com/hbm/items/tool/ItemStructureTool.java | 3 + .../java/com/hbm/items/tool/ItemWandD.java | 23 +- .../java/com/hbm/lib/HbmChestContents.java | 2 +- src/main/java/com/hbm/util/LootGenerator.java | 34 +- .../world/gen/component/CivilianFeatures.java | 420 +++++++++++++++++- .../hbm/world/gen/component/Component.java | 4 +- 7 files changed, 468 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/hbm/items/tool/ItemStructurePattern.java b/src/main/java/com/hbm/items/tool/ItemStructurePattern.java index 0e4832ad4..09c75e5cd 100644 --- a/src/main/java/com/hbm/items/tool/ItemStructurePattern.java +++ b/src/main/java/com/hbm/items/tool/ItemStructurePattern.java @@ -49,7 +49,7 @@ public class ItemStructurePattern extends ItemStructureTool { Block b = world.getBlock(ix + pos.getX(), iy + pos.getY(), iz + pos.getZ()); int meta = world.getBlockMetadata(ix + pos.getX(), iy + pos.getY(), iz + pos.getZ()); - message.concat("placeBlockAtCurrentPosition(world, " + b.getUnlocalizedName() + ", " + meta + ", " + ix + ", " + iy + ", " + iz + ", box);\n"); + message += "placeBlockAtCurrentPosition(world, " + b.getUnlocalizedName() + ", " + meta + ", " + ix + ", " + iy + ", " + iz + ", box);\n"; } } } diff --git a/src/main/java/com/hbm/items/tool/ItemStructureTool.java b/src/main/java/com/hbm/items/tool/ItemStructureTool.java index 62e43b03c..de10db59e 100644 --- a/src/main/java/com/hbm/items/tool/ItemStructureTool.java +++ b/src/main/java/com/hbm/items/tool/ItemStructureTool.java @@ -137,6 +137,9 @@ public abstract class ItemStructureTool extends Item implements ILookOverlay { } } + if(Minecraft.getMinecraft().thePlayer.isSneaking()) + text.add("B: " + world.getBlock(x, y, z).getUnlocalizedName() + ", M: " + world.getBlockMetadata(x, y, z)); + ILookOverlay.printGeneric(event, this.getItemStackDisplayName(stack), 0xffff00, 0x404000, text); } } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index 8392b7ad1..d41af6091 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -6,13 +6,17 @@ 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 { @@ -26,6 +30,17 @@ 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()); @@ -36,13 +51,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 ElevatedPrefab1(world.rand, i, 64, j); - comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32));*/ + 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; @@ -80,7 +95,7 @@ public class ItemWandD extends Item { tom.destructionRange = 600; world.spawnEntityInWorld(tom);*/ - List del = world.getEntitiesWithinAABB(EntityNukeTorex.class, AxisAlignedBB.getBoundingBox(pos.blockX, pos.blockY + 1, pos.blockZ, pos.blockX, pos.blockY + 1, pos.blockZ).expand(50, 50, 50)); + /*List del = world.getEntitiesWithinAABB(EntityNukeTorex.class, AxisAlignedBB.getBoundingBox(pos.blockX, pos.blockY + 1, pos.blockZ, pos.blockX, pos.blockY + 1, pos.blockZ).expand(50, 50, 50)); if(!del.isEmpty()) { for(EntityNukeTorex torex : del) torex.setDead(); diff --git a/src/main/java/com/hbm/lib/HbmChestContents.java b/src/main/java/com/hbm/lib/HbmChestContents.java index 964bfc4dc..c0bda98a8 100644 --- a/src/main/java/com/hbm/lib/HbmChestContents.java +++ b/src/main/java/com/hbm/lib/HbmChestContents.java @@ -442,7 +442,7 @@ public class HbmChestContents { String key; int pages; - switch(rand.nextInt(4)) { + switch(rand.nextInt(5)) { case 0: key = "bf_bomb_1"; pages = 4; break; case 1: diff --git a/src/main/java/com/hbm/util/LootGenerator.java b/src/main/java/com/hbm/util/LootGenerator.java index 537796427..0c7e5c7af 100644 --- a/src/main/java/com/hbm/util/LootGenerator.java +++ b/src/main/java/com/hbm/util/LootGenerator.java @@ -101,23 +101,19 @@ public class LootGenerator { if(loot != null && loot.items.isEmpty()) { - if(world.rand.nextInt(2) == 0) - addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.gun_lever_action), 0, 0, 0.125); + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.gun_lever_action), 0.125, 0.025, 0.25); + + if(world.rand.nextBoolean()) + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.wrench), -0.25, 0, -0.28125); int count = world.rand.nextInt(2) + 1; for(int i = 0; i < count; i++) { - int type = world.rand.nextInt(2); - Item parts = type < 1 ? ModItems.plate_steel : ModItems.mechanism_rifle_1; - addItemWithDeviation(loot, world.rand, new ItemStack(parts), -0.3125, i * 0.03125, 0.3125); + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.plate_steel), -0.25, i * 0.03125, 0.3125); } count = world.rand.nextInt(2) + 2; for(int i = 0; i < count; i++) - addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.wire_aluminium), 0.3125, i * 0.03125, -0.125); - - int type = world.rand.nextInt(4); - Item tool = type > 2 ? ModItems.wrench : ModItems.screwdriver; - addItemWithDeviation(loot, world.rand, new ItemStack(tool), 0.005, 0, -0.3125); + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.wire_aluminium), 0.25, i * 0.03125, 0.1875); } } @@ -183,4 +179,22 @@ public class LootGenerator { } } } + + public static void lootBookLore(World world, int x, int y, int z, ItemStack book) { + + TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z); + + if(loot != null && loot.items.isEmpty()) { + addItemWithDeviation(loot, world.rand, book, 0, 0, -0.25); + + int count = world.rand.nextInt(3) + 2; + for(int k = 0; k < count; k++) + addItemWithDeviation(loot, world.rand, new ItemStack(Items.book), -0.25, k * 0.03125, 0.1875); + + count = world.rand.nextInt(2) + 1; + for(int k = 0; k < count; k++) + addItemWithDeviation(loot, world.rand, new ItemStack(Items.paper), 0.25, k * 0.03125, 0.125); + } + } + } 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 66301f925..3495e6291 100644 --- a/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java @@ -8,6 +8,7 @@ import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; import com.hbm.lib.HbmChestContents; import com.hbm.util.LootGenerator; +import net.minecraft.block.BlockStairs; import net.minecraft.init.Blocks; import net.minecraft.item.ItemDoor; import net.minecraft.nbt.NBTTagCompound; @@ -25,9 +26,10 @@ public class CivilianFeatures { public static void registerComponents() { MapGenStructureIO.func_143031_a(NTMHouse1.class, "NTMHouse1"); MapGenStructureIO.func_143031_a(NTMHouse2.class, "NTMHouse2"); - MapGenStructureIO.func_143031_a(NTMLab1.class, "NTMLab1"); + MapGenStructureIO.func_143031_a(NTMLab1.class, "NTMLab1"); //i'll replace these shitty structures one day trust MapGenStructureIO.func_143031_a(NTMLab2.class, "NTMLab2"); MapGenStructureIO.func_143031_a(NTMWorkshop1.class, "NTMWorkshop1"); + MapGenStructureIO.func_143031_a(RuralHouse1.class, "NTMRuralHouse1"); } /** Sandstone Ruin 1 */ @@ -725,4 +727,420 @@ public class CivilianFeatures { } } + + public static class RuralHouse1 extends Component { + + + public RuralHouse1() { + super(); + } + + public RuralHouse1(Random rand, int minX, int minZ) { + super(rand, minX, 64, minZ, 14, 8, 14); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + + if(!this.setAverageHeight(world, box, this.boundingBox.minY)) { + return false; + } + + //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); + fillWithBlocks(world, box, 4, 0, 1, 9, 0, 1, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 9, 0, 2, 10, 0, 2, ModBlocks.concrete_colored_ext); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 12, 0, 2, box); + fillWithBlocks(world, box, 13, 0, 2, 13, 0, 9, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 4, 0, 9, 12, 0, 9, ModBlocks.concrete_colored_ext); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 2, 0, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 8, 0, 10, box); + fillWithBlocks(world, box, 8, 0, 12, 8, 0, 13, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 1, 0, 13, 7, 0, 13, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 1, 0, 5, 1, 0, 12, ModBlocks.concrete_colored_ext); + placeFoundationUnderneath(world, ModBlocks.concrete_colored_ext, 0, 1, 10, 8, 13, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_colored_ext, 0, 1, 4, 3, 9, -1, box); + placeFoundationUnderneath(world, ModBlocks.concrete_colored_ext, 0, 4, 1, 13, 9, -1, box); + + placeFoundationUnderneath(world, Blocks.log, 0, 2, 3, 2, 3, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 3, 2, 3, 2, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 3, 0, 3, 0, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 5, 0, 5, 0, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 8, 0, 8, 0, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 10, 0, 10, 0, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 14, 1, 14, 1, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 14, 3, 14, 3, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 14, 5, 14, 6, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 14, 8, 14, 8, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 14, 10, 14, 10, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 9, 14, 9, 14, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 7, 14, 7, 14, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 4, 14, 5, 14, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 2, 14, 2, 14, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 14, 0, 14, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 13, 0, 13, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 11, 0, 11, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 9, 0, 9, -1, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 6, 0, 7, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 4, 0, 4, 0, box); + placeFoundationUnderneath(world, Blocks.log, 0, 0, 3, 0, 4, -1, box); + + //Walls + //North/Front + fillWithBlocks(world, box, 1, 1, 4, 4, 4, 4, Blocks.brick_block); + fillWithBlocks(world, box, 2, 5, 4, 7, 5, 4, Blocks.brick_block); + placeBlockAtCurrentPosition(world, Blocks.brick_block, 0, 3, 6, 4, box); + placeBlockAtCurrentPosition(world, Blocks.brick_block, 0, 6, 6, 4, box); + fillWithBlocks(world, box, 4, 7, 4, 5, 7, 4, Blocks.brick_block); + fillWithBlocks(world, box, 4, 1, 1, 4, 4, 3, Blocks.brick_block); + fillWithBlocks(world, box, 5, 1, 1, 8, 1, 1, Blocks.brick_block); + fillWithBlocks(world, box, 5, 4, 1, 8, 4, 1, Blocks.brick_block); + fillWithBlocks(world, box, 9, 1, 1, 9, 4, 2, Blocks.brick_block); + fillWithBlocks(world, box, 10, 1, 2, 10, 3, 2, Blocks.brick_block); + fillWithBlocks(world, box, 12, 1, 2, 13, 3, 2, Blocks.brick_block); + fillWithBlocks(world, box, 10, 4, 2, 13, 4, 2, Blocks.brick_block); + fillWithBlocks(world, box, 9, 5, 2, 12, 5, 2, Blocks.brick_block); + fillWithBlocks(world, box, 10, 6, 2, 11, 6, 2, Blocks.brick_block); + //East/Left + fillWithBlocks(world, box, 13, 1, 3, 13, 1, 8, Blocks.brick_block); + fillWithBlocks(world, box, 13, 3, 3, 13, 4, 8, Blocks.brick_block); + //South/Back + fillWithBlocks(world, box, 13, 1, 9, 13, 4, 9, Blocks.brick_block); + fillWithBlocks(world, box, 9, 1, 9, 12, 1, 9, Blocks.brick_block); + fillWithBlocks(world, box, 9, 4, 9, 12, 5, 9, Blocks.brick_block); + fillWithBlocks(world, box, 10, 6, 9, 11, 6, 9, Blocks.brick_block); + fillWithBlocks(world, box, 8, 1, 9, 8, 4, 10, Blocks.brick_block); + fillWithBlocks(world, box, 8, 1, 12, 8, 3, 13, Blocks.brick_block); + fillWithBlocks(world, box, 8, 4, 11, 8, 4, 13, Blocks.brick_block); + fillWithBlocks(world, box, 7, 1, 13, 7, 3, 13, Blocks.brick_block); + fillWithBlocks(world, box, 3, 1, 13, 6, 1, 13, Blocks.brick_block); + fillWithBlocks(world, box, 2, 4, 13, 7, 5, 13, Blocks.brick_block); + placeBlockAtCurrentPosition(world, Blocks.brick_block, 0, 6, 6, 13, box); + placeBlockAtCurrentPosition(world, Blocks.brick_block, 0, 3, 6, 13, box); + fillWithBlocks(world, box, 4, 7, 13, 5, 7, 13, Blocks.brick_block); + fillWithBlocks(world, box, 2, 1, 13, 2, 3, 13, Blocks.brick_block); + //West/Right + fillWithBlocks(world, box, 1, 1, 13, 1, 4, 13, Blocks.brick_block); + fillWithBlocks(world, box, 1, 1, 5, 1, 1, 12, Blocks.brick_block); + placeBlockAtCurrentPosition(world, Blocks.brick_block, 0, 1, 2, 9, box); + fillWithBlocks(world, box, 1, 3, 5, 1, 3, 12, Blocks.brick_block); + //Inside + fillWithBlocks(world, box, 2, 1, 9, 2, 3, 9, Blocks.brick_block); + fillWithBlocks(world, box, 4, 1, 9, 7, 3, 9, Blocks.brick_block); + //Wood Paneling + fillWithMetadataBlocks(world, box, 5, 2, 1, 5, 3, 1, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 8, 2, 1, 8, 3, 1, Blocks.planks, 1); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 11, 3, 2, box); + fillWithMetadataBlocks(world, box, 13, 2, 3, 13, 2, 4, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 13, 2, 7, 13, 2, 8, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 12, 2, 9, 12, 3, 9, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 9, 2, 9, 9, 3, 9, Blocks.planks, 1); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 8, 3, 11, box); + fillWithMetadataBlocks(world, box, 6, 2, 13, 6, 3, 13, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 3, 2, 13, 3, 3, 13, Blocks.planks, 1); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 12, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 10, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 8, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 5, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 3, 3, 9, box); + //Wood Framing + //North/Front + int logW = this.getPillarMeta(4); + int logN = this.getPillarMeta(8); + + fillWithBlocks(world, box, 0, 0, 3, 0, 3, 3, Blocks.log); + fillWithMetadataBlocks(world, box, 1, 4, 3, 3, 4, 3, Blocks.log, logW); + fillWithMetadataBlocks(world, box, 3, 4, 1, 3, 4, 2, Blocks.log, logN); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 1, 3, 3, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 3, 3, 1, box); + fillWithMetadataBlocks(world, box, 1, 1, 3, 2, 1, 3, Blocks.wooden_slab, 1); + fillWithMetadataBlocks(world, box, 3, 1, 1, 3, 1, 3, Blocks.wooden_slab, 1); + fillWithBlocks(world, box, 3, 0, 0, 3, 3, 0, Blocks.log); + fillWithMetadataBlocks(world, box, 4, 1, 0, 9, 1, 0, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 4, 3, 0, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 9, 3, 0, box); + fillWithBlocks(world, box, 10, 0, 0, 10, 3, 0, Blocks.log); + fillWithMetadataBlocks(world, box, 10, 4, 1, 13, 4, 1, Blocks.log, logW); + fillWithBlocks(world, box, 14, 0, 1, 14, 3, 1, Blocks.log); + //East/Left + fillWithBlocks(world, box, 14, 0, 3, 14, 3, 3, Blocks.log); + fillWithBlocks(world, box, 14, 0, 8, 14, 3, 8, Blocks.log); + fillWithBlocks(world, box, 14, 0, 10, 14, 3, 10, Blocks.log); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 14, 1, 2, box); + fillWithMetadataBlocks(world, box, 14, 1, 4, 14, 1, 7, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 14, 1, 9, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 14, 3, 2, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 14, 3, 4, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 14, 3, 7, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 14, 3, 9, box); + //South/Back + fillWithMetadataBlocks(world, box, 9, 4, 10, 13, 4, 10, Blocks.log, logW); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 13, 3, 10, box); + fillWithBlocks(world, box, 9, 0, 14, 9, 3, 14, Blocks.log); + fillWithBlocks(world, box, 7, 0, 14, 7, 3, 14, Blocks.log); + fillWithBlocks(world, box, 2, 0, 14, 2, 3, 14, Blocks.log); + fillWithBlocks(world, box, 0, 0, 14, 0, 3, 14, Blocks.log); + fillWithMetadataBlocks(world, box, 1, 4, 14, 8, 4, 14, Blocks.log, logW); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 8, 1, 14, box); + fillWithMetadataBlocks(world, box, 3, 1, 14, 6, 1, 14, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 1, 1, 14, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 8, 3, 14, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 1, 3, 14, box); + //West/Right + fillWithBlocks(world, box, 0, 0, 9, 0, 3, 9, Blocks.log); + fillWithMetadataBlocks(world, box, 0, 1, 10, 0, 1, 13, Blocks.wooden_slab, 1); + fillWithMetadataBlocks(world, box, 0, 1, 4, 0, 1, 8, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 13, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 10, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 8, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 4, box); + + int stairW = this.getStairMeta(0); + int stairE = this.getStairMeta(1); + int stairN = this.getStairMeta(2); + int stairS = this.getStairMeta(3); + + //Floor + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 11, 0, 2, box); + fillWithMetadataBlocks(world, box, 9, 0, 3, 12, 0, 8, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 5, 0, 2, 8, 0, 8, Blocks.planks, 1); + fillWithMetadataBlocks(world, box, 2, 0, 5, 4, 0, 8, Blocks.planks, 1); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 3, 0, 9, box); + fillWithMetadataBlocks(world, box, 2, 0, 10, 7, 0, 12, Blocks.planks, 1); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 8, 0, 11, box); + fillWithBlocks(world, box, 13, 1, 0, 14, 1, 0, Blocks.fence); + //Porches + fillWithBlocks(world, box, 10, 0, 1, 13, 0, 1, Blocks.planks); + fillWithMetadataBlocks(world, box, 11, 0, 0, 12, 0, 0, Blocks.spruce_stairs, stairN); + fillWithMetadataBlocks(world, box, 13, 0, 0, 14, 0, 0, Blocks.planks, 1); + fillWithBlocks(world, box, 12, 0, 10, 13, 0, 10, Blocks.planks); + fillWithBlocks(world, box, 9, 0, 10, 11, 0, 11, Blocks.planks); + fillWithBlocks(world, box, 9, 0, 12, 10, 0, 12, Blocks.planks); + placeBlockAtCurrentPosition(world, Blocks.planks, 0, 9, 0, 13, box); + for(int i = 0; i < 3; i++) { + fillWithMetadataBlocks(world, box, 10 + i, 0, 13 - i, 11 + i, 0, 13 - i, Blocks.planks, 1); + fillWithBlocks(world, box, 10 + i, 1, 13 - i, 11 + i, 1, 13 - i, Blocks.fence); + } + + //Ceiling + fillWithMetadataBlocks(world, box, 12, 4, 3, 12, 4, 8, Blocks.oak_stairs, stairW | 4); + fillWithBlocks(world, box, 12, 5, 3, 12, 5, 8, Blocks.planks); + fillWithBlocks(world, box, 10, 5, 3, 11, 6, 8, Blocks.planks); + fillWithBlocks(world, box, 9, 5, 3, 9, 5, 8, Blocks.planks); + fillWithMetadataBlocks(world, box, 9, 4, 3, 9, 4, 8, Blocks.oak_stairs, stairE | 4); + fillWithBlocks(world, box, 8, 4, 5, 8, 4, 8, Blocks.planks); + fillWithBlocks(world, box, 5, 4, 2, 8, 4, 4, Blocks.planks); + fillWithBlocks(world, box, 1, 4, 5, 7, 4, 12, Blocks.planks); + + //Roofing + //Framing + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 1, 5, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 2, 6, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 3, 6, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 3, 7, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 4, 7, 3, box); + fillWithMetadataBlocks(world, box, 4, 8, 3, 5, 8, 3, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 5, 7, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 6, 7, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 6, 6, 3, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 7, 6, 3, box); + fillWithMetadataBlocks(world, box, 2, 5, 3, 3, 5, 3, Blocks.planks, 1); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 3, 5, 2, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 3, 5, 1, box); + fillWithMetadataBlocks(world, box, 3, 4, 0, 14, 4, 0, Blocks.spruce_stairs, stairN); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 8, 5, 1, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 9, 5, 1, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 10, 5, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 9, 6, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 10, 6, 1, box); + fillWithMetadataBlocks(world, box, 10, 7, 1, 11, 7, 1, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 11, 6, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 12, 6, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 12, 5, 1, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 13, 5, 1, box); + fillWithMetadataBlocks(world, box, 14, 4, 1, 14, 4, 10, Blocks.spruce_stairs, stairE); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 13, 5, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 12, 5, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 12, 6, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 11, 6, 10, box); + fillWithMetadataBlocks(world, box, 10, 7, 10, 11, 7, 10, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 10, 6, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 9, 6, 10, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 9, 5, 10, box); + fillWithMetadataBlocks(world, box, 9, 4, 11, 9, 4, 14, Blocks.spruce_stairs, stairE); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 8, 5, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 7, 5, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 7, 6, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 6, 6, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE, 6, 7, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 5, 7, 14, box); + fillWithMetadataBlocks(world, box, 4, 8, 14, 5, 8, 14, Blocks.wooden_slab, 1); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 4, 7, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 3, 7, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 3, 6, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 2, 6, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 2, 5, 14, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 1, 5, 14, box); + fillWithMetadataBlocks(world, box, 0, 4, 3, 0, 4, 14, Blocks.spruce_stairs, stairW); + //Beams + for(int z = 6; z <= 11; z += 5) { + for(int i = 0; i < 3; i++) { + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairE | 4, 2 + i, 5 + i, z, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 7 - i, 5 + i, z, box); + } + } + + //Main (LEFT) + BrokenStairs roofStairs = new BrokenStairs(); + BrokenBlocks roofBlocks = new BrokenBlocks(); + + roofStairs.setMetadata(stairW); + fillWithBlocks(world, box, 4, 5, 1, 7, 5, 1, Blocks.wooden_slab); + fillWithRandomizedBlocks(world, box, 4, 5, 2, 7, 5, 3, rand, roofBlocks); //TODO separate into stair/slab/block block selectors + fillWithRandomizedBlocks(world, box, 8, 5, 2, 8, 5, 10, rand, roofBlocks); + fillWithRandomizedBlocks(world, box, 9, 6, 2, 9, 6, 9, rand, roofStairs); + randomlyFillWithBlocks(world, box, rand, 0.8F, 10, 7, 2, 11, 7, 9, Blocks.wooden_slab); + roofStairs.setMetadata(stairE); + fillWithRandomizedBlocks(world, box, 12, 6, 2, 12, 6, 9, rand, roofStairs); //i should redo like most of this shit + fillWithRandomizedBlocks(world, box, 13, 5, 2, 13, 5, 9, rand, roofStairs); + //Main (RIGHT) + fillWithRandomizedBlocks(world, box, 8, 5, 11, 8, 5, 13, rand, roofStairs); + fillWithRandomizedBlocks(world, box, 7, 6, 4, 7, 6, 13, rand, roofStairs); + fillWithRandomizedBlocks(world, box, 6, 7, 4, 6, 7, 7, rand, roofStairs); + fillWithRandomizedBlocks(world, box, 6, 7, 11, 6, 7, 13, rand, roofStairs); + roofStairs.setMetadata(stairW); + fillWithBlocks(world, box, 4, 8, 4, 5, 8, 5, Blocks.wooden_slab); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 5, 8, 6, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 0, 4, 8, 11, box); + fillWithBlocks(world, box, 4, 8, 12, 5, 8, 13, Blocks.wooden_slab); + fillWithRandomizedBlocks(world, box, 3, 7, 4, 3, 7, 6, rand, roofStairs); + fillWithRandomizedBlocks(world, box, 3, 7, 10, 3, 7, 13, rand, roofStairs); + fillWithRandomizedBlocks(world, box, 2, 6, 4, 2, 6, 13, rand, roofStairs); + fillWithRandomizedBlocks(world, box, 1, 5, 4, 1, 5, 13, rand, roofStairs); + + //Deco + //Webs + randomlyFillWithBlocks(world, box, rand, 0.05F, 12, 3, 3, 12, 3, 8, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.05F, 10, 4, 3, 11, 4, 8, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.05F, 5, 3, 2, 9, 3, 8, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.05F, 2, 3, 5, 4, 3, 8, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.05F, 2, 3, 10, 7, 3, 12, Blocks.web); + //Doors + placeDoor(world, box, Blocks.wooden_door, 1, false, false, 11, 1, 2); + placeDoor(world, box, Blocks.wooden_door, 1, false, rand.nextBoolean(), 3, 1, 9); + placeDoor(world, box, Blocks.wooden_door, 2, false, rand.nextBoolean(), 8, 1, 11); + //Windows + randomlyFillWithBlocks(world, box, rand, 0.5F, 6, 2, 1, 7, 3, 1, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 13, 2, 5, 13, 2, 6, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 10, 2, 9, 11, 3, 9, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 4, 2, 13, 5, 3, 13, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 1, 2, 11, 1, 2, 11, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 1, 2, 6, 1, 2, 7, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 4, 6, 4, 5, 6, 4, Blocks.glass_pane); + randomlyFillWithBlocks(world, box, rand, 0.5F, 4, 6, 13, 5, 6, 13, Blocks.glass_pane); + //Attic Access + placeBlockAtCurrentPosition(world, Blocks.trapdoor, getDecoModelMeta(4) >> 2, 6, 4, 10, box); + fillWithMetadataBlocks(world, box, 6, 2, 10, 6, 3, 10, Blocks.ladder, getDecoMeta(3)); + //Furniture + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairS, 12, 1, 5, box); //Couch + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW, 12, 1, 6, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN, 12, 1, 7, box); + fillWithMetadataBlocks(world, box, 7, 1, 5, 8, 1, 5, Blocks.oak_stairs, stairS | 4); //Table + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 8, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 8, 7, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, 8, 1, 2, box); //Kitchen Counter + placeBlockAtCurrentPosition(world, Blocks.cauldron, 1, 7, 1, 2, box); + fillWithBlocks(world, box, 5, 1, 2, 6, 1, 2, Blocks.stone_slab); + placeBlockAtCurrentPosition(world, Blocks.furnace, 5, 5, 1, 3, box); + placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, 5, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE, 9, 1, 8, box); //Bookshelf + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 9, 2, 8, box); + fillWithBlocks(world, box, 7, 1, 8, 8, 2, 8, Blocks.bookshelf); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW, 6, 1, 8, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 6, 2, 8, box); + fillWithMetadataBlocks(world, box, 6, 3, 8, 9, 3, 8, Blocks.wooden_slab, 1); + fillWithMetadataBlocks(world, box, 4, 1, 6, 4, 2, 6, Blocks.oak_stairs, stairN | 4); //Shelves + fillWithMetadataBlocks(world, box, 4, 1, 5, 4, 2, 5, Blocks.oak_stairs, stairE | 4); + fillWithBlocks(world, box, 2, 1, 5, 3, 1, 5, Blocks.bookshelf); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(2), 2, 2, 5, box); + + placeBlockAtCurrentPosition(world, Blocks.bed, 0, 2, 1, 11, box); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairN | 4, 3, 1, 12, box); //Nightstand + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 5, 1, 12, box); //Desk + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN | 4, 6, 1, 12, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 7, 1, 12, box); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairS, 6, 1, 11, box); //Chair + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, 0, 6, 2, 12, box); + + placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 7, 5, 12, box); + placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 5, 5, 12, box); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairN | 4, 3, 5, 10, box); //Desk + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairE | 4, 3, 5, 9, box); + placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 4, 5, 9, box); //Chair + fillWithBlocks(world, box, 3, 5, 6, 3, 5, 7, Blocks.bookshelf); + placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 6, 5, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.machine_diesel, getDecoMeta(4), 7, 5, 8, box); + + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 8, 2, 4, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 3, 2, 12, box); + //Loot + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 4, 1, 12, HbmChestContents.officeTrash, 4); + generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(5), 2, 5, 5, HbmChestContents.lockersVault, 8); + placeRandomBobble(world, box, rand, 3, 6, 10); + //Loot blocks + + placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 3, 2, 5, box); + LootGenerator.lootBookLore(world, getXWithOffset(3, 5), getYWithOffset(2), getZWithOffset(3, 5), HbmChestContents.generateLabBook(rand)); //TODO write more lore + placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 3, 6, 9, box); + LootGenerator.lootMakeshiftGun(world, getXWithOffset(3, 9), getYWithOffset(6), getZWithOffset(3, 9)); + + return true; + } + + //i don't like this class + public static class BrokenStairs extends BlockSelector { + //man. + public void setMetadata(int meta) { + this.selectedBlockMetaData = meta; + } + //mannnnnnnn. + @Override + public int getSelectedBlockMetaData() { + return this.field_151562_a instanceof BlockStairs ? this.selectedBlockMetaData : 0; + } + + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { + float chance = rand.nextFloat(); + + if(chance < 0.7) + this.field_151562_a = Blocks.oak_stairs; + else if(chance < 0.97) + this.field_151562_a = Blocks.wooden_slab; + else + this.field_151562_a = Blocks.air; + } + } + + //this fucking sucks. i am racist against the blockselector class + public static class BrokenBlocks extends BlockSelector { + + @Override + public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) { + float chance = rand.nextFloat(); + + if(chance < 0.6) { + this.field_151562_a = Blocks.planks; + this.selectedBlockMetaData = 0; + } else if(chance < 0.8) { + this.field_151562_a = Blocks.oak_stairs; + this.selectedBlockMetaData = rand.nextInt(4); + } else { + this.field_151562_a = Blocks.wooden_slab; + this.selectedBlockMetaData = 0; + } + } + } + } } diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index f1263b23a..505ff6b83 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -6,13 +6,11 @@ import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.blocks.generic.BlockBobble.BobbleType; import com.hbm.blocks.generic.BlockBobble.TileEntityBobble; -import com.hbm.blocks.generic.BlockLoot.TileEntityLoot; import com.hbm.config.StructureConfig; import com.hbm.handler.MultiblockHandlerXR; import com.hbm.tileentity.machine.TileEntityLockableBase; import net.minecraft.block.Block; -import net.minecraft.block.BlockWeb; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -197,7 +195,7 @@ abstract public class Component extends StructureComponent { metadata = metadata ^ 3; break; } - + //genuinely like. why did i do that return metadata << 2; //To accommodate for BlockDecoModel's shift in the rotation bits; otherwise, simply bit-shift right and or any non-rotation meta after } From 8d0faf719239b5a2e5accf57fb3e22a02ef7667d Mon Sep 17 00:00:00 2001 From: Vaern Date: Fri, 9 Feb 2024 23:40:51 -0800 Subject: [PATCH 15/18] fixes --- .../hbm/world/gen/component/CivilianFeatures.java | 13 +++++++------ .../java/com/hbm/world/gen/component/Component.java | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) 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 3495e6291..1417f35ff 100644 --- a/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java @@ -1023,7 +1023,8 @@ public class CivilianFeatures { //Webs randomlyFillWithBlocks(world, box, rand, 0.05F, 12, 3, 3, 12, 3, 8, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.05F, 10, 4, 3, 11, 4, 8, Blocks.web); - randomlyFillWithBlocks(world, box, rand, 0.05F, 5, 3, 2, 9, 3, 8, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.05F, 5, 3, 2, 8, 3, 2, Blocks.web); + randomlyFillWithBlocks(world, box, rand, 0.05F, 5, 3, 3, 9, 3, 8, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.05F, 2, 3, 5, 4, 3, 8, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.05F, 2, 3, 10, 7, 3, 12, Blocks.web); //Doors @@ -1049,11 +1050,11 @@ public class CivilianFeatures { fillWithMetadataBlocks(world, box, 7, 1, 5, 8, 1, 5, Blocks.oak_stairs, stairS | 4); //Table placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 8, 1, 4, box); placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 8, 7, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, 8, 1, 2, box); //Kitchen Counter + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 8, 1, 2, box); //Kitchen Counter placeBlockAtCurrentPosition(world, Blocks.cauldron, 1, 7, 1, 2, box); - fillWithBlocks(world, box, 5, 1, 2, 6, 1, 2, Blocks.stone_slab); + fillWithBlocks(world, box, 5, 1, 2, 6, 1, 2, Blocks.double_stone_slab); placeBlockAtCurrentPosition(world, Blocks.furnace, 5, 5, 1, 3, box); - placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, 5, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 1, 4, box); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE, 9, 1, 8, box); //Bookshelf placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 9, 2, 8, box); fillWithBlocks(world, box, 7, 1, 8, 8, 2, 8, Blocks.bookshelf); @@ -1065,13 +1066,13 @@ public class CivilianFeatures { fillWithBlocks(world, box, 2, 1, 5, 3, 1, 5, Blocks.bookshelf); placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(2), 2, 2, 5, box); - placeBlockAtCurrentPosition(world, Blocks.bed, 0, 2, 1, 11, box); + placeBed(world, box, 0, 2, 1, 11); placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairN | 4, 3, 1, 12, box); //Nightstand placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 5, 1, 12, box); //Desk placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN | 4, 6, 1, 12, box); placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 7, 1, 12, box); placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairS, 6, 1, 11, box); //Chair - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, 0, 6, 2, 12, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 6, 2, 12, box); placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 7, 5, 12, box); placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 5, 5, 12, box); diff --git a/src/main/java/com/hbm/world/gen/component/Component.java b/src/main/java/com/hbm/world/gen/component/Component.java index 505ff6b83..8607d2323 100644 --- a/src/main/java/com/hbm/world/gen/component/Component.java +++ b/src/main/java/com/hbm/world/gen/component/Component.java @@ -38,7 +38,7 @@ abstract public class Component extends StructureComponent { protected Component(Random rand, int minX, int minY, int minZ, int maxX, int maxY, int maxZ ) { super(0); - this.coordBaseMode = 0;//rand.nextInt(4); + this.coordBaseMode = rand.nextInt(4); switch(this.coordBaseMode) { case 0: From b39eb2a52b17cd041af683bdba426730995ee9fe Mon Sep 17 00:00:00 2001 From: Vaern Date: Sat, 10 Feb 2024 17:52:40 -0800 Subject: [PATCH 16/18] reworksing furniture --- src/main/java/com/hbm/util/LootGenerator.java | 8 +- .../world/gen/component/CivilianFeatures.java | 121 ++++++++++-------- 2 files changed, 71 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/hbm/util/LootGenerator.java b/src/main/java/com/hbm/util/LootGenerator.java index 0c7e5c7af..aaf90910e 100644 --- a/src/main/java/com/hbm/util/LootGenerator.java +++ b/src/main/java/com/hbm/util/LootGenerator.java @@ -101,9 +101,11 @@ public class LootGenerator { if(loot != null && loot.items.isEmpty()) { - addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.gun_lever_action), 0.125, 0.025, 0.25); + boolean r = world.rand.nextBoolean(); + if(r) + addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.gun_lever_action), 0.125, 0.025, 0.25); - if(world.rand.nextBoolean()) + if(!r || world.rand.nextBoolean()) addItemWithDeviation(loot, world.rand, new ItemStack(ModItems.wrench), -0.25, 0, -0.28125); int count = world.rand.nextInt(2) + 1; @@ -189,7 +191,7 @@ public class LootGenerator { int count = world.rand.nextInt(3) + 2; for(int k = 0; k < count; k++) - addItemWithDeviation(loot, world.rand, new ItemStack(Items.book), -0.25, k * 0.03125, 0.1875); + addItemWithDeviation(loot, world.rand, new ItemStack(Items.book), -0.25, k * 0.03125, 0.25); count = world.rand.nextInt(2) + 1; for(int k = 0; k < count; k++) 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 1417f35ff..db31dd3cc 100644 --- a/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java +++ b/src/main/java/com/hbm/world/gen/component/CivilianFeatures.java @@ -753,8 +753,8 @@ public class CivilianFeatures { fillWithBlocks(world, box, 9, 0, 2, 10, 0, 2, ModBlocks.concrete_colored_ext); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 12, 0, 2, box); fillWithBlocks(world, box, 13, 0, 2, 13, 0, 9, ModBlocks.concrete_colored_ext); - fillWithBlocks(world, box, 4, 0, 9, 12, 0, 9, ModBlocks.concrete_colored_ext); - placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 2, 0, 9, box); + fillWithBlocks(world, box, 5, 0, 9, 12, 0, 9, ModBlocks.concrete_colored_ext); + fillWithBlocks(world, box, 2, 0, 9, 3, 0, 9, ModBlocks.concrete_colored_ext); placeBlockAtCurrentPosition(world, ModBlocks.concrete_colored_ext, 0, 8, 0, 10, box); fillWithBlocks(world, box, 8, 0, 12, 8, 0, 13, ModBlocks.concrete_colored_ext); fillWithBlocks(world, box, 1, 0, 13, 7, 0, 13, ModBlocks.concrete_colored_ext); @@ -826,8 +826,8 @@ public class CivilianFeatures { placeBlockAtCurrentPosition(world, Blocks.brick_block, 0, 1, 2, 9, box); fillWithBlocks(world, box, 1, 3, 5, 1, 3, 12, Blocks.brick_block); //Inside - fillWithBlocks(world, box, 2, 1, 9, 2, 3, 9, Blocks.brick_block); - fillWithBlocks(world, box, 4, 1, 9, 7, 3, 9, Blocks.brick_block); + fillWithBlocks(world, box, 2, 1, 9, 3, 3, 9, Blocks.brick_block); + fillWithBlocks(world, box, 5, 1, 9, 7, 3, 9, Blocks.brick_block); //Wood Paneling fillWithMetadataBlocks(world, box, 5, 2, 1, 5, 3, 1, Blocks.planks, 1); fillWithMetadataBlocks(world, box, 8, 2, 1, 8, 3, 1, Blocks.planks, 1); @@ -843,7 +843,7 @@ public class CivilianFeatures { placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 10, box); placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 8, box); placeBlockAtCurrentPosition(world, Blocks.planks, 1, 1, 2, 5, box); - placeBlockAtCurrentPosition(world, Blocks.planks, 1, 3, 3, 9, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 4, 3, 9, box); //Wood Framing //North/Front int logW = this.getPillarMeta(4); @@ -906,7 +906,7 @@ public class CivilianFeatures { fillWithMetadataBlocks(world, box, 9, 0, 3, 12, 0, 8, Blocks.planks, 1); fillWithMetadataBlocks(world, box, 5, 0, 2, 8, 0, 8, Blocks.planks, 1); fillWithMetadataBlocks(world, box, 2, 0, 5, 4, 0, 8, Blocks.planks, 1); - placeBlockAtCurrentPosition(world, Blocks.planks, 1, 3, 0, 9, box); + placeBlockAtCurrentPosition(world, Blocks.planks, 1, 4, 0, 9, box); fillWithMetadataBlocks(world, box, 2, 0, 10, 7, 0, 12, Blocks.planks, 1); placeBlockAtCurrentPosition(world, Blocks.planks, 1, 8, 0, 11, box); fillWithBlocks(world, box, 13, 1, 0, 14, 1, 0, Blocks.fence); @@ -1020,6 +1020,9 @@ public class CivilianFeatures { fillWithRandomizedBlocks(world, box, 1, 5, 4, 1, 5, 13, rand, roofStairs); //Deco + int metaN = getDecoMeta(3); + int metaE = getDecoMeta(4); + //Webs randomlyFillWithBlocks(world, box, rand, 0.05F, 12, 3, 3, 12, 3, 8, Blocks.web); randomlyFillWithBlocks(world, box, rand, 0.05F, 10, 4, 3, 11, 4, 8, Blocks.web); @@ -1029,7 +1032,7 @@ public class CivilianFeatures { randomlyFillWithBlocks(world, box, rand, 0.05F, 2, 3, 10, 7, 3, 12, Blocks.web); //Doors placeDoor(world, box, Blocks.wooden_door, 1, false, false, 11, 1, 2); - placeDoor(world, box, Blocks.wooden_door, 1, false, rand.nextBoolean(), 3, 1, 9); + placeDoor(world, box, Blocks.wooden_door, 1, false, rand.nextBoolean(), 4, 1, 9); placeDoor(world, box, Blocks.wooden_door, 2, false, rand.nextBoolean(), 8, 1, 11); //Windows randomlyFillWithBlocks(world, box, rand, 0.5F, 6, 2, 1, 7, 3, 1, Blocks.glass_pane); @@ -1042,59 +1045,67 @@ public class CivilianFeatures { randomlyFillWithBlocks(world, box, rand, 0.5F, 4, 6, 13, 5, 6, 13, Blocks.glass_pane); //Attic Access placeBlockAtCurrentPosition(world, Blocks.trapdoor, getDecoModelMeta(4) >> 2, 6, 4, 10, box); - fillWithMetadataBlocks(world, box, 6, 2, 10, 6, 3, 10, Blocks.ladder, getDecoMeta(3)); + fillWithMetadataBlocks(world, box, 6, 2, 10, 6, 3, 10, Blocks.ladder, metaN); //Furniture - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairS, 12, 1, 5, box); //Couch - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW, 12, 1, 6, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN, 12, 1, 7, box); - fillWithMetadataBlocks(world, box, 7, 1, 5, 8, 1, 5, Blocks.oak_stairs, stairS | 4); //Table - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 8, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 8, 7, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 8, 1, 2, box); //Kitchen Counter - placeBlockAtCurrentPosition(world, Blocks.cauldron, 1, 7, 1, 2, box); - fillWithBlocks(world, box, 5, 1, 2, 6, 1, 2, Blocks.double_stone_slab); - placeBlockAtCurrentPosition(world, Blocks.furnace, 5, 5, 1, 3, box); - placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 1, 4, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE, 9, 1, 8, box); //Bookshelf + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN | 4, 12, 1, 5, box); //tables + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 8, 12, 1, 6, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairS | 4, 12, 1, 7, box); + fillWithMetadataBlocks(world, box, 9, 1, 4, 9, 1, 5, Blocks.dark_oak_stairs, stairE | 4); + fillWithMetadataBlocks(world, box, 8, 1, 4, 8, 1, 5, Blocks.wooden_slab, 13); + fillWithMetadataBlocks(world, box, 7, 1, 4, 7, 1, 5, Blocks.dark_oak_stairs, stairW | 4); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairS | 4, 8, 1, 2, box); //couch + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairW, 7, 1, 2, box); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairS, 6, 1, 2, box); + fillWithMetadataBlocks(world, box, 5, 1, 2, 5, 1, 3, Blocks.dark_oak_stairs, stairE); + placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairN, 5, 1, 4, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW, 10, 1, 5, box); //chairs + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN, 8, 1, 6, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE, 9, 1, 8, box); //bookshelf placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 9, 2, 8, box); - fillWithBlocks(world, box, 7, 1, 8, 8, 2, 8, Blocks.bookshelf); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW, 6, 1, 8, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 6, 2, 8, box); - fillWithMetadataBlocks(world, box, 6, 3, 8, 9, 3, 8, Blocks.wooden_slab, 1); - fillWithMetadataBlocks(world, box, 4, 1, 6, 4, 2, 6, Blocks.oak_stairs, stairN | 4); //Shelves - fillWithMetadataBlocks(world, box, 4, 1, 5, 4, 2, 5, Blocks.oak_stairs, stairE | 4); - fillWithBlocks(world, box, 2, 1, 5, 3, 1, 5, Blocks.bookshelf); - placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(2), 2, 2, 5, box); + fillWithBlocks(world, box, 8, 1, 8, 8, 2, 8, Blocks.bookshelf); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW, 7, 1, 8, box); + 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); + 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); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 4, 3, 5, box); + placeBlockAtCurrentPosition(world, Blocks.redstone_lamp, 0, 3, 3, 5, box); + placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 2, 3, 5, box); + placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, metaN, 3, 3, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(2), 8, 2, 2, box); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 7, 2, 4, box); - placeBed(world, box, 0, 2, 1, 11); - placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairN | 4, 3, 1, 12, box); //Nightstand - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 5, 1, 12, box); //Desk - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairN | 4, 6, 1, 12, box); - placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 7, 1, 12, box); - placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairS, 6, 1, 11, box); //Chair - placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 6, 2, 12, box); + fillWithBlocks(world, box, 2, 1, 12, 3, 1, 12, Blocks.bookshelf); //bookshelf/desk + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 4, 1, 12, box); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 8, 5, 1, 12, box); + placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairW | 4, 6, 1, 12, box); + fillWithBlocks(world, box, 7, 1, 12, 7, 2, 12, Blocks.bookshelf); + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 5, 5, 1, 11, box); //seat + placeBed(world, box, 1, 3, 1, 10); + placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 4, 2, 12, box); + placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 5, 2, 12, box); - placeBlockAtCurrentPosition(world, ModBlocks.crate, 0, 7, 5, 12, box); - placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 5, 5, 12, box); - placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairN | 4, 3, 5, 10, box); //Desk - placeBlockAtCurrentPosition(world, Blocks.dark_oak_stairs, stairE | 4, 3, 5, 9, box); - placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 4, 5, 9, box); //Chair - fillWithBlocks(world, box, 3, 5, 6, 3, 5, 7, Blocks.bookshelf); - placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 6, 5, 5, box); - placeBlockAtCurrentPosition(world, ModBlocks.machine_diesel, getDecoMeta(4), 7, 5, 8, box); + fillWithMetadataBlocks(world, box, 4, 5, 5, 5, 5, 5, Blocks.dark_oak_stairs, stairS | 4); //seat and desk + placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 4, 5, 6, box); + placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 7, 5, 7, box); //conserve crates + placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 2, 5, 9, box); + placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 3, 5, 11, box); + if(rand.nextBoolean()) + placeBlockAtCurrentPosition(world, ModBlocks.machine_diesel, metaE, 7, 5, 9, box); + placeBlockAtCurrentPosition(world, rand.nextBoolean() ? ModBlocks.crate_weapon : ModBlocks.crate, 0, 6, 5, 12, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 8, 2, 4, box); - placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 3, 2, 12, box); - //Loot - generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 4, 1, 12, HbmChestContents.officeTrash, 4); - generateInvContents(world, box, rand, Blocks.chest, getDecoMeta(5), 2, 5, 5, HbmChestContents.lockersVault, 8); - placeRandomBobble(world, box, rand, 3, 6, 10); - //Loot blocks - - placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 3, 2, 5, box); - LootGenerator.lootBookLore(world, getXWithOffset(3, 5), getYWithOffset(2), getZWithOffset(3, 5), HbmChestContents.generateLabBook(rand)); //TODO write more lore - placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 3, 6, 9, box); - LootGenerator.lootMakeshiftGun(world, getXWithOffset(3, 9), getYWithOffset(6), getZWithOffset(3, 9)); + //inventories + generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(2), 7, 1, 10, HbmChestContents.officeTrash, 4); + generateInvContents(world, box, rand, Blocks.chest, metaE, 7, 5, 5, HbmChestContents.modGeneric, 8); + //loot + placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 3, 2, 12, box); + LootGenerator.lootBookLore(world, getXWithOffset(3, 12), getYWithOffset(2), getZWithOffset(3, 12), HbmChestContents.generateLabBook(rand)); //TODO write more lore + placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 5, 6, 5, box); + LootGenerator.lootMakeshiftGun(world, getXWithOffset(5, 5), getYWithOffset(6), getZWithOffset(5, 5)); + placeRandomBobble(world, box, rand, 5, 5, 12); return true; } From 7f689bfc3757b8947315beb09fbf7b9844e186e6 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sun, 11 Feb 2024 13:06:05 -0800 Subject: [PATCH 17/18] minor changes, mapgen --- .../java/com/hbm/items/tool/ItemWandD.java | 31 +--------------- .../com/hbm/world/gen/MapGenNTMFeatures.java | 37 +++++++++++-------- .../world/gen/component/CivilianFeatures.java | 29 +++++++++------ .../world/gen/component/OfficeFeatures.java | 8 ++-- .../hbm/world/gen/component/RuinFeatures.java | 16 ++++---- 5 files changed, 53 insertions(+), 68 deletions(-) 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 From 81de0478256bf3f614dae2b1cbca05bfe58c5024 Mon Sep 17 00:00:00 2001 From: Vaern Date: Sun, 11 Feb 2024 13:11:34 -0800 Subject: [PATCH 18/18] fixes --- src/main/java/com/hbm/inventory/gui/GUIBookLore.java | 4 ++-- src/main/java/com/hbm/items/tool/ItemWandD.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/hbm/inventory/gui/GUIBookLore.java b/src/main/java/com/hbm/inventory/gui/GUIBookLore.java index 4ac298bd0..dc628427a 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIBookLore.java +++ b/src/main/java/com/hbm/inventory/gui/GUIBookLore.java @@ -102,13 +102,13 @@ public class GUIBookLore extends GuiScreen { if(argTag.hasNoTags()) text = I18nUtil.resolveKey(k + defacto); - else { //TODO consider caching the text per page + else { List args = new ArrayList(); int index = 1; String arg = argTag.getString("a1"); while(!arg.isEmpty()) { - args.add(I18nUtil.resolveKey(arg)); //TODO check if this works fine + args.add(arg); index++; arg = argTag.getString("a" + index); } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index f3bd325b1..b3fff506b 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -2,11 +2,13 @@ package com.hbm.items.tool; import java.util.List; +import com.hbm.entity.effect.EntityNukeTorex; import com.hbm.lib.Library; 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; @@ -68,7 +70,7 @@ public class ItemWandD extends Item { tom.destructionRange = 600; world.spawnEntityInWorld(tom);*/ - /*List del = world.getEntitiesWithinAABB(EntityNukeTorex.class, AxisAlignedBB.getBoundingBox(pos.blockX, pos.blockY + 1, pos.blockZ, pos.blockX, pos.blockY + 1, pos.blockZ).expand(50, 50, 50)); + List del = world.getEntitiesWithinAABB(EntityNukeTorex.class, AxisAlignedBB.getBoundingBox(pos.blockX, pos.blockY + 1, pos.blockZ, pos.blockX, pos.blockY + 1, pos.blockZ).expand(50, 50, 50)); if(!del.isEmpty()) { for(EntityNukeTorex torex : del) torex.setDead(); @@ -80,7 +82,6 @@ public class ItemWandD extends Item { IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c"); EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId()); entry.blocksDistanceThreshold = 1000;*/ - //TrackerUtil.setTrackingRange(world, torex, 1000); //world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, 150, pos.blockX, pos.blockY + 1, pos.blockZ)); //DungeonToolbox.generateBedrockOreWithChance(world, world.rand, pos.blockX, pos.blockZ, EnumBedrockOre.TITANIUM, new FluidStack(Fluids.SULFURIC_ACID, 500), 2, 1);