mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
Add linting + fix warnings
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
13
.idea/inspectionProfiles/Project_Default.xml
generated
13
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -6,5 +6,18 @@
|
||||
<language minSize="54" name="Java" />
|
||||
</Languages>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="NonSerializableObjectPassedToObjectStream" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="SerialVersionUIDNotStaticFinal" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="SerializableHasSerialVersionUIDField" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoreAnonymousInnerClasses" value="false" />
|
||||
<option name="superClassString" value="java.awt.Component" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SerializableInnerClassHasSerialVersionUIDField" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoreAnonymousInnerClasses" value="false" />
|
||||
<option name="superClassString" value="java.awt.Component" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SerializableStoresNonSerializable" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="TransientFieldInNonSerializableClass" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="TransientFieldNotInitialized" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
@@ -48,9 +48,17 @@ dependencies {
|
||||
testImplementation(name = "Gaea-1.14.0", group = "")
|
||||
}
|
||||
|
||||
val compileJava: JavaCompile by tasks
|
||||
compileJava.apply {
|
||||
options.encoding = "UTF-8"
|
||||
doFirst {
|
||||
options.compilerArgs = mutableListOf("-Xlint:all", "-Xlint:-processing")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
|
||||
|
||||
maxHeapSize = "1G"
|
||||
ignoreFailures = false
|
||||
failFast = true
|
||||
|
||||
@@ -35,6 +35,7 @@ public class Terra extends GaeaPlugin {
|
||||
TerraChunkGenerator.saveAll();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onEnable() {
|
||||
instance = this;
|
||||
@@ -54,7 +55,6 @@ public class Terra extends GaeaPlugin {
|
||||
locatePl.setTabCompleter(locate);
|
||||
|
||||
saveDefaultConfig();
|
||||
//noinspection deprecation
|
||||
Bukkit.getScheduler().scheduleAsyncRepeatingTask(this, TerraChunkGenerator::saveAll, ConfigUtil.dataSave, ConfigUtil.dataSave);
|
||||
Bukkit.getPluginManager().registerEvents(new EventListener(this), this);
|
||||
PaperUtil.checkPaper(this);
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
|
||||
* Thrown when a config item is not valid.
|
||||
*/
|
||||
public class ConfigException extends InvalidConfigurationException {
|
||||
private static final long serialVersionUID = -4342864317005935979L;
|
||||
private final String message;
|
||||
private final String id;
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ package com.dfsek.terra.config.exception;
|
||||
* Thrown when a required config item is not found.
|
||||
*/
|
||||
public class NotFoundException extends ConfigException {
|
||||
private static final long serialVersionUID = -3763471113262357426L;
|
||||
|
||||
public NotFoundException(String item, String itemName, String id) {
|
||||
super(item + " \"" + itemName + "\" cannot be found!", id);
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ public class OreConfig extends TerraConfig {
|
||||
}
|
||||
}
|
||||
|
||||
private int randomInRange(Random r) {
|
||||
return r.nextInt(max - min + 1) + min;
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void doVein(Vector l, Chunk chunk, Random r) {
|
||||
@@ -91,6 +91,10 @@ public class OreConfig extends TerraConfig {
|
||||
}
|
||||
}
|
||||
|
||||
private int randomInRange(Random r) {
|
||||
return r.nextInt(max - min + 1) + min;
|
||||
}
|
||||
|
||||
public void doVeinSingle(Vector l, Chunk chunk, Random r) {
|
||||
FastNoiseLite ore = new FastNoiseLite(r.nextInt());
|
||||
ore.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
@@ -117,10 +121,6 @@ public class OreConfig extends TerraConfig {
|
||||
return "Ore with ID " + getID();
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public boolean crossChunks() {
|
||||
return crossChunks;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.awt.event.ActionListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class DebugFrame extends JFrame implements ActionListener {
|
||||
private static final long serialVersionUID = 9133084939622854303L;
|
||||
private final int x;
|
||||
private final int z;
|
||||
private final BufferedImage img;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class UserDefinedGenerator extends Generator {
|
||||
private final Variable xVar = s.getVariable("x");
|
||||
private final Variable yVar = s.getVariable("y");
|
||||
private final Variable zVar = s.getVariable("z");
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings({"unchecked", "rawtypes", "RedundantSuppression"})
|
||||
private final Palette<BlockData>[] palettes = new Palette[256];
|
||||
private final NoiseFunction2 n2 = new NoiseFunction2();
|
||||
private final NoiseFunction3 n3 = new NoiseFunction3();
|
||||
|
||||
@@ -28,6 +28,7 @@ public class CavePopulator extends BlockPopulator {
|
||||
private static final Map<Material, BlockData> shiftStorage = new HashMap<>(); // Persist BlockData created for shifts, to avoid re-calculating each time.
|
||||
private static final BlockData AIR = Material.AIR.createBlockData();
|
||||
|
||||
@SuppressWarnings("try")
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
|
||||
if(ConfigUtil.masterDisableCaves) return;
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.Random;
|
||||
* Populates Flora and Trees
|
||||
*/
|
||||
public class FloraPopulator extends GaeaBlockPopulator {
|
||||
@SuppressWarnings("try")
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
|
||||
try(ProfileFuture ignored = TerraProfiler.fromWorld(world).measure("FloraTime")) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class OrePopulator extends GaeaBlockPopulator {
|
||||
@SuppressWarnings("try")
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
|
||||
try(ProfileFuture ignored = TerraProfiler.fromWorld(world).measure("OreTime")) {
|
||||
@@ -44,7 +45,7 @@ public class OrePopulator extends GaeaBlockPopulator {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(!event.isCancelled()) {
|
||||
if(ore.crossChunks()) ore.doVein(v, chunk, random);
|
||||
else ore.doVeinSingleChunk(new Vector(x, y, z), chunk, random);
|
||||
else ore.doVeinSingle(new Vector(x, y, z), chunk, random);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public class SnowPopulator extends GaeaBlockPopulator {
|
||||
Bukkit.getLogger().info("Added " + blacklistSpawn.size() + " materials to snow blacklist");
|
||||
}
|
||||
|
||||
@SuppressWarnings("try")
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
|
||||
try(ProfileFuture ignored = TerraProfiler.fromWorld(world).measure("SnowTime")) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.util.Random;
|
||||
|
||||
public class StructurePopulator extends BlockPopulator {
|
||||
|
||||
@SuppressWarnings("try")
|
||||
@Override
|
||||
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk chunk) {
|
||||
try(ProfileFuture ignored = TerraProfiler.fromWorld(world).measure("StructureTime")) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class InitializationException extends Exception {
|
||||
private static final long serialVersionUID = -3817726044758088486L;
|
||||
private final Location worldLoc;
|
||||
|
||||
public InitializationException(String message, @Nullable Location worldLoc) {
|
||||
|
||||
@@ -163,46 +163,6 @@ public class Structure implements Serializable {
|
||||
this.executeForBlocksInRange(xRange, getRange(Axis.Y, r), zRange, block -> pasteBlock(block, origin, r), r);
|
||||
}
|
||||
|
||||
public boolean checkSpawns(Location origin, Rotation r) {
|
||||
for(StructureContainedBlock b : spawns) {
|
||||
Vector2 rot = getRotatedCoords(new Vector2(b.getX() - structureInfo.getCenterX(), b.getZ() - structureInfo.getCenterZ()), r);
|
||||
if(!b.getRequirement().matches(origin.getWorld(), (int) rot.getX() + origin.getBlockX(), origin.getBlockY() + b.getY(), (int) rot.getZ() + origin.getBlockZ()))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public HashSet<StructureContainedInventory> getInventories() {
|
||||
return inventories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get GaeaStructureInfo object
|
||||
*
|
||||
* @return Structure Info
|
||||
*/
|
||||
@NotNull
|
||||
public StructureInfo getStructureInfo() {
|
||||
return structureInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paste structure at an origin location, confined to a single chunk.
|
||||
*
|
||||
* @param origin Origin location
|
||||
* @param chunk Chunk to confine pasting to
|
||||
* @param r Rotation
|
||||
*/
|
||||
public void paste(Location origin, Chunk chunk, Rotation r) {
|
||||
int xOr = (chunk.getX() << 4);
|
||||
int zOr = (chunk.getZ() << 4);
|
||||
Range intersectX = new Range(xOr, xOr + 16).sub(origin.getBlockX() - structureInfo.getCenterX());
|
||||
Range intersectZ = new Range(zOr, zOr + 16).sub(origin.getBlockZ() - structureInfo.getCenterZ());
|
||||
if(intersectX == null || intersectZ == null) return;
|
||||
executeForBlocksInRange(intersectX, getRange(Axis.Y, r), intersectZ, block -> pasteBlock(block, origin, r), r);
|
||||
Debug.info(intersectX.toString() + " : " + intersectZ.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Paste a single StructureDefinedBlock at an origin location, offset by its coordinates.
|
||||
*
|
||||
@@ -298,6 +258,16 @@ public class Structure implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get GaeaStructureInfo object
|
||||
*
|
||||
* @return Structure Info
|
||||
*/
|
||||
@NotNull
|
||||
public StructureInfo getStructureInfo() {
|
||||
return structureInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether a set of coordinates is within the current structure
|
||||
*
|
||||
@@ -339,6 +309,36 @@ public class Structure implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkSpawns(Location origin, Rotation r) {
|
||||
for(StructureContainedBlock b : spawns) {
|
||||
Vector2 rot = getRotatedCoords(new Vector2(b.getX() - structureInfo.getCenterX(), b.getZ() - structureInfo.getCenterZ()), r);
|
||||
if(!b.getRequirement().matches(origin.getWorld(), (int) rot.getX() + origin.getBlockX(), origin.getBlockY() + b.getY(), (int) rot.getZ() + origin.getBlockZ()))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public HashSet<StructureContainedInventory> getInventories() {
|
||||
return inventories;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paste structure at an origin location, confined to a single chunk.
|
||||
*
|
||||
* @param origin Origin location
|
||||
* @param chunk Chunk to confine pasting to
|
||||
* @param r Rotation
|
||||
*/
|
||||
public void paste(Location origin, Chunk chunk, Rotation r) {
|
||||
int xOr = (chunk.getX() << 4);
|
||||
int zOr = (chunk.getZ() << 4);
|
||||
Range intersectX = new Range(xOr, xOr + 16).sub(origin.getBlockX() - structureInfo.getCenterX());
|
||||
Range intersectZ = new Range(zOr, zOr + 16).sub(origin.getBlockZ() - structureInfo.getCenterZ());
|
||||
if(intersectX == null || intersectZ == null) return;
|
||||
executeForBlocksInRange(intersectX, getRange(Axis.Y, r), intersectZ, block -> pasteBlock(block, origin, r), r);
|
||||
Debug.info(intersectX.toString() + " : " + intersectZ.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* From an origin location (First bound) fetch the second bound.
|
||||
*
|
||||
|
||||
@@ -32,6 +32,7 @@ public class SerializableBanner implements SerializableBlockState {
|
||||
}
|
||||
|
||||
private static final class Pattern implements Serializable {
|
||||
private static final long serialVersionUID = -7802163816361757171L;
|
||||
private final DyeColor color;
|
||||
private final PatternType type;
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ public final class RotationUtil {
|
||||
* @param r Rotate
|
||||
* @return Rotated/mirrored shape
|
||||
*/
|
||||
@SuppressWarnings("fallthrough")
|
||||
public static Rail.Shape getRotatedRail(Rail.Shape orig, Structure.Rotation r) {
|
||||
switch(r) {
|
||||
case CCW_90:
|
||||
|
||||
@@ -36,6 +36,13 @@ public final class WorldEditUtil {
|
||||
return new Location[] {l1, l2};
|
||||
}
|
||||
|
||||
public static WorldEditPlugin getWorldEdit() {
|
||||
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if(p instanceof WorldEditPlugin) return (WorldEditPlugin) p;
|
||||
Bukkit.getLogger().severe("[Terra] a command requiring WorldEdit was executed, but WorldEdit was not detected!");
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Location[] getSelectionPositions(Player sender) {
|
||||
WorldEditPlugin we = WorldEditUtil.getWorldEdit();
|
||||
if(we == null) {
|
||||
@@ -59,11 +66,4 @@ public final class WorldEditUtil {
|
||||
Location l2 = new Location(sender.getWorld(), max.getBlockX(), max.getBlockY(), max.getBlockZ());
|
||||
return new Location[] {l1, l2};
|
||||
}
|
||||
|
||||
public static WorldEditPlugin getWorldEdit() {
|
||||
Plugin p = Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if(p instanceof WorldEditPlugin) return (WorldEditPlugin) p;
|
||||
Bukkit.getLogger().severe("[Terra] a command requiring WorldEdit was executed, but WorldEdit was not detected!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_path": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_path": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:white_terracotta": 2
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_path": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:grass_block": 1
|
||||
- "minecraft:white_terracotta": 2
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:dirt": 7
|
||||
- "minecraft:white_terracotta": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:dirt": 7
|
||||
- "minecraft:white_terracotta": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "ARID"
|
||||
simplex: true
|
||||
frequency: 0.05
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:grass_block": 2
|
||||
- "minecraft:snow_block": 3
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:dirt": 2
|
||||
- "minecraft:snow_block": 3
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:grass_block": 2
|
||||
- "minecraft:snow_block": 3
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:dirt": 2
|
||||
- "minecraft:snow_block": 3
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "MOUNTAIN_GRASS"
|
||||
simplex: true
|
||||
frequency: 0.075
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:brown_terracotta": 2
|
||||
- "minecraft:grass_block": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:brown_terracotta": 2
|
||||
- "minecraft:dirt": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:brown_terracotta": 2
|
||||
- "minecraft:grass_block": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:brown_terracotta": 2
|
||||
- "minecraft:dirt": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "MOUNTAIN_JUNGLE"
|
||||
simplex: true
|
||||
frequency: 0.04
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 2
|
||||
- "minecraft:clay": 2
|
||||
- "minecraft:light_gray_terracotta": 2
|
||||
- "minecraft:grass_block": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 2
|
||||
- "minecraft:clay": 2
|
||||
- "minecraft:light_gray_terracotta": 2
|
||||
- "minecraft:dirt": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 2
|
||||
- "minecraft:clay": 2
|
||||
- "minecraft:light_gray_terracotta": 2
|
||||
- "minecraft:grass_block": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 2
|
||||
- "minecraft:clay": 2
|
||||
- "minecraft:light_gray_terracotta": 2
|
||||
- "minecraft:dirt": 10
|
||||
- "minecraft:cobblestone": 1
|
||||
- "minecraft:stone": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "MOUNTAIN_PRETTY"
|
||||
simplex: true
|
||||
frequency: 0.03
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:stone": 2
|
||||
- "minecraft:snow_block": 3
|
||||
- "minecraft:cobblestone": 1
|
||||
layers: 3
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:stone": 2
|
||||
- "minecraft:snow_block": 3
|
||||
- "minecraft:cobblestone": 1
|
||||
layers: 3
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "MOUNTAIN_STONE"
|
||||
simplex: true
|
||||
frequency: 0.075
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:stone": 2
|
||||
- "minecraft:grass_block": 2
|
||||
- "minecraft:snow_block": 4
|
||||
- "minecraft:cobblestone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:stone": 2
|
||||
- "minecraft:dirt": 2
|
||||
- "minecraft:snow_block": 4
|
||||
- "minecraft:cobblestone": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:stone": 2
|
||||
- "minecraft:grass_block": 2
|
||||
- "minecraft:snow_block": 4
|
||||
- "minecraft:cobblestone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cyan_terracotta": 1
|
||||
- "minecraft:stone": 2
|
||||
- "minecraft:dirt": 2
|
||||
- "minecraft:snow_block": 4
|
||||
- "minecraft:cobblestone": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "MOUNTAIN_STONE_GRASS"
|
||||
simplex: true
|
||||
frequency: 0.075
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:dirt": 4
|
||||
- "minecraft:sand": 2
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:dirt": 4
|
||||
- "minecraft:sand": 2
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "RIVER_BOTTOM"
|
||||
simplex: true
|
||||
frequency: 0.05
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:grass_block": 4
|
||||
- "minecraft:sand": 2
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:dirt": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:grass_block": 4
|
||||
- "minecraft:sand": 2
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:dirt": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "RIVER_SHORE"
|
||||
simplex: true
|
||||
frequency: 0.05
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:cobblestone_slab": 1
|
||||
- "minecraft:stone_slab": 3
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cobblestone_slab": 1
|
||||
- "minecraft:stone_slab": 3
|
||||
layers: 1
|
||||
id: "MOUNTAIN_SLABS"
|
||||
simplex: true
|
||||
frequency: 0.1
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:cobblestone_stairs": 1
|
||||
- "minecraft:stone_stairs": 3
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:cobblestone_stairs": 1
|
||||
- "minecraft:stone_stairs": 3
|
||||
layers: 1
|
||||
id: "MOUNTAIN_STAIRS"
|
||||
simplex: true
|
||||
frequency: 0.1
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:grass_block": 2
|
||||
- "minecraft:podzol": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:dirt": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:grass_block": 2
|
||||
- "minecraft:podzol": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:dirt": 1
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "TAIGA"
|
||||
simplex: true
|
||||
frequency: 0.03
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
layers:
|
||||
- materials:
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:stone": 1
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:stone": 1
|
||||
- "minecraft:snow_block": 2
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:snow_block": 2
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 4
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
- materials:
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:stone": 1
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:stone": 1
|
||||
- "minecraft:snow_block": 2
|
||||
- "minecraft:gravel": 1
|
||||
- "minecraft:snow_block": 2
|
||||
layers: 2
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 4
|
||||
- materials:
|
||||
- "minecraft:stone": 1
|
||||
layers: 1
|
||||
id: "TUNDRA"
|
||||
simplex: true
|
||||
frequency: 0.04
|
||||
|
||||
@@ -104,12 +104,6 @@ class LookupGenerator {
|
||||
return Math.min((int) Math.floor((i + 1) * ((double) n / 2)), n - 1);
|
||||
}
|
||||
|
||||
public static int normalize(double i, int n) {
|
||||
i *= 1.42; // Magic simplex value (sqrt(2) plus a little)
|
||||
i = Math.min(Math.max(i, -1), 1);
|
||||
return Math.min((int) Math.floor((i + 1) * ((double) n / 2)), n - 1);
|
||||
}
|
||||
|
||||
private static class Worker extends Thread {
|
||||
private final List<Double> l;
|
||||
private final int searches;
|
||||
|
||||
Reference in New Issue
Block a user