mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
setro OWNS me... (we've lost the plot)
This commit is contained in:
parent
daae6e9694
commit
f499e6cf00
@ -51,6 +51,7 @@ public class StructureConfig {
|
||||
public static int forestPostSpawnWeight = 30;
|
||||
|
||||
public static int spireSpawnWeight = 2;
|
||||
public static int craneSpawnWeight = 20;
|
||||
public static int bunkerSpawnWeight = 6;
|
||||
public static int dishSpawnWeight = 20;
|
||||
public static int featuresSpawnWeight = 50;
|
||||
@ -109,6 +110,7 @@ public class StructureConfig {
|
||||
ruinsJSpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.34_ruinJSpawnWeight", "Spawn weight for ruin J structure.", 12);
|
||||
radioSpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.35_radioSpawnWeight", "Spawn weight for radio structure.", 25);
|
||||
factorySpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.36_factorySpawnWeight", "Spawn weight for factory structure.", 40);
|
||||
craneSpawnWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.37_craneSpawnWeight", "Spawn weight for crane structure.", 20);
|
||||
|
||||
plainsNullWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.37_plainsNullWeight", "Null spawn weight for plains biome", 20);
|
||||
oceanNullWeight = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.38_oceanNullWeight", "Null spawn weight for ocean biomes", 35);
|
||||
|
||||
@ -85,6 +85,8 @@ public class StructureManager {
|
||||
|
||||
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.nbt"));
|
||||
|
||||
public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt"));
|
||||
|
||||
// public static final NBTStructure test_rot = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-rot.nbt"));
|
||||
|
||||
@ -145,6 +145,12 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = StructureConfig.factorySpawnWeight;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("crane") {{
|
||||
canSpawn = flatbiomes::contains;
|
||||
structure = new JigsawPiece("crane", StructureManager.crane, -10);
|
||||
spawnWeight = StructureConfig.craneSpawnWeight;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("plane1") {{
|
||||
canSpawn = biome -> biome.heightVariation <= 0.3F;
|
||||
structure = new JigsawPiece("crashed_plane_1", StructureManager.plane1, -5);
|
||||
|
||||
@ -116,6 +116,40 @@ public class LogicBlockActions {
|
||||
// world.setBlock(x, y, z, ModBlocks.block_steel); this is useless
|
||||
};
|
||||
|
||||
public static Consumer<LogicBlock.TileEntityLogicBlock> COLLAPSE_ROOF_RAD_10 = (tile) -> {
|
||||
World world = tile.getWorldObj();
|
||||
int x = tile.xCoord;
|
||||
int y = tile.yCoord;
|
||||
int z = tile.zCoord;
|
||||
|
||||
if(tile.phase == 0) return;
|
||||
|
||||
int r = 8;
|
||||
int r2 = r * r;
|
||||
int r22 = r2 / 2;
|
||||
|
||||
for (int xx = -r; xx < r; xx++) {
|
||||
int X = xx + x;
|
||||
int XX = xx * xx;
|
||||
for (int yy = -r; yy < r; yy++) {
|
||||
int Y = yy + y;
|
||||
int YY = XX + yy * yy;
|
||||
for (int zz = -r; zz < r; zz++) {
|
||||
int Z = zz + z;
|
||||
int ZZ = YY + zz * zz;
|
||||
if (ZZ < r22) {
|
||||
|
||||
if (world.getBlock(X, Y, Z).getExplosionResistance(null) <= 70) {
|
||||
EntityFallingBlockNT entityfallingblock = new EntityFallingBlockNT(world, X + 0.5, Y + 0.5, Z + 0.5, world.getBlock(X, Y, Z), world.getBlockMetadata(X, Y, Z));
|
||||
world.spawnEntityInWorld(entityfallingblock);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
};
|
||||
|
||||
public static Consumer<LogicBlock.TileEntityLogicBlock> FODDER_WAVE = (tile) -> {
|
||||
World world = tile.getWorldObj();
|
||||
int x = tile.xCoord;
|
||||
@ -342,6 +376,7 @@ public class LogicBlockActions {
|
||||
actions.put("FODDER_WAVE", FODDER_WAVE);
|
||||
actions.put("ABERRATOR", PHASE_ABERRATOR);
|
||||
actions.put("COLLAPSE_ROOF_RAD_5", COLLAPSE_ROOF_RAD_5);
|
||||
actions.put("COLLAPSE_ROOF_RAD_10", COLLAPSE_ROOF_RAD_10);
|
||||
actions.put("PUZZLE_TEST", PUZZLE_TEST);
|
||||
actions.put("MISSILE_STRIKE", MISSILE_STRIKE);
|
||||
actions.put("IRRADIATE_ENTITIES_AOE", RAD_CONTAINMENT_SYSTEM);
|
||||
|
||||
@ -43,6 +43,14 @@ public class LogicBlockConditions {
|
||||
return false;
|
||||
};
|
||||
|
||||
public static Function<LogicBlock.TileEntityLogicBlock, Boolean> PLAYER_CUBE_3 = (tile) -> {
|
||||
World world = tile.getWorldObj();
|
||||
int x = tile.xCoord;
|
||||
int y = tile.yCoord;
|
||||
int z = tile.zCoord;
|
||||
return !world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(3, 3, 3)).isEmpty();
|
||||
};
|
||||
|
||||
public static Function<LogicBlock.TileEntityLogicBlock, Boolean> PLAYER_CUBE_5 = (tile) -> {
|
||||
World world = tile.getWorldObj();
|
||||
int x = tile.xCoord;
|
||||
@ -97,6 +105,7 @@ public class LogicBlockConditions {
|
||||
//example conditions
|
||||
conditions.put("EMPTY", EMPTY);
|
||||
conditions.put("ABERRATOR", ABERRATOR);
|
||||
conditions.put("PLAYER_CUBE_3", PLAYER_CUBE_3);
|
||||
conditions.put("PLAYER_CUBE_5", PLAYER_CUBE_5);
|
||||
conditions.put("PLAYER_CUBE_25", PLAYER_CUBE_25);
|
||||
conditions.put("REDSTONE", REDSTONE);
|
||||
|
||||
BIN
src/main/resources/assets/hbm/structures/crane.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/crane.nbt
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user