mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
Reformat code
This commit is contained in:
@@ -167,6 +167,7 @@ public class VanillaOre implements Structure {
|
||||
|
||||
return blockCount > 0;
|
||||
}
|
||||
|
||||
public BlockState getMaterial(BlockType replace) {
|
||||
return materials.getOrDefault(replace, material);
|
||||
}
|
||||
|
||||
+5
-4
@@ -15,6 +15,7 @@ import static com.dfsek.terra.addons.ore.utils.VanillaOreUtils.shouldPlace;
|
||||
|
||||
public class VanillaScatteredOre extends VanillaOre {
|
||||
protected final int spread;
|
||||
|
||||
public VanillaScatteredOre(BlockState material, double size, MaterialSet replaceable, boolean applyGravity, double exposed,
|
||||
Map<BlockType, BlockState> materials, int spread) {
|
||||
super(material, size, replaceable, applyGravity, exposed, materials);
|
||||
@@ -30,9 +31,9 @@ public class VanillaScatteredOre extends VanillaOre {
|
||||
for(int j = 0; j < i; ++j) {
|
||||
this.setPos(mutable, random, location, Math.min(j, spread));
|
||||
BlockType block = world.getBlockState(mutable).getBlockType();
|
||||
if (shouldPlace(getReplaceable(), block, exposed, random, world, mutable.getX(), mutable.getY(), mutable.getZ())) {
|
||||
world.setBlockState(mutable, getMaterial(block), isApplyGravity());
|
||||
}
|
||||
if(shouldPlace(getReplaceable(), block, exposed, random, world, mutable.getX(), mutable.getY(), mutable.getZ())) {
|
||||
world.setBlockState(mutable, getMaterial(block), isApplyGravity());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -48,6 +49,6 @@ public class VanillaScatteredOre extends VanillaOre {
|
||||
}
|
||||
|
||||
private int getSpread(Random random, int spread) {
|
||||
return Math.round((random.nextFloat() - random.nextFloat()) * (float)spread);
|
||||
return Math.round((random.nextFloat() - random.nextFloat()) * (float) spread);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ public class VanillaOreUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldPlace(MaterialSet replaceable, BlockType type, Double exposed, Random random, WritableWorld world, int x, int y, int z) {
|
||||
public static boolean shouldPlace(MaterialSet replaceable, BlockType type, Double exposed, Random random, WritableWorld world, int x,
|
||||
int y, int z) {
|
||||
if(!replaceable.contains(type)) {
|
||||
return false;
|
||||
} else if(shouldNotDiscard(random, exposed)) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
schema-version: 1
|
||||
contributors:
|
||||
- Terra contributors
|
||||
- Terra contributors
|
||||
id: config-ore
|
||||
version: @VERSION@
|
||||
entrypoints:
|
||||
- "com.dfsek.terra.addons.ore.OreAddon"
|
||||
- "com.dfsek.terra.addons.ore.OreAddon"
|
||||
website:
|
||||
issues: https://github.com/PolyhedralDev/Terra/issues
|
||||
source: https://github.com/PolyhedralDev/Terra
|
||||
docs: https://terra.polydev.org
|
||||
issues: https://github.com/PolyhedralDev/Terra/issues
|
||||
source: https://github.com/PolyhedralDev/Terra
|
||||
docs: https://terra.polydev.org
|
||||
license: MIT License
|
||||
Reference in New Issue
Block a user