diff --git a/src/main/java/com/hbm/blocks/generic/BlockWandJigsaw.java b/src/main/java/com/hbm/blocks/generic/BlockWandJigsaw.java index 365c42e56..55cd7aff9 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockWandJigsaw.java +++ b/src/main/java/com/hbm/blocks/generic/BlockWandJigsaw.java @@ -36,6 +36,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.inventory.Container; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -133,6 +134,19 @@ public class BlockWandJigsaw extends BlockContainer implements IBlockSideRotatio if(!(te instanceof TileEntityWandJigsaw)) return false; TileEntityWandJigsaw jigsaw = (TileEntityWandJigsaw) te; + + if(player.getHeldItem() != null && player.getHeldItem().getItem() == Items.paper) { + TileEntityWandJigsaw.copyMode = true; + if(!player.getHeldItem().hasTagCompound()) { + player.getHeldItem().stackTagCompound = new NBTTagCompound(); + jigsaw.writeToNBT(player.getHeldItem().stackTagCompound); + } else { + jigsaw.readFromNBT(player.getHeldItem().stackTagCompound); + jigsaw.markDirty(); + } + TileEntityWandJigsaw.copyMode = false; + return true; + } if(!player.isSneaking()) { Block block = getBlock(world, player.getHeldItem()); @@ -203,6 +217,7 @@ public class BlockWandJigsaw extends BlockContainer implements IBlockSideRotatio private Block replaceBlock = Blocks.air; private int replaceMeta = 0; private boolean isRollable = true; // sets joint type, rollable joints can be placed in any orientation for vertical jigsaw connections + public static boolean copyMode = false; @Override public void updateEntity() { @@ -237,8 +252,10 @@ public class BlockWandJigsaw extends BlockContainer implements IBlockSideRotatio @Override public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - nbt.setInteger("direction", this.getBlockMetadata()); + if(!copyMode) { + super.writeToNBT(nbt); + nbt.setInteger("direction", this.getBlockMetadata()); + } nbt.setInteger("selection", selectionPriority); nbt.setInteger("placement", placementPriority); @@ -252,7 +269,9 @@ public class BlockWandJigsaw extends BlockContainer implements IBlockSideRotatio @Override public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); + if(!copyMode) { + super.readFromNBT(nbt); + } selectionPriority = nbt.getInteger("selection"); placementPriority = nbt.getInteger("placement"); diff --git a/src/main/java/com/hbm/itempool/ItemPoolsComponent.java b/src/main/java/com/hbm/itempool/ItemPoolsComponent.java index 7bbeea0e0..1ffe8c61b 100644 --- a/src/main/java/com/hbm/itempool/ItemPoolsComponent.java +++ b/src/main/java/com/hbm/itempool/ItemPoolsComponent.java @@ -28,6 +28,8 @@ public class ItemPoolsComponent { public static final String POOL_OIL_RIG = "POOL_OIL_RIG"; public static final String POOL_RTG = "POOL_RTG"; public static final String POOL_REPAIR_MATERIALS = "POOL_REPAIR_MATERIALS"; + public static final String POOL_TRENCH_ROOM = "POOL_TRENCH_ROOM"; + public static final String POOL_TRENCH_BUNKER = "POOL_TRENCH_BUNKER"; public static void init() { @@ -213,14 +215,14 @@ public class ItemPoolsComponent { weighted(ModItems.circuit, EnumCircuitType.CAPACITOR.ordinal(), 1, 1, 3), }; }}; - + new ItemPool(POOL_RTG) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.pellet_rtg_depleted, ItemRTGPelletDepleted.DepletedRTGMaterial.LEAD.ordinal(), 1, 1, 40), weighted(ModItems.pellet_rtg_weak,0, 0, 1, 1), }; }}; - + new ItemPool(POOL_REPAIR_MATERIALS) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.ingot_aluminium, 0, 2, 8, 3), @@ -239,5 +241,17 @@ public class ItemPoolsComponent { weighted(ModItems.circuit, EnumCircuitType.CAPACITOR.ordinal(), 1, 1, 3), }; }}; + + new ItemPool(POOL_TRENCH_ROOM) {{ + this.pool = new WeightedRandomChestContent[] { + weighted(ModItems.ingot_aluminium, 0, 2, 8, 3), + }; + }}; + + new ItemPool(POOL_TRENCH_BUNKER) {{ + this.pool = new WeightedRandomChestContent[] { + weighted(ModItems.ingot_aluminium, 0, 2, 8, 3), + }; + }}; } } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index f6f0d2792..5c766fa45 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -1,5 +1,6 @@ package com.hbm.items.tool; +import java.util.HashMap; import java.util.List; import java.util.Random; @@ -11,12 +12,20 @@ import com.hbm.lib.Library; import com.hbm.main.MainRegistry; import com.hbm.main.StructureManager; import com.hbm.tileentity.machine.storage.TileEntitySafe; +import com.hbm.world.biome.BiomeGenNoMansLand; +import com.hbm.world.gen.NBTStructure; +import com.hbm.world.gen.NTMWorldGenerator; +import com.hbm.world.gen.NBTStructure.JigsawPiece; +import com.hbm.world.gen.NBTStructure.JigsawPool; +import com.hbm.world.gen.NBTStructure.SpawnCondition; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -32,7 +41,9 @@ public class ItemWandD extends Item { int y = world.getHeightValue(pos.blockX, pos.blockZ); - StructureManager.spire.build(world, pos.blockX, y, pos.blockZ); + NTMWorldGenerator.TRENCH.canSpawn = biome -> { return true; }; + NBTStructure.Start start = new NBTStructure.Start(world, world.rand, NTMWorldGenerator.TRENCH, pos.blockX >> 4, pos.blockZ >> 4); + start.generateStructure(world, world.rand, new StructureBoundingBox(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE)); /*ExplosionVNT vnt = new ExplosionVNT(world, pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 7); vnt.setBlockAllocator(new BlockAllocatorBulkie(60)); diff --git a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java index ff3bb0829..a61182139 100644 --- a/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java +++ b/src/main/java/com/hbm/items/weapon/ItemAmmoArty.java @@ -245,9 +245,9 @@ public class ItemAmmoArty extends Item { private void init() { /* STANDARD SHELLS */ - this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); ExplosionCreator.composeEffect(shell.worldObj, mop.blockX + 0.5, mop.blockY + 0.5, mop.blockZ + 0.5, 10, 2F, 0.5F, 25F, 5, 0, 20, 0.75F, 1F, -2F, 150); }}; - this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); ExplosionCreator.composeEffect(shell.worldObj, mop.blockX + 0.5, mop.blockY + 0.5, mop.blockZ + 0.5, 15, 5F, 1F, 45F, 10, 0, 50, 1F, 3F, -2F, 200); }}; - this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); ExplosionCreator.composeEffect(shell.worldObj, mop.blockX + 0.5, mop.blockY + 0.5, mop.blockZ + 0.5, 15, 5F, 1F, 45F, 10, 16, 50, 1F, 3F, -2F, 200); }}; + this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); ExplosionCreator.composeEffect(shell.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 10, 2F, 0.5F, 25F, 5, 0, 20, 0.75F, 1F, -2F, 150); }}; + this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); ExplosionCreator.composeEffect(shell.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 15, 5F, 1F, 45F, 10, 0, 50, 1F, 3F, -2F, 200); }}; + this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); ExplosionCreator.composeEffect(shell.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, 15, 5F, 1F, 45F, 10, 16, 50, 1F, 3F, -2F, 200); }}; /* MINI NUKE */ this.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) { diff --git a/src/main/java/com/hbm/main/StructureManager.java b/src/main/java/com/hbm/main/StructureManager.java index 3bb2f2387..dfff91870 100644 --- a/src/main/java/com/hbm/main/StructureManager.java +++ b/src/main/java/com/hbm/main/StructureManager.java @@ -65,10 +65,26 @@ public class StructureManager { public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt")); /// TRENCH /// - public static final NBTStructure trench = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench.nbt")); - public static final NBTStructure trench_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench_left.nbt")); - public static final NBTStructure trench_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench_right.nbt")); - public static final NBTStructure trench_junction = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/trench_junction.nbt")); + public static final NBTStructure trench_straight = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight.nbt")); + public static final NBTStructure trench_straight_dirt = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_dirt.nbt")); + public static final NBTStructure trench_straight_bridge = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_bridge.nbt")); + public static final NBTStructure trench_straight_stairs = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_stairs.nbt")); + public static final NBTStructure trench_straight_door_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_door_left.nbt")); + public static final NBTStructure trench_straight_door_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_door_right.nbt")); + public static final NBTStructure trench_t_outer = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/t_outer.nbt")); + public static final NBTStructure trench_t_inner = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/t_inner.nbt")); + public static final NBTStructure trench_s_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/s_left.nbt")); + public static final NBTStructure trench_s_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/s_right.nbt")); + public static final NBTStructure trench_end_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/end_left.nbt")); + public static final NBTStructure trench_end_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/end_right.nbt")); + public static final NBTStructure trench_cross = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/cross.nbt")); + public static final NBTStructure trench_curve_outer = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/curve_outer.nbt")); + public static final NBTStructure trench_curve_inner = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/curve_inner.nbt")); + public static final NBTStructure trench_bunker_small = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_small.nbt")); + public static final NBTStructure trench_bunker_large = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_large.nbt")); + public static final NBTStructure trench_bunker_fuel = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_fuel.nbt")); + public static final NBTStructure trench_bunker_collapsed = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_collapsed.nbt")); + public static final NBTStructure trench_bunker_folly = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_folly.nbt")); // public static final NBTStructure test_rot = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-rot.nbt")); // public static final NBTStructure test_jigsaw = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-jigsaw.nbt")); diff --git a/src/main/java/com/hbm/particle/helper/ExplosionCreator.java b/src/main/java/com/hbm/particle/helper/ExplosionCreator.java index dc59694ff..302422d7c 100644 --- a/src/main/java/com/hbm/particle/helper/ExplosionCreator.java +++ b/src/main/java/com/hbm/particle/helper/ExplosionCreator.java @@ -55,7 +55,7 @@ public class ExplosionCreator implements IParticleCreator { @Override @SideOnly(Side.CLIENT) public void makeParticle(World world, EntityPlayer player, TextureManager man, Random rand, double x, double y, double z, NBTTagCompound data) { - + int cloudCount = data.getByte("cloudCount"); float cloudScale = data.getFloat("cloudScale"); float cloudSpeedMult = data.getFloat("cloudSpeedMult"); diff --git a/src/main/java/com/hbm/world/biome/BiomeDecoratorNoMansLand.java b/src/main/java/com/hbm/world/biome/BiomeDecoratorNoMansLand.java index defdc37b2..6fff43ca8 100644 --- a/src/main/java/com/hbm/world/biome/BiomeDecoratorNoMansLand.java +++ b/src/main/java/com/hbm/world/biome/BiomeDecoratorNoMansLand.java @@ -8,9 +8,7 @@ import com.hbm.world.feature.WorldGenSurfaceSpot; import net.minecraft.init.Blocks; import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraft.world.gen.feature.WorldGenDeadBush; -import net.minecraft.world.gen.feature.WorldGenLiquids; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; @@ -88,7 +86,7 @@ public class BiomeDecoratorNoMansLand extends BiomeDecorator { if(this.randomGenerator.nextInt(10) == 0) trees++; /// TREES /// - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); for(int i = 0; doGen && i < trees; ++i) { x = this.chunk_X + this.randomGenerator.nextInt(16) + 8; z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; @@ -99,7 +97,7 @@ public class BiomeDecoratorNoMansLand extends BiomeDecorator { if(worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, x, y, z)) { worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, x, y, z); } - } + }*/ /// TALL GRASS /// doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); @@ -121,7 +119,7 @@ public class BiomeDecoratorNoMansLand extends BiomeDecorator { } /// LAKES /// - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); if(doGen && this.generateLakes) { for(int i = 0; i < 50; ++i) { x = this.chunk_X + this.randomGenerator.nextInt(16) + 8; @@ -129,7 +127,7 @@ public class BiomeDecoratorNoMansLand extends BiomeDecorator { z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, x, y, z); } - } + }*/ MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); } diff --git a/src/main/java/com/hbm/world/biome/BiomeGenNoMansLand.java b/src/main/java/com/hbm/world/biome/BiomeGenNoMansLand.java index 667d03ef8..7b9894085 100644 --- a/src/main/java/com/hbm/world/biome/BiomeGenNoMansLand.java +++ b/src/main/java/com/hbm/world/biome/BiomeGenNoMansLand.java @@ -36,7 +36,7 @@ public class BiomeGenNoMansLand extends BiomeGenBase { this.spawnableCreatureList.clear(); this.spawnableWaterCreatureList.clear(); this.spawnableCaveCreatureList.clear(); - this.setHeight(height_LowPlains); + this.setHeight(new BiomeGenBase.Height(0.125F, 0.0125F)); this.theBiomeDecorator.treesPerChunk = -999; this.theBiomeDecorator.flowersPerChunk = 0; this.theBiomeDecorator.grassPerChunk = 0; diff --git a/src/main/java/com/hbm/world/gen/NBTStructure.java b/src/main/java/com/hbm/world/gen/NBTStructure.java index 073a641d5..3e81e9864 100644 --- a/src/main/java/com/hbm/world/gen/NBTStructure.java +++ b/src/main/java/com/hbm/world/gen/NBTStructure.java @@ -684,6 +684,7 @@ public class NBTStructure { } protected JigsawPool getPool(String name) { + if(!pools.containsKey(name)) throw new IllegalStateException("Structure with start " + startPool + " trying to access invalid pool " + name); return pools.get(name).clone(); } diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index d1019b9e5..d560b01a1 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -8,6 +8,7 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.config.StructureConfig; +import com.hbm.lib.RefStrings; import com.hbm.main.StructureManager; import com.hbm.world.biome.BiomeGenNoMansLand; import com.hbm.world.gen.NBTStructure.JigsawPiece; @@ -22,6 +23,7 @@ import com.hbm.world.gen.component.Component.SupplyCrates; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.Block; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; @@ -34,6 +36,59 @@ import net.minecraftforge.event.world.WorldEvent; public class NTMWorldGenerator implements IWorldGenerator { boolean regTest = false; + + public static final NBTStructure trench_straight = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight.nbt")); + public static final NBTStructure trench_straight_dirt = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_dirt.nbt")); + public static final NBTStructure trench_straight_bridge = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_bridge.nbt")); + public static final NBTStructure trench_straight_stairs = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_stairs.nbt")); + public static final NBTStructure trench_straight_door_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/straight_door_left.nbt")); + public static final NBTStructure trench_t_outer = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/t_outer.nbt")); + public static final NBTStructure trench_t_inner = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/t_inner.nbt")); + public static final NBTStructure trench_s_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/s_left.nbt")); + public static final NBTStructure trench_s_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/s_right.nbt")); + public static final NBTStructure trench_end_left = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/end_left.nbt")); + public static final NBTStructure trench_end_right = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/end_right.nbt")); + public static final NBTStructure trench_cross = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/cross.nbt")); + public static final NBTStructure trench_curve_outer = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/curve_outer.nbt")); + public static final NBTStructure trench_curve_inner = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/curve_inner.nbt")); + public static final NBTStructure trench_bunker_small = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_small.nbt")); + public static final NBTStructure trench_bunker_large = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_large.nbt")); + public static final NBTStructure trench_bunker_fuel = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_fuel.nbt")); + public static final NBTStructure trench_bunker_collapsed = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_collapsed.nbt")); + public static final NBTStructure trench_bunker_folly = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/trench/bunker_folly.nbt")); + + public static SpawnCondition TRENCH = new SpawnCondition() {{ + canSpawn = biome -> biome == BiomeGenNoMansLand.noMansLand; + sizeLimit = 128; + startPool = "trench"; + spawnWeight = 200; + pools = new HashMap() {{ + put("trench", new JigsawPool() {{ + add(new JigsawPiece("trench_straight", StructureManager.trench_straight) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_straight_dirt", StructureManager.trench_straight_dirt) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_straight_bridge", StructureManager.trench_straight_bridge) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_straight_stairs", StructureManager.trench_straight_stairs) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_straight_door_left", StructureManager.trench_straight_door_left) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_straight_door_right", StructureManager.trench_straight_door_right) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_s_left", StructureManager.trench_s_left) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_s_right", StructureManager.trench_s_right) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_end_left", StructureManager.trench_end_left) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_end_right", StructureManager.trench_end_right) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_curve_outer", StructureManager.trench_curve_outer) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_curve_inner", StructureManager.trench_curve_inner) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_t_outer", StructureManager.trench_t_outer) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_t_inner", StructureManager.trench_t_inner) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + add(new JigsawPiece("trench_cross", StructureManager.trench_cross) {{ heightOffset = -4; conformToTerrain = true; }}, 100); + }}); + put("bunker", new JigsawPool() {{ + add(new JigsawPiece("trench_bunker_small", StructureManager.trench_bunker_small) {{ heightOffset = -6; }}, 100); + add(new JigsawPiece("trench_bunker_large", StructureManager.trench_bunker_large) {{ heightOffset = -6; }}, 100); + add(new JigsawPiece("trench_bunker_fuel", StructureManager.trench_bunker_fuel) {{ heightOffset = -3; }}, 100); + add(new JigsawPiece("trench_bunker_collapsed", StructureManager.trench_bunker_collapsed) {{ heightOffset = -3; }}, 100); + add(new JigsawPiece("trench_bunker_folly", StructureManager.trench_bunker_folly) {{ heightOffset = -3; }}, 100); + }}); + }}; + }}; public NTMWorldGenerator() { final List invalidBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean}); @@ -49,20 +104,7 @@ public class NTMWorldGenerator implements IWorldGenerator { }}); /// TRENCH /// - NBTStructure.registerStructure(0, new SpawnCondition() {{ - canSpawn = biome -> biome == BiomeGenNoMansLand.noMansLand; - sizeLimit = 128; - startPool = "trench"; - spawnWeight = 200; - pools = new HashMap() {{ - put("trench", new JigsawPool() {{ - add(new JigsawPiece("trench", StructureManager.trench) {{ heightOffset = -4; conformToTerrain = true; }}, 100); - add(new JigsawPiece("trench_left", StructureManager.trench_left) {{ heightOffset = -4; conformToTerrain = true; }}, 25); - add(new JigsawPiece("trench_right", StructureManager.trench_right) {{ heightOffset = -4; conformToTerrain = true; }}, 25); - add(new JigsawPiece("trench_junction", StructureManager.trench_junction) {{ heightOffset = -4; conformToTerrain = true; }}, 35); - }}); - }}; - }}); + NBTStructure.registerStructure(0, TRENCH); NBTStructure.registerStructure(0, new SpawnCondition() {{ canSpawn = biome -> !invalidBiomes.contains(biome); diff --git a/src/main/resources/assets/hbm/structures/trench/bunker_collapsed.nbt b/src/main/resources/assets/hbm/structures/trench/bunker_collapsed.nbt new file mode 100644 index 000000000..ed8807af7 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/bunker_collapsed.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/bunker_folly.nbt b/src/main/resources/assets/hbm/structures/trench/bunker_folly.nbt new file mode 100644 index 000000000..c1a491d11 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/bunker_folly.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/bunker_fuel.nbt b/src/main/resources/assets/hbm/structures/trench/bunker_fuel.nbt new file mode 100644 index 000000000..6caf8365c Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/bunker_fuel.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/bunker_large.nbt b/src/main/resources/assets/hbm/structures/trench/bunker_large.nbt new file mode 100644 index 000000000..77803de5b Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/bunker_large.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/bunker_small.nbt b/src/main/resources/assets/hbm/structures/trench/bunker_small.nbt new file mode 100644 index 000000000..3d348ca3e Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/bunker_small.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/cross.nbt b/src/main/resources/assets/hbm/structures/trench/cross.nbt new file mode 100644 index 000000000..d8ac92226 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/cross.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/curve_inner.nbt b/src/main/resources/assets/hbm/structures/trench/curve_inner.nbt new file mode 100644 index 000000000..a54247061 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/curve_inner.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/curve_outer.nbt b/src/main/resources/assets/hbm/structures/trench/curve_outer.nbt new file mode 100644 index 000000000..c3c01a0d8 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/curve_outer.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/end_left.nbt b/src/main/resources/assets/hbm/structures/trench/end_left.nbt new file mode 100644 index 000000000..20b772ce7 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/end_left.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/end_right.nbt b/src/main/resources/assets/hbm/structures/trench/end_right.nbt new file mode 100644 index 000000000..31e0fa96c Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/end_right.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/s_left.nbt b/src/main/resources/assets/hbm/structures/trench/s_left.nbt new file mode 100644 index 000000000..c352f08ef Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/s_left.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/s_right.nbt b/src/main/resources/assets/hbm/structures/trench/s_right.nbt new file mode 100644 index 000000000..fbba87c57 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/s_right.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/straight.nbt b/src/main/resources/assets/hbm/structures/trench/straight.nbt new file mode 100644 index 000000000..4f0dc95ee Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/straight.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/straight_bridge.nbt b/src/main/resources/assets/hbm/structures/trench/straight_bridge.nbt new file mode 100644 index 000000000..383f8a61e Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/straight_bridge.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/straight_dirt.nbt b/src/main/resources/assets/hbm/structures/trench/straight_dirt.nbt new file mode 100644 index 000000000..abcb8787e Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/straight_dirt.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/straight_door_left.nbt b/src/main/resources/assets/hbm/structures/trench/straight_door_left.nbt new file mode 100644 index 000000000..b17a0430f Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/straight_door_left.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/straight_door_right.nbt b/src/main/resources/assets/hbm/structures/trench/straight_door_right.nbt new file mode 100644 index 000000000..5f6fbcd03 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/straight_door_right.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/straight_stairs.nbt b/src/main/resources/assets/hbm/structures/trench/straight_stairs.nbt new file mode 100644 index 000000000..b94d39bac Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/straight_stairs.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/t_inner.nbt b/src/main/resources/assets/hbm/structures/trench/t_inner.nbt new file mode 100644 index 000000000..fc57b3252 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/t_inner.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/t_outer.nbt b/src/main/resources/assets/hbm/structures/trench/t_outer.nbt new file mode 100644 index 000000000..c56a473b0 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/trench/t_outer.nbt differ diff --git a/src/main/resources/assets/hbm/structures/trench/trench.nbt b/src/main/resources/assets/hbm/structures/trench/trench.nbt deleted file mode 100644 index 6fabff53d..000000000 Binary files a/src/main/resources/assets/hbm/structures/trench/trench.nbt and /dev/null differ diff --git a/src/main/resources/assets/hbm/structures/trench/trench_junction.nbt b/src/main/resources/assets/hbm/structures/trench/trench_junction.nbt deleted file mode 100644 index 9c840c0de..000000000 Binary files a/src/main/resources/assets/hbm/structures/trench/trench_junction.nbt and /dev/null differ diff --git a/src/main/resources/assets/hbm/structures/trench/trench_left.nbt b/src/main/resources/assets/hbm/structures/trench/trench_left.nbt deleted file mode 100644 index aa957a637..000000000 Binary files a/src/main/resources/assets/hbm/structures/trench/trench_left.nbt and /dev/null differ diff --git a/src/main/resources/assets/hbm/structures/trench/trench_right.nbt b/src/main/resources/assets/hbm/structures/trench/trench_right.nbt deleted file mode 100644 index bf8d49f8c..000000000 Binary files a/src/main/resources/assets/hbm/structures/trench/trench_right.nbt and /dev/null differ