diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 9d1799dfd..296c358b9 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -23,7 +23,7 @@ A clear and concise description of what you expected to happen.
**Screenshots or Video Recordings**
If applicable, add screenshots or video recordings to help explain your problem.
-**Server and Plugin Informations**
+**Server and Plugin Information**
- Installed plugins:
- Iris Version:
- Server Platform and Version [eg: PaperSpigot 1.16.3 #240]:
diff --git a/build.gradle b/build.gradle
index ee384e0de..fe7301f28 100644
--- a/build.gradle
+++ b/build.gradle
@@ -10,11 +10,30 @@ def apiVersion = '1.17'
def name = 'Iris'
def main = 'com.volmit.iris.Iris'
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
// ADD YOURSELF AS A NEW LINE IF YOU WANT YOUR OWN BUILD TASK GENERATED
// ==============================================================
registerCustomOutputTask('Cyberpwn', 'C://Users/cyberpwn/Documents/development/server/plugins');
registerCustomOutputTask('Psycho', 'D://Dan/MinecraftDevelopment/server/plugins');
registerCustomOutputTask('ArcaneArts', 'C://Users/arcane/Documents/development/server/plugins');
+registerCustomOutputTask('Coco', 'C:/Users/sjoer/Documents/MCServer/plugins');
// ==============================================================
def registerCustomOutputTask(name, path) {
diff --git a/gradle.properties b/gradle.properties
index 229aa2332..e30439176 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,21 @@
+#
+# Iris is a World Generator for Minecraft Bukkit Servers
+# Copyright (c) 2021 Arcane Arts (Volmit Software)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx3072m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index fe677279e..9a6266293 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,3 +1,21 @@
+#
+# Iris is a World Generator for Minecraft Bukkit Servers
+# Copyright (c) 2021 Arcane Arts (Volmit Software)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
diff --git a/gradlew b/gradlew
index 4f906e0c8..782ac18d3 100644
--- a/gradlew
+++ b/gradlew
@@ -1,19 +1,21 @@
#!/usr/bin/env sh
#
-# Copyright 2015 the original author or authors.
+# Iris is a World Generator for Minecraft Bukkit Servers
+# Copyright (c) 2021 Arcane Arts (Volmit Software)
#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
-# https://www.apache.org/licenses/LICENSE-2.0
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
#
##############################################################################
diff --git a/settings.gradle b/settings.gradle
index d7f73608f..7e3e7191b 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,20 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
rootProject.name = 'Iris'
diff --git a/src/main/java/com/volmit/iris/Iris.java b/src/main/java/com/volmit/iris/Iris.java
index 50d036ac7..aaebcdf35 100644
--- a/src/main/java/com/volmit/iris/Iris.java
+++ b/src/main/java/com/volmit/iris/Iris.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris;
import com.volmit.iris.manager.*;
@@ -12,7 +30,6 @@ import com.volmit.iris.nms.INMS;
import com.volmit.iris.object.IrisCompat;
import com.volmit.iris.object.IrisDimension;
import com.volmit.iris.scaffold.IrisWorlds;
-import com.volmit.iris.scaffold.data.DataProvider;
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
import com.volmit.iris.util.*;
import io.papermc.lib.PaperLib;
@@ -24,14 +41,15 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
+import org.jetbrains.annotations.NotNull;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
-import java.util.concurrent.Callable;
+@SuppressWarnings("CanBeFinal")
public class Iris extends VolmitPlugin implements Listener {
public static KList executors = new KList<>();
public static Iris instance;
@@ -71,48 +89,42 @@ public class Iris extends VolmitPlugin implements Listener {
boolean reboot = false;
File packs = new File("plugins/Iris/packs");
File dpacks = null;
+ File props = new File("server.properties");
- look: for(File i : new File(".").listFiles())
- {
- if(i.isDirectory())
- {
- for(File j : i.listFiles())
- {
- if(j.isDirectory() && j.getName().equals("datapacks"))
- {
- dpacks = j;
- break look;
+ if (props.exists()) {
+ try {
+ KList m = new KList<>(IO.readAll(props).split("\\Q\n\\E"));
+
+ for (String i : m) {
+ if (i.trim().startsWith("level-name=")) {
+ dpacks = new File(i.trim().split("\\Q=\\E")[1] + "/datapacks");
+ break;
}
}
+ } catch (IOException e) {
+ e.printStackTrace();
}
}
- if(dpacks == null)
- {
+ if (dpacks == null) {
Iris.error("Cannot find the datapacks folder! Please try generating a default world first maybe? Is this a new server?");
return;
}
- if(packs.exists())
- {
- for(File i : packs.listFiles())
- {
- if(i.isDirectory())
- {
+
+ if (packs.exists()) {
+ for (File i : packs.listFiles()) {
+ if (i.isDirectory()) {
Iris.verbose("Checking Pack: " + i.getPath());
IrisDataManager data = new IrisDataManager(i);
File dims = new File(i, "dimensions");
- if(dims.exists())
- {
- for(File j : dims.listFiles())
- {
- if(j.getName().endsWith(".json"))
- {
+ if (dims.exists()) {
+ for (File j : dims.listFiles()) {
+ if (j.getName().endsWith(".json")) {
IrisDimension dim = data.getDimensionLoader().load(j.getName().split("\\Q.\\E")[0]);
Iris.verbose(" Checking Dimension " + dim.getLoadFile().getPath());
- if(dim.installDataPack(() -> data, dpacks))
- {
+ if (dim.installDataPack(() -> data, dpacks)) {
reboot = true;
}
}
@@ -131,7 +143,7 @@ public class Iris extends VolmitPlugin implements Listener {
if (tc <= 0) {
int p = Runtime.getRuntime().availableProcessors();
- return p > 16 ? 16 : p < 4 ? 4 : p;
+ return p > 16 ? 16 : Math.max(p, 4);
}
return tc;
@@ -142,7 +154,7 @@ public class Iris extends VolmitPlugin implements Listener {
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
return v >= 15;
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
@@ -154,7 +166,7 @@ public class Iris extends VolmitPlugin implements Listener {
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
return v >= 14;
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
@@ -166,7 +178,7 @@ public class Iris extends VolmitPlugin implements Listener {
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
return v >= 15;
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
@@ -276,19 +288,9 @@ public class Iris extends VolmitPlugin implements Listener {
J.s(() -> {
Metrics m = new Metrics(Iris.instance, 8757);
- m.addCustomChart(new Metrics.SingleLineChart("custom_dimensions", new Callable() {
- @Override
- public Integer call() throws Exception {
- return ProjectManager.countUniqueDimensions();
- }
- }));
+ m.addCustomChart(new Metrics.SingleLineChart("custom_dimensions", ProjectManager::countUniqueDimensions));
- m.addCustomChart(new Metrics.SimplePie("using_custom_dimensions", new Callable() {
- @Override
- public String call() throws Exception {
- return ProjectManager.countUniqueDimensions() > 0 ? "Active Projects" : "No Projects";
- }
- }));
+ m.addCustomChart(new Metrics.SimplePie("using_custom_dimensions", () -> ProjectManager.countUniqueDimensions() > 0 ? "Active Projects" : "No Projects"));
});
}
}
@@ -308,7 +310,7 @@ public class Iris extends VolmitPlugin implements Listener {
@Override
- public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
+ public ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
String dimension = IrisSettings.get().getGenerator().getDefaultWorldType();
if (id != null && !id.isEmpty()) {
diff --git a/src/main/java/com/volmit/iris/IrisSettings.java b/src/main/java/com/volmit/iris/IrisSettings.java
index 24342c048..020c0ef3e 100644
--- a/src/main/java/com/volmit/iris/IrisSettings.java
+++ b/src/main/java/com/volmit/iris/IrisSettings.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris;
import com.google.gson.Gson;
@@ -7,6 +25,7 @@ import lombok.Data;
import java.io.File;
import java.io.IOException;
+@SuppressWarnings("SynchronizeOnNonFinalField")
@Data
public class IrisSettings {
public static transient IrisSettings settings;
@@ -18,13 +37,14 @@ public class IrisSettings {
private IrisSettingsGenerator generator = new IrisSettingsGenerator();
private IrisSettingsStudio studio = new IrisSettingsStudio();
- @DontObfuscate
+
public int configurationVersion = 3;
public boolean isStudio() {
return getStudio().isStudio();
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isUseServerLaunchedGuis() {
return getGui().isUseServerLaunchedGuis();
}
@@ -35,77 +55,77 @@ public class IrisSettings {
@Data
public static class IrisSettingsCache {
- @DontObfuscate
+
public int streamingCacheSize = 8192;
}
@Data
public static class IrisSettingsConcurrency {
- @DontObfuscate
+
public int threadCount = -1;
}
@Data
public static class IrisSettingsParallax {
- @DontObfuscate
+
public int parallaxRegionEvictionMS = 15000;
- @DontObfuscate
+
public int parallaxChunkEvictionMS = 5000;
}
@Data
public static class IrisSettingsGeneral {
- @DontObfuscate
+
public boolean commandSounds = true;
- @DontObfuscate
+
public boolean verbose = false;
- @DontObfuscate
+
public boolean ignoreWorldEdit = false;
- @DontObfuscate
+
public boolean disableNMS = false;
- @DontObfuscate
+
public boolean pluginMetrics = true;
- @DontObfuscate
+
public boolean splashLogoStartup = true;
}
@Data
public static class IrisSettingsGUI {
- @DontObfuscate
+
public boolean useServerLaunchedGuis = true;
- @DontObfuscate
+
public boolean maximumPregenGuiFPS = false;
- @DontObfuscate
+
public boolean localPregenGui = true;
}
@Data
public static class IrisSettingsGenerator {
- @DontObfuscate
+
public String defaultWorldType = "overworld";
- @DontObfuscate
+
public boolean mcaPregenerator = false;
- @DontObfuscate
+
public boolean systemEffects = true;
- @DontObfuscate
+
public boolean systemEntitySpawnOverrides = true;
- @DontObfuscate
+
public boolean systemEntityInitialSpawns = true;
- @DontObfuscate
+
public int maxBiomeChildDepth = 5;
}
@@ -113,13 +133,13 @@ public class IrisSettings {
@Data
public static class IrisSettingsStudio {
- @DontObfuscate
+
public boolean studio = true;
- @DontObfuscate
+
public boolean openVSCode = true;
- @DontObfuscate
+
public boolean disableTimeAndWeather = true;
}
diff --git a/src/main/java/com/volmit/iris/generator/IrisComplex.java b/src/main/java/com/volmit/iris/generator/IrisComplex.java
index 849b4e834..488c485c9 100644
--- a/src/main/java/com/volmit/iris/generator/IrisComplex.java
+++ b/src/main/java/com/volmit/iris/generator/IrisComplex.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.google.common.util.concurrent.AtomicDouble;
@@ -315,6 +333,7 @@ public class IrisComplex implements DataProvider {
return bx.getGenLinkMax(gen.getLoadKey());
} catch (Throwable e) {
+ e.printStackTrace();
Iris.warn("Failed to sample hi biome at " + xx + " " + zz + " using the generator " + gen.getLoadKey());
}
@@ -328,6 +347,7 @@ public class IrisComplex implements DataProvider {
return bx.getGenLinkMin(gen.getLoadKey());
} catch (Throwable e) {
+ e.printStackTrace();
Iris.warn("Failed to sample lo biome at " + xx + " " + zz + " using the generator " + gen.getLoadKey());
}
diff --git a/src/main/java/com/volmit/iris/generator/IrisEngine.java b/src/main/java/com/volmit/iris/generator/IrisEngine.java
index d1327fb19..e04b4773d 100644
--- a/src/main/java/com/volmit/iris/generator/IrisEngine.java
+++ b/src/main/java/com/volmit/iris/generator/IrisEngine.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/generator/IrisEngineCompound.java b/src/main/java/com/volmit/iris/generator/IrisEngineCompound.java
index ebaec7962..9dca2a6d3 100644
--- a/src/main/java/com/volmit/iris/generator/IrisEngineCompound.java
+++ b/src/main/java/com/volmit/iris/generator/IrisEngineCompound.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/generator/IrisEngineEffects.java b/src/main/java/com/volmit/iris/generator/IrisEngineEffects.java
index 34f9d423f..acb00b242 100644
--- a/src/main/java/com/volmit/iris/generator/IrisEngineEffects.java
+++ b/src/main/java/com/volmit/iris/generator/IrisEngineEffects.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.volmit.iris.scaffold.engine.Engine;
diff --git a/src/main/java/com/volmit/iris/generator/IrisEngineFramework.java b/src/main/java/com/volmit/iris/generator/IrisEngineFramework.java
index 45abdf0ed..57f7fad68 100644
--- a/src/main/java/com/volmit/iris/generator/IrisEngineFramework.java
+++ b/src/main/java/com/volmit/iris/generator/IrisEngineFramework.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/generator/IrisEngineParallax.java b/src/main/java/com/volmit/iris/generator/IrisEngineParallax.java
index 71ba8716d..5a534d733 100644
--- a/src/main/java/com/volmit/iris/generator/IrisEngineParallax.java
+++ b/src/main/java/com/volmit/iris/generator/IrisEngineParallax.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.volmit.iris.scaffold.engine.Engine;
diff --git a/src/main/java/com/volmit/iris/generator/IrisWorldManager.java b/src/main/java/com/volmit/iris/generator/IrisWorldManager.java
index 77a229c97..0e4e2107c 100644
--- a/src/main/java/com/volmit/iris/generator/IrisWorldManager.java
+++ b/src/main/java/com/volmit/iris/generator/IrisWorldManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator;
import com.volmit.iris.IrisSettings;
@@ -109,7 +127,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
});
}
});
- } catch (Throwable xe) {
+ } catch (Throwable ignored) {
}
}
diff --git a/src/main/java/com/volmit/iris/generator/actuator/IrisBiomeActuator.java b/src/main/java/com/volmit/iris/generator/actuator/IrisBiomeActuator.java
index 6b1a315c0..7818e1579 100644
--- a/src/main/java/com/volmit/iris/generator/actuator/IrisBiomeActuator.java
+++ b/src/main/java/com/volmit/iris/generator/actuator/IrisBiomeActuator.java
@@ -1,7 +1,26 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.actuator;
import com.volmit.iris.nms.INMS;
import com.volmit.iris.object.IrisBiome;
+import com.volmit.iris.object.IrisBiomeCustom;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedActuator;
import com.volmit.iris.scaffold.hunk.Hunk;
@@ -10,62 +29,74 @@ import com.volmit.iris.scaffold.parallel.BurstExecutor;
import com.volmit.iris.scaffold.parallel.MultiBurst;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
+import com.volmit.iris.util.TerrainChunk;
import org.bukkit.block.Biome;
+import org.bukkit.generator.ChunkGenerator;
public class IrisBiomeActuator extends EngineAssignedActuator {
+ private final RNG rng;
+
public IrisBiomeActuator(Engine engine) {
super(engine, "Biome");
+ rng = new RNG(engine.getWorld().getSeed() + 243995);
+ }
+
+ private boolean injectBiome(Hunk h, int x, int y, int z, Object bb) {
+ try {
+ if (h instanceof BiomeGridHunkView hh) {
+ ChunkGenerator.BiomeGrid g = hh.getChunk();
+ if (g instanceof TerrainChunk) {
+ ((TerrainChunk) g).getBiomeBaseInjector().setBiome(x, y, z, bb);
+ } else {
+ hh.forceBiomeBaseInto(x, y, z, bb);
+ }
+ return true;
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+
+ return false;
}
@Override
public void onActuate(int x, int z, Hunk h) {
PrecisionStopwatch p = PrecisionStopwatch.start();
- int zf, hh;
- BurstExecutor burst = MultiBurst.burst.burst(h.getWidth() * h.getDepth());
+ int zf;
for (int xf = 0; xf < h.getWidth(); xf++) {
for (zf = 0; zf < h.getDepth(); zf++) {
- int xxf = xf;
- int zzf = zf;
- burst.queue(() -> {
- IrisBiome ib = getComplex().getTrueBiomeStream().get(modX(xxf + x), modZ(zzf + z));
+ IrisBiome ib = getComplex().getTrueBiomeStream().get(modX(xf + x), modZ(zf + z));
- if(ib.isCustom())
- {
- try
- {
- Object biomeBase = INMS.get().getCustomBiomeBaseFor(getDimension().getLoadKey()+":"+ib.getCustom().getId());
- ((BiomeGridHunkView)h).forceBiomeBaseInto(x, 0, z, biomeBase);
+ if (ib.isCustom()) {
+ try {
+ IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
+ Object biomeBase = INMS.get().getCustomBiomeBaseFor(getDimension().getLoadKey() + ":" + custom.getId());
- for (int i = 0; i < h.getHeight(); i++) {
- ((BiomeGridHunkView)h).forceBiomeBaseInto(xxf, i, zzf, biomeBase);
- }
+ if (!injectBiome(h, x, 0, z, biomeBase)) {
+ throw new RuntimeException("Cant inject biome!");
}
- catch(Throwable e)
- {
- e.printStackTrace();
- Biome v = ib.getSkyBiome(RNG.r, x, 0, z);
- for (int i = 0; i < h.getHeight(); i++) {
- h.set(xxf, i, zzf, v);
- }
- }
- }
-
- else
- {
- Biome v = ib.getSkyBiome(RNG.r, x, 0, z);
for (int i = 0; i < h.getHeight(); i++) {
- h.set(xxf, i, zzf, v);
+ injectBiome(h, xf, i, zf, biomeBase);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ Biome v = ib.getSkyBiome(rng, x, 0, z);
+ for (int i = 0; i < h.getHeight(); i++) {
+ h.set(xf, i, zf, v);
}
}
- });
+ } else {
+ Biome v = ib.getSkyBiome(rng, x, 0, z);
+ for (int i = 0; i < h.getHeight(); i++) {
+ h.set(xf, i, zf, v);
+ }
+ }
}
}
- burst.complete();
-
getEngine().getMetrics().getBiome().put(p.getMilliseconds());
}
}
diff --git a/src/main/java/com/volmit/iris/generator/actuator/IrisDecorantActuator.java b/src/main/java/com/volmit/iris/generator/actuator/IrisDecorantActuator.java
index 7eb360bfd..7261744ce 100644
--- a/src/main/java/com/volmit/iris/generator/actuator/IrisDecorantActuator.java
+++ b/src/main/java/com/volmit/iris/generator/actuator/IrisDecorantActuator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.actuator;
import com.volmit.iris.generator.decorator.*;
diff --git a/src/main/java/com/volmit/iris/generator/actuator/IrisTerrainActuator.java b/src/main/java/com/volmit/iris/generator/actuator/IrisTerrainActuator.java
index edb19256e..883757f24 100644
--- a/src/main/java/com/volmit/iris/generator/actuator/IrisTerrainActuator.java
+++ b/src/main/java/com/volmit/iris/generator/actuator/IrisTerrainActuator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.actuator;
import com.volmit.iris.object.IrisBiome;
diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java
index b080bdd82..0bc379273 100644
--- a/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java
+++ b/src/main/java/com/volmit/iris/generator/decorator/IrisCeilingDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisEngineDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisEngineDecorator.java
index d8dbd0655..2f37fa5ad 100644
--- a/src/main/java/com/volmit/iris/generator/decorator/IrisEngineDecorator.java
+++ b/src/main/java/com/volmit/iris/generator/decorator/IrisEngineDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.decorator;
import com.volmit.iris.Iris;
@@ -23,7 +41,7 @@ public abstract class IrisEngineDecorator extends EngineAssignedComponent implem
public IrisEngineDecorator(Engine engine, String name, DecorationPart part) {
super(engine, name + " Decorator");
this.part = part;
- this.rng = new RNG(getSeed() + 29356788 - (part.ordinal() * 10439677));
+ this.rng = new RNG(getSeed() + 29356788 - (part.ordinal() * 10439677L));
}
protected IrisDecorator getDecorator(IrisBiome biome, double realX, double realZ) {
diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java
index 480b58ac5..214e45204 100644
--- a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java
+++ b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaFloorDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java
index 2400a7608..91b346ebb 100644
--- a/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java
+++ b/src/main/java/com/volmit/iris/generator/decorator/IrisSeaSurfaceDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java
index 4476dbac9..af1125dff 100644
--- a/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java
+++ b/src/main/java/com/volmit/iris/generator/decorator/IrisShoreLineDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
diff --git a/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java b/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java
index 97d121227..f6ec108d4 100644
--- a/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java
+++ b/src/main/java/com/volmit/iris/generator/decorator/IrisSurfaceDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
@@ -41,7 +59,7 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
((Bisected) bd).setHalf(Bisected.Half.TOP);
try {
data.set(x, height + 2, z, bd);
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
bd = bd.clone();
diff --git a/src/main/java/com/volmit/iris/generator/modifier/IrisCaveModifier.java b/src/main/java/com/volmit/iris/generator/modifier/IrisCaveModifier.java
index 076cc9af4..676bf86c3 100644
--- a/src/main/java/com/volmit/iris/generator/modifier/IrisCaveModifier.java
+++ b/src/main/java/com/volmit/iris/generator/modifier/IrisCaveModifier.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.modifier;
import com.volmit.iris.generator.noise.FastNoiseDouble;
diff --git a/src/main/java/com/volmit/iris/generator/modifier/IrisDepositModifier.java b/src/main/java/com/volmit/iris/generator/modifier/IrisDepositModifier.java
index 607a03565..4977bbd4d 100644
--- a/src/main/java/com/volmit/iris/generator/modifier/IrisDepositModifier.java
+++ b/src/main/java/com/volmit/iris/generator/modifier/IrisDepositModifier.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.modifier;
import com.volmit.iris.object.IrisBiome;
diff --git a/src/main/java/com/volmit/iris/generator/modifier/IrisPostModifier.java b/src/main/java/com/volmit/iris/generator/modifier/IrisPostModifier.java
index 5674da8c5..a54d7db89 100644
--- a/src/main/java/com/volmit/iris/generator/modifier/IrisPostModifier.java
+++ b/src/main/java/com/volmit/iris/generator/modifier/IrisPostModifier.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.modifier;
import com.volmit.iris.object.IrisBiome;
@@ -42,6 +60,7 @@ public class IrisPostModifier extends EngineAssignedModifier {
getEngine().getMetrics().getPost().put(p.getMilliseconds());
}
+ @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter")
private void post(int currentPostX, int currentPostZ, Hunk currentData, int x, int z) {
int h = getFramework().getEngineParallax().trueHeight(x, z);
@@ -322,9 +341,22 @@ public class IrisPostModifier extends EngineAssignedModifier {
}
if (!cancel && isAirOrWater(x, c, z, currentPostX, currentPostZ, currentData)) {
- Slab slab = (Slab) d.clone();
- slab.setType(Slab.Type.TOP);
- setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
+ try {
+ Slab slab = (Slab) d.clone();
+ slab.setType(Slab.Type.TOP);
+ setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
+ } catch (Throwable ignored) {
+ try {
+ Slab slab = (Slab) d.clone();
+
+ synchronized (slab) {
+ slab.setType(Slab.Type.TOP);
+ setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
+ }
+ } catch (Throwable ignored2) {
+
+ }
+ }
}
}
}
diff --git a/src/main/java/com/volmit/iris/generator/modifier/IrisRavineModifier.java b/src/main/java/com/volmit/iris/generator/modifier/IrisRavineModifier.java
index 166e3b4d7..9ebe280d3 100644
--- a/src/main/java/com/volmit/iris/generator/modifier/IrisRavineModifier.java
+++ b/src/main/java/com/volmit/iris/generator/modifier/IrisRavineModifier.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.modifier;
import com.volmit.iris.generator.noise.CNG;
@@ -9,6 +27,7 @@ import com.volmit.iris.util.*;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
+@SuppressWarnings("ALL")
public class IrisRavineModifier extends EngineAssignedModifier {
private static final BlockData CAVE_AIR = B.get("CAVE_AIR");
private static final BlockData LAVA = B.get("LAVA");
@@ -52,7 +71,7 @@ public class IrisRavineModifier extends EngineAssignedModifier {
private final float[] ravineCache = new float[1024];
- private void doRavine(long seed, int tx, int tz, ChunkPosition pos, double sx, double sy, double sz, float f, float f2, float f3, int n3, int n4, double d4, RNG bbx, Hunk terrain) {
+ private void doRavine(long seed, int tx, int tz, ChunkPosition pos, double sx, double sy, double sz, float f, float f2, float f3, @SuppressWarnings("SameParameterValue") int n3, @SuppressWarnings("SameParameterValue") int n4, @SuppressWarnings("SameParameterValue") double d4, RNG bbx, Hunk terrain) {
int n5;
RNG random = new RNG(seed);
double x = tx * 16 + 8;
@@ -196,7 +215,7 @@ public class IrisRavineModifier extends EngineAssignedModifier {
}
}
- private BlockPosition cSet(BlockPosition bb, double var0, double var2, double var4) {
+ private BlockPosition cSet(BlockPosition bb, double var0, @SuppressWarnings("SameParameterValue") double var2, double var4) {
bb.setX(MathHelper.floor(var0));
bb.setY(MathHelper.floor(var2));
bb.setZ(MathHelper.floor(var4));
diff --git a/src/main/java/com/volmit/iris/generator/noise/CNG.java b/src/main/java/com/volmit/iris/generator/noise/CNG.java
index f88c2a108..521b46700 100644
--- a/src/main/java/com/volmit/iris/generator/noise/CNG.java
+++ b/src/main/java/com/volmit/iris/generator/noise/CNG.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.scaffold.stream.ProceduralStream;
@@ -48,7 +66,7 @@ public class CNG {
}
public ProceduralStream stream(double min, double max) {
- return new FittedStream(stream(), min, max);
+ return new FittedStream<>(stream(), min, max);
}
public static CNG signature(RNG rng) {
@@ -286,7 +304,7 @@ public class CNG {
try {
return v.get(fit(0, v.size() - 1, dim));
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
diff --git a/src/main/java/com/volmit/iris/generator/noise/CNGFactory.java b/src/main/java/com/volmit/iris/generator/noise/CNGFactory.java
index 4f2eca08a..a4394d65a 100644
--- a/src/main/java/com/volmit/iris/generator/noise/CNGFactory.java
+++ b/src/main/java/com/volmit/iris/generator/noise/CNGFactory.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/CellGenerator.java b/src/main/java/com/volmit/iris/generator/noise/CellGenerator.java
index 2265c551c..3ba9bd7d0 100644
--- a/src/main/java/com/volmit/iris/generator/noise/CellGenerator.java
+++ b/src/main/java/com/volmit/iris/generator/noise/CellGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/CellHeightNoise.java b/src/main/java/com/volmit/iris/generator/noise/CellHeightNoise.java
index ec7565b21..0ff84cd96 100644
--- a/src/main/java/com/volmit/iris/generator/noise/CellHeightNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/CellHeightNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.M;
diff --git a/src/main/java/com/volmit/iris/generator/noise/CellularNoise.java b/src/main/java/com/volmit/iris/generator/noise/CellularNoise.java
index ee8fab770..00e4b1020 100644
--- a/src/main/java/com/volmit/iris/generator/noise/CellularNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/CellularNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/CubicNoise.java b/src/main/java/com/volmit/iris/generator/noise/CubicNoise.java
index a34b69081..1936c743b 100644
--- a/src/main/java/com/volmit/iris/generator/noise/CubicNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/CubicNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/FastNoise.java b/src/main/java/com/volmit/iris/generator/noise/FastNoise.java
index dcffbf8e5..fc445510c 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FastNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FastNoise.java
@@ -1,30 +1,20 @@
-// FastNoise.java
-//
-// MIT License
-//
-// Copyright(c) 2017 Jordan Peck
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files(the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions :
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-//
-// The developer's email is jorzixdan.me2@gzixmail.com (for great email, take
-// off every 'zix'.)
-//
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
package com.volmit.iris.generator.noise;
diff --git a/src/main/java/com/volmit/iris/generator/noise/FastNoiseDouble.java b/src/main/java/com/volmit/iris/generator/noise/FastNoiseDouble.java
index 8ec4ab5d6..932edf732 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FastNoiseDouble.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FastNoiseDouble.java
@@ -1,30 +1,20 @@
-// FastNoise.java
-//
-// MIT License
-//
-// Copyright(c) 2017 Jordan Peck
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files(the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions :
-//
-// The above copyright notice and this permission notice shall be included in all
-// copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-// SOFTWARE.
-//
-// The developer's email is jorzixdan.me2@gzixmail.com (for great email, take
-// off every 'zix'.)
-//
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.Vector2f;
@@ -193,6 +183,7 @@ public class FastNoiseDouble {
m_gradientPerturbAmp = gradientPerturbAmp / 0.45;
}
+ @SuppressWarnings("ClassCanBeRecord")
private static class Double2 {
public final double x, y;
@@ -202,6 +193,7 @@ public class FastNoiseDouble {
}
}
+ @SuppressWarnings("ClassCanBeRecord")
private static class Double3 {
public final double x, y, z;
@@ -368,21 +360,21 @@ public class FastNoiseDouble {
hash &= 31;
double a = yd, b = zd, c = wd; // X,Y,Z
switch ((int) hash >> 3) { // OR, DEPENDING ON HIGH ORDER 2 BITS:
- case 1:
+ case 1 -> {
a = wd;
b = xd;
c = yd;
- break; // W,X,Y
- case 2:
+ } // W,X,Y
+ case 2 -> {
a = zd;
b = wd;
c = xd;
- break; // Z,W,X
- case 3:
+ } // Z,W,X
+ case 3 -> {
a = yd;
b = zd;
c = wd;
- break; // Y,Z,W
+ } // Y,Z,W
}
return ((hash & 4) == 0 ? -a : a) + ((hash & 2) == 0 ? -b : b) + ((hash & 1) == 0 ? -c : c);
}
@@ -396,66 +388,42 @@ public class FastNoiseDouble {
case Value:
return SingleValue(m_seed, x, y, z);
case ValueFractal:
- switch (m_fractalType) {
- case FBM:
- return SingleValueFractalFBM(x, y, z);
- case Billow:
- return SingleValueFractalBillow(x, y, z);
- case RigidMulti:
- return SingleValueFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleValueFractalFBM(x, y, z);
+ case Billow -> SingleValueFractalBillow(x, y, z);
+ case RigidMulti -> SingleValueFractalRigidMulti(x, y, z);
+ };
case Perlin:
return SinglePerlin(m_seed, x, y, z);
case PerlinFractal:
- switch (m_fractalType) {
- case FBM:
- return SinglePerlinFractalFBM(x, y, z);
- case Billow:
- return SinglePerlinFractalBillow(x, y, z);
- case RigidMulti:
- return SinglePerlinFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SinglePerlinFractalFBM(x, y, z);
+ case Billow -> SinglePerlinFractalBillow(x, y, z);
+ case RigidMulti -> SinglePerlinFractalRigidMulti(x, y, z);
+ };
case Simplex:
return SingleSimplex(m_seed, x, y, z);
case SimplexFractal:
- switch (m_fractalType) {
- case FBM:
- return SingleSimplexFractalFBM(x, y, z);
- case Billow:
- return SingleSimplexFractalBillow(x, y, z);
- case RigidMulti:
- return SingleSimplexFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleSimplexFractalFBM(x, y, z);
+ case Billow -> SingleSimplexFractalBillow(x, y, z);
+ case RigidMulti -> SingleSimplexFractalRigidMulti(x, y, z);
+ };
case Cellular:
- switch (m_cellularReturnType) {
- case CellValue:
- case NoiseLookup:
- case Distance:
- return SingleCellular(x, y, z);
- default:
- return SingleCellular2Edge(x, y, z);
- }
+ return switch (m_cellularReturnType) {
+ case CellValue, NoiseLookup, Distance -> SingleCellular(x, y, z);
+ default -> SingleCellular2Edge(x, y, z);
+ };
case WhiteNoise:
return GetWhiteNoise(x, y, z);
case Cubic:
return SingleCubic(m_seed, x, y, z);
case CubicFractal:
- switch (m_fractalType) {
- case FBM:
- return SingleCubicFractalFBM(x, y, z);
- case Billow:
- return SingleCubicFractalBillow(x, y, z);
- case RigidMulti:
- return SingleCubicFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleCubicFractalFBM(x, y, z);
+ case Billow -> SingleCubicFractalBillow(x, y, z);
+ case RigidMulti -> SingleCubicFractalRigidMulti(x, y, z);
+ };
default:
return 0;
}
@@ -469,66 +437,42 @@ public class FastNoiseDouble {
case Value:
return SingleValue(m_seed, x, y);
case ValueFractal:
- switch (m_fractalType) {
- case FBM:
- return SingleValueFractalFBM(x, y);
- case Billow:
- return SingleValueFractalBillow(x, y);
- case RigidMulti:
- return SingleValueFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleValueFractalFBM(x, y);
+ case Billow -> SingleValueFractalBillow(x, y);
+ case RigidMulti -> SingleValueFractalRigidMulti(x, y);
+ };
case Perlin:
return SinglePerlin(m_seed, x, y);
case PerlinFractal:
- switch (m_fractalType) {
- case FBM:
- return SinglePerlinFractalFBM(x, y);
- case Billow:
- return SinglePerlinFractalBillow(x, y);
- case RigidMulti:
- return SinglePerlinFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SinglePerlinFractalFBM(x, y);
+ case Billow -> SinglePerlinFractalBillow(x, y);
+ case RigidMulti -> SinglePerlinFractalRigidMulti(x, y);
+ };
case Simplex:
return SingleSimplex(m_seed, x, y);
case SimplexFractal:
- switch (m_fractalType) {
- case FBM:
- return SingleSimplexFractalFBM(x, y);
- case Billow:
- return SingleSimplexFractalBillow(x, y);
- case RigidMulti:
- return SingleSimplexFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleSimplexFractalFBM(x, y);
+ case Billow -> SingleSimplexFractalBillow(x, y);
+ case RigidMulti -> SingleSimplexFractalRigidMulti(x, y);
+ };
case Cellular:
- switch (m_cellularReturnType) {
- case CellValue:
- case NoiseLookup:
- case Distance:
- return SingleCellular(x, y);
- default:
- return SingleCellular2Edge(x, y);
- }
+ return switch (m_cellularReturnType) {
+ case CellValue, NoiseLookup, Distance -> SingleCellular(x, y);
+ default -> SingleCellular2Edge(x, y);
+ };
case WhiteNoise:
return GetWhiteNoise(x, y);
case Cubic:
return SingleCubic(m_seed, x, y);
case CubicFractal:
- switch (m_fractalType) {
- case FBM:
- return SingleCubicFractalFBM(x, y);
- case Billow:
- return SingleCubicFractalBillow(x, y);
- case RigidMulti:
- return SingleCubicFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleCubicFractalFBM(x, y);
+ case Billow -> SingleCubicFractalBillow(x, y);
+ case RigidMulti -> SingleCubicFractalRigidMulti(x, y);
+ };
default:
return 0;
}
@@ -584,16 +528,11 @@ public class FastNoiseDouble {
y *= m_frequency;
z *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SingleValueFractalFBM(x, y, z);
- case Billow:
- return SingleValueFractalBillow(x, y, z);
- case RigidMulti:
- return SingleValueFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleValueFractalFBM(x, y, z);
+ case Billow -> SingleValueFractalBillow(x, y, z);
+ case RigidMulti -> SingleValueFractalRigidMulti(x, y, z);
+ };
}
private double SingleValueFractalFBM(double x, double y, double z) {
@@ -659,24 +598,23 @@ public class FastNoiseDouble {
long y1 = y0 + 1;
long z1 = z0 + 1;
- double xs, ys, zs;
+ double xs=0, ys=0, zs=0;
switch (m_longerp) {
- default:
- case Linear:
+ case Linear -> {
xs = x - x0;
ys = y - y0;
zs = z - z0;
- break;
- case Hermite:
+ }
+ case Hermite -> {
xs = longerpHermiteFunc(x - x0);
ys = longerpHermiteFunc(y - y0);
zs = longerpHermiteFunc(z - z0);
- break;
- case Qulongic:
+ }
+ case Qulongic -> {
xs = longerpQulongicFunc(x - x0);
ys = longerpQulongicFunc(y - y0);
zs = longerpQulongicFunc(z - z0);
- break;
+ }
}
double xf00 = lerp(valCoord3D(seed, x0, y0, z0), valCoord3D(seed, x1, y0, z0), xs);
@@ -694,16 +632,11 @@ public class FastNoiseDouble {
x *= m_frequency;
y *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SingleValueFractalFBM(x, y);
- case Billow:
- return SingleValueFractalBillow(x, y);
- case RigidMulti:
- return SingleValueFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleValueFractalFBM(x, y);
+ case Billow -> SingleValueFractalBillow(x, y);
+ case RigidMulti -> SingleValueFractalRigidMulti(x, y);
+ };
}
private double SingleValueFractalFBM(double x, double y) {
@@ -763,21 +696,20 @@ public class FastNoiseDouble {
long x1 = x0 + 1;
long y1 = y0 + 1;
- double xs, ys;
+ double xs=0, ys=0;
switch (m_longerp) {
- default:
- case Linear:
+ case Linear -> {
xs = x - x0;
ys = y - y0;
- break;
- case Hermite:
+ }
+ case Hermite -> {
xs = longerpHermiteFunc(x - x0);
ys = longerpHermiteFunc(y - y0);
- break;
- case Qulongic:
+ }
+ case Qulongic -> {
xs = longerpQulongicFunc(x - x0);
ys = longerpQulongicFunc(y - y0);
- break;
+ }
}
double xf0 = lerp(valCoord2D(seed, x0, y0), valCoord2D(seed, x1, y0), xs);
@@ -792,16 +724,11 @@ public class FastNoiseDouble {
y *= m_frequency;
z *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SinglePerlinFractalFBM(x, y, z);
- case Billow:
- return SinglePerlinFractalBillow(x, y, z);
- case RigidMulti:
- return SinglePerlinFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SinglePerlinFractalFBM(x, y, z);
+ case Billow -> SinglePerlinFractalBillow(x, y, z);
+ case RigidMulti -> SinglePerlinFractalRigidMulti(x, y, z);
+ };
}
private double SinglePerlinFractalFBM(double x, double y, double z) {
@@ -867,24 +794,23 @@ public class FastNoiseDouble {
long y1 = y0 + 1;
long z1 = z0 + 1;
- double xs, ys, zs;
+ double xs=0, ys=0, zs=0;
switch (m_longerp) {
- default:
- case Linear:
+ case Linear -> {
xs = x - x0;
ys = y - y0;
zs = z - z0;
- break;
- case Hermite:
+ }
+ case Hermite -> {
xs = longerpHermiteFunc(x - x0);
ys = longerpHermiteFunc(y - y0);
zs = longerpHermiteFunc(z - z0);
- break;
- case Qulongic:
+ }
+ case Qulongic -> {
xs = longerpQulongicFunc(x - x0);
ys = longerpQulongicFunc(y - y0);
zs = longerpQulongicFunc(z - z0);
- break;
+ }
}
double xd0 = x - x0;
@@ -909,16 +835,11 @@ public class FastNoiseDouble {
x *= m_frequency;
y *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SinglePerlinFractalFBM(x, y);
- case Billow:
- return SinglePerlinFractalBillow(x, y);
- case RigidMulti:
- return SinglePerlinFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SinglePerlinFractalFBM(x, y);
+ case Billow -> SinglePerlinFractalBillow(x, y);
+ case RigidMulti -> SinglePerlinFractalRigidMulti(x, y);
+ };
}
private double SinglePerlinFractalFBM(double x, double y) {
@@ -1012,16 +933,11 @@ public class FastNoiseDouble {
y *= m_frequency;
z *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SingleSimplexFractalFBM(x, y, z);
- case Billow:
- return SingleSimplexFractalBillow(x, y, z);
- case RigidMulti:
- return SingleSimplexFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleSimplexFractalFBM(x, y, z);
+ case Billow -> SingleSimplexFractalBillow(x, y, z);
+ case RigidMulti -> SingleSimplexFractalRigidMulti(x, y, z);
+ };
}
private double SingleSimplexFractalFBM(double x, double y, double z) {
@@ -1199,16 +1115,11 @@ public class FastNoiseDouble {
x *= m_frequency;
y *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SingleSimplexFractalFBM(x, y);
- case Billow:
- return SingleSimplexFractalBillow(x, y);
- case RigidMulti:
- return SingleSimplexFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleSimplexFractalFBM(x, y);
+ case Billow -> SingleSimplexFractalBillow(x, y);
+ case RigidMulti -> SingleSimplexFractalRigidMulti(x, y);
+ };
}
private double SingleSimplexFractalFBM(double x, double y) {
@@ -1431,16 +1342,11 @@ public class FastNoiseDouble {
y *= m_frequency;
z *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SingleCubicFractalFBM(x, y, z);
- case Billow:
- return SingleCubicFractalBillow(x, y, z);
- case RigidMulti:
- return SingleCubicFractalRigidMulti(x, y, z);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleCubicFractalFBM(x, y, z);
+ case Billow -> SingleCubicFractalBillow(x, y, z);
+ case RigidMulti -> SingleCubicFractalRigidMulti(x, y, z);
+ };
}
private double SingleCubicFractalFBM(double x, double y, double z) {
@@ -1529,16 +1435,11 @@ public class FastNoiseDouble {
x *= m_frequency;
y *= m_frequency;
- switch (m_fractalType) {
- case FBM:
- return SingleCubicFractalFBM(x, y);
- case Billow:
- return SingleCubicFractalBillow(x, y);
- case RigidMulti:
- return SingleCubicFractalRigidMulti(x, y);
- default:
- return 0;
- }
+ return switch (m_fractalType) {
+ case FBM -> SingleCubicFractalFBM(x, y);
+ case Billow -> SingleCubicFractalBillow(x, y);
+ case RigidMulti -> SingleCubicFractalRigidMulti(x, y);
+ };
}
private double SingleCubicFractalFBM(double x, double y) {
@@ -1624,14 +1525,10 @@ public class FastNoiseDouble {
y *= m_frequency;
z *= m_frequency;
- switch (m_cellularReturnType) {
- case CellValue:
- case NoiseLookup:
- case Distance:
- return SingleCellular(x, y, z);
- default:
- return SingleCellular2Edge(x, y, z);
- }
+ return switch (m_cellularReturnType) {
+ case CellValue, NoiseLookup, Distance -> SingleCellular(x, y, z);
+ default -> SingleCellular2Edge(x, y, z);
+ };
}
private double SingleCellular(double x, double y, double z) {
@@ -1793,34 +1690,24 @@ public class FastNoiseDouble {
break;
}
- switch (m_cellularReturnType) {
- case Distance2:
- return distance2 - 1;
- case Distance2Add:
- return distance2 + distance - 1;
- case Distance2Sub:
- return distance2 - distance - 1;
- case Distance2Mul:
- return distance2 * distance - 1;
- case Distance2Div:
- return distance / distance2 - 1;
- default:
- return 0;
- }
+ return switch (m_cellularReturnType) {
+ case Distance2 -> distance2 - 1;
+ case Distance2Add -> distance2 + distance - 1;
+ case Distance2Sub -> distance2 - distance - 1;
+ case Distance2Mul -> distance2 * distance - 1;
+ case Distance2Div -> distance / distance2 - 1;
+ default -> 0;
+ };
}
public double GetCellular(double x, double y) {
x *= m_frequency;
y *= m_frequency;
- switch (m_cellularReturnType) {
- case CellValue:
- case NoiseLookup:
- case Distance:
- return SingleCellular(x, y);
- default:
- return SingleCellular2Edge(x, y);
- }
+ return switch (m_cellularReturnType) {
+ case CellValue, NoiseLookup, Distance -> SingleCellular(x, y);
+ default -> SingleCellular2Edge(x, y);
+ };
}
private double SingleCellular(double x, double y) {
@@ -1959,20 +1846,14 @@ public class FastNoiseDouble {
break;
}
- switch (m_cellularReturnType) {
- case Distance2:
- return distance2 - 1;
- case Distance2Add:
- return distance2 + distance - 1;
- case Distance2Sub:
- return distance2 - distance - 1;
- case Distance2Mul:
- return distance2 * distance - 1;
- case Distance2Div:
- return distance / distance2 - 1;
- default:
- return 0;
- }
+ return switch (m_cellularReturnType) {
+ case Distance2 -> distance2 - 1;
+ case Distance2Add -> distance2 + distance - 1;
+ case Distance2Sub -> distance2 - distance - 1;
+ case Distance2Mul -> distance2 * distance - 1;
+ case Distance2Div -> distance / distance2 - 1;
+ default -> 0;
+ };
}
public void GradientPerturb(Vector3f v3) {
@@ -2005,24 +1886,23 @@ public class FastNoiseDouble {
long y1 = y0 + 1;
long z1 = z0 + 1;
- double xs, ys, zs;
+ double xs=0, ys=0, zs=0;
switch (m_longerp) {
- default:
- case Linear:
+ case Linear -> {
xs = xf - x0;
ys = yf - y0;
zs = zf - z0;
- break;
- case Hermite:
+ }
+ case Hermite -> {
xs = longerpHermiteFunc(xf - x0);
ys = longerpHermiteFunc(yf - y0);
zs = longerpHermiteFunc(zf - z0);
- break;
- case Qulongic:
+ }
+ case Qulongic -> {
xs = longerpQulongicFunc(xf - x0);
ys = longerpQulongicFunc(yf - y0);
zs = longerpQulongicFunc(zf - z0);
- break;
+ }
}
Double3 vec0 = CELL_3D[(int) hash3D(seed, x0, y0, z0) & 255];
@@ -2089,21 +1969,20 @@ public class FastNoiseDouble {
long x1 = x0 + 1;
long y1 = y0 + 1;
- double xs, ys;
+ double xs=0, ys=0;
switch (m_longerp) {
- default:
- case Linear:
+ case Linear -> {
xs = xf - x0;
ys = yf - y0;
- break;
- case Hermite:
+ }
+ case Hermite -> {
xs = longerpHermiteFunc(xf - x0);
ys = longerpHermiteFunc(yf - y0);
- break;
- case Qulongic:
+ }
+ case Qulongic -> {
xs = longerpQulongicFunc(xf - x0);
ys = longerpQulongicFunc(yf - y0);
- break;
+ }
}
Double2 vec0 = CELL_2D[(int) hash2D(seed, x0, y0) & 255];
diff --git a/src/main/java/com/volmit/iris/generator/noise/FlatNoise.java b/src/main/java/com/volmit/iris/generator/noise/FlatNoise.java
index 897dfd34d..8c2944106 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FlatNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FlatNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
public class FlatNoise implements NoiseGenerator {
diff --git a/src/main/java/com/volmit/iris/generator/noise/FractalBillowPerlinNoise.java b/src/main/java/com/volmit/iris/generator/noise/FractalBillowPerlinNoise.java
index f1a19f539..104253f51 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FractalBillowPerlinNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FractalBillowPerlinNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
diff --git a/src/main/java/com/volmit/iris/generator/noise/FractalBillowSimplexNoise.java b/src/main/java/com/volmit/iris/generator/noise/FractalBillowSimplexNoise.java
index 03207afd5..e5b54553d 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FractalBillowSimplexNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FractalBillowSimplexNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
diff --git a/src/main/java/com/volmit/iris/generator/noise/FractalCubicNoise.java b/src/main/java/com/volmit/iris/generator/noise/FractalCubicNoise.java
index c87be8070..ed0abff2f 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FractalCubicNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FractalCubicNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
diff --git a/src/main/java/com/volmit/iris/generator/noise/FractalFBMSimplexNoise.java b/src/main/java/com/volmit/iris/generator/noise/FractalFBMSimplexNoise.java
index 4789e4f8c..b6d6d9e52 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FractalFBMSimplexNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FractalFBMSimplexNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
diff --git a/src/main/java/com/volmit/iris/generator/noise/FractalRigidMultiSimplexNoise.java b/src/main/java/com/volmit/iris/generator/noise/FractalRigidMultiSimplexNoise.java
index 40ec8d270..df5fed649 100644
--- a/src/main/java/com/volmit/iris/generator/noise/FractalRigidMultiSimplexNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/FractalRigidMultiSimplexNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
diff --git a/src/main/java/com/volmit/iris/generator/noise/GlobNoise.java b/src/main/java/com/volmit/iris/generator/noise/GlobNoise.java
index 938c352a8..d51b33dbe 100644
--- a/src/main/java/com/volmit/iris/generator/noise/GlobNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/GlobNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/NoiseFactory.java b/src/main/java/com/volmit/iris/generator/noise/NoiseFactory.java
index bbe56e338..22a50d96d 100644
--- a/src/main/java/com/volmit/iris/generator/noise/NoiseFactory.java
+++ b/src/main/java/com/volmit/iris/generator/noise/NoiseFactory.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
@FunctionalInterface
diff --git a/src/main/java/com/volmit/iris/generator/noise/NoiseGenerator.java b/src/main/java/com/volmit/iris/generator/noise/NoiseGenerator.java
index 9a88c4ac0..2269bb0bb 100644
--- a/src/main/java/com/volmit/iris/generator/noise/NoiseGenerator.java
+++ b/src/main/java/com/volmit/iris/generator/noise/NoiseGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
public interface NoiseGenerator {
diff --git a/src/main/java/com/volmit/iris/generator/noise/NoiseType.java b/src/main/java/com/volmit/iris/generator/noise/NoiseType.java
index a986c1b3e..9ad1c4fdd 100644
--- a/src/main/java/com/volmit/iris/generator/noise/NoiseType.java
+++ b/src/main/java/com/volmit/iris/generator/noise/NoiseType.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
public enum NoiseType {
diff --git a/src/main/java/com/volmit/iris/generator/noise/OctaveNoise.java b/src/main/java/com/volmit/iris/generator/noise/OctaveNoise.java
index aa77f8db4..5af655c76 100644
--- a/src/main/java/com/volmit/iris/generator/noise/OctaveNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/OctaveNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
public interface OctaveNoise {
diff --git a/src/main/java/com/volmit/iris/generator/noise/PerlinNoise.java b/src/main/java/com/volmit/iris/generator/noise/PerlinNoise.java
index a26baefb7..97fd1f69f 100644
--- a/src/main/java/com/volmit/iris/generator/noise/PerlinNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/PerlinNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/RarityCellGenerator.java b/src/main/java/com/volmit/iris/generator/noise/RarityCellGenerator.java
index 32f2f1e35..d4ba1084b 100644
--- a/src/main/java/com/volmit/iris/generator/noise/RarityCellGenerator.java
+++ b/src/main/java/com/volmit/iris/generator/noise/RarityCellGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.IRare;
diff --git a/src/main/java/com/volmit/iris/generator/noise/SimplexNoise.java b/src/main/java/com/volmit/iris/generator/noise/SimplexNoise.java
index 8ee42e2be..e1ee1d1cd 100644
--- a/src/main/java/com/volmit/iris/generator/noise/SimplexNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/SimplexNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/generator/noise/VascularNoise.java b/src/main/java/com/volmit/iris/generator/noise/VascularNoise.java
index a78188baa..e069e44d0 100644
--- a/src/main/java/com/volmit/iris/generator/noise/VascularNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/VascularNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.M;
diff --git a/src/main/java/com/volmit/iris/generator/noise/WhiteNoise.java b/src/main/java/com/volmit/iris/generator/noise/WhiteNoise.java
index 8081501a7..67689f77b 100644
--- a/src/main/java/com/volmit/iris/generator/noise/WhiteNoise.java
+++ b/src/main/java/com/volmit/iris/generator/noise/WhiteNoise.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
diff --git a/src/main/java/com/volmit/iris/manager/ConversionManager.java b/src/main/java/com/volmit/iris/manager/ConversionManager.java
index 95d622e0c..f08c02d19 100644
--- a/src/main/java/com/volmit/iris/manager/ConversionManager.java
+++ b/src/main/java/com/volmit/iris/manager/ConversionManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.google.gson.Gson;
@@ -28,46 +46,44 @@ public class ConversionManager {
converters = new KList<>();
J.s(() ->
- {
- J.attemptAsync(() ->
- {
- if (Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
- converters.add(new Converter() {
- @Override
- public String getOutExtension() {
- return "iob";
- }
+ J.attemptAsync(() ->
+ {
+ if (Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
+ converters.add(new Converter() {
+ @Override
+ public String getOutExtension() {
+ return "iob";
+ }
- @Override
- public String getInExtension() {
- return "schem";
- }
+ @Override
+ public String getInExtension() {
+ return "schem";
+ }
- @Override
- public void convert(File in, File out) {
- SKConversion.convertSchematic(in, out);
- }
- });
+ @Override
+ public void convert(File in, File out) {
+ SKConversion.convertSchematic(in, out);
+ }
+ });
- converters.add(new Converter() {
- @Override
- public String getOutExtension() {
- return "iob";
- }
+ converters.add(new Converter() {
+ @Override
+ public String getOutExtension() {
+ return "iob";
+ }
- @Override
- public String getInExtension() {
- return "schematic";
- }
+ @Override
+ public String getInExtension() {
+ return "schematic";
+ }
- @Override
- public void convert(File in, File out) {
- SKConversion.convertSchematic(in, out);
- }
- });
- }
- });
- }, 5);
+ @Override
+ public void convert(File in, File out) {
+ SKConversion.convertSchematic(in, out);
+ }
+ });
+ }
+ }), 5);
}
private String toPoolName(String poolReference) {
@@ -118,22 +134,22 @@ public class ConversionManager {
if (compound.containsKey("blocks") && compound.containsKey("palette") && compound.containsKey("size")) {
String id = in.toURI().relativize(folder.toURI()).getPath() + file.getName().split("\\Q.\\E")[0];
- ListTag size = (ListTag) compound.getListTag("size");
+ @SuppressWarnings("unchecked") ListTag size = (ListTag) compound.getListTag("size");
int w = size.get(0).asInt();
int h = size.get(1).asInt();
int d = size.get(2).asInt();
KList palette = new KList<>();
- ListTag paletteList = (ListTag) compound.getListTag("palette");
+ @SuppressWarnings("unchecked") ListTag paletteList = (ListTag) compound.getListTag("palette");
for (int i = 0; i < paletteList.size(); i++) {
CompoundTag cp = paletteList.get(i);
palette.add(DirectWorldWriter.getBlockData(cp));
}
IrisJigsawPiece piece = new IrisJigsawPiece();
IrisObject object = new IrisObject(w, h, d);
- ListTag blockList = (ListTag) compound.getListTag("blocks");
+ @SuppressWarnings("unchecked") ListTag blockList = (ListTag) compound.getListTag("blocks");
for (int i = 0; i < blockList.size(); i++) {
CompoundTag cp = blockList.get(i);
- ListTag pos = (ListTag) cp.getListTag("pos");
+ @SuppressWarnings("unchecked") ListTag pos = (ListTag) cp.getListTag("pos");
int x = pos.get(0).asInt();
int y = pos.get(1).asInt();
int z = pos.get(2).asInt();
diff --git a/src/main/java/com/volmit/iris/manager/EditManager.java b/src/main/java/com/volmit/iris/manager/EditManager.java
index 460e116d0..1bbb37321 100644
--- a/src/main/java/com/volmit/iris/manager/EditManager.java
+++ b/src/main/java/com/volmit/iris/manager/EditManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/IrisBoardManager.java b/src/main/java/com/volmit/iris/manager/IrisBoardManager.java
index a591fd322..2c42115ec 100644
--- a/src/main/java/com/volmit/iris/manager/IrisBoardManager.java
+++ b/src/main/java/com/volmit/iris/manager/IrisBoardManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
@@ -14,14 +32,14 @@ import org.bukkit.event.player.PlayerChangedWorldEvent;
import java.util.List;
public class IrisBoardManager implements BoardProvider, Listener {
- @DontObfuscate
+
private final BoardManager manager;
private String mem = "...";
- public RollingSequence hits = new RollingSequence(20);
- public RollingSequence tp = new RollingSequence(100);
+ public final RollingSequence hits = new RollingSequence(20);
+ public final RollingSequence tp = new RollingSequence(100);
private final ChronoLatch cl = new ChronoLatch(1000);
- @DontObfuscate
+
public IrisBoardManager() {
Iris.instance.registerListener(this);
//@builder
@@ -37,7 +55,7 @@ public class IrisBoardManager implements BoardProvider, Listener {
J.s(() -> updatePlayer(e.getPlayer()));
}
- @DontObfuscate
+
private boolean isIrisWorld(World w) {
return IrisWorlds.isIrisWorld(w) && IrisWorlds.access(w).isStudio();
}
@@ -56,7 +74,7 @@ public class IrisBoardManager implements BoardProvider, Listener {
return C.GREEN + "Iris";
}
- @DontObfuscate
+
@Override
public List getLines(Player player) {
KList v = new KList<>();
@@ -87,9 +105,9 @@ public class IrisBoardManager implements BoardProvider, Listener {
parallaxRegions += g.getCompound().getEngine(i).getParallax().getRegionCount();
parallaxChunks += g.getCompound().getEngine(i).getParallax().getChunkCount();
loadedObjects += g.getCompound().getData().getObjectLoader().getSize();
- memoryGuess += g.getCompound().getData().getObjectLoader().getTotalStorage() * 225;
- memoryGuess += parallaxChunks * 3500;
- memoryGuess += parallaxRegions * 1700000;
+ memoryGuess += g.getCompound().getData().getObjectLoader().getTotalStorage() * 225L;
+ memoryGuess += parallaxChunks * 3500L;
+ memoryGuess += parallaxRegions * 1700000L;
}
tp.put(0); // TODO: CHUNK SPEED
@@ -118,7 +136,7 @@ public class IrisBoardManager implements BoardProvider, Listener {
return v;
}
- @DontObfuscate
+
public void disable() {
manager.onDisable();
}
diff --git a/src/main/java/com/volmit/iris/manager/IrisDataManager.java b/src/main/java/com/volmit/iris/manager/IrisDataManager.java
index b90c49132..ba4cdfc3f 100644
--- a/src/main/java/com/volmit/iris/manager/IrisDataManager.java
+++ b/src/main/java/com/volmit/iris/manager/IrisDataManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/IrisProject.java b/src/main/java/com/volmit/iris/manager/IrisProject.java
index e6043d4ed..62b543c6b 100644
--- a/src/main/java/com/volmit/iris/manager/IrisProject.java
+++ b/src/main/java/com/volmit/iris/manager/IrisProject.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.google.gson.Gson;
@@ -23,6 +41,7 @@ import java.io.IOException;
import java.util.Objects;
import java.util.UUID;
+@SuppressWarnings("ALL")
@Data
public class IrisProject {
private File path;
@@ -104,21 +123,18 @@ public class IrisProject {
}
private KList scanForErrors(IrisBiome biome, IrisObjectPlacement i) {
- KList reports = new KList<>();
- return reports;
+ return new KList<>();
}
private KList scanForErrors(IrisBiome biome, IrisBiomePaletteLayer i) {
- KList reports = new KList<>();
- return reports;
+ return new KList<>();
}
private KList scanForErrorsSeaLayers(IrisBiome biome, IrisBiomePaletteLayer i) {
- KList reports = new KList<>();
- return reports;
+ return new KList<>();
}
public boolean isOpen() {
@@ -365,16 +381,16 @@ public class IrisProject {
settings.put("json.maxItemsComputed", 30000);
JSONArray schemas = new JSONArray();
IrisDataManager dm = new IrisDataManager(getPath());
- schemas.put(getSchemaEntry(IrisDimension.class, dm, "/dimensions/*.json"));
- schemas.put(getSchemaEntry(IrisEntity.class, dm, "/entities/*.json"));
- schemas.put(getSchemaEntry(IrisBiome.class, dm, "/biomes/*.json"));
- schemas.put(getSchemaEntry(IrisRegion.class, dm, "/regions/*.json"));
- schemas.put(getSchemaEntry(IrisGenerator.class, dm, "/generators/*.json"));
- schemas.put(getSchemaEntry(IrisJigsawPiece.class, dm, "/jigsaw-pieces/*.json"));
- schemas.put(getSchemaEntry(IrisJigsawPool.class, dm, "/jigsaw-pools/*.json"));
- schemas.put(getSchemaEntry(IrisJigsawStructure.class, dm, "/jigsaw-structures/*.json"));
- schemas.put(getSchemaEntry(IrisBlockData.class, dm, "/blocks/*.json"));
- schemas.put(getSchemaEntry(IrisLootTable.class, dm, "/loot/*.json"));
+ schemas.put(getSchemaEntry(IrisDimension.class, dm, "/dimensions/*.json", "/dimensions/*/*.json", "/dimensions/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisEntity.class, dm, "/entities/*.json", "/entities/*/*.json", "/entities/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisBiome.class, dm, "/biomes/*.json", "/biomes/*/*.json", "/biomes/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisRegion.class, dm, "/regions/*.json", "/regions/*/*.json", "/regions/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisGenerator.class, dm, "/generators/*.json", "/generators/*/*.json", "/generators/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisJigsawPiece.class, dm, "/jigsaw-pieces/*.json", "/jigsaw-pieces/*/*.json", "/jigsaw-pieces/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisJigsawPool.class, dm, "/jigsaw-pools/*.json", "/jigsaw-pools/*/*.json", "/jigsaw-pools/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisJigsawStructure.class, dm, "/jigsaw-structures/*.json", "/jigsaw-structures/*/*/*.json", "/jigsaw-structures/*/*.json"));
+ schemas.put(getSchemaEntry(IrisBlockData.class, dm, "/blocks/*.json", "/blocks/*/*.json", "/blocks/*/*/*.json"));
+ schemas.put(getSchemaEntry(IrisLootTable.class, dm, "/loot/*.json", "/loot/*/*.json", "/loot/*/*/*.json"));
settings.put("json.schemas", schemas);
ws.put("settings", settings);
diff --git a/src/main/java/com/volmit/iris/manager/ProjectManager.java b/src/main/java/com/volmit/iris/manager/ProjectManager.java
index 75ba742d3..6aedd4700 100644
--- a/src/main/java/com/volmit/iris/manager/ProjectManager.java
+++ b/src/main/java/com/volmit/iris/manager/ProjectManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.google.gson.Gson;
@@ -12,7 +30,6 @@ import org.zeroturnaround.zip.ZipUtil;
import org.zeroturnaround.zip.commons.FileUtils;
import java.io.File;
-import java.io.FileFilter;
import java.io.IOException;
import java.util.UUID;
@@ -35,7 +52,7 @@ public class ProjectManager {
if (m != null) {
try {
IO.copyFile(m, ignore);
- } catch (IOException e) {
+ } catch (IOException ignored) {
}
}
@@ -45,7 +62,8 @@ public class ProjectManager {
}
public static int countUniqueDimensions() {
- int vv = counter.aquire(() -> {
+
+ return counter.aquire(() -> {
int v = 0;
try {
@@ -64,8 +82,6 @@ public class ProjectManager {
return v;
});
-
- return vv;
}
public IrisDimension installIntoWorld(MortarSender sender, String type, File folder) {
@@ -88,7 +104,7 @@ public class ProjectManager {
try {
FileUtils.copyDirectory(f, irispack);
- } catch (IOException e) {
+ } catch (IOException ignored) {
}
}
@@ -174,12 +190,13 @@ public class ProjectManager {
} catch (Throwable e) {
e.printStackTrace();
sender.sendMessage(
- "Issue when unpacking. Please check/do the following:" +
- "\n1. Do you have a functioning internet connection?" +
- "\n2. Did the download corrupt?" +
- "\n3. Try deleting the */plugins/iris/packs folder and re-download." +
- "\n4. Download the pack from the GitHub repo: https://github.com/IrisDimensions/overworld" +
- "\n5. Contact support (if all other options do not help)"
+ """
+ Issue when unpacking. Please check/do the following:
+ 1. Do you have a functioning internet connection?
+ 2. Did the download corrupt?
+ 3. Try deleting the */plugins/iris/packs folder and re-download.
+ 4. Download the pack from the GitHub repo: https://github.com/IrisDimensions/overworld
+ 5. Contact support (if all other options do not help)"""
);
}
File dir = null;
@@ -334,12 +351,7 @@ public class ProjectManager {
}
try {
- FileUtils.copyDirectory(importPack, newPack, new FileFilter() {
- @Override
- public boolean accept(File pathname) {
- return !pathname.getAbsolutePath().contains(".git");
- }
- }, false);
+ FileUtils.copyDirectory(importPack, newPack, pathname -> !pathname.getAbsolutePath().contains(".git"), false);
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/src/main/java/com/volmit/iris/manager/SchemaBuilder.java b/src/main/java/com/volmit/iris/manager/SchemaBuilder.java
index d3b6078ce..0c978ce74 100644
--- a/src/main/java/com/volmit/iris/manager/SchemaBuilder.java
+++ b/src/main/java/com/volmit/iris/manager/SchemaBuilder.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
@@ -9,6 +27,7 @@ import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.List;
+import java.util.Map;
public class SchemaBuilder {
private static final String SYMBOL_LIMIT__N = "*";
@@ -25,7 +44,7 @@ public class SchemaBuilder {
public SchemaBuilder(Class> root, IrisDataManager data) {
this.data = data;
warnings = new KList<>();
- this.definitions = new KMap();
+ this.definitions = new KMap<>();
this.root = root;
}
@@ -44,8 +63,8 @@ public class SchemaBuilder {
JSONObject defs = new JSONObject();
- for (String i : definitions.keySet()) {
- defs.put(i, definitions.get(i));
+ for (Map.Entry entry : definitions.entrySet()) {
+ defs.put(entry.getKey(), entry.getValue());
}
schema.put("definitions", defs);
@@ -93,625 +112,618 @@ public class SchemaBuilder {
private JSONObject buildProperty(Field k, Class> cl) {
JSONObject prop = new JSONObject();
String type = getType(k.getType());
- KList description = new KList();
+ KList description = new KList<>();
prop.put("!required", k.isAnnotationPresent(Required.class));
prop.put("type", type);
String fancyType = "Unknown Type";
- if (type.equals("boolean")) {
- fancyType = "Boolean";
- } else if (type.equals("integer")) {
- fancyType = "Integer";
- if (k.isAnnotationPresent(MinNumber.class)) {
- int min = (int) k.getDeclaredAnnotation(MinNumber.class).value();
- prop.put("minimum", min);
- description.add(SYMBOL_LIMIT__N + " Minimum allowed is " + min);
+ switch (type) {
+ case "boolean" -> fancyType = "Boolean";
+ case "integer" -> {
+ fancyType = "Integer";
+ if (k.isAnnotationPresent(MinNumber.class)) {
+ int min = (int) k.getDeclaredAnnotation(MinNumber.class).value();
+ prop.put("minimum", min);
+ description.add(SYMBOL_LIMIT__N + " Minimum allowed is " + min);
+ }
+ if (k.isAnnotationPresent(MaxNumber.class)) {
+ int max = (int) k.getDeclaredAnnotation(MaxNumber.class).value();
+ prop.put("maximum", max);
+ description.add(SYMBOL_LIMIT__N + " Maximum allowed is " + max);
+ }
}
-
- if (k.isAnnotationPresent(MaxNumber.class)) {
- int max = (int) k.getDeclaredAnnotation(MaxNumber.class).value();
- prop.put("maximum", max);
- description.add(SYMBOL_LIMIT__N + " Maximum allowed is " + max);
+ case "number" -> {
+ fancyType = "Number";
+ if (k.isAnnotationPresent(MinNumber.class)) {
+ double min = k.getDeclaredAnnotation(MinNumber.class).value();
+ prop.put("minimum", min);
+ description.add(SYMBOL_LIMIT__N + " Minimum allowed is " + min);
+ }
+ if (k.isAnnotationPresent(MaxNumber.class)) {
+ double max = k.getDeclaredAnnotation(MaxNumber.class).value();
+ prop.put("maximum", max);
+ description.add(SYMBOL_LIMIT__N + " Maximum allowed is " + max);
+ }
}
- } else if (type.equals("number")) {
- fancyType = "Number";
- if (k.isAnnotationPresent(MinNumber.class)) {
- double min = k.getDeclaredAnnotation(MinNumber.class).value();
- prop.put("minimum", min);
- description.add(SYMBOL_LIMIT__N + " Minimum allowed is " + min);
- }
-
- if (k.isAnnotationPresent(MaxNumber.class)) {
- double max = k.getDeclaredAnnotation(MaxNumber.class).value();
- prop.put("maximum", max);
- description.add(SYMBOL_LIMIT__N + " Maximum allowed is " + max);
- }
- } else if (type.equals("string")) {
- fancyType = "Text";
- if (k.isAnnotationPresent(MinNumber.class)) {
- int min = (int) k.getDeclaredAnnotation(MinNumber.class).value();
- prop.put("minLength", min);
- description.add(SYMBOL_LIMIT__N + " Minimum Length allowed is " + min);
- }
-
- if (k.isAnnotationPresent(MaxNumber.class)) {
- int max = (int) k.getDeclaredAnnotation(MaxNumber.class).value();
- prop.put("maxLength", max);
- description.add(SYMBOL_LIMIT__N + " Maximum Length allowed is " + max);
- }
-
- if (k.isAnnotationPresent(RegistryListBiome.class)) {
- String key = "enum-reg-biome";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getBiomeLoader().getPossibleKeys()));
- definitions.put(key, j);
+ case "string" -> {
+ fancyType = "Text";
+ if (k.isAnnotationPresent(MinNumber.class)) {
+ int min = (int) k.getDeclaredAnnotation(MinNumber.class).value();
+ prop.put("minLength", min);
+ description.add(SYMBOL_LIMIT__N + " Minimum Length allowed is " + min);
}
-
- fancyType = "Iris Biome";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListMythical.class)) {
- String key = "enum-reg-mythical";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(Iris.linkMythicMobs.getMythicMobTypes()));
- definitions.put(key, j);
+ if (k.isAnnotationPresent(MaxNumber.class)) {
+ int max = (int) k.getDeclaredAnnotation(MaxNumber.class).value();
+ prop.put("maxLength", max);
+ description.add(SYMBOL_LIMIT__N + " Maximum Length allowed is " + max);
}
-
- fancyType = "Mythic Mob Type";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Define mythic mobs with the mythic mobs plugin configuration files.");
- } else if (k.isAnnotationPresent(RegistryListBlockType.class)) {
- String key = "enum-block-type";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- JSONArray ja = new JSONArray();
-
- for (String i : data.getBlockLoader().getPossibleKeys()) {
- ja.put(i);
- }
-
- for (String i : B.getBlockTypes()) {
- ja.put(i);
- }
-
- j.put("enum", ja);
- definitions.put(key, j);
- }
-
- fancyType = "Block Type";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Block Type (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListItemType.class)) {
- String key = "enum-item-type";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", ITEM_TYPES);
- definitions.put(key, j);
- }
-
- fancyType = "Item Type";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Item Type (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListEntity.class)) {
- String key = "enum-reg-entity";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getEntityLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Entity";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Iris Entity (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListFont.class)) {
- String key = "enum-font";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", FONT_TYPES);
- definitions.put(key, j);
- }
-
- fancyType = "Font Family";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Font Family (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListLoot.class)) {
- String key = "enum-reg-loot-table";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getLootLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Loot Table";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Loot Table (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListDimension.class)) {
- String key = "enum-reg-dimension";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getDimensionLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Dimension";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Dimension (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListGenerator.class)) {
- String key = "enum-reg-generator";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getGeneratorLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Generator";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Generator (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListObject.class)) {
- String key = "enum-reg-object";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getObjectLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Object";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Object (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListRegion.class)) {
- String key = "enum-reg-region";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getRegionLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Region";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Region (use ctrl+space for auto complete!)");
-
- } else if (k.isAnnotationPresent(RegistryListJigsawPiece.class)) {
- String key = "enum-reg-structure-piece";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Jigsaw Piece";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListJigsaw.class)) {
- String key = "enum-reg-jigsaw";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Jigsaw";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListJigsawPool.class)) {
- String key = "enum-reg-structure-pool";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- fancyType = "Iris Jigsaw Pool";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
- } else if (k.getType().equals(Enchantment.class)) {
- String key = "enum-enchantment";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", ENCHANT_TYPES);
- definitions.put(key, j);
- }
-
- fancyType = "Enchantment Type";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Enchantment Type (use ctrl+space for auto complete!)");
- } else if (k.getType().equals(PotionEffectType.class)) {
- String key = "enum-potion-effect-type";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", POTION_TYPES);
- definitions.put(key, j);
- }
-
- fancyType = "Potion Effect Type";
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid Potion Effect Type (use ctrl+space for auto complete!)");
-
- } else if (k.getType().isEnum()) {
- fancyType = k.getType().getSimpleName().replaceAll("\\QIris\\E", "");
- JSONArray a = new JSONArray();
- boolean advanced = k.getType().isAnnotationPresent(Desc.class);
- for (Object gg : k.getType().getEnumConstants()) {
- if (advanced) {
- try {
- JSONObject j = new JSONObject();
- String name = ((Enum>) gg).name();
- j.put("const", name);
- Desc dd = k.getType().getField(name).getAnnotation(Desc.class);
- j.put("description", dd == null ? ("No Description for " + name) : dd.value());
- a.put(j);
- } catch (Throwable e) {
- e.printStackTrace();
- }
- } else {
- a.put(((Enum>) gg).name());
- }
- }
-
- String key = (advanced ? "oneof-" : "") + "enum-" + k.getType().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put(advanced ? "oneOf" : "enum", a);
- definitions.put(key, j);
- }
-
- prop.put("$ref", "#/definitions/" + key);
- description.add(SYMBOL_TYPE__N + " Must be a valid " + k.getType().getSimpleName().replaceAll("\\QIris\\E", "") + " (use ctrl+space for auto complete!)");
-
- }
- } else if (type.equals("object")) {
- fancyType = k.getType().getSimpleName().replaceAll("\\QIris\\E", "") + " (Object)";
-
- String key = "obj-" + k.getType().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
-
- if (!definitions.containsKey(key)) {
- definitions.put(key, new JSONObject());
- definitions.put(key, buildProperties(k.getType()));
- }
-
- prop.put("$ref", "#/definitions/" + key);
- } else if (type.equals("array")) {
- fancyType = "List of Something...?";
-
- ArrayType t = k.getDeclaredAnnotation(ArrayType.class);
-
- if (t != null) {
- if (t.min() > 0) {
- prop.put("minItems", t.min());
- if (t.min() == 1) {
- description.add(SYMBOL_LIMIT__N + " At least one entry must be defined, or just remove this list.");
- } else {
- description.add(SYMBOL_LIMIT__N + " Requires at least " + t.min() + " entries.");
- }
- }
-
- String arrayType = getType(t.type());
-
- if (arrayType.equals("integer")) {
- fancyType = "List of Integers";
- } else if (arrayType.equals("number")) {
- fancyType = "List of Numbers";
- } else if (arrayType.equals("object")) {
- fancyType = "List of " + t.type().getSimpleName().replaceAll("\\QIris\\E", "") + "s (Objects)";
- String key = "obj-" + t.type().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
+ if (k.isAnnotationPresent(RegistryListBiome.class)) {
+ String key = "enum-reg-biome";
if (!definitions.containsKey(key)) {
- definitions.put(key, new JSONObject());
- definitions.put(key, buildProperties(t.type()));
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getBiomeLoader().getPossibleKeys()));
+ definitions.put(key, j);
}
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- } else if (arrayType.equals("string")) {
- fancyType = "List of Text";
+ fancyType = "Iris Biome";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
- if (k.isAnnotationPresent(RegistryListBiome.class)) {
- fancyType = "List of Iris Biomes";
- String key = "enum-reg-biome";
+ } else if (k.isAnnotationPresent(RegistryListMythical.class)) {
+ String key = "enum-reg-mythical";
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getBiomeLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListMythical.class)) {
- fancyType = "List of Mythic Mob Types";
- String key = "enum-reg-mythical";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- JSONArray ja = new JSONArray();
-
- for (String i : Iris.linkMythicMobs.getMythicMobTypes()) {
- ja.put(i);
- }
-
- j.put("enum", ja);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Configure mob types in the mythic mobs plugin configuration files.");
- } else if (k.isAnnotationPresent(RegistryListBlockType.class)) {
- fancyType = "List of Block Types";
- String key = "enum-block-type";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- JSONArray ja = new JSONArray();
-
- for (String i : data.getBlockLoader().getPossibleKeys()) {
- ja.put(i);
- }
-
- for (String i : B.getBlockTypes()) {
- ja.put(i);
- }
-
- j.put("enum", ja);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Block Type (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListItemType.class)) {
- fancyType = "List of Item Types";
- String key = "enum-item-type";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", ITEM_TYPES);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Item Type (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListEntity.class)) {
- fancyType = "List of Iris Entities";
- String key = "enum-reg-entity";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getEntityLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Iris Entity (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListFont.class)) {
- String key = "enum-font";
- fancyType = "List of Font Families";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", FONT_TYPES);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Font Family (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListLoot.class)) {
- fancyType = "List of Iris Loot Tables";
- String key = "enum-reg-loot-table";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getLootLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Loot Table (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListDimension.class)) {
- fancyType = "List of Iris Dimensions";
- String key = "enum-reg-dimension";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getDimensionLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Dimension (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListGenerator.class)) {
- fancyType = "List of Iris Generators";
- String key = "enum-reg-generator";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getGeneratorLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Generator (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListObject.class)) {
- fancyType = "List of Iris Objects";
- String key = "enum-reg-object";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getObjectLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Object (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListRegion.class)) {
- fancyType = "List of Iris Regions";
- String key = "enum-reg-region";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getRegionLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Region (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListJigsawPiece.class)) {
- fancyType = "List of Iris Jigsaw Pieces";
- String key = "enum-reg-structure-piece";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListJigsawPool.class)) {
- fancyType = "List of Iris Jigsaw Pools";
- String key = "enum-reg-structure-pool";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Pool (use ctrl+space for auto complete!)");
- } else if (k.isAnnotationPresent(RegistryListJigsaw.class)) {
- fancyType = "List of Iris Jigsaw Structures";
- String key = "enum-reg-jigsaw";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
- } else if (t.type().equals(Enchantment.class)) {
- fancyType = "List of Enchantment Types";
- String key = "enum-enchantment";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", ENCHANT_TYPES);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Enchantment Type (use ctrl+space for auto complete!)");
- } else if (t.type().equals(PotionEffectType.class)) {
- fancyType = "List of Potion Effect Types";
- String key = "enum-potion-effect-type";
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put("enum", POTION_TYPES);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid Potion Effect Type (use ctrl+space for auto complete!)");
- } else if (t.type().isEnum()) {
- fancyType = "List of " + t.type().getSimpleName().replaceAll("\\QIris\\E", "") + "s";
- JSONArray a = new JSONArray();
- boolean advanced = t.type().isAnnotationPresent(Desc.class);
- for (Object gg : t.type().getEnumConstants()) {
- if (advanced) {
- try {
- JSONObject j = new JSONObject();
- String name = ((Enum>) gg).name();
- j.put("const", name);
- Desc dd = t.type().getField(name).getAnnotation(Desc.class);
- j.put("description", dd == null ? ("No Description for " + name) : dd.value());
- a.put(j);
- } catch (Throwable e) {
- e.printStackTrace();
- }
- } else {
- a.put(((Enum>) gg).name());
- }
- }
-
- String key = (advanced ? "oneof-" : "") + "enum-" + t.type().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
-
- if (!definitions.containsKey(key)) {
- JSONObject j = new JSONObject();
- j.put(advanced ? "oneOf" : "enum", a);
- definitions.put(key, j);
- }
-
- JSONObject items = new JSONObject();
- items.put("$ref", "#/definitions/" + key);
- prop.put("items", items);
- description.add(SYMBOL_TYPE__N + " Must be a valid " + t.type().getSimpleName().replaceAll("\\QIris\\E", "") + " (use ctrl+space for auto complete!)");
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(Iris.linkMythicMobs.getMythicMobTypes()));
+ definitions.put(key, j);
}
+
+ fancyType = "Mythic Mob Type";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Define mythic mobs with the mythic mobs plugin configuration files.");
+ } else if (k.isAnnotationPresent(RegistryListBlockType.class)) {
+ String key = "enum-block-type";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ JSONArray ja = new JSONArray();
+
+ for (String i : data.getBlockLoader().getPossibleKeys()) {
+ ja.put(i);
+ }
+
+ for (String i : B.getBlockTypes()) {
+ ja.put(i);
+ }
+
+ j.put("enum", ja);
+ definitions.put(key, j);
+ }
+
+ fancyType = "Block Type";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Block Type (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListItemType.class)) {
+ String key = "enum-item-type";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", ITEM_TYPES);
+ definitions.put(key, j);
+ }
+
+ fancyType = "Item Type";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Item Type (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListEntity.class)) {
+ String key = "enum-reg-entity";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getEntityLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Entity";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Iris Entity (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListFont.class)) {
+ String key = "enum-font";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", FONT_TYPES);
+ definitions.put(key, j);
+ }
+
+ fancyType = "Font Family";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Font Family (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListLoot.class)) {
+ String key = "enum-reg-loot-table";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getLootLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Loot Table";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Loot Table (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListDimension.class)) {
+ String key = "enum-reg-dimension";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getDimensionLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Dimension";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Dimension (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListGenerator.class)) {
+ String key = "enum-reg-generator";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getGeneratorLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Generator";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Generator (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListObject.class)) {
+ String key = "enum-reg-object";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getObjectLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Object";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Object (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListRegion.class)) {
+ String key = "enum-reg-region";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getRegionLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Region";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Region (use ctrl+space for auto complete!)");
+
+ } else if (k.isAnnotationPresent(RegistryListJigsawPiece.class)) {
+ String key = "enum-reg-structure-piece";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Jigsaw Piece";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListJigsaw.class)) {
+ String key = "enum-reg-jigsaw";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Jigsaw";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListJigsawPool.class)) {
+ String key = "enum-reg-structure-pool";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ fancyType = "Iris Jigsaw Pool";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
+ } else if (k.getType().equals(Enchantment.class)) {
+ String key = "enum-enchantment";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", ENCHANT_TYPES);
+ definitions.put(key, j);
+ }
+
+ fancyType = "Enchantment Type";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Enchantment Type (use ctrl+space for auto complete!)");
+ } else if (k.getType().equals(PotionEffectType.class)) {
+ String key = "enum-potion-effect-type";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", POTION_TYPES);
+ definitions.put(key, j);
+ }
+
+ fancyType = "Potion Effect Type";
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Potion Effect Type (use ctrl+space for auto complete!)");
+
+ } else if (k.getType().isEnum()) {
+ fancyType = k.getType().getSimpleName().replaceAll("\\QIris\\E", "");
+ JSONArray a = new JSONArray();
+ boolean advanced = k.getType().isAnnotationPresent(Desc.class);
+ for (Object gg : k.getType().getEnumConstants()) {
+ if (advanced) {
+ try {
+ JSONObject j = new JSONObject();
+ String name = ((Enum>) gg).name();
+ j.put("const", name);
+ Desc dd = k.getType().getField(name).getAnnotation(Desc.class);
+ j.put("description", dd == null ? ("No Description for " + name) : dd.value());
+ a.put(j);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ } else {
+ a.put(((Enum>) gg).name());
+ }
+ }
+
+ String key = (advanced ? "oneof-" : "") + "enum-" + k.getType().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put(advanced ? "oneOf" : "enum", a);
+ definitions.put(key, j);
+ }
+
+ prop.put("$ref", "#/definitions/" + key);
+ description.add(SYMBOL_TYPE__N + " Must be a valid " + k.getType().getSimpleName().replaceAll("\\QIris\\E", "") + " (use ctrl+space for auto complete!)");
+
}
- } else {
- warnings.add("Undefined array type for field " + k.getName() + " (" + k.getType().getSimpleName() + ") in class " + cl.getSimpleName());
}
- } else {
- warnings.add("Unexpected Schema Type: " + type + " for field " + k.getName() + " (" + k.getType().getSimpleName() + ") in class " + cl.getSimpleName());
+ case "object" -> {
+ fancyType = k.getType().getSimpleName().replaceAll("\\QIris\\E", "") + " (Object)";
+ String key = "obj-" + k.getType().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
+ if (!definitions.containsKey(key)) {
+ definitions.put(key, new JSONObject());
+ definitions.put(key, buildProperties(k.getType()));
+ }
+ prop.put("$ref", "#/definitions/" + key);
+ }
+ case "array" -> {
+ fancyType = "List of Something...?";
+ ArrayType t = k.getDeclaredAnnotation(ArrayType.class);
+ if (t != null) {
+ if (t.min() > 0) {
+ prop.put("minItems", t.min());
+ if (t.min() == 1) {
+ description.add(SYMBOL_LIMIT__N + " At least one entry must be defined, or just remove this list.");
+ } else {
+ description.add(SYMBOL_LIMIT__N + " Requires at least " + t.min() + " entries.");
+ }
+ }
+
+ String arrayType = getType(t.type());
+
+ switch (arrayType) {
+ case "integer" -> fancyType = "List of Integers";
+ case "number" -> fancyType = "List of Numbers";
+ case "object" -> {
+ fancyType = "List of " + t.type().getSimpleName().replaceAll("\\QIris\\E", "") + "s (Objects)";
+ String key = "obj-" + t.type().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
+ if (!definitions.containsKey(key)) {
+ definitions.put(key, new JSONObject());
+ definitions.put(key, buildProperties(t.type()));
+ }
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ }
+ case "string" -> {
+ fancyType = "List of Text";
+ if (k.isAnnotationPresent(RegistryListBiome.class)) {
+ fancyType = "List of Iris Biomes";
+ String key = "enum-reg-biome";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getBiomeLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Biome (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListMythical.class)) {
+ fancyType = "List of Mythic Mob Types";
+ String key = "enum-reg-mythical";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ JSONArray ja = new JSONArray();
+
+ for (String i : Iris.linkMythicMobs.getMythicMobTypes()) {
+ ja.put(i);
+ }
+
+ j.put("enum", ja);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Mythic Mob Type (use ctrl+space for auto complete!) Configure mob types in the mythic mobs plugin configuration files.");
+ } else if (k.isAnnotationPresent(RegistryListBlockType.class)) {
+ fancyType = "List of Block Types";
+ String key = "enum-block-type";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ JSONArray ja = new JSONArray();
+
+ for (String i : data.getBlockLoader().getPossibleKeys()) {
+ ja.put(i);
+ }
+
+ for (String i : B.getBlockTypes()) {
+ ja.put(i);
+ }
+
+ j.put("enum", ja);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Block Type (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListItemType.class)) {
+ fancyType = "List of Item Types";
+ String key = "enum-item-type";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", ITEM_TYPES);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Item Type (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListEntity.class)) {
+ fancyType = "List of Iris Entities";
+ String key = "enum-reg-entity";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getEntityLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Iris Entity (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListFont.class)) {
+ String key = "enum-font";
+ fancyType = "List of Font Families";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", FONT_TYPES);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Font Family (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListLoot.class)) {
+ fancyType = "List of Iris Loot Tables";
+ String key = "enum-reg-loot-table";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getLootLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Loot Table (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListDimension.class)) {
+ fancyType = "List of Iris Dimensions";
+ String key = "enum-reg-dimension";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getDimensionLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Dimension (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListGenerator.class)) {
+ fancyType = "List of Iris Generators";
+ String key = "enum-reg-generator";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getGeneratorLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Generator (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListObject.class)) {
+ fancyType = "List of Iris Objects";
+ String key = "enum-reg-object";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getObjectLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Object (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListRegion.class)) {
+ fancyType = "List of Iris Regions";
+ String key = "enum-reg-region";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getRegionLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Region (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListJigsawPiece.class)) {
+ fancyType = "List of Iris Jigsaw Pieces";
+ String key = "enum-reg-structure-piece";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getJigsawPieceLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Piece (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListJigsawPool.class)) {
+ fancyType = "List of Iris Jigsaw Pools";
+ String key = "enum-reg-structure-pool";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getJigsawPoolLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw Pool (use ctrl+space for auto complete!)");
+ } else if (k.isAnnotationPresent(RegistryListJigsaw.class)) {
+ fancyType = "List of Iris Jigsaw Structures";
+ String key = "enum-reg-jigsaw";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", new JSONArray(data.getJigsawStructureLoader().getPossibleKeys()));
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Jigsaw (use ctrl+space for auto complete!)");
+ } else if (t.type().equals(Enchantment.class)) {
+ fancyType = "List of Enchantment Types";
+ String key = "enum-enchantment";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", ENCHANT_TYPES);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Enchantment Type (use ctrl+space for auto complete!)");
+ } else if (t.type().equals(PotionEffectType.class)) {
+ fancyType = "List of Potion Effect Types";
+ String key = "enum-potion-effect-type";
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put("enum", POTION_TYPES);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid Potion Effect Type (use ctrl+space for auto complete!)");
+ } else if (t.type().isEnum()) {
+ fancyType = "List of " + t.type().getSimpleName().replaceAll("\\QIris\\E", "") + "s";
+ JSONArray a = new JSONArray();
+ boolean advanced = t.type().isAnnotationPresent(Desc.class);
+ for (Object gg : t.type().getEnumConstants()) {
+ if (advanced) {
+ try {
+ JSONObject j = new JSONObject();
+ String name = ((Enum>) gg).name();
+ j.put("const", name);
+ Desc dd = t.type().getField(name).getAnnotation(Desc.class);
+ j.put("description", dd == null ? ("No Description for " + name) : dd.value());
+ a.put(j);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ } else {
+ a.put(((Enum>) gg).name());
+ }
+ }
+
+ String key = (advanced ? "oneof-" : "") + "enum-" + t.type().getCanonicalName().replaceAll("\\Q.\\E", "-").toLowerCase();
+
+ if (!definitions.containsKey(key)) {
+ JSONObject j = new JSONObject();
+ j.put(advanced ? "oneOf" : "enum", a);
+ definitions.put(key, j);
+ }
+
+ JSONObject items = new JSONObject();
+ items.put("$ref", "#/definitions/" + key);
+ prop.put("items", items);
+ description.add(SYMBOL_TYPE__N + " Must be a valid " + t.type().getSimpleName().replaceAll("\\QIris\\E", "") + " (use ctrl+space for auto complete!)");
+ }
+ }
+ }
+ } else {
+ warnings.add("Undefined array type for field " + k.getName() + " (" + k.getType().getSimpleName() + ") in class " + cl.getSimpleName());
+ }
+ }
+ default -> warnings.add("Unexpected Schema Type: " + type + " for field " + k.getName() + " (" + k.getType().getSimpleName() + ") in class " + cl.getSimpleName());
}
KList d = new KList<>();
@@ -734,7 +746,7 @@ public class SchemaBuilder {
d.add("* Default Value is " + value);
}
}
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
diff --git a/src/main/java/com/volmit/iris/manager/WandManager.java b/src/main/java/com/volmit/iris/manager/WandManager.java
index 9b1f67c76..aacd365be 100644
--- a/src/main/java/com/volmit/iris/manager/WandManager.java
+++ b/src/main/java/com/volmit/iris/manager/WandManager.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
@@ -109,7 +127,7 @@ public class WandManager implements Listener {
}
Location lv = new Location(d[0].getWorld(), j, k, l).clone().add(0.5, 0.5, 0.5).clone().add(push);
- Color color = Color.getHSBColor((float) (0.5f + (Math.sin((j + k + l + (p.getTicksLived() / 2)) / 20f) / 2)), 1, 1);
+ Color color = Color.getHSBColor((float) (0.5f + (Math.sin((j + k + l + (p.getTicksLived() / 2f)) / 20f) / 2)), 1, 1);
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
diff --git a/src/main/java/com/volmit/iris/manager/command/CommandIris.java b/src/main/java/com/volmit/iris/manager/command/CommandIris.java
index 0be3616df..02bd9c00e 100644
--- a/src/main/java/com/volmit/iris/manager/command/CommandIris.java
+++ b/src/main/java/com/volmit/iris/manager/command/CommandIris.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/CommandIrisDownload.java b/src/main/java/com/volmit/iris/manager/command/CommandIrisDownload.java
index 5a6a46e18..bdecd724b 100644
--- a/src/main/java/com/volmit/iris/manager/command/CommandIrisDownload.java
+++ b/src/main/java/com/volmit/iris/manager/command/CommandIrisDownload.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
@@ -29,6 +47,7 @@ public class CommandIrisDownload extends MortarCommand {
for (String i : args) {
if (i.equals("-t") || i.equals("--trim")) {
trim = true;
+ break;
}
}
diff --git a/src/main/java/com/volmit/iris/manager/command/CommandIrisMetrics.java b/src/main/java/com/volmit/iris/manager/command/CommandIrisMetrics.java
index 44340e9c4..0b0eaff37 100644
--- a/src/main/java/com/volmit/iris/manager/command/CommandIrisMetrics.java
+++ b/src/main/java/com/volmit/iris/manager/command/CommandIrisMetrics.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/CommandIrisReload.java b/src/main/java/com/volmit/iris/manager/command/CommandIrisReload.java
index 41f528a8f..64f4b4589 100644
--- a/src/main/java/com/volmit/iris/manager/command/CommandIrisReload.java
+++ b/src/main/java/com/volmit/iris/manager/command/CommandIrisReload.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/CommandIrisUpdateProject.java b/src/main/java/com/volmit/iris/manager/command/CommandIrisUpdateProject.java
index 8280d8f9d..ed0f450e0 100644
--- a/src/main/java/com/volmit/iris/manager/command/CommandIrisUpdateProject.java
+++ b/src/main/java/com/volmit/iris/manager/command/CommandIrisUpdateProject.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/PermissionIris.java b/src/main/java/com/volmit/iris/manager/command/PermissionIris.java
index b47293ce3..c0065c85e 100644
--- a/src/main/java/com/volmit/iris/manager/command/PermissionIris.java
+++ b/src/main/java/com/volmit/iris/manager/command/PermissionIris.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.util.MortarPermission;
diff --git a/src/main/java/com/volmit/iris/manager/command/PermissionIrisStudio.java b/src/main/java/com/volmit/iris/manager/command/PermissionIrisStudio.java
index 06754b91c..232218e7b 100644
--- a/src/main/java/com/volmit/iris/manager/command/PermissionIrisStudio.java
+++ b/src/main/java/com/volmit/iris/manager/command/PermissionIrisStudio.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command;
import com.volmit.iris.util.MortarPermission;
diff --git a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsaw.java b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsaw.java
index e6e4d0e26..7de096185 100644
--- a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsaw.java
+++ b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsaw.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawEdit.java b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawEdit.java
index ff6390fe9..352d51e96 100644
--- a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawEdit.java
+++ b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawEdit.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawExit.java b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawExit.java
index 4ec791390..20aac2247 100644
--- a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawExit.java
+++ b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawExit.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawNew.java b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawNew.java
index 7b4f99f47..dff3ba497 100644
--- a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawNew.java
+++ b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawNew.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawPlace.java b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawPlace.java
index a857bb062..f6c736ddf 100644
--- a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawPlace.java
+++ b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawPlace.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawSave.java b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawSave.java
index bff3de7af..b9e744b1e 100644
--- a/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawSave.java
+++ b/src/main/java/com/volmit/iris/manager/command/jigsaw/CommandIrisJigsawSave.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObject.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObject.java
index b9c2c963d..251f7596c 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObject.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObject.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectContract.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectContract.java
index fdfa09c21..adc8ea7e8 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectContract.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectContract.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -41,7 +59,7 @@ public class CommandIrisObjectContract extends MortarCommand {
return true;
}
- int amt = args.length == 1 ? Integer.valueOf(args[0]) : 1;
+ int amt = args.length == 1 ? Integer.parseInt(args[0]) : 1;
Location[] b = WandManager.getCuboid(p.getInventory().getItemInMainHand());
Location a1 = b[0].clone();
Location a2 = b[1].clone();
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectDust.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectDust.java
index b36494922..7b7942084 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectDust.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectDust.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectExpand.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectExpand.java
index cb206611a..89b429168 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectExpand.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectExpand.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -41,7 +59,7 @@ public class CommandIrisObjectExpand extends MortarCommand {
return true;
}
- int amt = args.length == 1 ? Integer.valueOf(args[0]) : 1;
+ int amt = args.length == 1 ? Integer.parseInt(args[0]) : 1;
Location[] b = WandManager.getCuboid(p.getInventory().getItemInMainHand());
Location a1 = b[0].clone();
Location a2 = b[1].clone();
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP1.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP1.java
index b8cbef00b..9a4b71845 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP1.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP1.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -7,12 +25,9 @@ import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import org.bukkit.Location;
-import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
-import java.util.Set;
-
public class CommandIrisObjectP1 extends MortarCommand {
public CommandIrisObjectP1() {
super("p1");
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP2.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP2.java
index be87af517..3750c55cb 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP2.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectP2.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -7,12 +25,9 @@ import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import org.bukkit.Location;
-import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
-import java.util.Set;
-
public class CommandIrisObjectP2 extends MortarCommand {
public CommandIrisObjectP2() {
super("p2");
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectPaste.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectPaste.java
index 00dd0e29f..3c5f32fac 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectPaste.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectPaste.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -10,13 +28,11 @@ import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import org.bukkit.Location;
-import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.io.File;
-import java.util.Set;
public class CommandIrisObjectPaste extends MortarCommand {
public CommandIrisObjectPaste() {
@@ -63,6 +79,7 @@ public class CommandIrisObjectPaste extends MortarCommand {
for (String i : args) {
if (i.equalsIgnoreCase("-edit")) {
intoWand = true;
+ break;
}
}
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectSave.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectSave.java
index cf11a992e..69ec7b5ed 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectSave.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectSave.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -51,6 +69,7 @@ public class CommandIrisObjectSave extends MortarCommand {
for (String i : args) {
if (i.equals("-o")) {
overwrite = true;
+ break;
}
}
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectShift.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectShift.java
index edb485664..07f53aaa0 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectShift.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectShift.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
@@ -41,7 +59,7 @@ public class CommandIrisObjectShift extends MortarCommand {
return true;
}
- int amt = args.length == 1 ? Integer.valueOf(args[0]) : 1;
+ int amt = args.length == 1 ? Integer.parseInt(args[0]) : 1;
Location[] b = WandManager.getCuboid(p.getInventory().getItemInMainHand());
Location a1 = b[0].clone();
Location a2 = b[1].clone();
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectWand.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectWand.java
index 7b726b528..1afc5450b 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectWand.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectWand.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXAY.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXAY.java
index fb83ae370..87129e8d8 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXAY.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXAY.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXPY.java b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXPY.java
index 209259b92..db19986ec 100644
--- a/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXPY.java
+++ b/src/main/java/com/volmit/iris/manager/command/object/CommandIrisObjectXPY.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudio.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudio.java
index a50f04df8..24fb9f79a 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudio.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudio.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioBeautify.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioBeautify.java
index 623fef310..dbe4a0788 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioBeautify.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioBeautify.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioClose.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioClose.java
index 749eb8838..de2054e00 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioClose.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioClose.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioConvert.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioConvert.java
index 14ecdf360..0ed3977df 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioConvert.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioConvert.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioCreate.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioCreate.java
index c8a4b1f93..b51132ce3 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioCreate.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioCreate.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioEditBiome.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioEditBiome.java
index ff76c050c..28401d667 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioEditBiome.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioEditBiome.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorer.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorer.java
index d0ca08f8b..14318b49e 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorer.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorerGenerator.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorerGenerator.java
index 21f71ee75..a561dcaa1 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorerGenerator.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioExplorerGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
@@ -12,7 +30,7 @@ import com.volmit.iris.util.RNG;
public class CommandIrisStudioExplorerGenerator extends MortarCommand {
public CommandIrisStudioExplorerGenerator() {
- super("generator", "gen", "g");
+ super("generator", "gen");
setDescription("Preview created noise noises generators");
requiresPermission(Iris.perm.studio);
setCategory("World");
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioGoto.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioGoto.java
index d9945b78a..d4b69d43f 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioGoto.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioGoto.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioHotload.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioHotload.java
index c79e3f291..ca8d3510e 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioHotload.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioHotload.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioLoot.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioLoot.java
index cf5de89d5..a45d6ac8b 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioLoot.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioLoot.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
@@ -72,7 +90,7 @@ public class CommandIrisStudioLoot extends MortarCommand {
boolean fast = ffast;
boolean add = fadd;
- O ta = new O();
+ O ta = new O<>();
ta.set(-1);
ta.set(Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, () ->
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioMap.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioMap.java
index fe4a14ae6..cba8a1bcd 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioMap.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioMap.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java
index 441b884e3..a3e4b597c 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioOpen.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioPackage.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioPackage.java
index 27a601543..6f372d270 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioPackage.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioPackage.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
@@ -40,6 +58,7 @@ public class CommandIrisStudioPackage extends MortarCommand {
for (String i : args) {
if (i.equalsIgnoreCase("-o")) {
o = true;
+ break;
}
}
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioProfile.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioProfile.java
index 91e0c7741..aec8f2c72 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioProfile.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioProfile.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
@@ -95,12 +113,7 @@ public class CommandIrisStudioProfile extends MortarCommand {
in.setFunction(i);
in.setHorizontalScale(8);
- NoiseProvider np = new NoiseProvider() {
- @Override
- public double noise(double x, double z) {
- return Math.random();
- }
- };
+ NoiseProvider np = (x, z) -> Math.random();
for (int j = 0; j < 3000; j++) {
in.interpolate(j, -j, np);
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioSummon.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioSummon.java
index 0b0accbc7..7fcad75fb 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioSummon.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioSummon.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioTPStudio.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioTPStudio.java
index 2da7c274a..ab2396012 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioTPStudio.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioTPStudio.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
@@ -9,7 +27,7 @@ import org.bukkit.GameMode;
public class CommandIrisStudioTPStudio extends MortarCommand {
public CommandIrisStudioTPStudio() {
- super("tps", "stp", "tpstudio");
+ super("tps", "stp", "tpstudio", "tp");
requiresPermission(Iris.perm.studio);
setDescription("Go to the spawn of the currently open studio world.");
setCategory("Studio");
diff --git a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioUpdate.java b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioUpdate.java
index 84bce9e66..4b72bbc13 100644
--- a/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioUpdate.java
+++ b/src/main/java/com/volmit/iris/manager/command/studio/CommandIrisStudioUpdate.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.studio;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhat.java b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhat.java
index fe0bbd9bb..9bdb8e6cc 100644
--- a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhat.java
+++ b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhat.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.what;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java
index fc22eb4f0..47fcd6ae0 100644
--- a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java
+++ b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBiome.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.what;
import com.volmit.iris.Iris;
@@ -45,7 +63,7 @@ public class CommandIrisWhatBiome extends MortarCommand {
if (p.getLocation().getBlock().getBiome().equals(Biome.CUSTOM)) {
try {
sender.sendMessage("Data Pack Biome: " + INMS.get().getTrueBiomeBaseKey(p.getLocation()) + " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(p.getLocation())) + ")");
- } catch (Throwable ex) {
+ } catch (Throwable ignored) {
}
}
diff --git a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBlock.java b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBlock.java
index 528d79faf..b67c4bf97 100644
--- a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBlock.java
+++ b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatBlock.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.what;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatHand.java b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatHand.java
index 07c0346da..1eb0a0ac2 100644
--- a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatHand.java
+++ b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatHand.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.what;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatObjects.java b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatObjects.java
index 15e498d28..57f4b9d4d 100644
--- a/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatObjects.java
+++ b/src/main/java/com/volmit/iris/manager/command/what/CommandIrisWhatObjects.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.what;
import com.volmit.iris.Iris;
@@ -36,6 +54,7 @@ public class CommandIrisWhatObjects extends MortarCommand {
}
+ @SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
@Override
public boolean handle(MortarSender sender, String[] args) {
if (sender.isPlayer()) {
@@ -60,7 +79,7 @@ public class CommandIrisWhatObjects extends MortarCommand {
int cz = l.getChunk().getZ();
new Spiraler(3, 3, (x, z) -> chunks.addIfMissing(world.getChunkAt(x + cx, z + cz))).drain();
}
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
@@ -200,6 +219,7 @@ public class CommandIrisWhatObjects extends MortarCommand {
objects.compute(n1, (k1, v1) ->
{
+ //noinspection ReplaceNullCheck
if (v1 == null) {
return new KMap<>();
}
diff --git a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisCreate.java b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisCreate.java
index 47a2cdbfd..7cda1755d 100644
--- a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisCreate.java
+++ b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisCreate.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.world;
import com.volmit.iris.Iris;
@@ -42,24 +60,28 @@ public class CommandIrisCreate extends MortarCommand {
String pre = split[0].toLowerCase();
- if (pre.equals("type")) {
- for (String s : Iris.proj.getListing(true).keySet()) {
- list.add("type=" + s);
+ switch (pre) {
+ case "type" -> {
+ for (String s : Iris.proj.getListing(true).keySet()) {
+ list.add("type=" + s);
+ }
+ if (!list.contains("type=overworld")) {
+ list.contains("type=overworld");
+ }
}
- if (!list.contains("type=overworld")) {
- list.contains("type=overworld");
+ case "seed" -> {
+ list.add("seed=1337");
+ list.add("seed=" + new Random().nextInt());
+ list.add("seed=random");
+ }
+ case "pregen" -> {
+ list.add("500");
+ list.add("1000");
+ list.add("2000");
+ list.add("5k");
+ list.add("10k");
+ list.add("25k");
}
- } else if (pre.equals("seed")) {
- list.add("seed=1337");
- list.add("seed=" + new Random().nextInt());
- list.add("seed=random");
- } else if (pre.equals("pregen")) {
- list.add("500");
- list.add("1000");
- list.add("2000");
- list.add("5k");
- list.add("10k");
- list.add("25k");
}
}
@@ -111,13 +133,13 @@ public class CommandIrisCreate extends MortarCommand {
sender.sendMessage("You must remember to either have multiverse installed or use the Bukkit method, otherwise the world will go corrupt!");
sender.sendMessage("Wiki: https://volmitsoftware.gitbook.io/iris/getting-started");
- O b = new O();
+ O b = new O<>();
b.set(true);
if (sender.isPlayer()) {
try {
sender.player().teleport(world.get().getSpawnLocation());
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
}
@@ -130,9 +152,7 @@ public class CommandIrisCreate extends MortarCommand {
sender.sendMessage("Expect server lag during this time. Use '/iris pregen stop' to cancel");
new Pregenerator(world.get(), size, () ->
- {
- b.set(true);
- });
+ b.set(true));
}
World ww = world.get();
diff --git a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisFix.java b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisFix.java
index 3cb98b5a2..c3170c168 100644
--- a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisFix.java
+++ b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisFix.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.world;
import com.volmit.iris.Iris;
@@ -29,7 +47,7 @@ public class CommandIrisFix extends MortarCommand {
return true;
}
- int viewDistance = args.length > 0 ? Integer.valueOf(args[0]) : -1;
+ int viewDistance = args.length > 0 ? Integer.parseInt(args[0]) : -1;
if (viewDistance <= 1) {
J.a(() -> {
int fixed = a.getCompound().getDefaultEngine().getFramework().getEngineParallax().repairChunk(sender.player().getLocation().getChunk());
diff --git a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisPregen.java b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisPregen.java
index 7b9ea39be..6db7e0e4e 100644
--- a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisPregen.java
+++ b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisPregen.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.world;
import com.volmit.iris.Iris;
@@ -15,10 +33,11 @@ public class CommandIrisPregen extends MortarCommand {
public CommandIrisPregen() {
super("pregen", "preg", "p");
setDescription(
- "Pregen this world with optional parameters: " +
- "\n'1k' = 1000 by 1000 blocks, '1c' = 1 by 1 chunks, and '1r' = 32 by 32 chunks." +
- "\nIf you are using the console or want to pregen a world you're not in:" +
- "\nalso specify the name of the world. E.g. /ir pregen 5k world"
+ """
+ Pregen this world with optional parameters:\s
+ '1k' = 1000 by 1000 blocks, '1c' = 1 by 1 chunks, and '1r' = 32 by 32 chunks.
+ If you are using the console or want to pregen a world you're not in:
+ also specify the name of the world. E.g. /ir pregen 5k world"""
);
requiresPermission(Iris.perm.studio);
setCategory("Pregen");
diff --git a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisRegen.java b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisRegen.java
index c0d894651..ed19ca3af 100644
--- a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisRegen.java
+++ b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisRegen.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.world;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisUpdateWorld.java b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisUpdateWorld.java
index 36f84dd3e..22808dccc 100644
--- a/src/main/java/com/volmit/iris/manager/command/world/CommandIrisUpdateWorld.java
+++ b/src/main/java/com/volmit/iris/manager/command/world/CommandIrisUpdateWorld.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.world;
import com.volmit.iris.Iris;
@@ -30,6 +48,7 @@ public class CommandIrisUpdateWorld extends MortarCommand {
for (String i : args) {
if (i.equalsIgnoreCase("--fresh-download")) {
fresh = true;
+ break;
}
}
diff --git a/src/main/java/com/volmit/iris/manager/command/world/CommandLocate.java b/src/main/java/com/volmit/iris/manager/command/world/CommandLocate.java
index c7382ef09..800cc34c4 100644
--- a/src/main/java/com/volmit/iris/manager/command/world/CommandLocate.java
+++ b/src/main/java/com/volmit/iris/manager/command/world/CommandLocate.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.command.world;
import com.volmit.iris.Iris;
@@ -13,7 +31,7 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import java.util.Arrays;
public class CommandLocate extends MortarCommand implements Listener {
- CommandLocate instance;
+ final CommandLocate instance;
@EventHandler
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) {
diff --git a/src/main/java/com/volmit/iris/manager/edit/BlockEditor.java b/src/main/java/com/volmit/iris/manager/edit/BlockEditor.java
index 1f7239850..6a61874a3 100644
--- a/src/main/java/com/volmit/iris/manager/edit/BlockEditor.java
+++ b/src/main/java/com/volmit/iris/manager/edit/BlockEditor.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.edit;
import org.bukkit.block.Biome;
diff --git a/src/main/java/com/volmit/iris/manager/edit/BlockSignal.java b/src/main/java/com/volmit/iris/manager/edit/BlockSignal.java
index f1b6a6a7c..b7139034d 100644
--- a/src/main/java/com/volmit/iris/manager/edit/BlockSignal.java
+++ b/src/main/java/com/volmit/iris/manager/edit/BlockSignal.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.edit;
import com.volmit.iris.scaffold.parallel.MultiBurst;
@@ -10,6 +28,7 @@ import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
+@SuppressWarnings("InstantiationOfUtilityClass")
public class BlockSignal {
public static void of(Block block, int ticks) {
new BlockSignal(block, ticks);
diff --git a/src/main/java/com/volmit/iris/manager/edit/BukkitBlockEditor.java b/src/main/java/com/volmit/iris/manager/edit/BukkitBlockEditor.java
index 26c6ee9ca..792eda3e6 100644
--- a/src/main/java/com/volmit/iris/manager/edit/BukkitBlockEditor.java
+++ b/src/main/java/com/volmit/iris/manager/edit/BukkitBlockEditor.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.edit;
import com.volmit.iris.util.M;
@@ -5,6 +23,7 @@ import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
+@SuppressWarnings("ClassCanBeRecord")
public class BukkitBlockEditor implements BlockEditor {
private final World world;
diff --git a/src/main/java/com/volmit/iris/manager/edit/DustRevealer.java b/src/main/java/com/volmit/iris/manager/edit/DustRevealer.java
index 76223d193..a7c9e5527 100644
--- a/src/main/java/com/volmit/iris/manager/edit/DustRevealer.java
+++ b/src/main/java/com/volmit/iris/manager/edit/DustRevealer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.edit;
import com.volmit.iris.scaffold.IrisWorlds;
@@ -8,6 +26,7 @@ import lombok.Data;
import org.bukkit.World;
import org.bukkit.block.Block;
+@SuppressWarnings("ALL")
@Data
public class DustRevealer {
private final ParallaxAccess parallax;
diff --git a/src/main/java/com/volmit/iris/manager/edit/JigsawEditor.java b/src/main/java/com/volmit/iris/manager/edit/JigsawEditor.java
index 454efe088..63a9bc342 100644
--- a/src/main/java/com/volmit/iris/manager/edit/JigsawEditor.java
+++ b/src/main/java/com/volmit/iris/manager/edit/JigsawEditor.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.edit;
import com.google.gson.Gson;
diff --git a/src/main/java/com/volmit/iris/manager/edit/WEBlockEditor.java b/src/main/java/com/volmit/iris/manager/edit/WEBlockEditor.java
index 9066c172a..ca1b1cd8a 100644
--- a/src/main/java/com/volmit/iris/manager/edit/WEBlockEditor.java
+++ b/src/main/java/com/volmit/iris/manager/edit/WEBlockEditor.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.edit;
import com.sk89q.worldedit.EditSession;
@@ -44,7 +62,6 @@ public class WEBlockEditor implements BlockEditor {
@Override
public void close() {
es.close();
- return;
}
@Override
diff --git a/src/main/java/com/volmit/iris/manager/gui/IrisRenderer.java b/src/main/java/com/volmit/iris/manager/gui/IrisRenderer.java
index 7800b45df..085b443b3 100644
--- a/src/main/java/com/volmit/iris/manager/gui/IrisRenderer.java
+++ b/src/main/java/com/volmit/iris/manager/gui/IrisRenderer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.gui;
import com.volmit.iris.scaffold.engine.Engine;
@@ -6,6 +24,7 @@ import org.bukkit.Material;
import java.awt.image.BufferedImage;
+@SuppressWarnings("ClassCanBeRecord")
public class IrisRenderer {
private final Renderer renderer;
diff --git a/src/main/java/com/volmit/iris/manager/gui/IrisVision.java b/src/main/java/com/volmit/iris/manager/gui/IrisVision.java
index aec1110c6..ac4e19923 100644
--- a/src/main/java/com/volmit/iris/manager/gui/IrisVision.java
+++ b/src/main/java/com/volmit/iris/manager/gui/IrisVision.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.gui;
import com.volmit.iris.Iris;
@@ -14,12 +32,10 @@ import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.awt.image.BufferedImage;
-import java.awt.image.ImageObserver;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
public class IrisVision extends JPanel implements MouseWheelListener {
private static final long serialVersionUID = 2094606939770332040L;
@@ -45,38 +61,32 @@ public class IrisVision extends JPanel implements MouseWheelListener {
private final KMap fastpositions = new KMap<>();
private final KSet working = new KSet<>();
private final KSet workingfast = new KSet<>();
- private final ExecutorService e = Executors.newFixedThreadPool(8, new ThreadFactory() {
- @Override
- public Thread newThread(Runnable r) {
- tid++;
- Thread t = new Thread(r);
- t.setName("Iris HD Renderer " + tid);
- t.setPriority(Thread.MIN_PRIORITY);
- t.setUncaughtExceptionHandler((et, e) ->
- {
- Iris.info("Exception encountered in " + et.getName());
- e.printStackTrace();
- });
+ private final ExecutorService e = Executors.newFixedThreadPool(8, r -> {
+ tid++;
+ Thread t = new Thread(r);
+ t.setName("Iris HD Renderer " + tid);
+ t.setPriority(Thread.MIN_PRIORITY);
+ t.setUncaughtExceptionHandler((et, e) ->
+ {
+ Iris.info("Exception encountered in " + et.getName());
+ e.printStackTrace();
+ });
- return t;
- }
+ return t;
});
- private final ExecutorService eh = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), new ThreadFactory() {
- @Override
- public Thread newThread(Runnable r) {
- tid++;
- Thread t = new Thread(r);
- t.setName("Iris Renderer " + tid);
- t.setPriority(Thread.NORM_PRIORITY);
- t.setUncaughtExceptionHandler((et, e) ->
- {
- Iris.info("Exception encountered in " + et.getName());
- e.printStackTrace();
- });
+ private final ExecutorService eh = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), r -> {
+ tid++;
+ Thread t = new Thread(r);
+ t.setName("Iris Renderer " + tid);
+ t.setPriority(Thread.NORM_PRIORITY);
+ t.setUncaughtExceptionHandler((et, e) ->
+ {
+ Iris.info("Exception encountered in " + et.getName());
+ e.printStackTrace();
+ });
- return t;
- }
+ return t;
});
public IrisVision() {
@@ -223,12 +233,7 @@ public class IrisVision extends JPanel implements MouseWheelListener {
BufferedImage t = getTile(gg, iscale, Math.floorDiv((posX / iscale) + i, iscale) * iscale, Math.floorDiv((posZ / iscale) + j, iscale) * iscale, m);
if (t != null) {
- g.drawImage(t, i - ((posX / iscale) % (iscale)), j - ((posZ / iscale) % (iscale)), iscale, iscale, new ImageObserver() {
- @Override
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
- return true;
- }
- });
+ g.drawImage(t, i - ((posX / iscale) % (iscale)), j - ((posZ / iscale) % (iscale)), iscale, iscale, (img, infoflags, x, y, width, height) -> true);
}
}
}
@@ -280,7 +285,7 @@ public class IrisVision extends JPanel implements MouseWheelListener {
if (file != null) {
try {
frame.setIconImage(ImageIO.read(file));
- } catch (IOException e) {
+ } catch (IOException ignored) {
}
}
@@ -288,9 +293,7 @@ public class IrisVision extends JPanel implements MouseWheelListener {
public static void launch(IrisAccess g, int i) {
J.a(() ->
- {
- createAndShowGUI((x, z) -> g.getEngineAccess(i).draw(x, z), i, g.getCompound().getWorld());
- });
+ createAndShowGUI((x, z) -> g.getEngineAccess(i).draw(x, z), i, g.getCompound().getWorld()));
}
public void mouseWheelMoved(MouseWheelEvent e) {
@@ -303,6 +306,6 @@ public class IrisVision extends JPanel implements MouseWheelListener {
positions.clear();
fastpositions.clear();
mscale = mscale + ((0.044 * mscale) * notches);
- mscale = mscale < 0.00001 ? 0.00001 : mscale;
+ mscale = Math.max(mscale, 0.00001);
}
}
diff --git a/src/main/java/com/volmit/iris/manager/gui/NoiseExplorer.java b/src/main/java/com/volmit/iris/manager/gui/NoiseExplorer.java
index a2a539dc0..afe016593 100644
--- a/src/main/java/com/volmit/iris/manager/gui/NoiseExplorer.java
+++ b/src/main/java/com/volmit/iris/manager/gui/NoiseExplorer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.gui;
import com.volmit.iris.Iris;
@@ -19,12 +37,16 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
private static final long serialVersionUID = 2094606939770332040L;
static JComboBox combo;
+ @SuppressWarnings("CanBeFinal")
RollingSequence r = new RollingSequence(90);
+ @SuppressWarnings("CanBeFinal")
boolean colorMode = true;
double scale = 1;
+ @SuppressWarnings("CanBeFinal")
static boolean hd = false;
static double ascale = 10;
CNG cng = NoiseStyle.STATIC.create(new RNG(RNG.r.nextLong()));
+ @SuppressWarnings("CanBeFinal")
GroupedExecutor gx = new GroupedExecutor(Runtime.getRuntime().availableProcessors(), Thread.MAX_PRIORITY, "Iris Renderer");
ReentrantLock l = new ReentrantLock();
int[][] co;
@@ -39,6 +61,7 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
double mz = 0;
static double mxx = 0;
static double mzz = 0;
+ @SuppressWarnings("CanBeFinal")
static boolean down = false;
double lx = Double.MAX_VALUE; //MouseX
double lz = Double.MAX_VALUE; //MouseY
@@ -136,8 +159,7 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
accuracy = down ? accuracy * 4 : accuracy;
int v = 1000;
- if (g instanceof Graphics2D) {
- Graphics2D gg = (Graphics2D) g;
+ if (g instanceof Graphics2D gg) {
if (getParent().getWidth() != w || getParent().getHeight() != h) {
w = getParent().getWidth();
@@ -232,8 +254,8 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
JFrame frame = new JFrame("Noise Explorer");
NoiseExplorer nv = new NoiseExplorer();
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
- KList li = new KList(NoiseStyle.values()).toStringList();
- combo = new JComboBox(li.toArray(new String[li.size()]));
+ KList li = new KList<>(NoiseStyle.values()).toStringList();
+ combo = new JComboBox<>(li.toArray(new String[0]));
combo.setSelectedItem("STATIC");
combo.setFocusable(false);
combo.addActionListener(e -> {
@@ -266,7 +288,7 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
}
public static void launch() {
- EventQueue.invokeLater(() -> createAndShowGUI());
+ EventQueue.invokeLater(NoiseExplorer::createAndShowGUI);
}
static class HandScrollListener extends MouseAdapter {
diff --git a/src/main/java/com/volmit/iris/manager/gui/Renderer.java b/src/main/java/com/volmit/iris/manager/gui/Renderer.java
index 6e78906c2..252e8e62c 100644
--- a/src/main/java/com/volmit/iris/manager/gui/Renderer.java
+++ b/src/main/java/com/volmit/iris/manager/gui/Renderer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.gui;
import java.awt.*;
diff --git a/src/main/java/com/volmit/iris/manager/gui/TileRender.java b/src/main/java/com/volmit/iris/manager/gui/TileRender.java
index a2d2efdfa..e8da8bb4b 100644
--- a/src/main/java/com/volmit/iris/manager/gui/TileRender.java
+++ b/src/main/java/com/volmit/iris/manager/gui/TileRender.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.gui;
import lombok.Builder;
diff --git a/src/main/java/com/volmit/iris/manager/link/BKLink.java b/src/main/java/com/volmit/iris/manager/link/BKLink.java
index 1b6374975..aec8a9d6a 100644
--- a/src/main/java/com/volmit/iris/manager/link/BKLink.java
+++ b/src/main/java/com/volmit/iris/manager/link/BKLink.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.link;
import org.bukkit.Bukkit;
@@ -22,8 +40,7 @@ public class BKLink {
}
public Plugin getBK() {
- Plugin p = Bukkit.getPluginManager().getPlugin("BKCommonLib");
- return p;
+ return Bukkit.getPluginManager().getPlugin("BKCommonLib");
}
}
diff --git a/src/main/java/com/volmit/iris/manager/link/CitizensLink.java b/src/main/java/com/volmit/iris/manager/link/CitizensLink.java
index 799c6677e..fcbeaed31 100644
--- a/src/main/java/com/volmit/iris/manager/link/CitizensLink.java
+++ b/src/main/java/com/volmit/iris/manager/link/CitizensLink.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.link;
import org.bukkit.Bukkit;
@@ -12,21 +30,8 @@ public class CitizensLink {
return getCitizens() != null;
}
- // public Entity spawn(EntityType type, String npcType, Location a)
- // {
- // if(!supported())
- // {
- // return null;
- // }
- //
- // NPC npc = CitizensAPI.getNPCRegistry().createNPC(type, "");
- // npc.spawn(a);
- // return npc.getEntity();
- // }
-
public Plugin getCitizens() {
- Plugin p = Bukkit.getPluginManager().getPlugin("Citizens");
- return p;
+ return Bukkit.getPluginManager().getPlugin("Citizens");
}
}
diff --git a/src/main/java/com/volmit/iris/manager/link/MultiverseCoreLink.java b/src/main/java/com/volmit/iris/manager/link/MultiverseCoreLink.java
index d1d6f3996..531b00cae 100644
--- a/src/main/java/com/volmit/iris/manager/link/MultiverseCoreLink.java
+++ b/src/main/java/com/volmit/iris/manager/link/MultiverseCoreLink.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.link;
import com.volmit.iris.object.IrisDimension;
@@ -100,9 +118,8 @@ public class MultiverseCoreLink {
}
public Plugin getMultiverse() {
- Plugin p = Bukkit.getPluginManager().getPlugin("Multiverse-Core");
- return p;
+ return Bukkit.getPluginManager().getPlugin("Multiverse-Core");
}
public String envName(World.Environment environment) {
@@ -110,15 +127,12 @@ public class MultiverseCoreLink {
return "normal";
}
- switch (environment) {
- case NORMAL:
- return "normal";
- case NETHER:
- return "nether";
- case THE_END:
- return "end";
- }
+ return switch (environment) {
+ case NORMAL -> "normal";
+ case NETHER -> "nether";
+ case THE_END -> "end";
+ default -> environment.toString().toLowerCase();
+ };
- return environment.toString().toLowerCase();
}
}
diff --git a/src/main/java/com/volmit/iris/manager/link/MythicMobsLink.java b/src/main/java/com/volmit/iris/manager/link/MythicMobsLink.java
index 8402dc36f..4f80ad9b7 100644
--- a/src/main/java/com/volmit/iris/manager/link/MythicMobsLink.java
+++ b/src/main/java/com/volmit/iris/manager/link/MythicMobsLink.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.link;
import com.volmit.iris.util.KList;
@@ -37,12 +55,11 @@ public class MythicMobsLink {
}
}
- return v.toArray(new String[v.size()]);
+ return v.toArray(new String[0]);
}
public Plugin getMythicMobs() {
- Plugin p = Bukkit.getPluginManager().getPlugin("MythicMobs");
- return p;
+ return Bukkit.getPluginManager().getPlugin("MythicMobs");
}
}
diff --git a/src/main/java/com/volmit/iris/manager/report/Report.java b/src/main/java/com/volmit/iris/manager/report/Report.java
index 56eeee6c7..e9a894cf6 100644
--- a/src/main/java/com/volmit/iris/manager/report/Report.java
+++ b/src/main/java/com/volmit/iris/manager/report/Report.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.report;
import lombok.Builder;
@@ -14,6 +32,6 @@ public class Report {
private final String suggestion = "No Suggestion";
public String toString() {
- return type.toString() + ": " + title + ": " + message + ": Suggestion: " + suggestion;
+ return type + ": " + title + ": " + message + ": Suggestion: " + suggestion;
}
}
diff --git a/src/main/java/com/volmit/iris/manager/report/ReportType.java b/src/main/java/com/volmit/iris/manager/report/ReportType.java
index 5b4ffe11d..6264a01ed 100644
--- a/src/main/java/com/volmit/iris/manager/report/ReportType.java
+++ b/src/main/java/com/volmit/iris/manager/report/ReportType.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.manager.report;
public enum ReportType {
diff --git a/src/main/java/com/volmit/iris/nms/BiomeBaseInjector.java b/src/main/java/com/volmit/iris/nms/BiomeBaseInjector.java
new file mode 100644
index 000000000..c9e778e8b
--- /dev/null
+++ b/src/main/java/com/volmit/iris/nms/BiomeBaseInjector.java
@@ -0,0 +1,28 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.volmit.iris.nms;
+
+@FunctionalInterface
+public interface BiomeBaseInjector {
+ default void setBiome(int x, int z, Object biomeBase) {
+ setBiome(x, 0, z, biomeBase);
+ }
+
+ void setBiome(int x, int y, int z, Object biomeBase);
+}
diff --git a/src/main/java/com/volmit/iris/nms/INMS.java b/src/main/java/com/volmit/iris/nms/INMS.java
index 0cab540a4..4f9c8d8f5 100644
--- a/src/main/java/com/volmit/iris/nms/INMS.java
+++ b/src/main/java/com/volmit/iris/nms/INMS.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.nms;
import com.volmit.iris.Iris;
diff --git a/src/main/java/com/volmit/iris/nms/INMSBinding.java b/src/main/java/com/volmit/iris/nms/INMSBinding.java
index ef5650599..1ebf216cc 100644
--- a/src/main/java/com/volmit/iris/nms/INMSBinding.java
+++ b/src/main/java/com/volmit/iris/nms/INMSBinding.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.nms;
import org.bukkit.Location;
@@ -31,7 +49,7 @@ public interface INMSBinding {
return c.createWorld();
}
- int countCustomBiomes();
+ int countCustomBiomes();
void forceBiomeInto(int x, int y, int z, Object somethingVeryDirty, ChunkGenerator.BiomeGrid chunk);
}
diff --git a/src/main/java/com/volmit/iris/nms/v17_1/NMSBinding17_1.java b/src/main/java/com/volmit/iris/nms/v17_1/NMSBinding17_1.java
index 090f0addd..331e32ab2 100644
--- a/src/main/java/com/volmit/iris/nms/v17_1/NMSBinding17_1.java
+++ b/src/main/java/com/volmit/iris/nms/v17_1/NMSBinding17_1.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.nms.v17_1;
import com.volmit.iris.Iris;
@@ -25,8 +43,7 @@ public class NMSBinding17_1 implements INMSBinding {
private final KMap baseBiomeCache = new KMap<>();
private Field biomeStorageCache = null;
- private Object getBiomeStorage(ChunkGenerator.BiomeGrid g)
- {
+ private Object getBiomeStorage(ChunkGenerator.BiomeGrid g) {
try {
return getFieldForBiomeStorage(g).get(g);
} catch (IllegalAccessException e) {
@@ -39,8 +56,7 @@ public class NMSBinding17_1 implements INMSBinding {
private Field getFieldForBiomeStorage(Object storage) {
Field f = biomeStorageCache;
- if (f != null)
- {
+ if (f != null) {
return f;
}
try {
@@ -53,7 +69,7 @@ public class NMSBinding17_1 implements INMSBinding {
Iris.error(storage.getClass().getCanonicalName());
}
- biomeStorageCache = f;
+ biomeStorageCache = f;
return null;
}
@@ -86,6 +102,7 @@ public class NMSBinding17_1 implements INMSBinding {
return getCustomBiomeRegistry().d(ResourceKey.a(IRegistry.aO, new MinecraftKey(mckey)));
}
+ @SuppressWarnings("OptionalGetWithoutIsPresent")
@Override
public String getKeyForBiomeBase(Object biomeBase) {
return getCustomBiomeRegistry().c((BiomeBase) biomeBase).get().a().toString();
@@ -109,6 +126,7 @@ public class NMSBinding17_1 implements INMSBinding {
try {
Method f = from.getClass().getDeclaredMethod(name, classify(par));
f.setAccessible(true);
+ //noinspection unchecked
return (T) f.invoke(from, par);
} catch (Throwable e) {
e.printStackTrace();
@@ -121,6 +139,7 @@ public class NMSBinding17_1 implements INMSBinding {
try {
Method f = from.getDeclaredMethod(name, classify(par));
f.setAccessible(true);
+ //noinspection unchecked
return (T) f.invoke(null, par);
} catch (Throwable e) {
e.printStackTrace();
@@ -133,6 +152,7 @@ public class NMSBinding17_1 implements INMSBinding {
try {
Field f = from.getClass().getDeclaredField(name);
f.setAccessible(true);
+ //noinspection unchecked
return (T) f.get(from);
} catch (Throwable e) {
e.printStackTrace();
@@ -145,6 +165,7 @@ public class NMSBinding17_1 implements INMSBinding {
try {
Field f = t.getDeclaredField(name);
f.setAccessible(true);
+ //noinspection unchecked
return (T) f.get(null);
} catch (Throwable e) {
e.printStackTrace();
@@ -160,11 +181,13 @@ public class NMSBinding17_1 implements INMSBinding {
if (v != null) {
return v;
}
+ //noinspection unchecked
v = org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock.biomeToBiomeBase((IRegistry) registry, biome);
if (v == null) {
// Ok so there is this new biome name called "CUSTOM" in Paper's new releases.
// But, this does NOT exist within CraftBukkit which makes it return an error.
// So, we will just return the ID that the plains biome returns instead.
+ //noinspection unchecked
return org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock.biomeToBiomeBase((IRegistry) registry, Biome.PLAINS);
}
baseBiomeCache.put(biome, v);
@@ -188,16 +211,15 @@ public class NMSBinding17_1 implements INMSBinding {
@Override
public int countCustomBiomes() {
AtomicInteger a = new AtomicInteger(0);
- getCustomBiomeRegistry().d().stream().forEach((i) -> {
+ getCustomBiomeRegistry().d().forEach((i) -> {
MinecraftKey k = i.getKey().a();
- if(k.getNamespace().equals("minecraft"))
- {
+ if (k.getNamespace().equals("minecraft")) {
return;
}
a.incrementAndGet();
- Iris.verbose("Custom Biome: " + k.toString());
+ Iris.verbose("Custom Biome: " + k);
});
return a.get();
@@ -207,7 +229,7 @@ public class NMSBinding17_1 implements INMSBinding {
public void forceBiomeInto(int x, int y, int z, Object somethingVeryDirty, ChunkGenerator.BiomeGrid chunk) {
try {
BiomeStorage s = (BiomeStorage) getFieldForBiomeStorage(chunk).get(chunk);
- s.setBiome(x,y,z, (BiomeBase) somethingVeryDirty);
+ s.setBiome(x, y, z, (BiomeBase) somethingVeryDirty);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
diff --git a/src/main/java/com/volmit/iris/nms/v1X/NMSBinding1X.java b/src/main/java/com/volmit/iris/nms/v1X/NMSBinding1X.java
index 991e9bfcd..9eacde597 100644
--- a/src/main/java/com/volmit/iris/nms/v1X/NMSBinding1X.java
+++ b/src/main/java/com/volmit/iris/nms/v1X/NMSBinding1X.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.nms.v1X;
import com.volmit.iris.nms.INMSBinding;
diff --git a/src/main/java/com/volmit/iris/object/CarvingMode.java b/src/main/java/com/volmit/iris/object/CarvingMode.java
index 49c8ce3c5..443d21311 100644
--- a/src/main/java/com/volmit/iris/object/CarvingMode.java
+++ b/src/main/java/com/volmit/iris/object/CarvingMode.java
@@ -1,26 +1,45 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("Defines if an object is allowed to place in carvings, surfaces or both.")
public enum CarvingMode {
@Desc("Only place this object on surfaces (NOT under carvings)")
- @DontObfuscate
+
SURFACE_ONLY,
@Desc("Only place this object under carvings (NOT on the surface)")
- @DontObfuscate
+
CARVING_ONLY,
@Desc("This object can place anywhere")
- @DontObfuscate
+
ANYWHERE;
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean supportsCarving() {
return this.equals(ANYWHERE) || this.equals(CARVING_ONLY);
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean supportsSurface() {
return this.equals(ANYWHERE) || this.equals(SURFACE_ONLY);
}
diff --git a/src/main/java/com/volmit/iris/object/DecorationPart.java b/src/main/java/com/volmit/iris/object/DecorationPart.java
index 29dc2c747..96c6037ab 100644
--- a/src/main/java/com/volmit/iris/object/DecorationPart.java
+++ b/src/main/java/com/volmit/iris/object/DecorationPart.java
@@ -1,27 +1,44 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("Represents a location where decorations should go")
public enum DecorationPart {
@Desc("The default, decorate anywhere")
- @DontObfuscate
+
NONE,
@Desc("Targets shore lines (typically for sugar cane)")
- @DontObfuscate
+
SHORE_LINE,
@Desc("Target sea surfaces (typically for lilypads)")
- @DontObfuscate
+
SEA_SURFACE,
@Desc("Targets the sea floor (entire placement must be bellow sea level)")
- @DontObfuscate
+
SEA_FLOOR,
@Desc("Decorates on cave & carving ceilings or underside of overhangs")
- @DontObfuscate
+
CEILING,
}
diff --git a/src/main/java/com/volmit/iris/object/FontStyle.java b/src/main/java/com/volmit/iris/object/FontStyle.java
index fe871ab07..f278c74a5 100644
--- a/src/main/java/com/volmit/iris/object/FontStyle.java
+++ b/src/main/java/com/volmit/iris/object/FontStyle.java
@@ -1,19 +1,36 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("Represents a basic font style to apply to a font family")
public enum FontStyle {
@Desc("Plain old text")
- @DontObfuscate
+
PLAIN,
@Desc("Italicized Text")
- @DontObfuscate
+
ITALIC,
@Desc("Bold Text")
- @DontObfuscate
+
BOLD,
}
diff --git a/src/main/java/com/volmit/iris/object/InferredType.java b/src/main/java/com/volmit/iris/object/InferredType.java
index 1ecd02a54..5ba2be767 100644
--- a/src/main/java/com/volmit/iris/object/InferredType.java
+++ b/src/main/java/com/volmit/iris/object/InferredType.java
@@ -1,35 +1,52 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("Represents a biome type")
public enum InferredType {
@Desc("Represents any shore biome type")
- @DontObfuscate
+
SHORE,
@Desc("Represents any land biome type")
- @DontObfuscate
+
LAND,
@Desc("Represents any sea biome type")
- @DontObfuscate
+
SEA,
@Desc("Represents any cave biome type")
- @DontObfuscate
+
CAVE,
@Desc("Represents any river biome type")
- @DontObfuscate
+
RIVER,
@Desc("Represents any lake biome type")
- @DontObfuscate
+
LAKE,
@Desc("Defers the type to whatever another biome type that already exists is.")
- @DontObfuscate
+
DEFER
}
diff --git a/src/main/java/com/volmit/iris/object/InterpolationMethod.java b/src/main/java/com/volmit/iris/object/InterpolationMethod.java
index 386696fba..b9bf58911 100644
--- a/src/main/java/com/volmit/iris/object/InterpolationMethod.java
+++ b/src/main/java/com/volmit/iris/object/InterpolationMethod.java
@@ -1,116 +1,133 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("An interpolation method (or function) is simply a method of smoothing a position based on surrounding points on a grid. Bicubic for example is smoother, but has 4 times the checks than Bilinear for example. Try using BILINEAR_STARCAST_9 for beautiful results.")
public enum InterpolationMethod {
@Desc("No interpolation. Nearest Neighbor (bad for terrain, great for performance).")
- @DontObfuscate
+
NONE,
@Desc("Uses 4 nearby points in a square to calculate a 2d slope. Very fast but creates square artifacts. See: https://en.wikipedia.org/wiki/Bilinear_interpolation")
- @DontObfuscate
+
BILINEAR,
@Desc("Starcast is Iris's own creation. It uses raytrace checks to find a horizontal boundary nearby. 3 Checks in a circle. Typically starcast is used with another interpolation method. See BILINEAR_STARCAST_9 For example. Starcast is meant to 'break up' large, abrupt cliffs to make cheap interpolation smoother.")
- @DontObfuscate
+
STARCAST_3,
@Desc("Starcast is Iris's own creation. It uses raytrace checks to find a horizontal boundary nearby. 6 Checks in a circle. Typically starcast is used with another interpolation method. See BILINEAR_STARCAST_9 For example. Starcast is meant to 'break up' large, abrupt cliffs to make cheap interpolation smoother.")
- @DontObfuscate
+
STARCAST_6,
@Desc("Starcast is Iris's own creation. It uses raytrace checks to find a horizontal boundary nearby. 9 Checks in a circle. Typically starcast is used with another interpolation method. See BILINEAR_STARCAST_9 For example. Starcast is meant to 'break up' large, abrupt cliffs to make cheap interpolation smoother.")
- @DontObfuscate
+
STARCAST_9,
@Desc("Starcast is Iris's own creation. It uses raytrace checks to find a horizontal boundary nearby. 12 Checks in a circle. Typically starcast is used with another interpolation method. See BILINEAR_STARCAST_9 For example. Starcast is meant to 'break up' large, abrupt cliffs to make cheap interpolation smoother.")
- @DontObfuscate
+
STARCAST_12,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with bilinear.")
- @DontObfuscate
+
BILINEAR_STARCAST_3,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with bilinear.")
- @DontObfuscate
+
BILINEAR_STARCAST_6,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with bilinear.")
- @DontObfuscate
+
BILINEAR_STARCAST_9,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with bilinear.")
- @DontObfuscate
+
BILINEAR_STARCAST_12,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with hermite.")
- @DontObfuscate
+
HERMITE_STARCAST_3,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with hermite.")
- @DontObfuscate
+
HERMITE_STARCAST_6,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with hermite.")
- @DontObfuscate
+
HERMITE_STARCAST_9,
@Desc("Uses starcast to break up the abrupt sharp cliffs, then smooths the rest out with hermite.")
- @DontObfuscate
+
HERMITE_STARCAST_12,
@Desc("Uses bilinear but on a bezier curve. See: https://en.wikipedia.org/wiki/Bezier_curve")
- @DontObfuscate
+
BILINEAR_BEZIER,
@Desc("Uses Bilinear but with parametric curves alpha 2.")
- @DontObfuscate
+
BILINEAR_PARAMETRIC_2,
@Desc("Uses Bilinear but with parametric curves alpha 4.")
- @DontObfuscate
+
BILINEAR_PARAMETRIC_4,
@Desc("Uses Bilinear but with parametric curves alpha 1.5.")
- @DontObfuscate
+
BILINEAR_PARAMETRIC_1_5,
@Desc("Bicubic noise creates 4, 4-point splines for a total of 16 checks. Bcubic can go higher than expected and lower than expected right before a large change in slope.")
- @DontObfuscate
+
BICUBIC,
@Desc("Hermite is similar to bicubic, but faster and it can be tuned a little bit")
- @DontObfuscate
+
HERMITE,
@Desc("Essentially bicubic with zero tension")
- @DontObfuscate
+
CATMULL_ROM_SPLINE,
@Desc("Essentially bicubic with max tension")
- @DontObfuscate
+
HERMITE_TENSE,
@Desc("Hermite is similar to bicubic, this variant reduces the dimple artifacts of bicubic")
- @DontObfuscate
+
HERMITE_LOOSE,
@Desc("Hermite is similar to bicubic, this variant reduces the dimple artifacts of bicubic")
- @DontObfuscate
+
HERMITE_LOOSE_HALF_POSITIVE_BIAS,
@Desc("Hermite is similar to bicubic, this variant reduces the dimple artifacts of bicubic")
- @DontObfuscate
+
HERMITE_LOOSE_HALF_NEGATIVE_BIAS,
@Desc("Hermite is similar to bicubic, this variant reduces the dimple artifacts of bicubic")
- @DontObfuscate
+
HERMITE_LOOSE_FULL_POSITIVE_BIAS,
@Desc("Hermite is similar to bicubic, this variant reduces the dimple artifacts of bicubic")
- @DontObfuscate
+
HERMITE_LOOSE_FULL_NEGATIVE_BIAS,
}
diff --git a/src/main/java/com/volmit/iris/object/InventorySlotType.java b/src/main/java/com/volmit/iris/object/InventorySlotType.java
index 93b180be2..8bdcc64f2 100644
--- a/src/main/java/com/volmit/iris/object/InventorySlotType.java
+++ b/src/main/java/com/volmit/iris/object/InventorySlotType.java
@@ -1,27 +1,44 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("An inventory slot type is used to represent a type of slot for items to fit into in any given inventory.")
public enum InventorySlotType {
@Desc("Typically the one you want to go with. Storage represnents most slots in inventories.")
- @DontObfuscate
+
STORAGE,
@Desc("Used for the fuel slot in Furnaces, Blast furnaces, smokers etc.")
- @DontObfuscate
+
FUEL,
@Desc("Used for the cook slot in furnaces")
- @DontObfuscate
+
FURNACE,
@Desc("Used for the cook slot in blast furnaces")
- @DontObfuscate
+
BLAST_FURNACE,
@Desc("Used for the cook slot in smokers")
- @DontObfuscate
+
SMOKER,
}
diff --git a/src/main/java/com/volmit/iris/object/IrisAttributeModifier.java b/src/main/java/com/volmit/iris/object/IrisAttributeModifier.java
index 1ab25d8a6..0bbb40a46 100644
--- a/src/main/java/com/volmit/iris/object/IrisAttributeModifier.java
+++ b/src/main/java/com/volmit/iris/object/IrisAttributeModifier.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -19,36 +37,27 @@ import org.bukkit.inventory.meta.ItemMeta;
public class IrisAttributeModifier {
@Required
- @DontObfuscate
@Desc("The Attribute type. This type is pulled from the game attributes. Zombie & Horse attributes will not work on non-zombie/horse entities.\nUsing an attribute on an item will have affects when held, or worn. There is no way to specify further granularity as the game picks this depending on the item type.")
private Attribute attribute = null;
@MinNumber(2)
@Required
- @DontObfuscate
+
@Desc("The Attribute Name is used internally only for the game. This value should be unique to all other attributes applied to this item/entity. It is not shown in game.")
private String name = "";
- @DontObfuscate
-
@Desc("The application operation (add number is default). Add Number adds to the default value. \nAdd scalar_1 will multiply by 1 for example if the health is 20 and you multiply_scalar_1 by 0.5, the health will result in 30, not 10. Use negative values to achieve that.")
private Operation operation = Operation.ADD_NUMBER;
- @DontObfuscate
-
@Desc("Minimum amount for this modifier. Iris randomly chooses an amount, this is the minimum it can choose randomly for this attribute.")
private double minAmount = 1;
-
- @DontObfuscate
@Desc("Maximum amount for this modifier Iris randomly chooses an amount, this is the maximum it can choose randomly for this attribute.")
private double maxAmount = 1;
@MinNumber(0)
@MaxNumber(1)
-
- @DontObfuscate
@Desc("The chance that this attribute is applied (0 to 1). If the chance is 0.5 (50%), then Iris will only apply this attribute 50% of the time.")
private double chance = 1;
diff --git a/src/main/java/com/volmit/iris/object/IrisAxisRotationClamp.java b/src/main/java/com/volmit/iris/object/IrisAxisRotationClamp.java
index 2e94b491d..eb5c181a4 100644
--- a/src/main/java/com/volmit/iris/object/IrisAxisRotationClamp.java
+++ b/src/main/java/com/volmit/iris/object/IrisAxisRotationClamp.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -12,17 +30,15 @@ import lombok.experimental.Accessors;
@Desc("Represents a rotation axis with intervals and maxes. The x and z axis values are defaulted to disabled. The Y axis defaults to on, rotating by 90 degree increments.")
@Data
public class IrisAxisRotationClamp {
- @DontObfuscate
+
@Desc("Should this axis be rotated at all?")
private boolean enabled = false;
-
private transient boolean forceLock = false;
@Required
@DependsOn({"max"})
@MinNumber(-360)
@MaxNumber(360)
- @DontObfuscate
@Desc("The minimum angle (from) or set this and max to zero for any angle degrees. Set both to the same non-zero value to force it to that angle only")
private double min = 0;
@@ -30,7 +46,6 @@ public class IrisAxisRotationClamp {
@DependsOn({"min"})
@MinNumber(-360)
@MaxNumber(360)
- @DontObfuscate
@Desc("The maximum angle (to) or set this and min to zero for any angle degrees. Set both to the same non-zero value to force it to that angle only")
private double max = 0;
@@ -38,7 +53,6 @@ public class IrisAxisRotationClamp {
@DependsOn({"min", "max"})
@MinNumber(0)
@MaxNumber(360)
- @DontObfuscate
@Desc("Iris spins the axis but not freely. For example an interval of 90 would mean 4 possible angles (right angles) degrees. \nSetting this to 0 means totally free rotation.\n\nNote that a lot of structures can have issues with non 90 degree intervals because the minecraft block resolution is so low.")
private double interval = 0;
diff --git a/src/main/java/com/volmit/iris/object/IrisBiome.java b/src/main/java/com/volmit/iris/object/IrisBiome.java
index b36266f2b..c3dc00502 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiome.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiome.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -18,165 +36,154 @@ import org.bukkit.block.data.BlockData;
import java.awt.*;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a biome in iris. Biomes are placed inside of regions and hold objects.\nA biome consists of layers (block palletes), decorations, objects & generators.")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisBiome extends IrisRegistrant implements IRare {
@MinNumber(2)
@Required
- @DontObfuscate
+
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
private String name = "A Biome";
- @DontObfuscate
- @Desc("If the biome type custom is defined, specify this")
- private IrisBiomeCustom custom;
- @DontObfuscate
+ @ArrayType(min = 1, type = IrisBiomeCustom.class)
+ @Desc("If the biome type custom is defined, specify this")
+ private KList customDerivitives;
+
+
@Desc("Entity spawns to override or add to this biome. Anytime an entity spawns, it has a chance to be replaced as one of these overrides.")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList entitySpawnOverrides = new KList<>();
- @DontObfuscate
+
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList features = new KList<>();
- @DontObfuscate
+
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList entityInitialSpawns = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
- @DontObfuscate
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList effects = new KList<>();
- @DontObfuscate
+
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
private IrisGeneratorStyle biomeStyle = NoiseStyle.SIMPLEX.style();
@ArrayType(min = 1, type = IrisBlockDrops.class)
- @DontObfuscate
@Desc("Define custom block drops for this biome")
private KList blockDrops = new KList<>();
- @DontObfuscate
+
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0.0001)
- @DontObfuscate
+
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
private double biomeZoom = 1;
- @DontObfuscate
+
@Desc("Layers no longer descend from the surface block, they descend from the max possible height the biome can produce (constant) creating mesa like layers.")
private boolean lockLayers = false;
- @DontObfuscate
+
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
private int lockLayersMax = 7;
@MinNumber(1)
@MaxNumber(512)
- @DontObfuscate
@Desc("The rarity of this biome (integer)")
private int rarity = 1;
- @DontObfuscate
+
@Desc("A color for visualizing this biome with a color. I.e. #F13AF5. This will show up on the map.")
private String color = null;
@Required
- @DontObfuscate
+
@Desc("The raw derivative of this biome. This is required or the terrain will not properly generate. Use any vanilla biome type. Look in examples/biome-list.txt")
private Biome derivative = Biome.THE_VOID;
@Required
- @DontObfuscate
+
@Desc("Override the derivative when vanilla places structures to this derivative. This is useful for example if you have an ocean biome, but you have set the derivative to desert to get a brown-ish color. To prevent desert structures from spawning on top of your ocean, you can set your vanillaDerivative to ocean, to allow for vanilla structures. Not defining this value will simply select the derivative.")
private Biome vanillaDerivative = null;
@ArrayType(min = 1, type = Biome.class)
- @DontObfuscate
@Desc("You can instead specify multiple biome derivatives to randomly scatter colors in this biome")
private KList biomeScatter = new KList<>();
@ArrayType(min = 1, type = Biome.class)
- @DontObfuscate
@Desc("Since 1.13 supports 3D biomes, you can add different derivative colors for anything above the terrain. (Think swampy tree leaves with a desert looking grass surface)")
private KList biomeSkyScatter = new KList<>();
- @DontObfuscate
+
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, how much smaller will it be (inside of this biome). Higher values means a smaller biome relative to this biome's size. Set higher than 1.0 and below 3.0 for best results.")
private double childShrinkFactor = 1.5;
- @DontObfuscate
+
@DependsOn({"children"})
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
private KList children = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
- @DontObfuscate
@Desc("Jigsaw structures")
private KList jigsawStructures = new KList<>();
@RegistryListBiome
- @DontObfuscate
+
@Desc("The carving biome. If specified the biome will be used when under a carving instead of this current biome.")
private String carvingBiome = "";
- @DontObfuscate
+
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
private IrisBiomePaletteLayer slab = new IrisBiomePaletteLayer().zero();
- @DontObfuscate
+
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero();
@Required
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
- @DontObfuscate
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
private KList layers = new KList().qadd(new IrisBiomePaletteLayer());
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
- @DontObfuscate
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
- private KList seaLayers = new KList();
+ private KList seaLayers = new KList<>();
@ArrayType(min = 1, type = IrisDecorator.class)
- @DontObfuscate
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
- private KList decorators = new KList();
+ private KList decorators = new KList<>();
@ArrayType(min = 1, type = IrisObjectPlacement.class)
- @DontObfuscate
@Desc("Objects define what schematics (iob files) iris will place in this biome")
- private KList objects = new KList();
+ private KList objects = new KList<>();
@Required
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
- @DontObfuscate
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
private KList generators = new KList().qadd(new IrisBiomeGeneratorLink());
@ArrayType(min = 1, type = IrisDepositGenerator.class)
- @DontObfuscate
@Desc("Define biome deposit generators that add onto the existing regional and global deposit generators")
private KList deposits = new KList<>();
@@ -200,9 +207,8 @@ public class IrisBiome extends IrisRegistrant implements IRare {
return vanillaDerivative == null ? derivative : vanillaDerivative;
}
- public boolean isCustom()
- {
- return getCustom() != null;
+ public boolean isCustom() {
+ return getCustomDerivitives() != null && getCustomDerivitives().isNotEmpty();
}
public double getGenLinkMax(String loadKey) {
@@ -303,9 +309,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
public CNG getBiomeGenerator(RNG random) {
return biomeGenerator.aquire(() ->
- {
- return biomeStyle.create(random.nextParallelRNG(213949 + 228888 + getRarity() + getName().length()));
- });
+ biomeStyle.create(random.nextParallelRNG(213949 + 228888 + getRarity() + getName().length())));
}
public CNG getChildrenGenerator(RNG random, int sig, double scale) {
@@ -399,7 +403,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
for (int i = 0; i < maxDepth; i++) {
int offset = (255 - height) - i;
int index = offset % data.size();
- real.add(data.get(index < 0 ? 0 : index));
+ real.add(data.get(Math.max(index, 0)));
}
return real;
@@ -517,6 +521,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
return isSea() || isLake() || isRiver();
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isShore() {
if (inferredType == null) {
return false;
@@ -536,6 +541,14 @@ public class IrisBiome extends IrisRegistrant implements IRare {
return biomeSkyScatter.get(getBiomeGenerator(rng).fit(0, biomeSkyScatter.size() - 1, x, y, z));
}
+ public IrisBiomeCustom getCustomBiome(RNG rng, double x, double y, double z) {
+ if (customDerivitives.size() == 1) {
+ return customDerivitives.get(0);
+ }
+
+ return customDerivitives.get(getBiomeGenerator(rng).fit(0, customDerivitives.size() - 1, x, y, z));
+ }
+
public KList getRealChildren(DataProvider g) {
return realChildren.aquire(() ->
{
@@ -557,14 +570,14 @@ public class IrisBiome extends IrisRegistrant implements IRare {
if (limit > 0) {
for (String i : getChildren()) {
IrisBiome b = g.getData().getBiomeLoader().load(i);
- int l = limit;
- m.addAll(b.getAllChildren(g, l));
+ m.addAll(b.getAllChildren(g, limit));
}
}
- return new KList(m);
+ return new KList<>(m);
}
+ //TODO: Test
public Biome getGroundBiome(RNG rng, double x, double y, double z) {
if (biomeScatter.isEmpty()) {
return getDerivative();
diff --git a/src/main/java/com/volmit/iris/object/IrisBiomeCustom.java b/src/main/java/com/volmit/iris/object/IrisBiomeCustom.java
index e9867ef54..28212a4b3 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiomeCustom.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiomeCustom.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -15,70 +33,65 @@ import java.awt.*;
@Desc("A custom biome, generated through a datapack")
@Data
public class IrisBiomeCustom {
- @DontObfuscate
+
@Required
@Desc("The resource key of this biome. Just a simple id such as 'plains' or something.")
private String id = "";
@MinNumber(-3)
@MaxNumber(3)
- @DontObfuscate
@Desc("The biome's temperature")
private double temperature = 0.8;
@MinNumber(-3)
@MaxNumber(3)
- @DontObfuscate
@Desc("The biome's downfall amount (snow / rain), see preci")
private double humidity = 0.4;
- @DontObfuscate
+
@Desc("The biome's downfall type")
private IrisBiomeCustomPrecipType downfallType = IrisBiomeCustomPrecipType.rain;
- @DontObfuscate
+
@Desc("The biome's category type")
private IrisBiomeCustomCategory category = IrisBiomeCustomCategory.plains;
- @DontObfuscate
+
@Desc("The color of the sky, top half of sky. (hex format)")
private String skyColor = "#79a8e1";
- @DontObfuscate
+
@Desc("The color of the fog, bottom half of sky. (hex format)")
private String fogColor = "#c0d8e1";
- @DontObfuscate
+
@Desc("The color of the water (hex format). Leave blank / don't define to not change")
private String waterColor = "#3f76e4";
- @DontObfuscate
+
@Desc("The color of water fog (hex format). Leave blank / don't define to not change")
private String waterFogColor = "#050533";
- @DontObfuscate
+
@Desc("The color of the grass (hex format). Leave blank / don't define to not change")
private String grassColor = "";
- @DontObfuscate
+
@Desc("The color of foliage (hex format). Leave blank / don't define to not change")
private String foliageColor = "";
- public String generateJson()
- {
+ public String generateJson() {
JSONObject effects = new JSONObject();
effects.put("sky_color", parseColor(getSkyColor()));
effects.put("fog_color", parseColor(getFogColor()));
effects.put("water_color", parseColor(getWaterColor()));
effects.put("water_fog_color", parseColor(getWaterFogColor()));
- if(getGrassColor() != null)
- {
+ if (!getGrassColor().isEmpty()) {
effects.put("grass_color", parseColor(getGrassColor()));
}
- if(getFoliageColor() != null)
- {
+ if (!getFoliageColor().isEmpty()) {
effects.put("foliage_color", parseColor(getFoliageColor()));
}
@@ -105,7 +118,7 @@ public class IrisBiomeCustom {
try {
return Color.decode(v).getRGB();
} catch (Throwable e) {
- Iris.error("Error Parsing '''color''', (" + c+ ")");
+ Iris.error("Error Parsing '''color''', (" + c + ")");
}
return 0;
diff --git a/src/main/java/com/volmit/iris/object/IrisBiomeCustomCategory.java b/src/main/java/com/volmit/iris/object/IrisBiomeCustomCategory.java
index 8f1ece8f6..f578a8ea5 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiomeCustomCategory.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiomeCustomCategory.java
@@ -1,7 +1,27 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
-public enum IrisBiomeCustomCategory
-{
+import com.volmit.iris.util.Desc;
+
+@Desc("The custom biome category. Vanilla asks for this, basically what represents your biome closest?")
+public enum IrisBiomeCustomCategory {
beach,
desert,
extreme_hills,
diff --git a/src/main/java/com/volmit/iris/object/IrisBiomeCustomPrecipType.java b/src/main/java/com/volmit/iris/object/IrisBiomeCustomPrecipType.java
index 7a618f34f..105ddf112 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiomeCustomPrecipType.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiomeCustomPrecipType.java
@@ -1,19 +1,36 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
-public enum IrisBiomeCustomPrecipType
-{
+@Desc("Snow, rain, or nothing")
+public enum IrisBiomeCustomPrecipType {
@Desc("No downfall")
- @DontObfuscate
+
none,
@Desc("Rain downfall")
- @DontObfuscate
+
rain,
@Desc("Snow downfall")
- @DontObfuscate
+
snow
}
diff --git a/src/main/java/com/volmit/iris/object/IrisBiomeGeneratorLink.java b/src/main/java/com/volmit/iris/object/IrisBiomeGeneratorLink.java
index eda606f21..32626c5be 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiomeGeneratorLink.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiomeGeneratorLink.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
@@ -16,7 +34,7 @@ import lombok.experimental.Accessors;
public class IrisBiomeGeneratorLink {
@RegistryListGenerator
- @DontObfuscate
+
@Desc("The generator id")
private String generator = "default";
@@ -24,7 +42,7 @@ public class IrisBiomeGeneratorLink {
@Required
@MinNumber(-256) // TODO: WARNING HEIGHT
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The min block value (value + fluidHeight)")
private int min = 0;
@@ -32,7 +50,7 @@ public class IrisBiomeGeneratorLink {
@Required
@MinNumber(-256) // TODO: WARNING HEIGHT
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The max block value (value + fluidHeight)")
private int max = 0;
diff --git a/src/main/java/com/volmit/iris/object/IrisBiomeMutation.java b/src/main/java/com/volmit/iris/object/IrisBiomeMutation.java
index 211f5de6a..b45fb536d 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiomeMutation.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiomeMutation.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
@@ -18,36 +36,31 @@ public class IrisBiomeMutation {
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("One of The following biomes or regions must show up")
private KList sideA = new KList<>();
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("One of The following biomes or regions must show up")
private KList sideB = new KList<>();
@Required
@MinNumber(1)
@MaxNumber(1024)
- @DontObfuscate
@Desc("The scan radius for placing this mutator")
private int radius = 16;
@Required
@MinNumber(1)
@MaxNumber(32)
- @DontObfuscate
@Desc("How many tries per chunk to check for this mutation")
private int checks = 2;
@RegistryListObject
@ArrayType(min = 1, type = IrisObjectPlacement.class)
- @DontObfuscate
@Desc("Objects define what schematics (iob files) iris will place in this biome mutation")
- private KList objects = new KList();
+ private KList objects = new KList<>();
private final transient AtomicCache> sideACache = new AtomicCache<>();
private final transient AtomicCache> sideBCache = new AtomicCache<>();
@@ -64,24 +77,26 @@ public class IrisBiomeMutation {
KSet r = new KSet<>();
for (String i : s) {
- String q = i;
- if (q.startsWith("^")) {
- r.addAll(xg.getData().getRegionLoader().load(q.substring(1)).getLandBiomes());
- continue;
- } else if (q.startsWith("*")) {
- String name = q.substring(1);
+ if (i.startsWith("^")) {
+ r.addAll(xg.getData().getRegionLoader().load(i.substring(1)).getLandBiomes());
+ } else if (i.startsWith("*")) {
+ String name = i.substring(1);
r.addAll(xg.getData().getBiomeLoader().load(name).getAllChildren(xg, 7));
- } else if (q.startsWith("!")) {
- r.remove(q.substring(1));
- } else if (q.startsWith("!*")) {
- String name = q.substring(2);
- r.removeAll(xg.getData().getBiomeLoader().load(name).getAllChildren(xg, 7));
+ } else if (i.startsWith("!")) {
+ r.remove(i.substring(1));
+ } else if (i.startsWith("!*")) {
+ String name = i.substring(2);
+
+ for(String g : xg.getData().getBiomeLoader().load(name).getAllChildren(xg, 7))
+ {
+ r.remove(g);
+ }
} else {
- r.add(q);
+ r.add(i);
}
}
- return new KList(r);
+ return new KList<>(r);
}
}
diff --git a/src/main/java/com/volmit/iris/object/IrisBiomePaletteLayer.java b/src/main/java/com/volmit/iris/object/IrisBiomePaletteLayer.java
index 8a61e269a..f6278efe5 100644
--- a/src/main/java/com/volmit/iris/object/IrisBiomePaletteLayer.java
+++ b/src/main/java/com/volmit/iris/object/IrisBiomePaletteLayer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -16,36 +34,34 @@ import org.bukkit.block.data.BlockData;
@Desc("A layer of surface / subsurface material in biomes")
@Data
public class IrisBiomePaletteLayer {
- @DontObfuscate
+
@Desc("The style of noise")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@DependsOn({"minHeight", "maxHeight"})
@MinNumber(0)
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The min thickness of this layer")
private int minHeight = 1;
@DependsOn({"minHeight", "maxHeight"})
@MinNumber(1)
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The max thickness of this layer")
private int maxHeight = 1;
- @DontObfuscate
+
@Desc("If set, this layer will change size depending on the slope. If in bounds, the layer will get larger (taller) the closer to the center of this slope clip it is. If outside of the slipe's bounds, this layer will not show.")
private IrisSlopeClip slopeCondition = new IrisSlopeClip();
@MinNumber(0.0001)
- @DontObfuscate
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
private double zoom = 5;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
- @DontObfuscate
@Desc("The palette of blocks to be used in this layer")
private KList palette = new KList().qadd(new IrisBlockData("GRASS_BLOCK"));
diff --git a/src/main/java/com/volmit/iris/object/IrisBlockData.java b/src/main/java/com/volmit/iris/object/IrisBlockData.java
index 08c136705..f4fc4a766 100644
--- a/src/main/java/com/volmit/iris/object/IrisBlockData.java
+++ b/src/main/java/com/volmit/iris/object/IrisBlockData.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -11,6 +29,9 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.bukkit.block.data.BlockData;
+import java.util.Map;
+
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@@ -20,29 +41,28 @@ import org.bukkit.block.data.BlockData;
public class IrisBlockData extends IrisRegistrant {
@RegistryListBlockType
@Required
- @DontObfuscate
+
@Desc("The block to use")
private String block = "air";
@Desc("Debug this block by printing it to the console when it's used")
- @DontObfuscate
+
private boolean debug = false;
- @DontObfuscate
+
@Desc("The resource key. Typically Minecraft")
private String key = "minecraft";
@MinNumber(1)
@MaxNumber(1000)
- @DontObfuscate
@Desc("The weight is used when this block data is inside of a list of blockdata. A weight of two is just as if you placed two of the same block data values in the same list making it more common when randomly picked.")
private int weight = 1;
- @DontObfuscate
+
@Desc("If the block cannot be created on this version, Iris will attempt to use this backup block data instead.")
private IrisBlockData backup = null;
- @DontObfuscate
+
@Desc("Optional properties for this block data such as 'waterlogged': true")
private KMap data = new KMap<>();
@@ -60,8 +80,8 @@ public class IrisBlockData extends IrisRegistrant {
KList r = new KList<>();
- for (String i : data.keySet()) {
- r.add(i + "=" + filter(data.get(i).toString()));
+ for (Map.Entry entry : data.entrySet()) {
+ r.add(entry.getKey() + "=" + filter(entry.getValue().toString()));
}
return "[" + r.toString(",") + "]";
@@ -177,13 +197,13 @@ public class IrisBlockData extends IrisRegistrant {
try {
return Integer.valueOf(string);
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
try {
return Double.valueOf(string).intValue();
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
diff --git a/src/main/java/com/volmit/iris/object/IrisBlockDrops.java b/src/main/java/com/volmit/iris/object/IrisBlockDrops.java
index 9f8edc7dd..fee02ac61 100644
--- a/src/main/java/com/volmit/iris/object/IrisBlockDrops.java
+++ b/src/main/java/com/volmit/iris/object/IrisBlockDrops.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.manager.IrisDataManager;
@@ -19,22 +37,22 @@ public class IrisBlockDrops {
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The blocks that drop loot")
- private KList blocks = new KList();
+ private KList blocks = new KList<>();
+
- @DontObfuscate
@Desc("If exact blocks is set to true, minecraft:barrel[axis=x] will only drop for that axis. When exact is false (default) any barrel will drop the defined drops.")
private boolean exactBlocks = false;
- @DontObfuscate
+
@Desc("Add in specific items to drop")
@ArrayType(min = 1, type = IrisLoot.class)
private KList drops = new KList<>();
- @DontObfuscate
+
@Desc("If this is in a biome, setting skipParents to true will ignore the drops in the region and dimension for this block type. The default (false) will allow all three nodes to fire and add to a list of drops.")
private boolean skipParents = false;
- @DontObfuscate
+
@Desc("Removes the default vanilla block drops and only drops the given items & any parent loot tables specified for this block type.")
private boolean replaceVanillaDrops = false;
@@ -65,6 +83,8 @@ public class IrisBlockDrops {
return false;
}
+ // TODO: WARNING USES RNG.R
+ @Deprecated
public void fillDrops(boolean debug, KList d) {
for (IrisLoot i : getDrops()) {
if (RNG.r.i(1, i.getRarity()) == i.getRarity()) {
diff --git a/src/main/java/com/volmit/iris/object/IrisCarveLayer.java b/src/main/java/com/volmit/iris/object/IrisCarveLayer.java
index b03e524e8..835418e43 100644
--- a/src/main/java/com/volmit/iris/object/IrisCarveLayer.java
+++ b/src/main/java/com/volmit/iris/object/IrisCarveLayer.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -15,31 +33,27 @@ import lombok.experimental.Accessors;
@Data
public class IrisCarveLayer {
@Required
- @DontObfuscate
+
@Desc("The 4d slope this carve layer follows")
private IrisGeneratorStyle style = new IrisGeneratorStyle();
@MaxNumber(512)
@MinNumber(-128)
- @DontObfuscate
@Desc("The max height")
private int maxHeight = 220;
@MinNumber(0.0)
@MaxNumber(1.0)
- @DontObfuscate
@Desc("The full percentage means the 4D opacity of this carver will decay from 100% to 0% at the min & max vertical ranges. Setting the percent to 1.0 will make a very drastic & charp change at the edge of the vertical min & max. Where as 0.15 means only 15% of the vertical range will actually be 100% opacity.")
private double fullPercent = 0.5;
@MaxNumber(512)
@MinNumber(-128)
- @DontObfuscate
@Desc("The min height")
private int minHeight = 147;
@MaxNumber(1)
@MinNumber(0)
- @DontObfuscate
@Desc("The threshold used as: \n\ncarved = noise(x,y,z) > threshold")
private double threshold = 0.5;
diff --git a/src/main/java/com/volmit/iris/object/IrisCaveFluid.java b/src/main/java/com/volmit/iris/object/IrisCaveFluid.java
index 24c670cb6..da24d72f8 100644
--- a/src/main/java/com/volmit/iris/object/IrisCaveFluid.java
+++ b/src/main/java/com/volmit/iris/object/IrisCaveFluid.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.manager.IrisDataManager;
@@ -18,16 +36,15 @@ public class IrisCaveFluid {
@Required
@MaxNumber(255)
@MinNumber(0)
- @DontObfuscate
@Desc("The fluid height of the cave")
private int fluidHeight = 35;
- @DontObfuscate
+
@Desc("Insead of fluidHeight & below being fluid, turning inverse height on will simply spawn fluid in this cave layer from min(max_height, cave_height) to the fluid height. Basically, fluid will spawn above the fluidHeight value instead of below the fluidHeight.")
private boolean inverseHeight = false;
@Required
- @DontObfuscate
+
@Desc("The fluid type that should spawn here")
private IrisBlockData fluidType = new IrisBlockData("CAVE_AIR");
diff --git a/src/main/java/com/volmit/iris/object/IrisCaveLayer.java b/src/main/java/com/volmit/iris/object/IrisCaveLayer.java
index 74bde0b8f..dd1be56d8 100644
--- a/src/main/java/com/volmit/iris/object/IrisCaveLayer.java
+++ b/src/main/java/com/volmit/iris/object/IrisCaveLayer.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.MinNumber;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
@@ -16,30 +33,28 @@ import lombok.experimental.Accessors;
@Data
public class IrisCaveLayer {
@Required
- @DontObfuscate
+
@Desc("The vertical slope this cave layer follows")
private IrisShapedGeneratorStyle verticalSlope = new IrisShapedGeneratorStyle();
@Required
- @DontObfuscate
+
@Desc("The horizontal slope this cave layer follows")
private IrisShapedGeneratorStyle horizontalSlope = new IrisShapedGeneratorStyle();
- @DontObfuscate
+
@Desc("If defined, a cave fluid will fill this cave below (or above) the specified fluidHeight in this object.")
private IrisCaveFluid fluid = new IrisCaveFluid();
@MinNumber(0.001)
- @DontObfuscate
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
private double caveZoom = 1D;
@MinNumber(0.001)
- @DontObfuscate
@Desc("The cave thickness.")
private double caveThickness = 1D;
- @DontObfuscate
+
@Desc("If set to true, this cave layer can break the surface")
private boolean canBreakSurface = false;
diff --git a/src/main/java/com/volmit/iris/object/IrisColor.java b/src/main/java/com/volmit/iris/object/IrisColor.java
index 8774bd713..4e87029f2 100644
--- a/src/main/java/com/volmit/iris/object/IrisColor.java
+++ b/src/main/java/com/volmit/iris/object/IrisColor.java
@@ -1,8 +1,25 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.MaxNumber;
import com.volmit.iris.util.MinNumber;
import lombok.Data;
@@ -17,25 +34,25 @@ import java.awt.*;
@Desc("Represents a color")
@Data
public class IrisColor {
- @DontObfuscate
+
@MaxNumber(7)
@MinNumber(6)
@Desc("Pass in a 6 digit hexadecimal color to fill R G and B values. You can also include the # symbol, but it's not required.")
private String hex = null;
- @DontObfuscate
+
@MaxNumber(255)
@MinNumber(0)
@Desc("Represents the red channel. Only define this if you are not defining the hex value.")
private int red = 0;
- @DontObfuscate
+
@MaxNumber(255)
@MinNumber(0)
@Desc("Represents the green channel. Only define this if you are not defining the hex value.")
private int green = 0;
- @DontObfuscate
+
@MaxNumber(255)
@MinNumber(0)
@Desc("Represents the blue channel. Only define this if you are not defining the hex value.")
@@ -49,7 +66,7 @@ public class IrisColor {
String v = (hex.startsWith("#") ? hex : "#" + hex).trim();
try {
return Color.decode(v);
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
}
@@ -73,8 +90,8 @@ public class IrisColor {
int g = 0;
int b = 0;
- for (int i = 0; i < c.length; i++) {
- int rgb = c[i].getRGB();
+ for (Color value : c) {
+ int rgb = value.getRGB();
int a1 = (rgb >> 24 & 0xff);
int r1 = ((rgb & 0xff0000) >> 16);
int g1 = ((rgb & 0xff00) >> 8);
diff --git a/src/main/java/com/volmit/iris/object/IrisCompat.java b/src/main/java/com/volmit/iris/object/IrisCompat.java
index a1f3b6384..6edf71b33 100644
--- a/src/main/java/com/volmit/iris/object/IrisCompat.java
+++ b/src/main/java/com/volmit/iris/object/IrisCompat.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.google.gson.Gson;
@@ -149,8 +167,6 @@ public class IrisCompat {
}
} catch (JsonSyntaxException e) {
e.printStackTrace();
- } catch (IOException e) {
- throw e;
}
return def;
diff --git a/src/main/java/com/volmit/iris/object/IrisCompatabilityBlockFilter.java b/src/main/java/com/volmit/iris/object/IrisCompatabilityBlockFilter.java
index ad0b5f691..2da2d9c38 100644
--- a/src/main/java/com/volmit/iris/object/IrisCompatabilityBlockFilter.java
+++ b/src/main/java/com/volmit/iris/object/IrisCompatabilityBlockFilter.java
@@ -1,10 +1,27 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.cache.AtomicCache;
import com.volmit.iris.util.B;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -19,16 +36,16 @@ import org.bukkit.block.data.BlockData;
@Data
public class IrisCompatabilityBlockFilter {
@Required
- @DontObfuscate
+
@Desc("When iris sees this block, and it's not reconized")
private String when = "";
@Required
- @DontObfuscate
+
@Desc("Replace it with this block. Dont worry if this block is also not reconized, iris repeat this compat check.")
private String supplement = "";
- @DontObfuscate
+
@Desc("If exact is true, it compares block data for example minecraft:some_log[axis=x]")
private boolean exact = false;
diff --git a/src/main/java/com/volmit/iris/object/IrisCompatabilityItemFilter.java b/src/main/java/com/volmit/iris/object/IrisCompatabilityItemFilter.java
index 6d4a012fa..93011b4cd 100644
--- a/src/main/java/com/volmit/iris/object/IrisCompatabilityItemFilter.java
+++ b/src/main/java/com/volmit/iris/object/IrisCompatabilityItemFilter.java
@@ -1,10 +1,27 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.cache.AtomicCache;
import com.volmit.iris.util.B;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.Required;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -17,12 +34,12 @@ import org.bukkit.Material;
@Data
public class IrisCompatabilityItemFilter {
@Required
- @DontObfuscate
+
@Desc("When iris sees this block, and it's not reconized")
private String when = "";
@Required
- @DontObfuscate
+
@Desc("Replace it with this block. Dont worry if this block is also not reconized, iris repeat this compat check.")
private String supplement = "";
diff --git a/src/main/java/com/volmit/iris/object/IrisDecorator.java b/src/main/java/com/volmit/iris/object/IrisDecorator.java
index 2f197c8b2..27bc2054b 100644
--- a/src/main/java/com/volmit/iris/object/IrisDecorator.java
+++ b/src/main/java/com/volmit/iris/object/IrisDecorator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -17,64 +35,59 @@ import org.bukkit.block.data.BlockData;
@Desc("A biome decorator is used for placing flowers, grass, cacti and so on")
@Data
public class IrisDecorator {
- @DontObfuscate
+
@Desc("The varience dispersion is used when multiple blocks are put in the palette. Scatter scrambles them, Wispy shows streak-looking varience")
private IrisGeneratorStyle variance = NoiseStyle.STATIC.style();
- @DontObfuscate
+
@Desc("Forcefully place this decorant anywhere it is supposed to go even if it should not go on a specific surface block. For example, you could force tallgrass to place on top of stone by using this.")
private boolean forcePlace = false;
- @DontObfuscate
+
@Desc("Dispersion is used to pick places to spawn. Scatter randomly places them (vanilla) or Wispy for a streak like patch system.")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@DependsOn({"stackMin", "stackMax"})
- @DontObfuscate
@Desc("If this decorator has a height more than 1 this changes how it picks the height between your maxes. Scatter = random, Wispy = wavy heights")
private IrisGeneratorStyle heightVariance = NoiseStyle.STATIC.style();
- @DontObfuscate
+
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
private DecorationPart partOf = DecorationPart.NONE;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(1)
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The minimum repeat stack height (setting to 3 would stack 3 of on top of each other")
private int stackMin = 1;
@DependsOn({"stackMin", "stackMax"})
@MinNumber(1)
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The maximum repeat stack height")
private int stackMax = 1;
@Required
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("The chance for this decorator to decorate at a given X,Y coordinate. This is hit 256 times per chunk (per surface block)")
// TODO: WARNING HEIGHT
private double chance = 0.1;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
- @DontObfuscate
@Desc("The palette of blocks to pick from when this decorator needs to place.")
private KList palette = new KList().qadd(new IrisBlockData("grass"));
@ArrayType(min = 1, type = IrisBlockData.class)
- @DontObfuscate
@Desc("The palette of blocks used at the very top of a 'stackMax' of higher than 1. For example, bamboo tops.")
- private KList topPalette = new KList();
+ private KList topPalette = new KList<>();
@DependsOn("topPalette")
@MinNumber(0.01)
@MaxNumber(1.0)
- @DontObfuscate
@Desc("When the stack passes the top threshold, the top palette will start being used instead of the normal palette.")
private double topThreshold = 1.0;
@@ -94,9 +107,7 @@ public class IrisDecorator {
public CNG getHeightGenerator(RNG rng, IrisDataManager data) {
return heightGenerator.aquire(() ->
- {
- return heightVariance.create(rng.nextParallelRNG(getBlockData(data).size() + stackMax + stackMin));
- });
+ heightVariance.create(rng.nextParallelRNG(getBlockData(data).size() + stackMax + stackMin)));
}
public CNG getGenerator(RNG rng, IrisDataManager data) {
@@ -210,6 +221,7 @@ public class IrisDecorator {
});
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isStacking() {
return getStackMax() > 1;
}
diff --git a/src/main/java/com/volmit/iris/object/IrisDepositGenerator.java b/src/main/java/com/volmit/iris/object/IrisDepositGenerator.java
index 67b26fe88..8ade96569 100644
--- a/src/main/java/com/volmit/iris/object/IrisDepositGenerator.java
+++ b/src/main/java/com/volmit/iris/object/IrisDepositGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.manager.IrisDataManager;
@@ -19,54 +37,48 @@ public class IrisDepositGenerator {
@Required
@MinNumber(0)
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The minimum height this deposit can generate at")
private int minHeight = 7;
@Required
@MinNumber(0)
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The maximum height this deposit can generate at")
private int maxHeight = 55;
@Required
@MinNumber(1)
@MaxNumber(32)
- @DontObfuscate
@Desc("The minimum amount of deposit blocks per clump")
private int minSize = 3;
@Required
@MinNumber(1)
@MaxNumber(32)
- @DontObfuscate
@Desc("The maximum amount of deposit blocks per clump")
private int maxSize = 5;
@Required
@MinNumber(1)
@MaxNumber(128)
- @DontObfuscate
@Desc("The maximum amount of clumps per chunk")
private int maxPerChunk = 3;
@Required
@MinNumber(0)
@MaxNumber(128)
- @DontObfuscate
@Desc("The minimum amount of clumps per chunk")
private int minPerChunk = 1;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
- @DontObfuscate
@Desc("The palette of blocks to be used in this deposit generator")
- private KList palette = new KList();
+ private KList palette = new KList<>();
@MinNumber(1)
@MaxNumber(64)
- @DontObfuscate
@Desc("Ore varience is how many different objects clumps iris will create")
private int varience = 3;
diff --git a/src/main/java/com/volmit/iris/object/IrisDimension.java b/src/main/java/com/volmit/iris/object/IrisDimension.java
index 938cde1f7..6bf73d4a9 100644
--- a/src/main/java/com/volmit/iris/object/IrisDimension.java
+++ b/src/main/java/com/volmit/iris/object/IrisDimension.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -11,7 +29,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
-import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World.Environment;
import org.bukkit.block.data.BlockData;
@@ -19,6 +36,7 @@ import org.bukkit.block.data.BlockData;
import java.io.File;
import java.io.IOException;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@@ -31,7 +49,7 @@ public class IrisDimension extends IrisRegistrant {
@MinNumber(2)
@Required
- @DontObfuscate
+
@Desc("The human readable name of this dimension")
private String name = "A Dimension";
@@ -39,296 +57,273 @@ public class IrisDimension extends IrisRegistrant {
@ArrayType(min = 1, type = IrisDimensionIndex.class)
private KList dimensionalComposite = new KList<>();
- @DontObfuscate
+
@Desc("Create an inverted dimension in the sky (like the nether)")
private IrisDimension sky = null;
@RegistryListJigsaw
- @DontObfuscate
+
@Desc("If defined, Iris will place the given jigsaw structure where minecraft should place the overworld stronghold.")
private String stronghold;
- @DontObfuscate
+
@Desc("Improves the biome grid variation by shuffling the cell grid more depending on the seed. This makes biomes across multiple seeds look far different than before.")
private boolean aggressiveBiomeReshuffle = false;
- @DontObfuscate
+
@Desc("Instead of a flat bottom, applies a clamp (using this noise style) to the bottom instead of a flat bottom. Useful for carving out center-dimensions in a dimension composite world.")
private IrisShapedGeneratorStyle undercarriage = null;
- @DontObfuscate
+
@Desc("Upon joining this world, Iris will send a resource pack request to the client. If they have previously selected yes, it will auto-switch depending on which dimension they go to.")
private String resourcePack = "";
- @DontObfuscate
+
@Desc("Entity spawns to override or add to this dimension")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList entitySpawnOverrides = new KList<>();
- @DontObfuscate
+
@Desc("Add specific features in exact positions")
@ArrayType(min = 1, type = IrisFeaturePositional.class)
private KList specificFeatures = new KList<>();
- @DontObfuscate
+
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList entityInitialSpawns = new KList<>();
- @DontObfuscate
+
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList features = new KList<>();
- @DontObfuscate
+
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0)
- @DontObfuscate
@Desc("The version of this dimension. Changing this will stop users from accidentally upgrading (and breaking their worlds).")
private int version = 1;
@ArrayType(min = 1, type = IrisBlockDrops.class)
- @DontObfuscate
@Desc("Define custom block drops for this dimension")
private KList blockDrops = new KList<>();
- @DontObfuscate
+
@Desc("Should bedrock be generated or not.")
private boolean bedrock = true;
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("The land chance. Up to 1.0 for total land or 0.0 for total sea")
private double landChance = 0.625;
- @DontObfuscate
+
@Desc("The placement style of regions")
private IrisGeneratorStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of land/sea")
private IrisGeneratorStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle landBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle shoreBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle seaBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle caveBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle riverBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle lakeBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle islandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle islandBiomeChanceStyle = NoiseStyle.CELLULAR_HEIGHT_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("The placement style of biomes")
private IrisGeneratorStyle skylandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
- @DontObfuscate
+
@Desc("Generate caves or not.")
private boolean caves = true;
- @DontObfuscate
+
@Desc("Instead of filling objects with air, fills them with cobweb so you can see them")
private boolean debugSmartBore = false;
- @DontObfuscate
+
@Desc("Carve terrain or not")
private boolean carving = true;
- @DontObfuscate
+
@Desc("If defined, If air is defined below the area, this fluid will always place")
private IrisCaveFluid forceFluid = new IrisCaveFluid();
- @DontObfuscate
+
@Desc("Generate decorations or not")
private boolean decorate = true;
- @DontObfuscate
+
@Desc("Generate ravines or not")
private boolean ravines = false;
@MinNumber(1)
- @DontObfuscate
@Desc("The rarity of a ravine layer having a lib (or rib) that sticks in or out by one block. Minecraft's default is 3.")
private int ravineRibRarity = 2;
@MinNumber(1)
- @DontObfuscate
@Desc("The rarity of ravines. Each chunk has a 1 in X chance")
private int ravineRarity = 50;
- @DontObfuscate
+
@Desc("Use post processing or not")
private boolean postProcessing = true;
- @DontObfuscate
+
@Desc("Add slabs in post processing")
private boolean postProcessingSlabs = true;
- @DontObfuscate
+
@Desc("Add painted walls in post processing")
private boolean postProcessingWalls = true;
- @DontObfuscate
+
@Desc("Use post processing for caves or not")
private boolean postProcessCaves = true;
- @DontObfuscate
+
@Desc("The world environment")
private Environment environment = Environment.NORMAL;
@RegistryListRegion
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("Define all of the regions to include in this dimension. Dimensions -> Regions -> Biomes -> Objects etc")
private KList regions = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
- @DontObfuscate
@Desc("Jigsaw structures")
private KList jigsawStructures = new KList<>();
@Required
@MinNumber(0)
@MaxNumber(255)
- @DontObfuscate
@Desc("The fluid height for this dimension")
private int fluidHeight = 63;
@RegistryListBiome
- @DontObfuscate
+
@Desc("Keep this either undefined or empty. Setting any biome name into this will force iris to only generate the specified biome. Great for testing.")
private String focus = "";
@RegistryListBiome
- @DontObfuscate
+
@Desc("Keep this either undefined or empty. Setting any region name into this will force iris to only generate the specified region. Great for testing.")
private String focusRegion = "";
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("Zoom in or out the biome size. Higher = bigger biomes")
private double biomeZoom = 5D;
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("Zoom in or out the terrain. This stretches the terrain. Due to performance improvements, Higher than 2.0 may cause weird rounding artifacts. Lower = more terrain changes per block. Its a true zoom-out.")
private double terrainZoom = 1D;
@MinNumber(0)
@MaxNumber(360)
- @DontObfuscate
@Desc("You can rotate the input coordinates by an angle. This can make terrain appear more natural (less sharp corners and lines). This literally rotates the entire dimension by an angle. Hint: Try 12 degrees or something not on a 90 or 45 degree angle.")
private double dimensionAngleDeg = 0;
@MinNumber(0)
@MaxNumber(8192)
- @DontObfuscate
@Desc("Coordinate fracturing applies noise to the input coordinates. This creates the 'iris swirls' and wavy features. The distance pushes these waves further into places they shouldnt be. This is a block value multiplier.")
private double coordFractureDistance = 20;
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("Coordinate fracturing zoom. Higher = less frequent warping, Lower = more frequent and rapid warping / swirls.")
private double coordFractureZoom = 8;
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("This zooms in the land space")
private double landZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("This zooms oceanic biomes")
private double seaZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("Zoom in continents")
private double continentZoom = 1;
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("Change the size of regions")
private double regionZoom = 1;
- @DontObfuscate
+
@Desc("Disable this to stop placing schematics in biomes")
private boolean placeObjects = true;
- @DontObfuscate
+
@Desc("Prevent Leaf decay as if placed in creative mode")
private boolean preventLeafDecay = false;
@ArrayType(min = 1, type = IrisDepositGenerator.class)
- @DontObfuscate
@Desc("Define global deposit generators")
private KList deposits = new KList<>();
@ArrayType(min = 1, type = IrisShapedGeneratorStyle.class)
- @DontObfuscate
@Desc("Overlay additional noise on top of the interoplated terrain.")
private KList overlayNoise = new KList<>();
@ArrayType(min = 1, type = IrisCaveLayer.class)
- @DontObfuscate
@Desc("Define cave layers")
private KList caveLayers = new KList<>();
@ArrayType(min = 1, type = IrisCarveLayer.class)
- @DontObfuscate
@Desc("Define carve layers")
private KList carveLayers = new KList<>();
@MinNumber(0.0001)
@MaxNumber(512)
- @DontObfuscate
@Desc("The rock zoom mostly for zooming in on a wispy palette")
private double rockZoom = 5;
- @DontObfuscate
+
@Desc("The palette of blocks for 'stone'")
private IrisMaterialPalette rockPalette = new IrisMaterialPalette().qclear().qadd("stone");
- @DontObfuscate
+
@Desc("The palette of blocks for 'water'")
private IrisMaterialPalette fluidPalette = new IrisMaterialPalette().qclear().qadd("water");
@ArrayType(min = 1, type = IrisBiomeMutation.class)
- @DontObfuscate
@Desc("Define biome mutations for this dimension")
private KList mutations = new KList<>();
@@ -458,43 +453,45 @@ public class IrisDimension extends IrisRegistrant {
return landBiomeStyle;
}
- public boolean installDataPack(DataProvider data, File datapacks)
- {
+ public boolean installDataPack(DataProvider data, File datapacks) {
boolean write = false;
boolean changed = false;
- for(IrisBiome i : getAllBiomes(data))
- {
- if(i.isCustom())
- {
+ IO.delete(new File(datapacks, "iris/data/" + getLoadKey()));
+
+ for (IrisBiome i : getAllBiomes(data)) {
+ if (i.isCustom()) {
write = true;
- File output = new File(datapacks, "iris/data/" + getLoadKey() + "/worldgen/biome/" + i.getCustom().getId() + ".json");
- if(!output.exists())
- {
- changed = true;
- }
+ for (IrisBiomeCustom j : i.getCustomDerivitives()) {
+ File output = new File(datapacks, "iris/data/" + getLoadKey() + "/worldgen/biome/" + j.getId() + ".json");
- Iris.verbose(" Installing Data Pack Biome: " + output.getPath());
- output.getParentFile().mkdirs();
- try {
- IO.writeAll(output, i.getCustom().generateJson());
- } catch (IOException e) {
- e.printStackTrace();
+ if (!output.exists()) {
+ changed = true;
+ }
+
+ Iris.verbose(" Installing Data Pack Biome: " + output.getPath());
+ output.getParentFile().mkdirs();
+ try {
+ IO.writeAll(output, j.generateJson());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
}
}
- if(write)
- {
+ if (write) {
File mcm = new File(datapacks, "iris/pack.mcmeta");
try {
- IO.writeAll(mcm, "{\n" +
- " \"pack\": {\n" +
- " \"description\": \"Iris Data Pack. This pack contains all installed Iris Packs' resources.\",\n" +
- " \"pack_format\": 7\n" +
- " }\n" +
- "}\n");
+ IO.writeAll(mcm, """
+ {
+ "pack": {
+ "description": "Iris Data Pack. This pack contains all installed Iris Packs' resources.",
+ "pack_format": 7
+ }
+ }
+ """);
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/src/main/java/com/volmit/iris/object/IrisDimensionIndex.java b/src/main/java/com/volmit/iris/object/IrisDimensionIndex.java
index f50fd2a61..ea1bc6ce6 100644
--- a/src/main/java/com/volmit/iris/object/IrisDimensionIndex.java
+++ b/src/main/java/com/volmit/iris/object/IrisDimensionIndex.java
@@ -1,12 +1,34 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
-import com.volmit.iris.util.*;
+import com.volmit.iris.util.Desc;
+import com.volmit.iris.util.MinNumber;
+import com.volmit.iris.util.RegistryListDimension;
+import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@@ -15,19 +37,19 @@ import lombok.experimental.Accessors;
@EqualsAndHashCode(callSuper = false)
public class IrisDimensionIndex {
@Required
- @DontObfuscate
+
@Desc("The weight of this dimension. If there are 2 dimensions, if the weight is the same on both, both dimensions will take up 128 blocks of height.")
private double weight = 1D;
- @DontObfuscate
+
@Desc("If inverted is set to true, the dimension will be updide down in the world")
private boolean inverted = false;
- @DontObfuscate
+
@Desc("Only one dimension layer should be set to primary. The primary dimension layer is where players spawn, and the biomes that the vanilla structure system uses to figure out what structures to place.")
private boolean primary = false;
- @DontObfuscate
+
@Required
@RegistryListDimension
@MinNumber(1)
diff --git a/src/main/java/com/volmit/iris/object/IrisDirection.java b/src/main/java/com/volmit/iris/object/IrisDirection.java
index 2d4abe649..eb96dd101 100644
--- a/src/main/java/com/volmit/iris/object/IrisDirection.java
+++ b/src/main/java/com/volmit/iris/object/IrisDirection.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Cuboid.CuboidDirection;
@@ -7,6 +25,8 @@ import org.bukkit.block.BlockFace;
import org.bukkit.block.data.type.Jigsaw;
import org.bukkit.util.Vector;
+import java.util.Map;
+
/**
* Directions
*
@@ -29,35 +49,15 @@ public enum IrisDirection {
private final CuboidDirection f;
public static IrisDirection getDirection(BlockFace f) {
- switch (f) {
- case DOWN:
- return DOWN_NEGATIVE_Y;
- case EAST:
- case EAST_NORTH_EAST:
- case EAST_SOUTH_EAST:
- return EAST_POSITIVE_X;
- case NORTH:
- case NORTH_NORTH_WEST:
- case NORTH_EAST:
- case NORTH_NORTH_EAST:
- case NORTH_WEST:
- return NORTH_NEGATIVE_Z;
- case SELF:
- case UP:
- return UP_POSITIVE_Y;
- case SOUTH:
- case SOUTH_EAST:
- case SOUTH_SOUTH_EAST:
- case SOUTH_SOUTH_WEST:
- case SOUTH_WEST:
- return SOUTH_POSITIVE_Z;
- case WEST:
- case WEST_NORTH_WEST:
- case WEST_SOUTH_WEST:
- return WEST_NEGATIVE_X;
- }
+ return switch (f) {
+ case DOWN -> DOWN_NEGATIVE_Y;
+ case EAST, EAST_NORTH_EAST, EAST_SOUTH_EAST -> EAST_POSITIVE_X;
+ case NORTH, NORTH_NORTH_WEST, NORTH_EAST, NORTH_NORTH_EAST, NORTH_WEST -> NORTH_NEGATIVE_Z;
+ case SELF, UP -> UP_POSITIVE_Y;
+ case SOUTH, SOUTH_EAST, SOUTH_SOUTH_EAST, SOUTH_SOUTH_WEST, SOUTH_WEST -> SOUTH_POSITIVE_Z;
+ case WEST, WEST_NORTH_WEST, WEST_SOUTH_WEST -> WEST_NEGATIVE_X;
+ };
- return DOWN_NEGATIVE_Y;
}
public static IrisDirection fromJigsawBlock(String direction) {
@@ -72,46 +72,26 @@ public enum IrisDirection {
}
public static IrisDirection getDirection(Jigsaw.Orientation orientation) {
- switch (orientation) {
- case DOWN_EAST:
- case UP_EAST:
- case EAST_UP:
- return EAST_POSITIVE_X;
- case DOWN_NORTH:
- case UP_NORTH:
- case NORTH_UP:
- return NORTH_NEGATIVE_Z;
- case DOWN_SOUTH:
- case UP_SOUTH:
- case SOUTH_UP:
- return SOUTH_POSITIVE_Z;
- case DOWN_WEST:
- case UP_WEST:
- case WEST_UP:
- return WEST_NEGATIVE_X;
- }
+ return switch (orientation) {
+ case DOWN_EAST, UP_EAST, EAST_UP -> EAST_POSITIVE_X;
+ case DOWN_NORTH, UP_NORTH, NORTH_UP -> NORTH_NEGATIVE_Z;
+ case DOWN_SOUTH, UP_SOUTH, SOUTH_UP -> SOUTH_POSITIVE_Z;
+ case DOWN_WEST, UP_WEST, WEST_UP -> WEST_NEGATIVE_X;
+ };
- return null;
}
@Override
public String toString() {
- switch (this) {
- case DOWN_NEGATIVE_Y:
- return "Down";
- case EAST_POSITIVE_X:
- return "East";
- case NORTH_NEGATIVE_Z:
- return "North";
- case SOUTH_POSITIVE_Z:
- return "South";
- case UP_POSITIVE_Y:
- return "Up";
- case WEST_NEGATIVE_X:
- return "West";
- }
+ return switch (this) {
+ case DOWN_NEGATIVE_Y -> "Down";
+ case EAST_POSITIVE_X -> "East";
+ case NORTH_NEGATIVE_Z -> "North";
+ case SOUTH_POSITIVE_Z -> "South";
+ case UP_POSITIVE_Y -> "Up";
+ case WEST_NEGATIVE_X -> "West";
+ };
- return "?";
}
public boolean isVertical() {
@@ -191,9 +171,10 @@ public enum IrisDirection {
public Vector angle(Vector initial, IrisDirection d) {
calculatePermutations();
- for (GBiset i : permute.keySet()) {
+ for (Map.Entry, DOP> entry : permute.entrySet()) {
+ GBiset i = entry.getKey();
if (i.getA().equals(this) && i.getB().equals(d)) {
- return permute.get(i).op(initial);
+ return entry.getValue().op(initial);
}
}
@@ -316,11 +297,11 @@ public enum IrisDirection {
return;
}
- permute = new KMap, DOP>();
+ permute = new KMap<>();
for (IrisDirection i : udnews()) {
for (IrisDirection j : udnews()) {
- GBiset b = new GBiset(i, j);
+ GBiset b = new GBiset<>(i, j);
if (i.equals(j)) {
permute.put(b, new DOP("DIRECT") {
@@ -400,37 +381,23 @@ public enum IrisDirection {
}
public BlockFace getFace() {
- switch (this) {
- case DOWN_NEGATIVE_Y:
- return BlockFace.DOWN;
- case EAST_POSITIVE_X:
- return BlockFace.EAST;
- case NORTH_NEGATIVE_Z:
- return BlockFace.NORTH;
- case SOUTH_POSITIVE_Z:
- return BlockFace.SOUTH;
- case UP_POSITIVE_Y:
- return BlockFace.UP;
- case WEST_NEGATIVE_X:
- return BlockFace.WEST;
- }
+ return switch (this) {
+ case DOWN_NEGATIVE_Y -> BlockFace.DOWN;
+ case EAST_POSITIVE_X -> BlockFace.EAST;
+ case NORTH_NEGATIVE_Z -> BlockFace.NORTH;
+ case SOUTH_POSITIVE_Z -> BlockFace.SOUTH;
+ case UP_POSITIVE_Y -> BlockFace.UP;
+ case WEST_NEGATIVE_X -> BlockFace.WEST;
+ };
- return null;
}
public Axis getAxis() {
- switch (this) {
- case DOWN_NEGATIVE_Y:
- case UP_POSITIVE_Y:
- return Axis.Y;
- case EAST_POSITIVE_X:
- case WEST_NEGATIVE_X:
- return Axis.X;
- case NORTH_NEGATIVE_Z:
- case SOUTH_POSITIVE_Z:
- return Axis.Z;
- }
+ return switch (this) {
+ case DOWN_NEGATIVE_Y, UP_POSITIVE_Y -> Axis.Y;
+ case EAST_POSITIVE_X, WEST_NEGATIVE_X -> Axis.X;
+ case NORTH_NEGATIVE_Z, SOUTH_POSITIVE_Z -> Axis.Z;
+ };
- return null;
}
}
diff --git a/src/main/java/com/volmit/iris/object/IrisEffect.java b/src/main/java/com/volmit/iris/object/IrisEffect.java
index 479b67daa..12b5316ba 100644
--- a/src/main/java/com/volmit/iris/object/IrisEffect.java
+++ b/src/main/java/com/volmit/iris/object/IrisEffect.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -22,150 +40,129 @@ import org.bukkit.potion.PotionEffectType;
@Data
public class IrisEffect {
- @DontObfuscate
+
@Desc("The potion effect to apply in this area")
private String potionEffect = "";
- @DontObfuscate
+
@Desc("The particle effect to apply in the area")
private Particle particleEffect = null;
@DependsOn({"particleEffect"})
@MinNumber(-32)
@MaxNumber(32)
- @DontObfuscate
@Desc("Randomly offset from the surface to this surface+value")
private int particleOffset = 0;
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
- @DontObfuscate
@Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltX = 0;
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
- @DontObfuscate
@Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltY = 0;
@DependsOn({"particleEffect"})
@MinNumber(-8)
@MaxNumber(8)
- @DontObfuscate
@Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
private double particleAltZ = 0;
@DependsOn({"particleEffect"})
- @DontObfuscate
@Desc("Randomize the altX by -altX to altX")
private boolean randomAltX = true;
@DependsOn({"particleEffect"})
- @DontObfuscate
@Desc("Randomize the altY by -altY to altY")
private boolean randomAltY = false;
@DependsOn({"particleEffect"})
- @DontObfuscate
@Desc("Randomize the altZ by -altZ to altZ")
private boolean randomAltZ = true;
- @DontObfuscate
+
@Desc("The sound to play")
private Sound sound = null;
@DependsOn({"sound"})
@MinNumber(0)
@MaxNumber(512)
- @DontObfuscate
@Desc("The max distance from the player the sound will play")
private int soundDistance = 12;
@DependsOn({"sound", "maxPitch"})
@MinNumber(0.01)
@MaxNumber(1.99)
- @DontObfuscate
@Desc("The minimum sound pitch")
private double minPitch = 0.5D;
@DependsOn({"sound", "minVolume"})
@MinNumber(0.01)
@MaxNumber(1.99)
- @DontObfuscate
@Desc("The max sound pitch")
private double maxPitch = 1.5D;
@DependsOn({"sound"})
@MinNumber(0.001)
@MaxNumber(512)
- @DontObfuscate
@Desc("The sound volume.")
private double volume = 1.5D;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(512)
- @DontObfuscate
@Desc("The particle count. Try setting to zero for using the alt xyz to a motion value instead of an offset")
private int particleCount = 0;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(64)
- @DontObfuscate
@Desc("How far away from the player particles can play")
private int particleDistance = 20;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(128)
- @DontObfuscate
@Desc("How wide the particles can play (player's view left and right) RADIUS")
private int particleDistanceWidth = 24;
@DependsOn({"particleEffect"})
- @DontObfuscate
@Desc("An extra value for some particles... Which bukkit doesn't even document.")
private double extra = 0;
@DependsOn({"potionEffect"})
@MinNumber(-1)
@MaxNumber(1024)
- @DontObfuscate
@Desc("The Potion Strength or -1 to disable")
private int potionStrength = -1;
@DependsOn({"potionEffect", "potionTicksMin"})
@MinNumber(1)
- @DontObfuscate
@Desc("The max time the potion will last for")
private int potionTicksMax = 155;
@DependsOn({"potionEffect", "potionTicksMax"})
@MinNumber(1)
- @DontObfuscate
@Desc("The min time the potion will last for")
private int potionTicksMin = 75;
@Required
@MinNumber(0)
- @DontObfuscate
@Desc("The effect interval in milliseconds")
private int interval = 150;
@DependsOn({"particleEffect"})
@MinNumber(0)
@MaxNumber(16)
- @DontObfuscate
@Desc("The effect distance start away")
private int particleAway = 5;
@Required
@MinNumber(1)
- @DontObfuscate
@Desc("The chance is 1 in CHANCE per interval")
private int chance = 50;
@@ -193,7 +190,7 @@ public class IrisEffect {
return t;
}
}
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
@@ -215,9 +212,7 @@ public class IrisEffect {
if (sound != null) {
Location part = p.getLocation().clone().add(RNG.r.i(-soundDistance, soundDistance), RNG.r.i(-soundDistance, soundDistance), RNG.r.i(-soundDistance, soundDistance));
- J.s(() -> {
- p.playSound(part, getSound(), (float) volume, (float) RNG.r.d(minPitch, maxPitch));
- });
+ J.s(() -> p.playSound(part, getSound(), (float) volume, (float) RNG.r.d(minPitch, maxPitch)));
}
if (particleEffect != null) {
@@ -226,23 +221,19 @@ public class IrisEffect {
part.setY(Math.round(g.getHeight(part.getBlockX(), part.getBlockZ())) + 1);
part.add(RNG.r.d(), 0, RNG.r.d());
if (extra != 0) {
- J.s(() -> {
- p.spawnParticle(particleEffect, part.getX(), part.getY() + RNG.r.i(particleOffset),
- part.getZ(),
- particleCount,
- randomAltX ? RNG.r.d(-particleAltX, particleAltX) : particleAltX,
- randomAltY ? RNG.r.d(-particleAltY, particleAltY) : particleAltY,
- randomAltZ ? RNG.r.d(-particleAltZ, particleAltZ) : particleAltZ,
- extra);
- });
+ J.s(() -> p.spawnParticle(particleEffect, part.getX(), part.getY() + RNG.r.i(particleOffset),
+ part.getZ(),
+ particleCount,
+ randomAltX ? RNG.r.d(-particleAltX, particleAltX) : particleAltX,
+ randomAltY ? RNG.r.d(-particleAltY, particleAltY) : particleAltY,
+ randomAltZ ? RNG.r.d(-particleAltZ, particleAltZ) : particleAltZ,
+ extra));
} else {
- J.s(() -> {
- p.spawnParticle(particleEffect, part.getX(), part.getY() + RNG.r.i(particleOffset), part.getZ(),
- particleCount,
- randomAltX ? RNG.r.d(-particleAltX, particleAltX) : particleAltX,
- randomAltY ? RNG.r.d(-particleAltY, particleAltY) : particleAltY,
- randomAltZ ? RNG.r.d(-particleAltZ, particleAltZ) : particleAltZ);
- });
+ J.s(() -> p.spawnParticle(particleEffect, part.getX(), part.getY() + RNG.r.i(particleOffset), part.getZ(),
+ particleCount,
+ randomAltX ? RNG.r.d(-particleAltX, particleAltX) : particleAltX,
+ randomAltY ? RNG.r.d(-particleAltY, particleAltY) : particleAltY,
+ randomAltZ ? RNG.r.d(-particleAltZ, particleAltZ) : particleAltZ));
}
}
@@ -253,18 +244,14 @@ public class IrisEffect {
return;
}
- J.s(() -> {
- p.removePotionEffect(getRealType());
- });
+ J.s(() -> p.removePotionEffect(getRealType()));
}
- J.s(() -> {
- p.addPotionEffect(new PotionEffect(getRealType(),
- RNG.r.i(Math.min(potionTicksMax, potionTicksMin),
- Math.max(potionTicksMax, potionTicksMin)),
- getPotionStrength(),
- true, false, false));
- });
+ J.s(() -> p.addPotionEffect(new PotionEffect(getRealType(),
+ RNG.r.i(Math.min(potionTicksMax, potionTicksMin),
+ Math.max(potionTicksMax, potionTicksMin)),
+ getPotionStrength(),
+ true, false, false)));
}
}
}
diff --git a/src/main/java/com/volmit/iris/object/IrisEnchantment.java b/src/main/java/com/volmit/iris/object/IrisEnchantment.java
index cd0fee53a..0687b272d 100644
--- a/src/main/java/com/volmit/iris/object/IrisEnchantment.java
+++ b/src/main/java/com/volmit/iris/object/IrisEnchantment.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -19,23 +37,20 @@ import java.lang.reflect.Field;
public class IrisEnchantment {
@Required
- @DontObfuscate
+
@Desc("The enchantment")
private String enchantment = "";
@MinNumber(1)
- @DontObfuscate
@Desc("Minimum amount of this loot")
private int minLevel = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("Maximum amount of this loot")
private int maxLevel = 1;
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("The chance that this enchantment is applied (0 to 1)")
private double chance = 1;
@@ -48,7 +63,7 @@ public class IrisEnchantment {
}
meta.addEnchant(getEnchant(), getLevel(rng), true);
}
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
}
diff --git a/src/main/java/com/volmit/iris/object/IrisEntity.java b/src/main/java/com/volmit/iris/object/IrisEntity.java
index a365241aa..1e3840149 100644
--- a/src/main/java/com/volmit/iris/object/IrisEntity.java
+++ b/src/main/java/com/volmit/iris/object/IrisEntity.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -24,115 +42,116 @@ import java.util.Collection;
import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;
+@SuppressWarnings("ALL")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents an iris entity.")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisEntity extends IrisRegistrant {
@Required
- @DontObfuscate
+
@Desc("The type of entity to spawn. To spawn a mythic mob, set this type to unknown and define mythic type.")
private EntityType type = EntityType.UNKNOWN;
@RegistryListMythical
@Desc("The type of mythic mob (if mythic mobs is installed). If this is set, make sure to set 'type' to UNKNOWN")
- @DontObfuscate
+
private String mythicalType = "";
- @DontObfuscate
+
@Desc("The custom name of this entity")
private String customName = "";
- @DontObfuscate
+
@Desc("Should the name on this entity be visible even if you arent looking at it.")
private boolean customNameVisible = false;
- @DontObfuscate
+
@Desc("If this entity type is a mob, should it be aware of it's surroundings & interact with the world.")
private boolean aware = true;
- @DontObfuscate
+
@Desc("If this entity type is a creature, should it have ai goals.")
private boolean ai = true;
- @DontObfuscate
+
@Desc("Should this entity be glowing")
private boolean glowing = false;
- @DontObfuscate
+
@Desc("Should gravity apply to this entity")
private boolean gravity = true;
- @DontObfuscate
+
@Desc("When an entity is invulnerable it can only be damaged by players increative mode.")
private boolean invulnerable = false;
- @DontObfuscate
+
@Desc("When an entity is silent it will not produce any sound.")
private boolean silent = false;
- @DontObfuscate
+
@Desc("Should this entity be allowed to pickup items")
private boolean pickupItems = false;
- @DontObfuscate
+
@Desc("Should this entity be removed when far away")
private boolean removable = true;
- @DontObfuscate
+
@Desc("Entity helmet equipment")
private IrisLoot helmet = null;
- @DontObfuscate
+
@Desc("Entity chestplate equipment")
private IrisLoot chestplate = null;
- @DontObfuscate
+
@Desc("Entity boots equipment")
private IrisLoot boots = null;
- @DontObfuscate
+
@Desc("Entity leggings equipment")
private IrisLoot leggings = null;
- @DontObfuscate
+
@Desc("Entity main hand equipment")
private IrisLoot mainHand = null;
- @DontObfuscate
+
@Desc("Entity off hand equipment")
private IrisLoot offHand = null;
- @DontObfuscate
+
@Desc("Make other entities ride this entity")
@ArrayType(min = 1, type = IrisEntity.class)
private KList passengers = new KList<>();
- @DontObfuscate
+
@Desc("Attribute modifiers for this entity")
@ArrayType(min = 1, type = IrisAttributeModifier.class)
private KList attributes = new KList<>();
- @DontObfuscate
+
@Desc("Loot tables for drops")
private IrisLootReference loot = new IrisLootReference();
- @DontObfuscate
+
@Desc("If specified, this entity will be leashed by this entity. I.e. THIS ENTITY Leashed by SPECIFIED. This has no effect on EnderDragons, Withers, Players, or Bats.Non-living entities excluding leashes will not persist as leashholders.")
private IrisEntity leashHolder = null;
- @DontObfuscate
+
@Desc("The main gene for a panda if the entity type is a panda")
private Gene pandaMainGene = Gene.NORMAL;
- @DontObfuscate
+
@Desc("The hidden gene for a panda if the entity type is a panda")
private Gene pandaHiddenGene = Gene.NORMAL;
- @DontObfuscate
+
@Desc("The this entity is ageable, set it's baby status")
private boolean baby = false;
@@ -268,7 +287,7 @@ public class IrisEntity extends IrisRegistrant {
J.s(() -> ae.set(doSpawn(at)));
PrecisionStopwatch p = PrecisionStopwatch.start();
- while (ae == null) {
+ while (ae.get() == null) {
J.sleep(3);
}
diff --git a/src/main/java/com/volmit/iris/object/IrisEntityInitialSpawn.java b/src/main/java/com/volmit/iris/object/IrisEntityInitialSpawn.java
index ab73b5725..a8269c635 100644
--- a/src/main/java/com/volmit/iris/object/IrisEntityInitialSpawn.java
+++ b/src/main/java/com/volmit/iris/object/IrisEntityInitialSpawn.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
@@ -19,22 +37,19 @@ import org.bukkit.entity.Entity;
public class IrisEntityInitialSpawn {
@RegistryListEntity
@Required
- @DontObfuscate
+
@Desc("The entity")
private String entity = "";
@MinNumber(1)
- @DontObfuscate
@Desc("The 1 in RARITY chance for this entity to spawn")
private int rarity = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("The minumum of this entity to spawn")
private int minSpawns = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("The max of this entity to spawn")
private int maxSpawns = 1;
diff --git a/src/main/java/com/volmit/iris/object/IrisEntitySpawnOverride.java b/src/main/java/com/volmit/iris/object/IrisEntitySpawnOverride.java
index 66cb48f64..f9dca3a19 100644
--- a/src/main/java/com/volmit/iris/object/IrisEntitySpawnOverride.java
+++ b/src/main/java/com/volmit/iris/object/IrisEntitySpawnOverride.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
@@ -21,24 +39,22 @@ public class IrisEntitySpawnOverride {
@RegistryListEntity
@Required
- @DontObfuscate
+
@Desc("The entity")
private String entity = "";
@Required
- @DontObfuscate
+
@Desc("If the following entity type spawns, spawn this entity. Set to unknown for any entity spawn")
private EntityType trigger = EntityType.UNKNOWN;
- @DontObfuscate
@Desc("If the source is triggered, cancel spawning the original entity instead of ADDING a new entity.")
private boolean cancelSourceSpawn = false;
@MinNumber(1)
- @DontObfuscate
@Desc("The 1 in RARITY chance for this entity to spawn")
private int rarity = 1;
diff --git a/src/main/java/com/volmit/iris/object/IrisFeature.java b/src/main/java/com/volmit/iris/object/IrisFeature.java
index 3c043d2b3..a3c78cfb3 100644
--- a/src/main/java/com/volmit/iris/object/IrisFeature.java
+++ b/src/main/java/com/volmit/iris/object/IrisFeature.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.google.gson.Gson;
@@ -12,62 +30,62 @@ import java.io.DataOutputStream;
import java.io.IOException;
@Data
-@DontObfuscate
+
@NoArgsConstructor
@AllArgsConstructor
@Desc("Represents an Iris zone")
public class IrisFeature {
@Required
- @DontObfuscate
+
@Desc("The block radius of this zone")
private double blockRadius = 32;
@MinNumber(0)
@MaxNumber(1)
@Required
- @DontObfuscate
+
@Desc("The chance an object that should be place actually will place. Set to below 1 to affect objects in this zone")
private double objectChance = 1;
@Required
- @DontObfuscate
+
@Desc("The interpolation radius of this zone")
private double interpolationRadius = 7;
@Required
- @DontObfuscate
+
@MaxNumber(1)
@MinNumber(0)
@Desc("The strength of this effect")
private double strength = 0.75;
@Required
- @DontObfuscate
+
@Desc("The interpolator to use for smoothing the strength")
private InterpolationMethod interpolator = InterpolationMethod.BILINEAR_STARCAST_9;
@Required
- @DontObfuscate
+
@Desc("If set, this will shift the terrain height in blocks (up or down)")
private double shiftHeight = 0;
@Required
- @DontObfuscate
+
@Desc("If set, this will force the terrain closer to the specified height.")
private double convergeToHeight = -1;
@Required
- @DontObfuscate
+
@Desc("Multiplies the input noise")
private double multiplyHeight = 1;
@Required
- @DontObfuscate
+
@Desc("Invert the zone so that anything outside this zone is affected.")
private boolean invertZone = false;
@Required
- @DontObfuscate
+
@Desc("Add additional noise to this spot")
private IrisGeneratorStyle addNoise = NoiseStyle.FLAT.style();
diff --git a/src/main/java/com/volmit/iris/object/IrisFeaturePositional.java b/src/main/java/com/volmit/iris/object/IrisFeaturePositional.java
index d8a71f336..b27163a65 100644
--- a/src/main/java/com/volmit/iris/object/IrisFeaturePositional.java
+++ b/src/main/java/com/volmit/iris/object/IrisFeaturePositional.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.google.gson.Gson;
@@ -11,7 +29,7 @@ import java.io.DataOutputStream;
import java.io.IOException;
@Data
-@DontObfuscate
+
@NoArgsConstructor
@Desc("Represents an Iris zone")
public class IrisFeaturePositional {
@@ -22,17 +40,17 @@ public class IrisFeaturePositional {
}
@Required
- @DontObfuscate
+
@Desc("The x coordinate of this zone")
private int x;
@Required
- @DontObfuscate
+
@Desc("The z coordinate of this zone")
private int z;
@Required
- @DontObfuscate
+
@Desc("The Terrain Feature to apply")
private IrisFeature feature;
diff --git a/src/main/java/com/volmit/iris/object/IrisFeaturePotential.java b/src/main/java/com/volmit/iris/object/IrisFeaturePotential.java
index 9e1f17d70..e43dbe3d0 100644
--- a/src/main/java/com/volmit/iris/object/IrisFeaturePotential.java
+++ b/src/main/java/com/volmit/iris/object/IrisFeaturePotential.java
@@ -1,21 +1,42 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
-import com.volmit.iris.util.*;
+import com.volmit.iris.util.Desc;
+import com.volmit.iris.util.MinNumber;
+import com.volmit.iris.util.RNG;
+import com.volmit.iris.util.Required;
import lombok.Data;
@Data
-@DontObfuscate
+
@Desc("Represents a potential Iris zone")
public class IrisFeaturePotential {
@MinNumber(0)
@Required
- @DontObfuscate
+
@Desc("The rarity is 1 in X chance per chunk")
private int rarity = 100;
@Required
- @DontObfuscate
+
@Desc("")
private IrisFeature zone = new IrisFeature();
diff --git a/src/main/java/com/volmit/iris/object/IrisGenerator.java b/src/main/java/com/volmit/iris/object/IrisGenerator.java
index d84c8826b..d9eee3459 100644
--- a/src/main/java/com/volmit/iris/object/IrisGenerator.java
+++ b/src/main/java/com/volmit/iris/object/IrisGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -12,6 +30,7 @@ import lombok.experimental.Accessors;
import java.util.List;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@@ -20,75 +39,67 @@ import java.util.List;
@EqualsAndHashCode(callSuper = false)
public class IrisGenerator extends IrisRegistrant {
@MinNumber(0.001)
- @DontObfuscate
@Desc("The zoom or frequency.")
private double zoom = 1;
@MinNumber(0)
- @DontObfuscate
@Desc("The opacity, essentially a multiplier on the output.")
private double opacity = 1;
- @DontObfuscate
+
@Desc("Multiply the compsites instead of adding them")
private boolean multiplicitive = false;
@MinNumber(0.001)
- @DontObfuscate
@Desc("The size of the cell fractures")
private double cellFractureZoom = 1D;
@MinNumber(0)
- @DontObfuscate
@Desc("Cell Fracture Coordinate Shuffling")
private double cellFractureShuffle = 12D;
- @DontObfuscate
+
@Desc("The height of fracture cells. Set to 0 to disable")
private double cellFractureHeight = 0D;
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("How big are the cells (X,Z) relative to the veins that touch them. Between 0 and 1. 0.1 means thick veins, small cells.")
private double cellPercentSize = 0.75D;
- @DontObfuscate
+
@Desc("The offset to shift this noise x")
private double offsetX = 0;
- @DontObfuscate
+
@Desc("The offset to shift this noise z")
private double offsetZ = 0;
@Required
- @DontObfuscate
+
@Desc("The seed for this generator")
private long seed = 1;
@Required
- @DontObfuscate
+
@Desc("The interpolator to use when smoothing this generator into other regions & generators")
private IrisInterpolator interpolator = new IrisInterpolator();
@MinNumber(0)
@MaxNumber(8192)
- @DontObfuscate
@Desc("Cliff Height Max. Disable with 0 for min and max")
private double cliffHeightMax = 0;
@MinNumber(0)
@MaxNumber(8192)
- @DontObfuscate
@Desc("Cliff Height Min. Disable with 0 for min and max")
private double cliffHeightMin = 0;
@ArrayType(min = 1, type = IrisNoiseGenerator.class)
- @DontObfuscate
@Desc("The list of noise gens this gen contains.")
- private KList composite = new KList();
+ private KList composite = new KList<>();
+
- @DontObfuscate
@Desc("The noise gen for cliff height.")
private IrisNoiseGenerator cliffHeightGenerator = new IrisNoiseGenerator();
diff --git a/src/main/java/com/volmit/iris/object/IrisGeneratorStyle.java b/src/main/java/com/volmit/iris/object/IrisGeneratorStyle.java
index b825a61c9..02c1dc9c4 100644
--- a/src/main/java/com/volmit/iris/object/IrisGeneratorStyle.java
+++ b/src/main/java/com/volmit/iris/object/IrisGeneratorStyle.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -16,35 +34,35 @@ import lombok.experimental.Accessors;
public class IrisGeneratorStyle {
@Required
- @DontObfuscate
+
@Desc("The chance is 1 in CHANCE per interval")
private NoiseStyle style = NoiseStyle.IRIS;
- @DontObfuscate
+
@MinNumber(0.00001)
@Desc("The zoom of this style")
private double zoom = 1;
- @DontObfuscate
+
@MinNumber(0.00001)
@Desc("The Output multiplier. Only used if parent is fracture.")
private double multiplier = 1;
- @DontObfuscate
+
@Desc("If set to true, each dimension will be fractured with a different order of input coordinates. This is usually 2 or 3 times slower than normal.")
private boolean maxFractureAccuracy = false;
- @DontObfuscate
+
@Desc("Apply a generator to the coordinate field fed into this parent generator. I.e. Distort your generator with another generator.")
private IrisGeneratorStyle fracture = null;
- @DontObfuscate
+
@MinNumber(0.01562)
@MaxNumber(64)
@Desc("The exponent")
private double exponent = 1;
- private final transient AtomicCache cng = new AtomicCache();
+ private final transient AtomicCache cng = new AtomicCache<>();
public IrisGeneratorStyle(NoiseStyle s) {
this.style = s;
@@ -69,6 +87,7 @@ public class IrisGeneratorStyle {
});
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isFlat() {
return style.equals(NoiseStyle.FLAT);
}
diff --git a/src/main/java/com/volmit/iris/object/IrisInterpolator.java b/src/main/java/com/volmit/iris/object/IrisInterpolator.java
index d173129da..2d01f63b1 100644
--- a/src/main/java/com/volmit/iris/object/IrisInterpolator.java
+++ b/src/main/java/com/volmit/iris/object/IrisInterpolator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -14,14 +32,13 @@ import lombok.experimental.Accessors;
public class IrisInterpolator {
@Required
- @DontObfuscate
+
@Desc("The interpolation method when two biomes use different heights but this same generator")
private InterpolationMethod function = InterpolationMethod.BICUBIC;
@Required
@MinNumber(1)
@MaxNumber(8192)
- @DontObfuscate
@Desc("The range checked horizontally. Smaller ranges yeild more detail but are not as smooth.")
private double horizontalScale = 3;
diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java b/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java
index 375c09d93..7ebb4bd00 100644
--- a/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java
+++ b/src/main/java/com/volmit/iris/object/IrisJigsawPiece.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
@@ -11,28 +29,29 @@ import org.bukkit.util.BlockVector;
import java.io.IOException;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a structure tile")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisJigsawPiece extends IrisRegistrant {
@RegistryListObject
@Required
- @DontObfuscate
+
@Desc("The object this piece represents")
private String object = "";
@Required
- @DontObfuscate
+
@ArrayType(type = IrisJigsawPieceConnector.class, min = 1)
@Desc("The connectors this object contains")
private KList connectors = new KList<>();
@Desc("Configure everything about the object placement. Please don't define this unless you actually need it as using this option will slow down the jigsaw deign stage. Use this where you need it, just avoid using it everywhere to keep things fast.")
- @DontObfuscate
+
private IrisObjectPlacement placementOptions = new IrisObjectPlacement().setMode(ObjectPlaceMode.FAST_MAX_HEIGHT);
private transient AtomicCache max2dDim = new AtomicCache<>();
diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawPieceConnector.java b/src/main/java/com/volmit/iris/object/IrisJigsawPieceConnector.java
index 2f7c846c9..a43348edd 100644
--- a/src/main/java/com/volmit/iris/object/IrisJigsawPieceConnector.java
+++ b/src/main/java/com/volmit/iris/object/IrisJigsawPieceConnector.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -7,29 +25,30 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a structure tile")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisJigsawPieceConnector {
@Required
- @DontObfuscate
+
@Desc("The name of this connector, such as entry, or table node. This is a name for organization. Other connectors can specifically use targetName to target a specific connector type. Multiple connectors can use the same name.")
private String name = "";
@Required
- @DontObfuscate
+
@Desc("Target a piece's connector with the specified name. For any piece's connector, define * or don't define it.")
private String targetName = "*";
- @DontObfuscate
+
@Desc("Rotates the placed piece on this connector. If rotation is enabled, this connector will effectivley rotate, if this connector is facing the Z direction, then the connected piece would rotate in the X,Y direction in 90 degree segments.")
private boolean rotateConnector = false;
- @DontObfuscate
+
@Desc("If set to true, this connector is allowed to place pieces inside of it's own piece. For example if you are adding a light post, or house on top of a path piece, you would set this to true to allow the piece to collide with the path bounding box.")
private boolean innerConnector = false;
@@ -40,31 +59,31 @@ public class IrisJigsawPieceConnector {
private KList pools = new KList<>();
@RegistryListEntity
- @DontObfuscate
+
@Desc("Pick an entity to spawn on this connector")
private String spawnEntity;
- @DontObfuscate
+
@Desc("Stop the entity from despawning")
private boolean keepEntity;
- @DontObfuscate
+
@MaxNumber(50)
@MinNumber(1)
@Desc("The amount of entities to spawn (must be a whole number)")
private int entityCount = 1;
- @DontObfuscate
+
@Desc("The relative position this connector is located at for connecting to other pieces")
@Required
private IrisPosition position = new IrisPosition(0, 0, 0);
- @DontObfuscate
+
@Desc("The relative position to this connector to place entities at")
@DependsOn({"spawnEntity"})
private IrisPosition entityPosition = null;
- @DontObfuscate
+
@Desc("The direction this connector is facing. If the direction is set to UP, then pieces will place ABOVE the connector.")
@Required
private IrisDirection direction = IrisDirection.UP_POSITIVE_Y;
diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawPlacement.java b/src/main/java/com/volmit/iris/object/IrisJigsawPlacement.java
index dee3c4cb7..69de0c108 100644
--- a/src/main/java/com/volmit/iris/object/IrisJigsawPlacement.java
+++ b/src/main/java/com/volmit/iris/object/IrisJigsawPlacement.java
@@ -1,6 +1,27 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
-import com.volmit.iris.util.*;
+import com.volmit.iris.util.Desc;
+import com.volmit.iris.util.MinNumber;
+import com.volmit.iris.util.RegistryListJigsaw;
+import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -14,13 +35,12 @@ import lombok.experimental.Accessors;
public class IrisJigsawPlacement {
@RegistryListJigsaw
@Required
- @DontObfuscate
+
@Desc("The jigsaw structure to use")
private String structure = "";
@Required
@MinNumber(1)
- @DontObfuscate
@Desc("The rarity for this jigsaw structure to place on a per chunk basis")
private int rarity = 29;
}
diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawPool.java b/src/main/java/com/volmit/iris/object/IrisJigsawPool.java
index 682d18359..39eee924b 100644
--- a/src/main/java/com/volmit/iris/object/IrisJigsawPool.java
+++ b/src/main/java/com/volmit/iris/object/IrisJigsawPool.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -7,17 +25,18 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a structure piece pool")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisJigsawPool extends IrisRegistrant {
@RegistryListJigsawPiece
@Required
- @DontObfuscate
+
@ArrayType(min = 1, type = String.class)
@Desc("A list of structure piece pools")
private KList pieces = new KList<>();
diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java b/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java
index f99057e8f..4f70f3d20 100644
--- a/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java
+++ b/src/main/java/com/volmit/iris/object/IrisJigsawStructure.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -9,36 +27,36 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a jigsaw structure")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisJigsawStructure extends IrisRegistrant {
@RegistryListJigsawPiece
@Required
- @DontObfuscate
+
@ArrayType(min = 1, type = String.class)
@Desc("The starting pieces. Randomly chooses a starting piece, then connects pieces using the pools define in the starting piece.")
private KList pieces = new KList<>();
@MaxNumber(32)
@MinNumber(1)
- @DontObfuscate
@Desc("The maximum pieces that can step out from the center piece")
private int maxDepth = 9;
- @DontObfuscate
+
@Desc("Jigsaw grows the parallax layer which slows iris down a bit. Since there are so many pieces, Iris takes the avg piece size and calculates the parallax radius from that. Unless your structures are using only the biggest pieces, your structure should fit in the chosen size fine. If you are seeing cut-off parts of your structures or broken terrain, turn this option on. This option will pick the biggest piece dimensions and multiply it by your (maxDepth+1) * 2 as the size to grow the parallax layer by. But typically keep this off.")
private boolean useMaxPieceSizeForParallaxRadius = false;
@Desc("Add a noise feature to this village")
- @DontObfuscate
+
private IrisFeature feature = null;
- @DontObfuscate
+
@Desc("If set to true, iris will look for any pieces with only one connector in valid pools for edge connectors and attach them to 'terminate' the paths/piece connectors. Essentially it caps off ends. For example in a village, Iris would add houses to the ends of roads where possible. For terminators to be selected, they can only have one connector or they wont be chosen.")
private boolean terminate = true;
diff --git a/src/main/java/com/volmit/iris/object/IrisJigsawStructurePlacement.java b/src/main/java/com/volmit/iris/object/IrisJigsawStructurePlacement.java
index 99594b411..819457c95 100644
--- a/src/main/java/com/volmit/iris/object/IrisJigsawStructurePlacement.java
+++ b/src/main/java/com/volmit/iris/object/IrisJigsawStructurePlacement.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.RegistryListJigsaw;
import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
@@ -10,21 +27,22 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a jigsaw structure placer")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisJigsawStructurePlacement extends IrisRegistrant {
@RegistryListJigsaw
@Required
- @DontObfuscate
+
@Desc("The structure to place")
private String structure;
- @DontObfuscate
+
@Required
@Desc("The 1 in X chance rarity")
private int rarity = 100;
diff --git a/src/main/java/com/volmit/iris/object/IrisLoot.java b/src/main/java/com/volmit/iris/object/IrisLoot.java
index 600c31301..c91f547fb 100644
--- a/src/main/java/com/volmit/iris/object/IrisLoot.java
+++ b/src/main/java/com/volmit/iris/object/IrisLoot.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -25,81 +43,73 @@ import java.awt.*;
@Desc("Represents a loot entry")
@Data
public class IrisLoot {
- @DontObfuscate
+
@Desc("The target inventory slot types to fill this loot with")
private InventorySlotType slotTypes = InventorySlotType.STORAGE;
@MinNumber(1)
- @DontObfuscate
@Desc("The sub rarity of this loot. Calculated after this loot table has been picked.")
private int rarity = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("Minimum amount of this loot")
private int minAmount = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("Maximum amount of this loot")
private int maxAmount = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("The display name of this item")
private String displayName = null;
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("Minimum durability percent")
private double minDurability = 0;
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("Maximum durability percent")
private double maxDurability = 1;
- @DontObfuscate
+
@Desc("Define a custom model identifier 1.14+ only")
private Integer customModel = null;
- @DontObfuscate
+
@Desc("Set this to true to prevent it from being broken")
private boolean unbreakable = false;
@ArrayType(min = 1, type = ItemFlag.class)
- @DontObfuscate
@Desc("The item flags to add")
private KList itemFlags = new KList<>();
- @DontObfuscate
+
@Desc("Apply enchantments to this item")
@ArrayType(min = 1, type = IrisEnchantment.class)
private KList enchantments = new KList<>();
- @DontObfuscate
+
@Desc("Apply attribute modifiers to this item")
@ArrayType(min = 1, type = IrisAttributeModifier.class)
private KList attributes = new KList<>();
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("Add lore to this item")
private KList lore = new KList<>();
@RegistryListItemType
@Required
- @DontObfuscate
+
@Desc("This is the item or block type. Does not accept minecraft:*. Only materials such as DIAMOND_SWORD or DIRT.")
private String type = "";
- @DontObfuscate
+
@Desc("The dye color")
private DyeColor dyeColor = null;
- @DontObfuscate
+
@Desc("The leather armor color")
private String leatherColor = null;
@@ -114,8 +124,7 @@ public class IrisLoot {
ItemStack is = new ItemStack(getType(), Math.max(1, rng.i(getMinAmount(), getMaxAmount())));
ItemMeta m = is.getItemMeta();
- if (getType().getMaxDurability() > 0 && m instanceof Damageable) {
- Damageable d = (Damageable) m;
+ if (getType().getMaxDurability() > 0 && m instanceof Damageable d) {
int max = getType().getMaxDurability();
d.setDamage((int) Math.round(Math.max(0, Math.min(max, (1D - rng.d(getMinDurability(), getMaxDurability())) * max))));
}
@@ -176,7 +185,7 @@ public class IrisLoot {
is.setItemMeta(m);
return is;
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
@@ -198,8 +207,7 @@ public class IrisLoot {
ItemStack is = new ItemStack(getType(), Math.max(1, rng.i(getMinAmount(), getMaxAmount())));
ItemMeta m = is.getItemMeta();
- if (getType().getMaxDurability() > 0 && m instanceof Damageable) {
- Damageable d = (Damageable) m;
+ if (getType().getMaxDurability() > 0 && m instanceof Damageable d) {
int max = getType().getMaxDurability();
d.setDamage((int) Math.round(Math.max(0, Math.min(max, (1D - rng.d(getMinDurability(), getMaxDurability())) * max))));
}
@@ -251,7 +259,7 @@ public class IrisLoot {
m.setLore(lore);
is.setItemMeta(m);
return is;
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
}
diff --git a/src/main/java/com/volmit/iris/object/IrisLootReference.java b/src/main/java/com/volmit/iris/object/IrisLootReference.java
index e7489daca..cf5b156fc 100644
--- a/src/main/java/com/volmit/iris/object/IrisLootReference.java
+++ b/src/main/java/com/volmit/iris/object/IrisLootReference.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.scaffold.cache.AtomicCache;
@@ -15,18 +33,17 @@ import lombok.experimental.Accessors;
@Data
public class IrisLootReference {
- @DontObfuscate
+
@Desc("Add = add on top of parent tables, Replace = clear first then add these. Clear = Remove all and dont add loot from this or parent.")
private LootMode mode = LootMode.ADD;
- @DontObfuscate
+
@RegistryListLoot
@ArrayType(min = 1, type = String.class)
@Desc("Add loot table registries here")
private KList tables = new KList<>();
@MinNumber(0)
- @DontObfuscate
@Desc("Increase the chance of loot in this area")
private double multiplier = 1D;
diff --git a/src/main/java/com/volmit/iris/object/IrisLootTable.java b/src/main/java/com/volmit/iris/object/IrisLootTable.java
index 7dcaa3c0b..ced2acb21 100644
--- a/src/main/java/com/volmit/iris/object/IrisLootTable.java
+++ b/src/main/java/com/volmit/iris/object/IrisLootTable.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -9,6 +27,7 @@ import lombok.experimental.Accessors;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@@ -19,26 +38,23 @@ public class IrisLootTable extends IrisRegistrant {
@Required
@Desc("The name of this loot table")
- @DontObfuscate
+
@MinNumber(2)
private String name = "";
@MinNumber(1)
- @DontObfuscate
@Desc("The rarity as in 1 in X chance")
private int rarity = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("The maximum amount of loot that can be picked in this table at a time.")
private int maxPicked = 5;
@MinNumber(0)
- @DontObfuscate
@Desc("The minimum amount of loot that can be picked in this table at a time.")
private int minPicked = 1;
- @DontObfuscate
+
@Desc("The loot in this table")
@ArrayType(min = 1, type = IrisLoot.class)
private KList loot = new KList<>();
diff --git a/src/main/java/com/volmit/iris/object/IrisMaterialPalette.java b/src/main/java/com/volmit/iris/object/IrisMaterialPalette.java
index 8905bae0c..e984a4e2a 100644
--- a/src/main/java/com/volmit/iris/object/IrisMaterialPalette.java
+++ b/src/main/java/com/volmit/iris/object/IrisMaterialPalette.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -16,18 +34,16 @@ import org.bukkit.block.data.BlockData;
@Desc("A palette of materials")
@Data
public class IrisMaterialPalette {
- @DontObfuscate
+
@Desc("The style of noise")
private IrisGeneratorStyle style = NoiseStyle.STATIC.style();
@MinNumber(0.0001)
- @DontObfuscate
@Desc("The terrain zoom mostly for zooming in on a wispy palette")
private double zoom = 5;
@Required
@ArrayType(min = 1, type = IrisBlockData.class)
- @DontObfuscate
@Desc("The palette of blocks to be used in this layer")
private KList palette = new KList().qadd(new IrisBlockData("STONE"));
diff --git a/src/main/java/com/volmit/iris/object/IrisNoiseGenerator.java b/src/main/java/com/volmit/iris/object/IrisNoiseGenerator.java
index 70a5b0b08..79a09c79b 100644
--- a/src/main/java/com/volmit/iris/object/IrisNoiseGenerator.java
+++ b/src/main/java/com/volmit/iris/object/IrisNoiseGenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -16,68 +34,64 @@ import lombok.experimental.Accessors;
public class IrisNoiseGenerator {
@MinNumber(0.0001)
- @DontObfuscate
@Desc("The coordinate input zoom")
private double zoom = 1;
- @DontObfuscate
+
@Desc("Reverse the output. So that noise = -noise + opacity")
private boolean negative = false;
@MinNumber(0)
- @DontObfuscate
@Desc("The output multiplier")
private double opacity = 1;
- @DontObfuscate
+
@Desc("Coordinate offset x")
private double offsetX = 0;
- @DontObfuscate
+
@Desc("Height output offset y")
private double offsetY = 0;
- @DontObfuscate
+
@Desc("Coordinate offset z")
private double offsetZ = 0;
@Required
- @DontObfuscate
+
@Desc("The seed")
private long seed = 0;
- @DontObfuscate
+
@Desc("Apply a parametric curve on the output")
private boolean parametric = false;
- @DontObfuscate
+
@Desc("Apply a bezier curve on the output")
private boolean bezier = false;
- @DontObfuscate
+
@Desc("Apply a sin-center curve on the output (0, and 1 = 0 and 0.5 = 1.0 using a sinoid shape.)")
private boolean sinCentered = false;
- @DontObfuscate
+
@Desc("The exponent noise^EXPONENT")
private double exponent = 1;
- @DontObfuscate
+
@Desc("Enable / disable. Outputs offsetY if disabled")
private boolean enabled = true;
@Required
- @DontObfuscate
+
@Desc("The Noise Style")
private IrisGeneratorStyle style = NoiseStyle.IRIS.style();
@MinNumber(1)
- @DontObfuscate
@Desc("Multiple octaves for multple generators of changing zooms added together")
private int octaves = 1;
@ArrayType(min = 1, type = IrisNoiseGenerator.class)
- @DontObfuscate
@Desc("Apply a child noise generator to fracture the input coordinates of this generator")
private KList fracture = new KList<>();
@@ -124,7 +138,7 @@ public class IrisNoiseGenerator {
}
public KList getAllComposites() {
- KList g = new KList();
+ KList g = new KList<>();
g.add(this);
diff --git a/src/main/java/com/volmit/iris/object/IrisObject.java b/src/main/java/com/volmit/iris/object/IrisObject.java
index f996c80a2..86ddb26c1 100644
--- a/src/main/java/com/volmit/iris/object/IrisObject.java
+++ b/src/main/java/com/volmit/iris/object/IrisObject.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -20,12 +38,10 @@ import org.bukkit.util.BlockVector;
import org.bukkit.util.Vector;
import java.io.*;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
import java.util.function.Consumer;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@Data
@EqualsAndHashCode(callSuper = false)
@@ -196,7 +212,7 @@ public class IrisObject extends IrisRegistrant {
center = new BlockVector(w / 2, h / 2, d / 2);
}
- @SuppressWarnings("resource")
+ @SuppressWarnings({"resource", "RedundantSuppression"})
public static BlockVector sampleSize(File file) throws IOException {
FileInputStream in = new FileInputStream(file);
DataInputStream din = new DataInputStream(in);
@@ -774,7 +790,7 @@ public class IrisObject extends IrisRegistrant {
}
}
- public IrisObject scaled(double scale) {
+ public IrisObject scaled(double scale, IrisObjectPlacementScaleInterpolator interpolation) {
Vector sm1 = new Vector(scale - 1, scale - 1, scale - 1);
scale = Math.max(0.001, Math.min(50, scale));
if (scale < 1) {
@@ -793,28 +809,33 @@ public class IrisObject extends IrisRegistrant {
if (getD() == 2) {
center = center.setZ(center.getBlockZ() + 0.5);
}
- HashMap placeBlock = new HashMap();
+ @SuppressWarnings({"unchecked", "rawtypes"}) HashMap placeBlock = new HashMap();
IrisObject oo = new IrisObject((int) Math.ceil((w * scale) + (scale * 2)), (int) Math.ceil((h * scale) + (scale * 2)), (int) Math.ceil((d * scale) + (scale * 2)));
- for (BlockVector i : blocks.keySet()) {
- BlockData bd = blocks.get(i);
- placeBlock.put(i.clone().add(HALF).subtract(center)
+ for (Map.Entry entry : blocks.entrySet()) {
+ BlockData bd = entry.getValue();
+ placeBlock.put(entry.getKey().clone().add(HALF).subtract(center)
.multiply(scale).toBlockVector(), bd);
}
- for (BlockVector v : placeBlock.keySet()) {
+ for (Map.Entry entry : placeBlock.entrySet()) {
+ BlockVector v = entry.getKey();
if (scale > 1) {
for (BlockVector vec : blocksBetweenTwoPoints(v.clone().add(center), v.clone().add(center).add(sm1))) {
- oo.getBlocks().put(vec, placeBlock.get(v));
+ oo.getBlocks().put(vec, entry.getValue());
}
} else {
- oo.setUnsigned(v.getBlockX(), v.getBlockY(), v.getBlockZ(), placeBlock.get(v));
+ oo.setUnsigned(v.getBlockX(), v.getBlockY(), v.getBlockZ(), entry.getValue());
}
}
if (scale > 1) {
- // oo.trihermite((int) Math.round(scale));
+ switch (interpolation) {
+ case TRILINEAR -> oo.trilinear((int) Math.round(scale));
+ case TRICUBIC -> oo.tricubic((int) Math.round(scale));
+ case TRIHERMITE -> oo.trihermite((int) Math.round(scale));
+ }
}
return oo;
@@ -921,14 +942,14 @@ public class IrisObject extends IrisRegistrant {
double d = Double.MAX_VALUE;
- for (BlockVector i : blocks.keySet()) {
- BlockData dat = blocks.get(i);
+ for (Map.Entry entry : blocks.entrySet()) {
+ BlockData dat = entry.getValue();
if (dat.getMaterial().isAir()) {
continue;
}
- double dx = i.distanceSquared(vv);
+ double dx = entry.getKey().distanceSquared(vv);
if (dx < d) {
d = dx;
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectLimit.java b/src/main/java/com/volmit/iris/object/IrisObjectLimit.java
index e60d331b4..e32d59ee3 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectLimit.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectLimit.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.MaxNumber;
import com.volmit.iris.util.MinNumber;
import lombok.AllArgsConstructor;
@@ -18,13 +35,11 @@ public class IrisObjectLimit {
@MinNumber(0)
@MaxNumber(255)
- @DontObfuscate
@Desc("The minimum height for placement (bottom of object)")
private int minimumHeight = 0;
@MinNumber(0)
@MaxNumber(255)
- @DontObfuscate
@Desc("The maximum height for placement (top of object)")
private int maximumHeight = 255;
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectLoot.java b/src/main/java/com/volmit/iris/object/IrisObjectLoot.java
index ec2d540b1..183d05c88 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectLoot.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectLoot.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.manager.IrisDataManager;
@@ -16,22 +34,22 @@ import org.bukkit.block.data.BlockData;
@Data
public class IrisObjectLoot {
- @DontObfuscate
+
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("The list of blocks this loot table should apply to")
private KList filter = new KList<>();
@Desc("Exactly match the block data or not")
- @DontObfuscate
+
private boolean exact = false;
- @DontObfuscate
+
@Desc("The loot table name")
@Required
@RegistryListLoot
private String name;
- @DontObfuscate
+
@Desc("The weight of this loot table being chosen")
private int weight = 1;
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectPlacement.java b/src/main/java/com/volmit/iris/object/IrisObjectPlacement.java
index 12cf41ae4..a379d541c 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectPlacement.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectPlacement.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -24,116 +42,107 @@ public class IrisObjectPlacement {
@RegistryListObject
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("List of objects to place")
private KList place = new KList<>();
@Desc("Rotate this objects placement")
private IrisObjectRotation rotation = new IrisObjectRotation();
- @DontObfuscate
+
@Desc("Limit the max height or min height of placement.")
private IrisObjectLimit clamp = new IrisObjectLimit();
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("The maximum layer level of a snow filter overtop of this placement. Set to 0 to disable. Max of 1.")
private double snow = 0;
@Required
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("The chance for this to place in a chunk. If you need multiple per chunk, set this to 1 and use density.")
private double chance = 1;
@MinNumber(1)
- @DontObfuscate
@Desc("If the chance check passes, place this many in a single chunk")
private int density = 1;
@MaxNumber(64)
@MinNumber(0)
- @DontObfuscate
@Desc("If the place mode is set to stilt, you can over-stilt it even further into the ground. Especially useful when using fast stilt due to inaccuracies.")
private int overStilt = 0;
@MaxNumber(64)
@MinNumber(0)
- @DontObfuscate
@Desc("When bore is enabled, expand max-y of the cuboid it removes")
private int boreExtendMaxY = 0;
@MaxNumber(64)
@MinNumber(-1)
- @DontObfuscate
@Desc("When bore is enabled, lower min-y of the cuboid it removes")
private int boreExtendMinY = 0;
- @DontObfuscate
+
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
private boolean underwater = false;
- @DontObfuscate
+
@Desc("If set to true, objects will place in carvings (such as underground) or under an overhang.")
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
- @DontObfuscate
+
@Desc("If this is defined, this object wont place on the terrain heightmap, but instead on this virtual heightmap")
private IrisNoiseGenerator heightmap;
- @DontObfuscate
+
@Desc("If set to true, Iris will try to fill the insides of 'rooms' and 'pockets' where air should fit based off of raytrace checks. This prevents a village house placing in an area where a tree already exists, and instead replaces the parts of the tree where the interior of the structure is. \n\nThis operation does not affect warmed-up generation speed however it does slow down loading objects.")
private boolean smartBore = false;
- @DontObfuscate
+
@Desc("If set to true, Blocks placed underwater that could be waterlogged are waterlogged.")
private boolean waterloggable = false;
- @DontObfuscate
+
@Desc("If set to true, objects will place on the fluid height level Such as boats.")
private boolean onwater = false;
- @DontObfuscate
+
@Desc("If set to true, this object will only place parts of itself where blocks already exist. Warning: Melding is very performance intensive!")
private boolean meld = false;
- @DontObfuscate
+
@Desc("If set to true, this object will place from the ground up instead of height checks when not y locked to the surface. This is not compatable with X and Z axis rotations (it may look off)")
private boolean bottom = false;
- @DontObfuscate
+
@Desc("If set to true, air will be placed before the schematic places.")
private boolean bore = false;
- @DontObfuscate
+
@Desc("Use a generator to warp the field of coordinates. Using simplex for example would make a square placement warp like a flag")
private IrisGeneratorStyle warp = new IrisGeneratorStyle(NoiseStyle.FLAT);
- @DontObfuscate
+
@Desc("If the place mode is set to CENTER_HEIGHT_RIGID and you have an X/Z translation, Turning on translate center will also translate the center height check.")
private boolean translateCenter = false;
- @DontObfuscate
+
@Desc("The placement mode")
private ObjectPlaceMode mode = ObjectPlaceMode.CENTER_HEIGHT;
@ArrayType(min = 1, type = IrisObjectReplace.class)
- @DontObfuscate
@Desc("Find and replace blocks")
private KList edit = new KList<>();
- @DontObfuscate
+
@Desc("Translate this object's placement")
private IrisObjectTranslate translate = new IrisObjectTranslate();
- @DontObfuscate
+
@Desc("Scale Objects")
private IrisObjectScale scale = new IrisObjectScale();
@ArrayType(min = 1, type = IrisObjectLoot.class)
- @DontObfuscate
@Desc("The loot tables to apply to these objects")
private KList loot = new KList<>();
@@ -168,9 +177,7 @@ public class IrisObjectPlacement {
public CNG getSurfaceWarp(RNG rng) {
return surfaceWarp.aquire(() ->
- {
- return getWarp().create(rng);
- });
+ getWarp().create(rng));
}
public double warp(RNG rng, double x, double y, double z) {
@@ -203,10 +210,10 @@ public class IrisObjectPlacement {
private transient AtomicCache cache = new AtomicCache<>();
- private class TableCache {
- transient WeightedRandom global = new WeightedRandom<>();
- transient KMap> basic = new KMap<>();
- transient KMap>> exact = new KMap<>();
+ private static class TableCache {
+ final transient WeightedRandom global = new WeightedRandom<>();
+ final transient KMap> basic = new KMap<>();
+ final transient KMap>> exact = new KMap<>();
}
private TableCache getCache(IrisDataManager manager) {
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectPlacementScaleInterpolator.java b/src/main/java/com/volmit/iris/object/IrisObjectPlacementScaleInterpolator.java
new file mode 100644
index 000000000..8c7f33547
--- /dev/null
+++ b/src/main/java/com/volmit/iris/object/IrisObjectPlacementScaleInterpolator.java
@@ -0,0 +1,40 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.volmit.iris.object;
+
+import com.volmit.iris.util.Desc;
+
+@Desc("Use 3D Interpolation on scaled objects if they are larger than the origin.")
+public enum IrisObjectPlacementScaleInterpolator {
+
+ @Desc("Don't interpolate, big cubes")
+ NONE,
+
+
+ @Desc("Uses linear interpolation in 3 dimensions, generally pretty good, but slow")
+ TRILINEAR,
+
+
+ @Desc("Uses cubic spline interpolation in 3 dimensions, even better, but extreme slowdowns")
+ TRICUBIC,
+
+
+ @Desc("Uses hermite spline interpolation in 3 dimensions, even better, but extreme slowdowns")
+ TRIHERMITE
+}
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectReplace.java b/src/main/java/com/volmit/iris/object/IrisObjectReplace.java
index 7450728d8..f718a2a3e 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectReplace.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectReplace.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -19,22 +37,22 @@ public class IrisObjectReplace {
@ArrayType(min = 1, type = IrisBlockData.class)
@Required
@Desc("Find this block")
- @DontObfuscate
+
private KList find = new KList<>();
@Required
@Desc("Replace it with this block palette")
- @DontObfuscate
+
private IrisMaterialPalette replace = new IrisMaterialPalette();
@Desc("Exactly match the block data or not")
- @DontObfuscate
+
private boolean exact = false;
@MinNumber(0)
@MaxNumber(1)
@Desc("Modifies the chance the block is replaced")
- @DontObfuscate
+
private float chance = 1;
private final transient AtomicCache replaceGen = new AtomicCache<>();
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectRotation.java b/src/main/java/com/volmit/iris/object/IrisObjectRotation.java
index 24c82cc8a..b38e602f5 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectRotation.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectRotation.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.KList;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -21,19 +38,19 @@ import java.util.List;
@Desc("Configures rotation for iris")
@Data
public class IrisObjectRotation {
- @DontObfuscate
+
@Desc("If this rotator is enabled or not")
private boolean enabled = true;
- @DontObfuscate
+
@Desc("The x axis rotation")
private IrisAxisRotationClamp xAxis = new IrisAxisRotationClamp();
- @DontObfuscate
+
@Desc("The y axis rotation")
private IrisAxisRotationClamp yAxis = new IrisAxisRotationClamp(true, false, 0, 0, 90);
- @DontObfuscate
+
@Desc("The z axis rotation")
private IrisAxisRotationClamp zAxis = new IrisAxisRotationClamp();
@@ -173,47 +190,29 @@ public class IrisObjectRotation {
}
public BlockFace faceForAxis(Axis axis) {
- switch (axis) {
- case X:
- return BlockFace.EAST;
- case Y:
- return BlockFace.UP;
- case Z:
- return BlockFace.NORTH;
- }
+ return switch (axis) {
+ case X -> BlockFace.EAST;
+ case Y -> BlockFace.UP;
+ case Z -> BlockFace.NORTH;
+ };
- return BlockFace.NORTH;
}
public Axis axisFor(BlockFace f) {
- switch (f) {
- case NORTH:
- case SOUTH:
- return Axis.Z;
- case EAST:
- case WEST:
- return Axis.X;
- case UP:
- case DOWN:
- return Axis.Y;
- }
+ return switch (f) {
+ case NORTH, SOUTH -> Axis.Z;
+ case EAST, WEST -> Axis.X;
+ default -> Axis.Y;
+ };
- return Axis.Y;
}
public Axis axisFor2D(BlockFace f) {
- switch (f) {
- case NORTH:
- case SOUTH:
- return Axis.Z;
- case EAST:
- case WEST:
- case UP:
- case DOWN:
- return Axis.X;
- }
+ return switch (f) {
+ case EAST, WEST, UP, DOWN -> Axis.X;
+ default -> Axis.Z;
+ };
- return Axis.Z;
}
public BlockData rotate(BlockData dd, int spinxx, int spinyy, int spinzz) {
@@ -227,8 +226,7 @@ public class IrisObjectRotation {
return d;
}
- if (d instanceof Directional) {
- Directional g = ((Directional) d);
+ if (d instanceof Directional g) {
BlockFace f = g.getFacing();
BlockVector bv = new BlockVector(f.getModX(), f.getModY(), f.getModZ());
bv = rotate(bv.clone(), spinx, spiny, spinz);
@@ -239,8 +237,7 @@ public class IrisObjectRotation {
} else if (!g.getMaterial().isSolid()) {
d = null;
}
- } else if (d instanceof Rotatable) {
- Rotatable g = ((Rotatable) d);
+ } else if (d instanceof Rotatable g) {
BlockFace f = g.getRotation();
BlockVector bv = new BlockVector(f.getModX(), 0, f.getModZ());
@@ -258,9 +255,8 @@ public class IrisObjectRotation {
if (!a.equals(((Orientable) d).getAxis()) && ((Orientable) d).getAxes().contains(a)) {
((Orientable) d).setAxis(a);
}
- } else if (d instanceof MultipleFacing) {
+ } else if (d instanceof MultipleFacing g) {
List faces = new KList<>();
- MultipleFacing g = (MultipleFacing) d;
for (BlockFace i : g.getFaces()) {
BlockVector bv = new BlockVector(i.getModX(), i.getModY(), i.getModZ());
@@ -279,9 +275,8 @@ public class IrisObjectRotation {
for (BlockFace i : faces) {
g.setFace(i, true);
}
- } else if (d.getMaterial().equals(Material.NETHER_PORTAL) && d instanceof Orientable) {
+ } else if (d.getMaterial().equals(Material.NETHER_PORTAL) && d instanceof Orientable g) {
//TODO: Fucks up logs
- Orientable g = ((Orientable) d);
BlockFace f = faceForAxis(g.getAxis());
BlockVector bv = new BlockVector(f.getModX(), f.getModY(), f.getModZ());
bv = rotate(bv.clone(), spinx, spiny, spinz);
@@ -289,7 +284,7 @@ public class IrisObjectRotation {
Axis a = !g.getAxes().contains(Axis.Y) ? axisFor(t) : axisFor2D(t);
((Orientable) d).setAxis(a);
}
- } catch (Throwable throwable) {
+ } catch (Throwable ignored) {
}
@@ -414,6 +409,7 @@ public class IrisObjectRotation {
return enabled && zAxis.isEnabled();
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean canRotate() {
return canRotateX() || canRotateY() || canRotateZ();
}
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectScale.java b/src/main/java/com/volmit/iris/object/IrisObjectScale.java
index a582b5e2c..a1fdff6e6 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectScale.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectScale.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
@@ -15,22 +33,23 @@ import lombok.experimental.Accessors;
public class IrisObjectScale {
@MinNumber(1)
@MaxNumber(32)
- @DontObfuscate
@Desc("Iris Objects are scaled and cached to speed up placements. Because of this extra memory is used, so we evenly distribute variations across the defined scale range, then pick one randomly. If the differences is small, use a lower number. For more possibilities on the scale spectrum, increase this at the cost of memory.")
private int variations = 7;
@MinNumber(0.01)
@MaxNumber(50)
- @DontObfuscate
@Desc("The minimum scale")
private double minimumScale = 1;
@MinNumber(0.01)
@MaxNumber(50)
- @DontObfuscate
@Desc("The maximum height for placement (top of object)")
private double maximumScale = 1;
+
+ @Desc("If this object is scaled up beyond its origin size, specify a 3D interpolator")
+ private IrisObjectPlacementScaleInterpolator interpolation = IrisObjectPlacementScaleInterpolator.NONE;
+
private final transient ConcurrentLinkedHashMap> cache
= new ConcurrentLinkedHashMap.Builder>()
.initialCapacity(64)
@@ -68,7 +87,7 @@ public class IrisObjectScale {
KList c = new KList<>();
for (double i = minimumScale; i < maximumScale; i += (maximumScale - minimumScale) / (double) (Math.min(variations, 32))) {
- c.add(origin.scaled(i));
+ c.add(origin.scaled(i, getInterpolation()));
}
return c;
diff --git a/src/main/java/com/volmit/iris/object/IrisObjectTranslate.java b/src/main/java/com/volmit/iris/object/IrisObjectTranslate.java
index b076183bf..f4e2fff80 100644
--- a/src/main/java/com/volmit/iris/object/IrisObjectTranslate.java
+++ b/src/main/java/com/volmit/iris/object/IrisObjectTranslate.java
@@ -1,6 +1,27 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
-import com.volmit.iris.util.*;
+import com.volmit.iris.util.Desc;
+import com.volmit.iris.util.MaxNumber;
+import com.volmit.iris.util.MinNumber;
+import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -16,26 +37,26 @@ public class IrisObjectTranslate {
@MinNumber(-128) // TODO: WARNING HEIGHT
@MaxNumber(128) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The x shift in blocks")
private int x = 0;
@Required
@MinNumber(-256) // TODO: WARNING HEIGHT
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The x shift in blocks")
private int y = 0;
@MinNumber(-128) // TODO: WARNING HEIGHT
@MaxNumber(128) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("Adds an additional amount of height randomly (translateY + rand(0 - yRandom))")
private int yRandom = 0;
@MinNumber(-128) // TODO: WARNING HEIGHT
@MaxNumber(128) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The x shift in blocks")
private int z = 0;
diff --git a/src/main/java/com/volmit/iris/object/IrisPosition.java b/src/main/java/com/volmit/iris/object/IrisPosition.java
index 3924e98d3..01f69a136 100644
--- a/src/main/java/com/volmit/iris/object/IrisPosition.java
+++ b/src/main/java/com/volmit/iris/object/IrisPosition.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -17,15 +34,15 @@ import org.bukkit.util.Vector;
@Desc("Represents a position")
@Data
public class IrisPosition {
- @DontObfuscate
+
@Desc("The x position")
private int x = 0;
- @DontObfuscate
+
@Desc("The y position")
private int y = 0;
- @DontObfuscate
+
@Desc("The z position")
private int z = 0;
diff --git a/src/main/java/com/volmit/iris/object/IrisPosition2D.java b/src/main/java/com/volmit/iris/object/IrisPosition2D.java
index a4f918a7e..02fc05ef4 100644
--- a/src/main/java/com/volmit/iris/object/IrisPosition2D.java
+++ b/src/main/java/com/volmit/iris/object/IrisPosition2D.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -13,11 +30,11 @@ import lombok.experimental.Accessors;
@Desc("Represents a position")
@Data
public class IrisPosition2D {
- @DontObfuscate
+
@Desc("The x position")
private int x = 0;
- @DontObfuscate
+
@Desc("The z position")
private int z = 0;
}
diff --git a/src/main/java/com/volmit/iris/object/IrisPotionEffect.java b/src/main/java/com/volmit/iris/object/IrisPotionEffect.java
index ba978f87a..2500acaf4 100644
--- a/src/main/java/com/volmit/iris/object/IrisPotionEffect.java
+++ b/src/main/java/com/volmit/iris/object/IrisPotionEffect.java
@@ -1,8 +1,29 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.cache.AtomicCache;
-import com.volmit.iris.util.*;
+import com.volmit.iris.util.Desc;
+import com.volmit.iris.util.MaxNumber;
+import com.volmit.iris.util.MinNumber;
+import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -14,34 +35,32 @@ import org.bukkit.potion.PotionEffectType;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("An iris potion effect")
@Data
public class IrisPotionEffect {
@Required
- @DontObfuscate
+
@Desc("The potion effect to apply in this area")
private String potionEffect = "";
@Required
@MinNumber(-1)
@MaxNumber(1024)
- @DontObfuscate
@Desc("The Potion Strength or -1 to disable")
private int strength = -1;
@Required
@MinNumber(1)
- @DontObfuscate
@Desc("The time the potion will last for")
private int ticks = 200;
- @DontObfuscate
+
@Desc("Is the effect ambient")
private boolean ambient = false;
- @DontObfuscate
+
@Desc("Is the effect showing particles")
private boolean particles = true;
@@ -64,7 +83,7 @@ public class IrisPotionEffect {
return t;
}
}
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
diff --git a/src/main/java/com/volmit/iris/object/IrisRange.java b/src/main/java/com/volmit/iris/object/IrisRange.java
index 8b7f3623f..2deb107e8 100644
--- a/src/main/java/com/volmit/iris/object/IrisRange.java
+++ b/src/main/java/com/volmit/iris/object/IrisRange.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.RNG;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -14,11 +31,11 @@ import lombok.experimental.Accessors;
@Desc("Represents a range")
@Data
public class IrisRange {
- @DontObfuscate
+
@Desc("The minimum value")
private double min = 16;
- @DontObfuscate
+
@Desc("The maximum value")
private double max = 32;
diff --git a/src/main/java/com/volmit/iris/object/IrisRareObject.java b/src/main/java/com/volmit/iris/object/IrisRareObject.java
index d3d9a3ab2..27ad7dad5 100644
--- a/src/main/java/com/volmit/iris/object/IrisRareObject.java
+++ b/src/main/java/com/volmit/iris/object/IrisRareObject.java
@@ -1,16 +1,38 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
-import com.volmit.iris.util.*;
+import com.volmit.iris.util.Desc;
+import com.volmit.iris.util.MinNumber;
+import com.volmit.iris.util.RegistryListObject;
+import com.volmit.iris.util.Required;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
-@DontObfuscate
+
@Desc("Represents a structure tile")
@Data
@EqualsAndHashCode(callSuper = false)
@@ -19,12 +41,12 @@ public class IrisRareObject {
@Required
@MinNumber(1)
@Desc("The rarity is 1 in X")
- @DontObfuscate
+
private int rarity = 1;
@RegistryListObject
@Required
@Desc("The object to place if rarity check passed")
- @DontObfuscate
+
private String object = "";
}
diff --git a/src/main/java/com/volmit/iris/object/IrisRegion.java b/src/main/java/com/volmit/iris/object/IrisRegion.java
index 29e435176..fa50f6c6b 100644
--- a/src/main/java/com/volmit/iris/object/IrisRegion.java
+++ b/src/main/java/com/volmit/iris/object/IrisRegion.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.Iris;
@@ -11,10 +29,11 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
-
import java.awt.Color;
import java.util.Random;
+
+@SuppressWarnings("DefaultAnnotationParam")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@@ -24,158 +43,134 @@ import java.util.Random;
public class IrisRegion extends IrisRegistrant implements IRare {
@MinNumber(2)
@Required
- @DontObfuscate
+
@Desc("The name of the region")
private String name = "A Region";
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
- @DontObfuscate
@Desc("Jigsaw structures")
private KList jigsawStructures = new KList<>();
- @DontObfuscate
+
@Desc("Add random chances for terrain features")
@ArrayType(min = 1, type = IrisFeaturePotential.class)
private KList features = new KList<>();
@ArrayType(min = 1, type = IrisEffect.class)
- @DontObfuscate
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
private KList effects = new KList<>();
- @DontObfuscate
+
@Desc("Entity spawns to override or add to this region")
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
private KList entitySpawnOverrides = new KList<>();
- @DontObfuscate
+
@Desc("Entity spawns during generation")
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
private KList entityInitialSpawns = new KList<>();
@MinNumber(1)
@MaxNumber(128)
- @DontObfuscate
@Desc("The rarity of the region")
private int rarity = 1;
@ArrayType(min = 1, type = IrisBlockDrops.class)
- @DontObfuscate
@Desc("Define custom block drops for this region")
private KList blockDrops = new KList<>();
@MinNumber(0.0001)
@MaxNumber(1)
- @DontObfuscate
@Desc("The shore ration (How much percent of land should be a shore)")
private double shoreRatio = 0.13;
@ArrayType(min = 1, type = IrisObjectPlacement.class)
- @DontObfuscate
@Desc("Objects define what schematics (iob files) iris will place in this region")
- private KList objects = new KList();
+ private KList objects = new KList<>();
@MinNumber(0)
- @DontObfuscate
@Desc("The min shore height")
private double shoreHeightMin = 1.2;
- @DontObfuscate
+
@Desc("Reference loot tables in this area")
private IrisLootReference loot = new IrisLootReference();
@MinNumber(0)
- @DontObfuscate
@Desc("The the max shore height")
private double shoreHeightMax = 3.2;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("The varience of the shore height")
private double shoreHeightZoom = 3.14;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("How large land biomes are in this region")
private double landBiomeZoom = 1;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("How large shore biomes are in this region")
private double shoreBiomeZoom = 1;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("How large lake biomes are in this region")
private double lakeBiomeZoom = 1;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("How large river biomes are in this region")
private double riverBiomeZoom = 1;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("How large sea biomes are in this region")
private double seaBiomeZoom = 1;
@MinNumber(0.0001)
- @DontObfuscate
@Desc("How large cave biomes are in this region")
private double caveBiomeZoom = 1;
@MinNumber(0.0001)
@MaxNumber(1)
- @DontObfuscate
@Desc("The biome implosion ratio, how much to implode biomes into children (chance)")
private double biomeImplosionRatio = 0.4;
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList landBiomes = new KList<>();
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList seaBiomes = new KList<>();
@RegistryListBiome
@Required
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList shoreBiomes = new KList<>();
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList riverBiomes = new KList<>();
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList lakeBiomes = new KList<>();
@RegistryListBiome
@ArrayType(min = 1, type = String.class)
- @DontObfuscate
@Desc("A list of root-level biomes in this region. Don't specify child biomes of other biomes here. Just the root parents.")
private KList caveBiomes = new KList<>();
@ArrayType(min = 1, type = IrisRegionRidge.class)
- @DontObfuscate
@Desc("Ridge biomes create a vein-like network like rivers through this region")
private KList ridgeBiomes = new KList<>();
@ArrayType(min = 1, type = IrisRegionSpot.class)
- @DontObfuscate
@Desc("Spot biomes splotch themselves across this region like lakes")
private KList spotBiomes = new KList<>();
@@ -183,43 +178,40 @@ public class IrisRegion extends IrisRegistrant implements IRare {
@Desc("Define regional deposit generators that add onto the global deposit generators")
private KList deposits = new KList<>();
- @DontObfuscate
+
@Desc("The style of rivers")
private IrisGeneratorStyle riverStyle = NoiseStyle.VASCULAR_THIN.style().zoomed(7.77);
- @DontObfuscate
+
@Desc("The style of lakes")
private IrisGeneratorStyle lakeStyle = NoiseStyle.CELLULAR_IRIS_THICK.style();
- @DontObfuscate
+
@Desc("The style of river chances")
private IrisGeneratorStyle riverChanceStyle = NoiseStyle.SIMPLEX.style().zoomed(4);
- @DontObfuscate
+
@Desc("Generate lakes in this region")
private boolean lakes = true;
- @DontObfuscate
+
@Desc("Generate rivers in this region")
private boolean rivers = true;
@MinNumber(1)
- @DontObfuscate
@Desc("Generate lakes in this region")
private int lakeRarity = 22;
@MinNumber(1)
- @DontObfuscate
@Desc("Generate rivers in this region")
private int riverRarity = 3;
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("Generate rivers in this region")
private double riverThickness = 0.1;
- @DontObfuscate
+
@Desc("A color for visualizing this region with a color. I.e. #F13AF5. This will show up on the map.")
private String color = null;
@@ -325,7 +317,7 @@ public class IrisRegion extends IrisRegistrant implements IRare {
public KList getRidgeBiomeKeys() {
return cacheRidge.aquire(() ->
{
- KList cacheRidge = new KList();
+ KList cacheRidge = new KList<>();
ridgeBiomes.forEach((i) -> cacheRidge.add(i.getBiome()));
return cacheRidge;
@@ -335,7 +327,7 @@ public class IrisRegion extends IrisRegistrant implements IRare {
public KList getSpotBiomeKeys() {
return cacheSpot.aquire(() ->
{
- KList cacheSpot = new KList();
+ KList cacheSpot = new KList<>();
spotBiomes.forEach((i) -> cacheSpot.add(i.getBiome()));
return cacheSpot;
});
@@ -343,9 +335,7 @@ public class IrisRegion extends IrisRegistrant implements IRare {
public CNG getShoreHeightGenerator() {
return shoreHeightGenerator.aquire(() ->
- {
- return CNG.signature(new RNG((long) (getName().length() + getLandBiomeZoom() + getLandBiomes().size() + 3458612)));
- });
+ CNG.signature(new RNG((long) (getName().length() + getLandBiomeZoom() + getLandBiomes().size() + 3458612))));
}
public double getShoreHeight(double x, double z) {
diff --git a/src/main/java/com/volmit/iris/object/IrisRegionRidge.java b/src/main/java/com/volmit/iris/object/IrisRegionRidge.java
index faf463dda..58791df44 100644
--- a/src/main/java/com/volmit/iris/object/IrisRegionRidge.java
+++ b/src/main/java/com/volmit/iris/object/IrisRegionRidge.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CellGenerator;
@@ -17,23 +35,21 @@ public class IrisRegionRidge {
@RegistryListBiome
@Required
- @DontObfuscate
+
@Desc("The biome name")
private String biome = "";
@Required
- @DontObfuscate
+
@Desc("The type this biome should override (land sea or shore)")
private InferredType type = InferredType.LAND;
- @DontObfuscate
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
private InferredType as = InferredType.DEFER;
- @DontObfuscate
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
private double noiseMultiplier = 0;
@@ -41,41 +57,34 @@ public class IrisRegionRidge {
@Required
@MinNumber(0)
@MaxNumber(1)
- @DontObfuscate
@Desc("The chance this biome will be placed in a given spot")
private double chance = 0.75;
@MinNumber(0)
- @DontObfuscate
@Desc("The scale of the biome ridge. Higher values = wider veins & bigger connected cells")
private double scale = 5;
- @DontObfuscate
@Desc("The chance scale (cell chances)")
private double chanceScale = 4;
@MinNumber(0)
- @DontObfuscate
@Desc("The shuffle, how 'natural' this looks. Compared to pure polygons")
private double shuffle = 16;
@MinNumber(0)
- @DontObfuscate
@Desc("The chance shuffle (polygon cell chances)")
private double chanceShuffle = 128;
@MinNumber(0)
- @DontObfuscate
@Desc("The thickness of the vein")
private double thickness = 0.125;
- @DontObfuscate
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
diff --git a/src/main/java/com/volmit/iris/object/IrisRegionSpot.java b/src/main/java/com/volmit/iris/object/IrisRegionSpot.java
index ee836bb6c..ceef60133 100644
--- a/src/main/java/com/volmit/iris/object/IrisRegionSpot.java
+++ b/src/main/java/com/volmit/iris/object/IrisRegionSpot.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CellGenerator;
@@ -17,40 +35,37 @@ public class IrisRegionSpot {
@RegistryListBiome
@Required
- @DontObfuscate
+
@Desc("The biome to be placed")
private String biome = "";
@Required
- @DontObfuscate
+
@Desc("Where this spot overrides. Land sea or shore")
private InferredType type = InferredType.LAND;
- @DontObfuscate
+
@Desc("What type this spot is (i.e. target SEA but as LAND) like an island. Default matches the target type")
private InferredType as = InferredType.DEFER;
- @DontObfuscate
+
@Desc("Use the distance from cell value to add or remove noise value. (Forces depth or height)")
private double noiseMultiplier = 0;
@MinNumber(0)
- @DontObfuscate
@Desc("The scale of splotches")
private double scale = 1;
@Required
@MinNumber(1)
- @DontObfuscate
@Desc("Rarity is how often this splotch appears. higher = less often")
private double rarity = 1;
@MinNumber(0)
- @DontObfuscate
@Desc("The shuffle or how natural the splotch looks like (anti-polygon)")
private double shuffle = 128;
- @DontObfuscate
+
@Desc("If the noise multiplier is below zero, what should the air be filled with?")
private IrisBiomePaletteLayer air = new IrisBiomePaletteLayer().zero();
diff --git a/src/main/java/com/volmit/iris/object/IrisRegistrant.java b/src/main/java/com/volmit/iris/object/IrisRegistrant.java
index d59351cf0..26fceaa04 100644
--- a/src/main/java/com/volmit/iris/object/IrisRegistrant.java
+++ b/src/main/java/com/volmit/iris/object/IrisRegistrant.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.manager.IrisDataManager;
diff --git a/src/main/java/com/volmit/iris/object/IrisShapedGeneratorStyle.java b/src/main/java/com/volmit/iris/object/IrisShapedGeneratorStyle.java
index 43f17b97b..fb6f4029a 100644
--- a/src/main/java/com/volmit/iris/object/IrisShapedGeneratorStyle.java
+++ b/src/main/java/com/volmit/iris/object/IrisShapedGeneratorStyle.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.*;
@@ -13,7 +31,7 @@ import lombok.experimental.Accessors;
@Data
public class IrisShapedGeneratorStyle {
@Required
- @DontObfuscate
+
@Desc("The generator id")
private IrisGeneratorStyle generator = new IrisGeneratorStyle(NoiseStyle.IRIS);
@@ -22,14 +40,14 @@ public class IrisShapedGeneratorStyle {
@MinNumber(-256) // TODO: WARNING HEIGHT
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The min block value")
private int min = 0;
@Required
@MinNumber(-256) // TODO: WARNING HEIGHT
@MaxNumber(256) // TODO: WARNING HEIGHT
- @DontObfuscate
+
@Desc("The max block value")
private int max = 0;
diff --git a/src/main/java/com/volmit/iris/object/IrisSlopeClip.java b/src/main/java/com/volmit/iris/object/IrisSlopeClip.java
index de974af4b..779b26737 100644
--- a/src/main/java/com/volmit/iris/object/IrisSlopeClip.java
+++ b/src/main/java/com/volmit/iris/object/IrisSlopeClip.java
@@ -1,7 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.MaxNumber;
import com.volmit.iris.util.MinNumber;
import lombok.AllArgsConstructor;
@@ -17,13 +34,11 @@ import lombok.experimental.Accessors;
public class IrisSlopeClip {
@MinNumber(0)
@MaxNumber(255)
- @DontObfuscate
@Desc("The minimum slope for placement")
private double minimumSlope = 0;
@MinNumber(0)
@MaxNumber(255)
- @DontObfuscate
@Desc("The maximum slope for placement")
private double maximumSlope = 10;
@@ -31,6 +46,7 @@ public class IrisSlopeClip {
return minimumSlope <= 0 && maximumSlope >= 10;
}
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isValid(double slope) {
if (isDefault()) {
return true;
diff --git a/src/main/java/com/volmit/iris/object/LootMode.java b/src/main/java/com/volmit/iris/object/LootMode.java
index 20b4a9bca..66fa156fc 100644
--- a/src/main/java/com/volmit/iris/object/LootMode.java
+++ b/src/main/java/com/volmit/iris/object/LootMode.java
@@ -1,19 +1,36 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("A loot mode is used to descrive what to do with the existing loot layers before adding this loot. Using ADD will simply add this table to the building list of tables (i.e. add dimension tables, region tables then biome tables). By using clear or replace, you remove the parent tables before and add just your tables.")
public enum LootMode {
@Desc("Add to the existing parent loot tables")
- @DontObfuscate
+
ADD,
@Desc("Clear all loot tables then add this table")
- @DontObfuscate
+
CLEAR,
@Desc("Replace all loot tables with this table (same as clear)")
- @DontObfuscate
+
REPLACE
}
diff --git a/src/main/java/com/volmit/iris/object/NoiseStyle.java b/src/main/java/com/volmit/iris/object/NoiseStyle.java
index a9255d980..09aad03c1 100644
--- a/src/main/java/com/volmit/iris/object/NoiseStyle.java
+++ b/src/main/java/com/volmit/iris/object/NoiseStyle.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.generator.noise.CNG;
@@ -5,430 +23,429 @@ import com.volmit.iris.generator.noise.CNGFactory;
import com.volmit.iris.generator.noise.NoiseType;
import com.volmit.iris.scaffold.stream.ProceduralStream;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.RNG;
@Desc("Styles of noise")
-@DontObfuscate
+
public enum NoiseStyle {
@Desc("White Noise is like static. Useful for block scattering but not terrain.")
- @DontObfuscate
+
STATIC(rng -> new CNG(rng, NoiseType.WHITE, 1D, 1)),
@Desc("Wispy Perlin-looking simplex noise. The 'iris' style noise.")
- @DontObfuscate
+
IRIS(rng -> CNG.signature(rng).scale(1)),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE(rng -> CNG.signaturePerlin(rng).scale(0.776).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_CELLULAR(rng -> CNG.signaturePerlin(rng, NoiseType.CELLULAR).scale(1).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_SIMPLEX(rng -> CNG.signaturePerlin(rng, NoiseType.SIMPLEX).scale(1).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_GLOB(rng -> CNG.signaturePerlin(rng, NoiseType.GLOB).scale(1).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_VASCULAR(rng -> CNG.signaturePerlin(rng, NoiseType.VASCULAR).scale(1).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_CUBIC(rng -> CNG.signaturePerlin(rng, NoiseType.CUBIC).scale(1).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_SUPERFRACTAL(rng -> CNG.signaturePerlin(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX).scale(1).bake()),
@Desc("Classic German Engineering")
- @DontObfuscate
+
NOWHERE_FRACTAL(rng -> CNG.signaturePerlin(rng, NoiseType.FRACTAL_BILLOW_PERLIN).scale(1).bake()),
@Desc("Wispy Perlin-looking simplex noise. The 'iris' style noise.")
- @DontObfuscate
+
IRIS_DOUBLE(rng -> CNG.signatureDouble(rng).scale(1)),
@Desc("Wispy Perlin-looking simplex noise. The 'iris' style noise.")
- @DontObfuscate
+
IRIS_THICK(rng -> CNG.signatureThick(rng).scale(1)),
@Desc("Wispy Perlin-looking simplex noise. The 'iris' style noise.")
- @DontObfuscate
+
IRIS_HALF(rng -> CNG.signatureHalf(rng).scale(1)),
@Desc("Basic, Smooth & Fast Simplex noise.")
- @DontObfuscate
+
SIMPLEX(rng -> new CNG(rng, 1D, 1).scale(1)),
@Desc("Very Detailed smoke using simplex fractured with fractal billow simplex at high octaves.")
- @DontObfuscate
+
FRACTAL_SMOKE(rng -> new CNG(rng, 1D, 1).fractureWith(new CNG(rng.nextParallelRNG(1), NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 8).scale(0.2), 1000).scale(0.34)),
@Desc("Thinner Veins.")
- @DontObfuscate
+
VASCULAR_THIN(rng -> new CNG(rng.nextParallelRNG(1), NoiseType.VASCULAR, 1D, 1).scale(1).pow(0.65)),
@Desc("Cells of simplex noise")
- @DontObfuscate
+
SIMPLEX_CELLS(rng -> new CNG(rng.nextParallelRNG(1), NoiseType.SIMPLEX, 1D, 1).scale(1).fractureWith(new CNG(rng.nextParallelRNG(8), NoiseType.CELLULAR, 1D, 1).scale(1), 200)),
@Desc("Veins of simplex noise")
- @DontObfuscate
+
SIMPLEX_VASCULAR(rng -> new CNG(rng.nextParallelRNG(1), NoiseType.SIMPLEX, 1D, 1).scale(1).fractureWith(new CNG(rng.nextParallelRNG(8), NoiseType.VASCULAR, 1D, 1).scale(1), 200)),
@Desc("Very Detailed fluid using simplex fractured with fractal billow simplex at high octaves.")
- @DontObfuscate
+
FRACTAL_WATER(rng -> new CNG(rng, 1D, 1).fractureWith(new CNG(rng.nextParallelRNG(1), NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 9).scale(0.03), 9900).scale(1.14)),
@Desc("Perlin. Like simplex but more natural")
- @DontObfuscate
+
PERLIN(rng -> new CNG(rng, NoiseType.PERLIN, 1D, 1).scale(1.15)),
@Desc("Perlin. Like simplex but more natural")
- @DontObfuscate
+
PERLIN_IRIS(rng -> CNG.signature(rng, NoiseType.PERLIN).scale(1.47)),
@Desc("Perlin. Like simplex but more natural")
- @DontObfuscate
+
PERLIN_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.PERLIN).scale(1.47)),
@Desc("Perlin. Like simplex but more natural")
- @DontObfuscate
+
PERLIN_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.PERLIN).scale(1.47)),
@Desc("Perlin. Like simplex but more natural")
- @DontObfuscate
+
PERLIN_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.PERLIN).scale(1.47)),
@Desc("Billow Fractal Perlin Noise.")
- @DontObfuscate
+
FRACTAL_BILLOW_PERLIN(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_PERLIN, 1D, 1).scale(1.47)),
@Desc("Billow Fractal Perlin Noise. 2 Octaves")
- @DontObfuscate
+
BIOCTAVE_FRACTAL_BILLOW_PERLIN(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_PERLIN, 1D, 2).scale(1.17)),
@Desc("Billow Fractal Simplex Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 1)),
@Desc("FBM Fractal Simplex Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 1)),
@Desc("Billow Fractal Iris Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_BILLOW_IRIS(rng -> CNG.signature(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX)),
@Desc("FBM Fractal Iris Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_FBM_IRIS(rng -> CNG.signature(rng, NoiseType.FRACTAL_FBM_SIMPLEX)),
@Desc("Billow Fractal Iris Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_BILLOW_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX)),
@Desc("FBM Fractal Iris Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_FBM_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.FRACTAL_FBM_SIMPLEX)),
@Desc("Billow Fractal Iris Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_BILLOW_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX)),
@Desc("FBM Fractal Iris Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_FBM_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.FRACTAL_FBM_SIMPLEX)),
@Desc("Rigid Multi Fractal Simplex Noise. Single octave.")
- @DontObfuscate
+
FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 1)),
@Desc("Billow Fractal Simplex Noise. 2 octaves.")
- @DontObfuscate
+
BIOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 2)),
@Desc("FBM Fractal Simplex Noise. 2 octaves.")
- @DontObfuscate
+
BIOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 2)),
@Desc("Rigid Multi Fractal Simplex Noise. 2 octaves.")
- @DontObfuscate
+
BIOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 2)),
@Desc("Rigid Multi Fractal Simplex Noise. 3 octaves.")
- @DontObfuscate
+
TRIOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 3)),
@Desc("Billow Fractal Simplex Noise. 3 octaves.")
- @DontObfuscate
+
TRIOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 3)),
@Desc("FBM Fractal Simplex Noise. 3 octaves.")
- @DontObfuscate
+
TRIOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 3)),
@Desc("Rigid Multi Fractal Simplex Noise. 4 octaves.")
- @DontObfuscate
+
QUADOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 4)),
@Desc("Billow Fractal Simplex Noise. 4 octaves.")
- @DontObfuscate
+
QUADOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 4)),
@Desc("FBM Fractal Simplex Noise. 4 octaves.")
- @DontObfuscate
+
QUADOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 4)),
@Desc("Rigid Multi Fractal Simplex Noise. 5 octaves.")
- @DontObfuscate
+
QUINTOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 5)),
@Desc("Billow Fractal Simplex Noise. 5 octaves.")
- @DontObfuscate
+
QUINTOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 5)),
@Desc("FBM Fractal Simplex Noise. 5 octaves.")
- @DontObfuscate
+
QUINTOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 5)),
@Desc("Rigid Multi Fractal Simplex Noise. 6 octaves.")
- @DontObfuscate
+
SEXOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 6)),
@Desc("Billow Fractal Simplex Noise. 6 octaves.")
- @DontObfuscate
+
SEXOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 6)),
@Desc("FBM Fractal Simplex Noise. 6 octaves.")
- @DontObfuscate
+
SEXOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 6)),
@Desc("Rigid Multi Fractal Simplex Noise. 7 octaves.")
- @DontObfuscate
+
SEPTOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 7)),
@Desc("Billow Fractal Simplex Noise. 7 octaves.")
- @DontObfuscate
+
SEPTOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 7)),
@Desc("FBM Fractal Simplex Noise. 7 octaves.")
- @DontObfuscate
+
SEPTOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 7)),
@Desc("Rigid Multi Fractal Simplex Noise. 8 octaves.")
- @DontObfuscate
+
OCTOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 8)),
@Desc("Billow Fractal Simplex Noise. 8 octaves.")
- @DontObfuscate
+
OCTOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 8)),
@Desc("FBM Fractal Simplex Noise. 8 octaves.")
- @DontObfuscate
+
OCTOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 8)),
@Desc("Rigid Multi Fractal Simplex Noise. 9 octaves.")
- @DontObfuscate
+
NONOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 9)),
@Desc("Billow Fractal Simplex Noise. 9 octaves.")
- @DontObfuscate
+
NONOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 9)),
@Desc("FBM Fractal Simplex Noise. 9 octaves.")
- @DontObfuscate
+
NONOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 9)),
@Desc("Rigid Multi Fractal Simplex Noise. 10 octaves.")
- @DontObfuscate
+
VIGOCTAVE_FRACTAL_RM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_RIGID_MULTI_SIMPLEX, 1D, 10)),
@Desc("Billow Fractal Simplex Noise. 10 octaves.")
- @DontObfuscate
+
VIGOCTAVE_FRACTAL_BILLOW_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_BILLOW_SIMPLEX, 1D, 10)),
@Desc("FBM Fractal Simplex Noise. 10 octaves.")
- @DontObfuscate
+
VIGOCTAVE_FRACTAL_FBM_SIMPLEX(rng -> new CNG(rng, NoiseType.FRACTAL_FBM_SIMPLEX, 1D, 10)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 2 octaves")
- @DontObfuscate
+
BIOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 2).scale(1D / 2D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 3 octaves")
- @DontObfuscate
+
TRIOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 3).scale(1D / 3D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 4 octaves")
- @DontObfuscate
+
QUADOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 4).scale(1D / 4D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 5 octaves")
- @DontObfuscate
+
QUINTOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 5).scale(1D / 5D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 6 octaves")
- @DontObfuscate
+
SEXOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 6).scale(1D / 6D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 7 octaves")
- @DontObfuscate
+
SEPTOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 7).scale(1D / 12D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 8 octaves")
- @DontObfuscate
+
OCTOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 8).scale(1D / 25D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 9 octaves")
- @DontObfuscate
+
NONOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 9).scale(1D / 50D)),
@Desc("Basic, Smooth & Fast Simplex noise. Uses 10 octaves")
- @DontObfuscate
+
VIGOCTAVE_SIMPLEX(rng -> new CNG(rng, 1D, 10).scale(1D / 100D)),
@Desc("Glob noise is like cellular, but with globs...")
- @DontObfuscate
+
GLOB(rng -> new CNG(rng, NoiseType.GLOB, 1D, 1)),
@Desc("Glob noise is like cellular, but with globs...")
- @DontObfuscate
+
GLOB_IRIS(rng -> CNG.signature(rng, NoiseType.GLOB)),
@Desc("Glob noise is like cellular, but with globs...")
- @DontObfuscate
+
GLOB_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.GLOB)),
@Desc("Glob noise is like cellular, but with globs...")
- @DontObfuscate
+
GLOB_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.GLOB)),
@Desc("Glob noise is like cellular, but with globs...")
- @DontObfuscate
+
GLOB_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.GLOB)),
@Desc("Cubic Noise")
- @DontObfuscate
+
CUBIC(rng -> new CNG(rng, NoiseType.CUBIC, 1D, 1).scale(256)),
@Desc("Fractal Cubic Noise")
- @DontObfuscate
+
FRACTAL_CUBIC(rng -> new CNG(rng, NoiseType.FRACTAL_CUBIC, 1D, 1).scale(2)),
@Desc("Fractal Cubic Noise With Iris Swirls")
- @DontObfuscate
+
FRACTAL_CUBIC_IRIS(rng -> CNG.signature(rng, NoiseType.FRACTAL_CUBIC).scale(2)),
@Desc("Fractal Cubic Noise With Iris Swirls")
- @DontObfuscate
+
FRACTAL_CUBIC_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.FRACTAL_CUBIC).scale(2)),
@Desc("Fractal Cubic Noise With Iris Swirls")
- @DontObfuscate
+
FRACTAL_CUBIC_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.FRACTAL_CUBIC).scale(2)),
@Desc("Fractal Cubic Noise With Iris Swirls")
- @DontObfuscate
+
FRACTAL_CUBIC_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.FRACTAL_CUBIC).scale(2)),
@Desc("Fractal Cubic Noise, 2 Octaves")
- @DontObfuscate
+
BIOCTAVE_FRACTAL_CUBIC(rng -> new CNG(rng, NoiseType.FRACTAL_CUBIC, 1D, 2).scale(2)),
@Desc("Fractal Cubic Noise, 3 Octaves")
- @DontObfuscate
+
TRIOCTAVE_FRACTAL_CUBIC(rng -> new CNG(rng, NoiseType.FRACTAL_CUBIC, 1D, 3).scale(1.5)),
@Desc("Fractal Cubic Noise, 4 Octaves")
- @DontObfuscate
+
QUADOCTAVE_FRACTAL_CUBIC(rng -> new CNG(rng, NoiseType.FRACTAL_CUBIC, 1D, 4).scale(1)),
@Desc("Cubic Noise")
- @DontObfuscate
+
CUBIC_IRIS(rng -> CNG.signature(rng, NoiseType.CUBIC).scale(256)),
@Desc("Cubic Noise")
- @DontObfuscate
+
CUBIC_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.CUBIC).scale(256)),
@Desc("Cubic Noise")
- @DontObfuscate
+
CUBIC_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.CUBIC).scale(256)),
@Desc("Cubic Noise")
- @DontObfuscate
+
CUBIC_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.CUBIC).scale(256)),
@Desc("Cellular noise creates the same noise level for cells, changes noise level on cell borders.")
- @DontObfuscate
+
CELLULAR(rng -> new CNG(rng, NoiseType.CELLULAR, 1D, 1)),
@Desc("Cellular noise creates the same noise level for cells, changes noise level on cell borders. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
CELLULAR_IRIS(rng -> CNG.signature(rng, NoiseType.CELLULAR)),
@Desc("Cellular noise creates the same noise level for cells, changes noise level on cell borders. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
CELLULAR_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.CELLULAR)),
@Desc("Cellular noise creates the same noise level for cells, changes noise level on cell borders. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
CELLULAR_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.CELLULAR)),
@Desc("Cellular noise creates the same noise level for cells, changes noise level on cell borders. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
CELLULAR_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.CELLULAR)),
@Desc("Inverse of vascular, height gets to 1.0 as it approaches the center of a cell")
- @DontObfuscate
+
CELLULAR_HEIGHT(rng -> new CNG(rng, NoiseType.CELLULAR_HEIGHT, 1D, 1)),
@Desc("Inverse of vascular, height gets to 1.0 as it approaches the center of a cell, using the iris style.")
- @DontObfuscate
+
CELLULAR_HEIGHT_IRIS(rng -> CNG.signature(rng, NoiseType.CELLULAR_HEIGHT)),
@Desc("Inverse of vascular, height gets to 1.0 as it approaches the center of a cell, using the iris style.")
- @DontObfuscate
+
CELLULAR_HEIGHT_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.CELLULAR_HEIGHT)),
@Desc("Inverse of vascular, height gets to 1.0 as it approaches the center of a cell, using the iris style.")
- @DontObfuscate
+
CELLULAR_HEIGHT_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.CELLULAR_HEIGHT)),
@Desc("Inverse of vascular, height gets to 1.0 as it approaches the center of a cell, using the iris style.")
- @DontObfuscate
+
CELLULAR_HEIGHT_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.CELLULAR_HEIGHT)),
@Desc("Vascular noise gets higher as the position nears a cell border.")
- @DontObfuscate
+
VASCULAR(rng -> new CNG(rng, NoiseType.VASCULAR, 1D, 1)),
@Desc("It always returns 0.5")
- @DontObfuscate
+
FLAT(rng -> new CNG(rng, NoiseType.FLAT, 1D, 1)),
@Desc("Vascular noise gets higher as the position nears a cell border. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
VASCULAR_IRIS(rng -> CNG.signature(rng, NoiseType.VASCULAR)),
@Desc("Vascular noise gets higher as the position nears a cell border. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
VASCULAR_IRIS_DOUBLE(rng -> CNG.signatureDouble(rng, NoiseType.VASCULAR)),
@Desc("Vascular noise gets higher as the position nears a cell border. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
VASCULAR_IRIS_THICK(rng -> CNG.signatureThick(rng, NoiseType.VASCULAR)),
@Desc("Vascular noise gets higher as the position nears a cell border. Cells are distorted using Iris styled wispy noise.")
- @DontObfuscate
+
VASCULAR_IRIS_HALF(rng -> CNG.signatureHalf(rng, NoiseType.VASCULAR)),
;
diff --git a/src/main/java/com/volmit/iris/object/ObjectPlaceMode.java b/src/main/java/com/volmit/iris/object/ObjectPlaceMode.java
index fa5d513b8..a58579035 100644
--- a/src/main/java/com/volmit/iris/object/ObjectPlaceMode.java
+++ b/src/main/java/com/volmit/iris/object/ObjectPlaceMode.java
@@ -1,43 +1,60 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object;
import com.volmit.iris.util.Desc;
-import com.volmit.iris.util.DontObfuscate;
@Desc("Object Place modes are useful for positioning objects just right. The default value is CENTER_HEIGHT.")
public enum ObjectPlaceMode {
@Desc("The default place mode. This mode picks a center point (where the center of the object will be) and takes the height. That height is used for the whole object.")
- @DontObfuscate
+
CENTER_HEIGHT,
@Desc("Samples a lot of points where the object will cover (horizontally) and picks the highest height, that height is then used to place the object. This mode is useful for preventing any part of your object from being buried though it will float off of cliffs.")
- @DontObfuscate
+
MAX_HEIGHT,
@Desc("Samples only 4 points where the object will cover (horizontally) and picks the highest height, that height is then used to place the object. This mode is useful for preventing any part of your object from being buried though it will float off of cliffs.\"")
- @DontObfuscate
+
FAST_MAX_HEIGHT,
@Desc("Samples a lot of points where the object will cover (horizontally) and picks the lowest height, that height is then used to place the object. This mode is useful for preventing any part of your object from overhanging a cliff though it gets buried a lot")
- @DontObfuscate
+
MIN_HEIGHT,
@Desc("Samples only 4 points where the object will cover (horizontally) and picks the lowest height, that height is then used to place the object. This mode is useful for preventing any part of your object from overhanging a cliff though it gets buried a lot")
- @DontObfuscate
+
FAST_MIN_HEIGHT,
@Desc("Stilting is MAX_HEIGHT but it repeats the bottom most block of your object until it hits the surface. This is expensive because it has to first sample every height value for each x,z position of your object. Avoid using this unless its structures for performance reasons.")
- @DontObfuscate
+
STILT,
@Desc("Just like stilting but very inaccurate. Useful for stilting a lot of objects without too much care on accuracy (you can use the over-stilt value to force stilts under ground further)")
- @DontObfuscate
+
FAST_STILT,
@Desc("Samples the height of the terrain at every x,z position of your object and pushes it down to the surface. It's pretty much like a melt function over the terrain.")
- @DontObfuscate
+
PAINT,
@Desc("Applies multiple terrain features into the parallax layer before this object places to distort the height, essentially vacuuming the terrain's heightmap closer to the bottom of this object. Uses MAX_HEIGHT to place")
- @DontObfuscate
+
VACUUM
}
diff --git a/src/main/java/com/volmit/iris/object/tile/TileBanner.java b/src/main/java/com/volmit/iris/object/tile/TileBanner.java
index 206b126cf..1893d16e6 100644
--- a/src/main/java/com/volmit/iris/object/tile/TileBanner.java
+++ b/src/main/java/com/volmit/iris/object/tile/TileBanner.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object.tile;
import com.volmit.iris.scaffold.data.nbt.tag.CompoundTag;
@@ -20,7 +38,7 @@ import java.util.List;
public class TileBanner implements TileData {
public static final int id = 2;
- private List patterns = new ArrayList();
+ private List patterns = new ArrayList<>();
private DyeColor baseColor;
@Override
@@ -45,6 +63,7 @@ public class TileBanner implements TileData {
this.baseColor = banner.getBaseColor();
}
+ @SuppressWarnings("MethodDoesntCallSuperMethod")
@Override
public TileBanner clone() {
TileBanner ts = new TileBanner();
@@ -77,9 +96,10 @@ public class TileBanner implements TileData {
}
}
+ @SuppressWarnings("deprecation")
@Override
public void toNBT(CompoundTag tag) {
- ListTag listTag = (ListTag) ListTag.createUnchecked(CompoundTag.class);
+ @SuppressWarnings("unchecked") ListTag listTag = (ListTag) ListTag.createUnchecked(CompoundTag.class);
for (Pattern p : patterns) {
CompoundTag pattern = new CompoundTag();
pattern.putString("Pattern", p.getPattern().getIdentifier());
@@ -90,43 +110,9 @@ public class TileBanner implements TileData {
}
public boolean isBanner(Material material) {
- switch (material) {
-
- case RED_BANNER:
- case RED_WALL_BANNER:
- case ORANGE_BANNER:
- case ORANGE_WALL_BANNER:
- case YELLOW_BANNER:
- case YELLOW_WALL_BANNER:
- case LIME_BANNER:
- case LIME_WALL_BANNER:
- case GREEN_BANNER:
- case GREEN_WALL_BANNER:
- case CYAN_BANNER:
- case CYAN_WALL_BANNER:
- case LIGHT_BLUE_BANNER:
- case LIGHT_BLUE_WALL_BANNER:
- case BLUE_BANNER:
- case BLUE_WALL_BANNER:
- case PURPLE_BANNER:
- case PURPLE_WALL_BANNER:
- case MAGENTA_BANNER:
- case MAGENTA_WALL_BANNER:
- case PINK_BANNER:
- case PINK_WALL_BANNER:
- case WHITE_BANNER:
- case WHITE_WALL_BANNER:
- case LIGHT_GRAY_BANNER:
- case LIGHT_GRAY_WALL_BANNER:
- case GRAY_BANNER:
- case GRAY_WALL_BANNER:
- case BLACK_BANNER:
- case BLACK_WALL_BANNER:
- case BROWN_BANNER:
- case BROWN_WALL_BANNER:
- return true;
- default:
- return false;
- }
+ return switch (material) {
+ case RED_BANNER, RED_WALL_BANNER, ORANGE_BANNER, ORANGE_WALL_BANNER, YELLOW_BANNER, YELLOW_WALL_BANNER, LIME_BANNER, LIME_WALL_BANNER, GREEN_BANNER, GREEN_WALL_BANNER, CYAN_BANNER, CYAN_WALL_BANNER, LIGHT_BLUE_BANNER, LIGHT_BLUE_WALL_BANNER, BLUE_BANNER, BLUE_WALL_BANNER, PURPLE_BANNER, PURPLE_WALL_BANNER, MAGENTA_BANNER, MAGENTA_WALL_BANNER, PINK_BANNER, PINK_WALL_BANNER, WHITE_BANNER, WHITE_WALL_BANNER, LIGHT_GRAY_BANNER, LIGHT_GRAY_WALL_BANNER, GRAY_BANNER, GRAY_WALL_BANNER, BLACK_BANNER, BLACK_WALL_BANNER, BROWN_BANNER, BROWN_WALL_BANNER -> true;
+ default -> false;
+ };
}
}
diff --git a/src/main/java/com/volmit/iris/object/tile/TileData.java b/src/main/java/com/volmit/iris/object/tile/TileData.java
index 8b73aac3f..e14dc3bff 100644
--- a/src/main/java/com/volmit/iris/object/tile/TileData.java
+++ b/src/main/java/com/volmit/iris/object/tile/TileData.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object.tile;
import com.volmit.iris.scaffold.data.nbt.tag.CompoundTag;
@@ -11,6 +29,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+@SuppressWarnings("ALL")
public interface TileData extends Cloneable {
KList> registry = setup();
@@ -27,7 +46,7 @@ public interface TileData extends Cloneable {
static TileData extends TileState> read(DataInputStream s) throws Throwable {
int id = s.readShort();
- TileData extends TileState> d = registry.get(id).getClass().getConstructor().newInstance();
+ @SuppressWarnings("unchecked") TileData extends TileState> d = registry.get(id).getClass().getConstructor().newInstance();
d.fromBinary(s);
return d;
}
@@ -44,7 +63,7 @@ public interface TileData extends Cloneable {
if (i.isApplicable(data)) {
try {
- TileData extends TileState> s = i.getClass().getConstructor().newInstance();
+ @SuppressWarnings("unchecked") TileData extends TileState> s = i.getClass().getConstructor().newInstance();
s.fromBukkitTry(block.getState());
return s;
} catch (Throwable e) {
@@ -66,6 +85,7 @@ public interface TileData extends Cloneable {
default boolean toBukkitTry(BlockState t) {
try {
+ //noinspection unchecked
toBukkit((T) t);
return true;
} catch (Throwable e) {
@@ -77,6 +97,7 @@ public interface TileData extends Cloneable {
default boolean fromBukkitTry(BlockState t) {
try {
+ //noinspection unchecked
fromBukkit((T) t);
return true;
} catch (Throwable e) {
diff --git a/src/main/java/com/volmit/iris/object/tile/TileSign.java b/src/main/java/com/volmit/iris/object/tile/TileSign.java
index 52b19cc2b..8d94dcd95 100644
--- a/src/main/java/com/volmit/iris/object/tile/TileSign.java
+++ b/src/main/java/com/volmit/iris/object/tile/TileSign.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object.tile;
import com.volmit.iris.scaffold.data.nbt.tag.CompoundTag;
@@ -48,6 +66,7 @@ public class TileSign implements TileData {
dyeColor = sign.getColor();
}
+ @SuppressWarnings("MethodDoesntCallSuperMethod")
@Override
public TileSign clone() {
TileSign ts = new TileSign();
diff --git a/src/main/java/com/volmit/iris/object/tile/TileSpawner.java b/src/main/java/com/volmit/iris/object/tile/TileSpawner.java
index 0849b18d2..d64dd5e8d 100644
--- a/src/main/java/com/volmit/iris/object/tile/TileSpawner.java
+++ b/src/main/java/com/volmit/iris/object/tile/TileSpawner.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.object.tile;
import com.volmit.iris.scaffold.data.nbt.tag.CompoundTag;
@@ -37,6 +55,7 @@ public class TileSpawner implements TileData {
entityType = sign.getSpawnedType();
}
+ @SuppressWarnings("MethodDoesntCallSuperMethod")
@Override
public TileSpawner clone() {
TileSpawner ts = new TileSpawner();
@@ -57,7 +76,7 @@ public class TileSpawner implements TileData {
@Override
public void toNBT(CompoundTag tag) {
- ListTag potentials = (ListTag) ListTag.createUnchecked(CompoundTag.class);
+ @SuppressWarnings("unchecked") ListTag potentials = (ListTag) ListTag.createUnchecked(CompoundTag.class);
CompoundTag t = new CompoundTag();
CompoundTag ent = new CompoundTag();
ent.putString("id", entityType.getKey().toString());
diff --git a/src/main/java/com/volmit/iris/pregen/DirectWorldWriter.java b/src/main/java/com/volmit/iris/pregen/DirectWorldWriter.java
index 42e08f839..8d04b205a 100644
--- a/src/main/java/com/volmit/iris/pregen/DirectWorldWriter.java
+++ b/src/main/java/com/volmit/iris/pregen/DirectWorldWriter.java
@@ -1,5 +1,24 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.pregen;
+import com.volmit.iris.Iris;
import com.volmit.iris.nms.INMS;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.scaffold.data.mca.Chunk;
@@ -21,6 +40,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Map;
+@SuppressWarnings("EmptyMethod")
public class DirectWorldWriter {
private final File worldFolder;
private final Map writeBuffer;
@@ -72,21 +92,20 @@ public class DirectWorldWriter {
return B.getAir();
}
- String p = tag.getString("Name");
+ StringBuilder p = new StringBuilder(tag.getString("Name"));
if (tag.containsKey("Properties")) {
CompoundTag props = tag.getCompoundTag("Properties");
- p += "[";
- KList m = new KList<>();
+ p.append('[');
for (String i : props.keySet()) {
- m.add(i + "=" + props.getString(i));
+ p.append(i).append('=').append(props.getString(i)).append(',');
}
- p += m.toString(",") + "]";
+ p.deleteCharAt(p.length() - 1).append(']');
}
- BlockData b = B.getOrNull(p);
+ BlockData b = B.getOrNull(p.toString());
if (b == null) {
return B.getAir();
@@ -139,7 +158,7 @@ public class DirectWorldWriter {
}
return getBlockData(tag);
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
return B.get("AIR");
@@ -216,4 +235,21 @@ public class DirectWorldWriter {
return biomeIds;
}
+
+ public void verify(int mcaox, int mcaoz) {
+ MCAFile file = getMCA(mcaox, mcaoz);
+
+ for(int i = 0; i < 32; i++)
+ {
+ for(int j = 0; j < 32; j++)
+ {
+ Chunk c = file.getChunk(i, j);
+
+ if(c == null)
+ {
+ Iris.warn("Chunk " + ((mcaox << 5) + i) + ", " + ((mcaoz << 5) + j) + " is null in MCA File " + mcaox + ", " + mcaoz);
+ }
+ }
+ }
+ }
}
diff --git a/src/main/java/com/volmit/iris/pregen/Pregenerator.java b/src/main/java/com/volmit/iris/pregen/Pregenerator.java
index 00fb9c1c6..b6459b277 100644
--- a/src/main/java/com/volmit/iris/pregen/Pregenerator.java
+++ b/src/main/java/com/volmit/iris/pregen/Pregenerator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.pregen;
import com.volmit.iris.Iris;
@@ -21,7 +39,6 @@ import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
-import java.awt.image.ImageObserver;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
@@ -29,6 +46,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
@@ -74,6 +92,7 @@ public class Pregenerator implements Listener {
private final ChronoLatch latch;
private IrisAccess access;
private final KList regionReload;
+ private KList wait = new KList<>();
public Pregenerator(World world, int blockSize, Runnable onComplete) {
this(world, blockSize);
@@ -137,8 +156,6 @@ public class Pregenerator implements Listener {
drawMCA(xx, zz, COLOR_MCA_PREPARE);
if (access != null && generateMCARegion(xx, zz, burst, access, mcaIteration)) {
flushWorld();
- } else {
- drawMCA(xx, zz, COLOR_MCA_DEFERRED);
}
});
@@ -165,6 +182,11 @@ public class Pregenerator implements Listener {
flushWorld();
}
+ while(wait.isNotEmpty())
+ {
+ J.sleep(50);
+ }
+
burst.shutdownNow();
directWriter.flush();
flushWorld();
@@ -205,6 +227,7 @@ public class Pregenerator implements Listener {
private boolean generateMCARegion(int x, int z, MultiBurst burst, IrisAccess access, Consumer3> mcaIteration) {
if (!Iris.instance.isMCA()) {
+ generateDeferedMCARegion(x, z, burst, mcaIteration);
return false;
}
@@ -227,13 +250,10 @@ public class Pregenerator implements Listener {
}));
e.complete();
directWriter.flush();
- if (!install(mcg, mca)) {
- drawMCA(x, z, COLOR_MCA_DEFERRED);
- generated.set(generated.get() - 1024);
- }
totalChunks.getAndAdd(1024);
mcaDefer.add(new ChunkPosition(x, z));
- } else {
+ install(mcg, mca);
+ } else {
totalChunks.getAndAdd(1024);
mcaDefer.add(new ChunkPosition(x, z));
e.complete();
@@ -272,49 +292,47 @@ public class Pregenerator implements Listener {
}
private void generateDeferedMCARegion(int x, int z, MultiBurst burst, Consumer3> mcaIteration) {
- BurstExecutor e = burst.burst(1024);
int mcaox = x << 5;
int mcaoz = z << 5;
if (PaperLib.isPaper()) {
method.set("PaperAsync (Slow)");
+
+ while(wait.size() > 8192)
+ {
+ J.sleep(25);
+ }
+
mcaIteration.accept(mcaox, mcaoz, (ii, jj) -> {
- e.queue(() -> {
- try {
- CompletableFuture cc = PaperLib.getChunkAtAsync(world, ii, jj);
- draw(ii, jj, COLOR_MCA_GENERATE_SLOW_ASYNC);
- cc.join();
- draw(ii, jj, COLOR_MCA_GENERATED);
- generated.getAndIncrement();
- vcax.set(ii);
- vcaz.set(jj);
- } catch (Throwable ex) {
- draw(ii, jj, COLOR_ERROR);
- ChunkPosition pos = new ChunkPosition(ii, jj);
- errors.add(pos);
- totalChunks.addAndGet(1024);
- mcaDefer.add(new ChunkPosition(pos.getX() >> 5, pos.getZ() >> 5));
- Iris.warn("Hole Detected in Chunk: " + pos.getX() + ", " + pos.getZ() + " (at block " + (pos.getX() << 4) + ", " + lowestBedrock + ", " + (pos.getZ() << 4) + ")");
+ ChunkPosition cx = new ChunkPosition(ii,jj);
+ PaperLib.getChunkAtAsync(world, ii, jj).thenAccept((c) -> {
+ draw(ii, jj, COLOR_MCA_GENERATE_SLOW_ASYNC);
+ draw(ii, jj, COLOR_MCA_GENERATED);
+ generated.getAndIncrement();
+ vcax.set(ii);
+ vcaz.set(jj);
+
+ synchronized (wait)
+ {
+ wait.remove(cx);
}
});
+
+ wait.add(cx);
});
- e.complete();
} else {
AtomicInteger m = new AtomicInteger();
method.set("Spigot (Very Slow)");
KList q = new KList<>();
- mcaIteration.accept(mcaox, mcaoz, (ii, jj) -> {
- q.add(() -> {
- draw(ii, jj, COLOR_MCA_GENERATE_SLOW);
- world.getChunkAt(ii, jj).load(true);
- Chunk c = world.getChunkAt(ii, jj);
- draw(ii, jj, COLOR_MCA_GENERATED);
- checkForError(c);
- m.getAndIncrement();
- generated.getAndIncrement();
- vcax.set(ii);
- vcaz.set(jj);
- });
- });
+ mcaIteration.accept(mcaox, mcaoz, (ii, jj) -> q.add(() -> {
+ draw(ii, jj, COLOR_MCA_GENERATE_SLOW);
+ world.getChunkAt(ii, jj).load(true);
+ Chunk c = world.getChunkAt(ii, jj);
+ draw(ii, jj, COLOR_MCA_GENERATED);
+ m.getAndIncrement();
+ generated.getAndIncrement();
+ vcax.set(ii);
+ vcaz.set(jj);
+ }));
ChronoLatch tick = new ChronoLatch(1000);
new SR(0) {
@Override
@@ -330,7 +348,7 @@ public class Pregenerator implements Listener {
try {
q.pop().run();
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
}
@@ -342,19 +360,6 @@ public class Pregenerator implements Listener {
}
}
- private void checkForError(Chunk c) {
- if (lowestBedrock >= 0 && lowestBedrock < 256) {
- if (!c.getBlock(14, lowestBedrock, 14).getType().equals(Material.BEDROCK)) {
- ChunkPosition pos = new ChunkPosition(c.getX(), c.getZ());
- errors.add(pos);
- totalChunks.addAndGet(1024);
- mcaDefer.add(new ChunkPosition(pos.getX() >> 5, pos.getZ() >> 5));
- draw(pos.getX(), pos.getZ(), COLOR_ERROR);
- Iris.warn("Hole Detected in Chunk: " + pos.getX() + ", " + pos.getZ() + " (at block " + (pos.getX() << 4) + ", " + lowestBedrock + ", " + (pos.getZ() << 4) + ")");
- }
- }
- }
-
private KList computeChunkOrder() {
ChunkPosition center = new ChunkPosition(15, 15);
KList p = new KList<>();
@@ -506,18 +511,13 @@ public class Pregenerator implements Listener {
while (order.isNotEmpty()) {
try {
order.pop().run();
- } catch (Throwable e) {
+ } catch (Throwable ignored) {
}
}
l.unlock();
- g.drawImage(image, 0, 0, getParent().getWidth(), getParent().getHeight(), new ImageObserver() {
- @Override
- public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
- return true;
- }
- });
+ g.drawImage(image, 0, 0, getParent().getWidth(), getParent().getHeight(), (img, infoflags, x, y, width, height) -> true);
g.setColor(Color.WHITE);
g.setFont(new Font("Hevetica", Font.BOLD, 28));
@@ -557,11 +557,7 @@ public class Pregenerator implements Listener {
@SuppressWarnings("deprecation")
private static MCAPregenGui createAndShowGUI(Pregenerator j) throws HeadlessException {
JFrame frame;
- try {
- frame = new JFrame("Pregen View");
- } catch (HeadlessException e) {
- throw e;
- }
+ frame = new JFrame("Pregen View");
MCAPregenGui nv = new MCAPregenGui();
frame.addKeyListener(nv);
nv.l = new ReentrantLock();
@@ -584,7 +580,7 @@ public class Pregenerator implements Listener {
if (file != null) {
try {
frame.setIconImage(ImageIO.read(file));
- } catch (IOException e) {
+ } catch (IOException ignored) {
}
}
diff --git a/src/main/java/com/volmit/iris/scaffold/IrisWorldCreator.java b/src/main/java/com/volmit/iris/scaffold/IrisWorldCreator.java
index 263b3ffb8..98fd0258a 100644
--- a/src/main/java/com/volmit/iris/scaffold/IrisWorldCreator.java
+++ b/src/main/java/com/volmit/iris/scaffold/IrisWorldCreator.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.scaffold;
import com.volmit.iris.manager.IrisDataManager;
diff --git a/src/main/java/com/volmit/iris/scaffold/IrisWorlds.java b/src/main/java/com/volmit/iris/scaffold/IrisWorlds.java
index e19925557..1b538b53b 100644
--- a/src/main/java/com/volmit/iris/scaffold/IrisWorlds.java
+++ b/src/main/java/com/volmit/iris/scaffold/IrisWorlds.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.scaffold;
import com.volmit.iris.Iris;
@@ -9,6 +27,7 @@ import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
+@SuppressWarnings("ALL")
public class IrisWorlds {
private static final KMap provisioned = new KMap<>();
diff --git a/src/main/java/com/volmit/iris/scaffold/cache/AtomicCache.java b/src/main/java/com/volmit/iris/scaffold/cache/AtomicCache.java
index 24c5eab28..abf0b2f0e 100644
--- a/src/main/java/com/volmit/iris/scaffold/cache/AtomicCache.java
+++ b/src/main/java/com/volmit/iris/scaffold/cache/AtomicCache.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.scaffold.cache;
import com.volmit.iris.util.IrisLock;
@@ -50,6 +68,7 @@ public class AtomicCache {
if (this.t != null && M.ms() - a > 1000) {
if (this.t != null) {
+ //noinspection NonAtomicOperationOnVolatileField
validations++;
}
@@ -82,6 +101,7 @@ public class AtomicCache {
}
if (M.ms() - a > 1000) {
+ //noinspection NonAtomicOperationOnVolatileField
validations++;
return this.t;
}
diff --git a/src/main/java/com/volmit/iris/scaffold/cache/Cache.java b/src/main/java/com/volmit/iris/scaffold/cache/Cache.java
index 583cce6cd..a04a36df6 100644
--- a/src/main/java/com/volmit/iris/scaffold/cache/Cache.java
+++ b/src/main/java/com/volmit/iris/scaffold/cache/Cache.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.scaffold.cache;
import org.bukkit.Chunk;
diff --git a/src/main/java/com/volmit/iris/scaffold/cache/Multicache.java b/src/main/java/com/volmit/iris/scaffold/cache/Multicache.java
index bf0cad559..b2540fb66 100644
--- a/src/main/java/com/volmit/iris/scaffold/cache/Multicache.java
+++ b/src/main/java/com/volmit/iris/scaffold/cache/Multicache.java
@@ -1,10 +1,26 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
package com.volmit.iris.scaffold.cache;
public interface Multicache {
- @SuppressWarnings("hiding")
Cache getCache(int id);
- @SuppressWarnings("hiding")
Cache createCache();
}
\ No newline at end of file
diff --git a/src/main/java/com/volmit/iris/scaffold/data/DataPalette.java b/src/main/java/com/volmit/iris/scaffold/data/DataPalette.java
index 7c36b2211..28a3a00b0 100644
--- a/src/main/java/com/volmit/iris/scaffold/data/DataPalette.java
+++ b/src/main/java/com/volmit/iris/scaffold/data/DataPalette.java
@@ -1,3 +1,21 @@
+/*
+ * Iris is a World Generator for Minecraft Bukkit Servers
+ * Copyright (c) 2021 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see