diff --git a/src/main/java/com/hbm/config/StructureConfig.java b/src/main/java/com/hbm/config/StructureConfig.java index 279cf0a52..e20d2410c 100644 --- a/src/main/java/com/hbm/config/StructureConfig.java +++ b/src/main/java/com/hbm/config/StructureConfig.java @@ -50,6 +50,7 @@ public class StructureConfig { public static int radioSpawnWeight = 30; public static int forestChemSpawnWeight = 30; public static int forestPostSpawnWeight = 30; + public static int towerBaseSpawnWeight = 30; public static int spireSpawnWeight = 2; public static int craneSpawnWeight = 20; @@ -115,6 +116,7 @@ public class StructureConfig { oceanNullWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.38_oceanNullWeight", "Null spawn weight for ocean biomes", 35); craneSpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.39_craneSpawnWeight", "Spawn weight for crane structure.", 20); broadcastingTowerSpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.40_broadcastingTowerSpawnWeight", "Spawn weight for broadcasting tower structure.", 25); + towerBaseSpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.41_towerBaseSpawnWeight", "Spawn weight for tower base.", 30); structureMinChunks = CommonConfig.setDef(structureMinChunks, 4); diff --git a/src/main/java/com/hbm/main/StructureManager.java b/src/main/java/com/hbm/main/StructureManager.java index 1fa86803a..8b0709e87 100644 --- a/src/main/java/com/hbm/main/StructureManager.java +++ b/src/main/java/com/hbm/main/StructureManager.java @@ -82,6 +82,7 @@ public class StructureManager { public static final NBTStructure forest_chem = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/forest_chem.nbt")); public static final NBTStructure plane1 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed_plane_1.nbt")); public static final NBTStructure plane2 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed_plane_2.nbt")); + public static final NBTStructure tower_base = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/tower_base.nbt")); public static final NBTStructure factory = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/factory.nbt")); public static final NBTStructure crane = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crane_mod.nbt")); diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 2c2e79b87..529d449b3 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -241,6 +241,11 @@ public class NTMWorldGenerator implements IWorldGenerator { structure = new JigsawPiece("NTMRuinsJ", StructureManager.ntmruinsJ, -1) {{conformToTerrain = true;}}; spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsJSpawnWeight : 0; }}); + NBTStructure.registerStructure(0, new SpawnCondition("tower_base") {{ + canSpawn = biome -> biome.heightVariation <= 0.3F && !isInvalidBiome(biome); + structure = new JigsawPiece("tower_base", StructureManager.tower_base, -6); + spawnWeight = StructureConfig.towerBaseSpawnWeight; + }}); NBTStructure.registerNullWeight(0, StructureConfig.plainsNullWeight, biome -> biome == BiomeGenBase.plains); NBTStructure.registerNullWeight(0, StructureConfig.oceanNullWeight, biome -> BiomeDictionary.isBiomeOfType(biome, Type.OCEAN)); diff --git a/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java b/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java index cbbf17142..1ef0b73d4 100644 --- a/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java +++ b/src/main/java/com/hbm/world/gen/util/LogicBlockActions.java @@ -487,6 +487,39 @@ public class LogicBlockActions { } }; + public static Consumer DEAD_GUY_BASE_TOWER = (tile) -> { + World world = tile.getWorldObj(); + int x = tile.xCoord; + int y = tile.yCoord; + int z = tile.zCoord; + if(tile.phase == 1) { + world.setBlock(x, y, z, ModBlocks.skeleton_holder); + TileEntity te = world.getTileEntity(x, y, z); + EntityPlayer player = (EntityPlayer) world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(25, 25, 25)).get(0); + + if (te instanceof BlockSkeletonHolder.TileEntitySkeletonHolder) { + BlockSkeletonHolder.TileEntitySkeletonHolder skeleton = (BlockSkeletonHolder.TileEntitySkeletonHolder) te; + int roll = world.rand.nextInt(100); + + if (roll < 44) { + skeleton.item = new ItemStack(ModItems.ammo_standard, 3, 91); + + } else if (roll < 71) { + skeleton.item = new ItemStack(ModItems.ammo_standard, 1, 92); + + } else if (roll < 92) { + skeleton.item = new ItemStack(ModItems.ammo_standard, 1, 73); + + } else if (roll < 96) { + skeleton.item = new ItemStack(ModItems.item_secret, 1, 3); + + } else { + skeleton.item = new ItemStack(ModItems.item_secret, 1, 4); + } + } + } + }; + public static List getActionNames(){ return new ArrayList<>(actions.keySet()); } @@ -506,6 +539,7 @@ public class LogicBlockActions { actions.put("BOMB_TRAP", BOMB_TRAP); actions.put("BOMB_CRANE", BOMB_CRANE); actions.put("DEAD_GUY_CRANE", DEAD_GUY_CRANE); + actions.put("DEAD_GUY_TOWER_BASE", DEAD_GUY_TOWER_BASE); //Mob Block Actions actions.put("SKELETON_GUN_TIER_1", SKELETONS_GUN_TIER_1); diff --git a/src/main/resources/assets/hbm/structures/tower_base.nbt b/src/main/resources/assets/hbm/structures/tower_base.nbt new file mode 100644 index 000000000..f2af67a08 Binary files /dev/null and b/src/main/resources/assets/hbm/structures/tower_base.nbt differ