getting jiggy with it

This commit is contained in:
Bob 2025-05-14 23:27:10 +02:00
parent 972b1140a8
commit 7861b4e20f
34 changed files with 136 additions and 35 deletions

View File

@ -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");

View File

@ -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),
};
}};
}
}

View File

@ -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));

View File

@ -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) {

View File

@ -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"));

View File

@ -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");

View File

@ -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));
}

View File

@ -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;

View File

@ -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();
}

View File

@ -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<String, NBTStructure.JigsawPool>() {{
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<BiomeGenBase> 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<String, NBTStructure.JigsawPool>() {{
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);