This commit is contained in:
Lazzzycatwastaken 2025-06-30 17:38:36 +02:00
parent 14377708be
commit 43f38d8679
4 changed files with 30 additions and 17 deletions

View File

@ -1,6 +1,7 @@
package com.hbm.blocks.machine; package com.hbm.blocks.machine;
import com.hbm.tileentity.machine.TileEntityCharger; import com.hbm.tileentity.machine.TileEntityCharger;
import com.hbm.world.gen.INBTTransformable;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@ -12,7 +13,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
public class Charger extends BlockContainer { public class Charger extends BlockContainer implements INBTTransformable {
public Charger(Material mat) { public Charger(Material mat) {
super(mat); super(mat);
@ -62,11 +63,11 @@ public class Charger extends BlockContainer {
float f = 0.0625F; float f = 0.0625F;
switch(world.getBlockMetadata(x, y, z)) { switch(world.getBlockMetadata(x, y, z)) {
case 2: this.setBlockBounds(5 * f, 0.25F, 12 * f, 11 * f, 0.75F, 1F); break; case 2: this.setBlockBounds(5 * f, 0.25F, 12 * f, 11 * f, 0.75F, 1F); break;
case 3: this.setBlockBounds(5 * f, 0.25F, 0F, 11 * f, 0.75F, 4 * f); break; case 3: this.setBlockBounds(5 * f, 0.25F, 0F, 11 * f, 0.75F, 4 * f); break;
case 4: this.setBlockBounds(12 * f, 0.25F, 5 * f, 1F, 0.75F, 11 * f); break; case 4: this.setBlockBounds(12 * f, 0.25F, 5 * f, 1F, 0.75F, 11 * f); break;
case 5: this.setBlockBounds(0F, 0.25F, 5 * f, 4 * f, 0.75F, 11 * f); break; case 5: this.setBlockBounds(0F, 0.25F, 5 * f, 4 * f, 0.75F, 11 * f); break;
default: this.setBlockBounds(5 * f, 0.25F, 5 * f, 11 * f, 0.75F, 11 * f); break; default: this.setBlockBounds(5 * f, 0.25F, 5 * f, 11 * f, 0.75F, 11 * f); break;
} }
} }
@ -75,4 +76,9 @@ public class Charger extends BlockContainer {
this.setBlockBoundsBasedOnState(world, x, y, z); this.setBlockBoundsBasedOnState(world, x, y, z);
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
} }
@Override
public int transformMeta(int meta, int coordBaseMode) {
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
}
} }

View File

@ -61,6 +61,7 @@ public class StructureManager {
public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt")); public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt"));
public static final NBTStructure lighthouse = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/lighthouse.nbt")); public static final NBTStructure lighthouse = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/lighthouse.nbt"));
public static final NBTStructure dish = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/dish.nbt")); public static final NBTStructure dish = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/dish.nbt"));
public static final NBTStructure laboratory = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/laboratory.nbt"));
public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt")); public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt"));

View File

@ -102,8 +102,6 @@ public class NTMWorldGenerator implements IWorldGenerator {
spawnWeight = 8; spawnWeight = 8;
}}); }});
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains); //why the fuck did this change
NBTStructure.registerStructure(0, new SpawnCondition() {{ NBTStructure.registerStructure(0, new SpawnCondition() {{
canSpawn = biome -> biome == BiomeGenBase.plains; canSpawn = biome -> biome == BiomeGenBase.plains;
structure = new JigsawPiece("dish", StructureManager.dish, -10); structure = new JigsawPiece("dish", StructureManager.dish, -10);
@ -112,8 +110,16 @@ public class NTMWorldGenerator implements IWorldGenerator {
spawnWeight = 1; spawnWeight = 1;
}}); }});
NBTStructure.registerStructure(0, new SpawnCondition() {{
canSpawn = biome -> biome == BiomeGenBase.plains;
structure = new JigsawPiece("laboratory", StructureManager.laboratory, -10);
minHeight = 53;
maxHeight = 65;
spawnWeight = 8;
}});
NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains); NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains);
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains); NBTStructure.registerNullWeight(0, 4, oceanBiomes::contains);
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{ Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
put(ModBlocks.meteor_brick, new MeteorBricks()); put(ModBlocks.meteor_brick, new MeteorBricks());