mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-18 06:41:08 +00:00
Lint
This commit is contained in:
@@ -1,12 +1,19 @@
|
|||||||
package com.volmit.iris;
|
package com.volmit.iris;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseWheelEvent;
|
||||||
|
import java.awt.event.MouseWheelListener;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JLayeredPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
import com.volmit.iris.noise.CNG;
|
import com.volmit.iris.noise.CNG;
|
||||||
@@ -17,13 +24,14 @@ import com.volmit.iris.util.PrecisionStopwatch;
|
|||||||
import com.volmit.iris.util.RNG;
|
import com.volmit.iris.util.RNG;
|
||||||
import com.volmit.iris.util.RollingSequence;
|
import com.volmit.iris.util.RollingSequence;
|
||||||
|
|
||||||
public class NoiseView extends JPanel {
|
public class NoiseView extends JPanel implements MouseWheelListener {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2094606939770332040L;
|
private static final long serialVersionUID = 2094606939770332040L;
|
||||||
|
|
||||||
|
static JComboBox<NoiseStyle> combo;
|
||||||
RollingSequence r = new RollingSequence(60);
|
RollingSequence r = new RollingSequence(60);
|
||||||
boolean colorMode = true;
|
boolean colorMode = true;
|
||||||
CNG cng = NoiseStyle.SIMPLEX.create(new RNG(RNG.r.nextLong())).scale(0.25);
|
CNG cng = NoiseStyle.STATIC.create(new RNG(RNG.r.nextLong()));
|
||||||
GroupedExecutor gx = new GroupedExecutor(Runtime.getRuntime().availableProcessors(), Thread.MAX_PRIORITY,
|
GroupedExecutor gx = new GroupedExecutor(Runtime.getRuntime().availableProcessors(), Thread.MAX_PRIORITY,
|
||||||
"Iris Renderer");
|
"Iris Renderer");
|
||||||
ReentrantLock l = new ReentrantLock();
|
ReentrantLock l = new ReentrantLock();
|
||||||
@@ -35,11 +43,19 @@ public class NoiseView extends JPanel {
|
|||||||
for (int i = 0; i < 60; i++) {
|
for (int i = 0; i < 60; i++) {
|
||||||
r.put(10000);
|
r.put(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addMouseWheelListener((MouseWheelListener) this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void mouseWheelMoved(MouseWheelEvent e) {
|
||||||
|
int notches = e.getWheelRotation();
|
||||||
|
cng.scale(cng.getScale() + ((0.05*cng.getScale())* notches));
|
||||||
|
cng.scale(cng.getScale() < 0.00001 ? 0.00001 : cng.getScale());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paint(Graphics g) {
|
public void paint(Graphics g) {
|
||||||
super.paint(g);
|
|
||||||
PrecisionStopwatch p = PrecisionStopwatch.start();
|
PrecisionStopwatch p = PrecisionStopwatch.start();
|
||||||
int accuracy = M.clip(r.getAverage() / 13D, 1D, 128D).intValue();
|
int accuracy = M.clip(r.getAverage() / 13D, 1D, 128D).intValue();
|
||||||
|
|
||||||
@@ -60,7 +76,7 @@ public class NoiseView extends JPanel {
|
|||||||
int xx = x;
|
int xx = x;
|
||||||
gx.queue("a", () -> {
|
gx.queue("a", () -> {
|
||||||
for (int z = 0; z < getParent().getHeight(); z += accuracy) {
|
for (int z = 0; z < getParent().getHeight(); z += accuracy) {
|
||||||
double n = cng.noise(xx, Math.sin((double) M.ms() / 10000D) * 400D, z);
|
double n = cng.noise(xx, Math.sin((double) M.ms() / 10000D) * 800D, z);
|
||||||
|
|
||||||
if (n > 1 || n < 0) {
|
if (n > 1 || n < 0) {
|
||||||
System.out.println("EXCEEDED " + n);
|
System.out.println("EXCEEDED " + n);
|
||||||
@@ -88,7 +104,6 @@ public class NoiseView extends JPanel {
|
|||||||
|
|
||||||
p.end();
|
p.end();
|
||||||
r.put(p.getMilliseconds());
|
r.put(p.getMilliseconds());
|
||||||
|
|
||||||
EventQueue.invokeLater(() -> {
|
EventQueue.invokeLater(() -> {
|
||||||
repaint();
|
repaint();
|
||||||
});
|
});
|
||||||
@@ -96,10 +111,24 @@ public class NoiseView extends JPanel {
|
|||||||
|
|
||||||
private static void createAndShowGUI() {
|
private static void createAndShowGUI() {
|
||||||
JFrame frame = new JFrame("Iris");
|
JFrame frame = new JFrame("Iris");
|
||||||
|
NoiseView nv = new NoiseView();
|
||||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
frame.add(new NoiseView());
|
combo = new JComboBox<NoiseStyle>(NoiseStyle.values());
|
||||||
frame.setLocationByPlatform(true);
|
combo.addActionListener(new ActionListener() {
|
||||||
frame.pack();
|
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
NoiseStyle s = (NoiseStyle)(((JComboBox<NoiseStyle>)e.getSource()).getSelectedItem());
|
||||||
|
nv.cng = s.create(RNG.r.nextParallelRNG(RNG.r.imax()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
combo.setSize(500, 100);
|
||||||
|
JLayeredPane pane = new JLayeredPane();
|
||||||
|
nv.setSize(new Dimension(1440, 820));
|
||||||
|
pane.add(nv, 1, 0);
|
||||||
|
pane.add(combo, 2, 0);
|
||||||
|
frame.add(pane);
|
||||||
frame.setSize(1440, 820);
|
frame.setSize(1440, 820);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.volmit.iris.object.NoiseStyle;
|
|||||||
import com.volmit.iris.object.StructureTileCondition;
|
import com.volmit.iris.object.StructureTileCondition;
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.ArrayType;
|
||||||
import com.volmit.iris.util.ChronoLatch;
|
import com.volmit.iris.util.ChronoLatch;
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.Form;
|
import com.volmit.iris.util.Form;
|
||||||
import com.volmit.iris.util.IO;
|
import com.volmit.iris.util.IO;
|
||||||
@@ -514,11 +515,31 @@ public class ProjectManager {
|
|||||||
return ws;
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File getWorkspaceFile(String dim) {
|
||||||
|
return Iris.instance.getDataFile("packs", dim, dim + ".code-workspace");
|
||||||
|
}
|
||||||
|
|
||||||
public void updateWorkspace(File ws) {
|
public void updateWorkspace(File ws) {
|
||||||
try {
|
try {
|
||||||
J.attemptAsync(() -> writeDocs(ws.getParentFile()));
|
J.attemptAsync(() -> writeDocs(ws.getParentFile()));
|
||||||
JSONObject j = new JSONObject(IO.readAll(ws));
|
JSONObject j = new JSONObject(IO.readAll(ws));
|
||||||
JSONObject s = j.getJSONObject("settings");
|
JSONObject s = j.getJSONObject("settings");
|
||||||
|
JSONObject jc = new JSONObject();
|
||||||
|
jc.put("editor.autoIndent", "brackets");
|
||||||
|
jc.put("editor.acceptSuggestionOnEnter", "smart");
|
||||||
|
jc.put("editor.cursorSmoothCaretAnimation", true);
|
||||||
|
jc.put("editor.dragAndDrop", false);
|
||||||
|
jc.put("files.trimTrailingWhitespace", true);
|
||||||
|
jc.put("diffEditor.ignoreTrimWhitespace", true);
|
||||||
|
jc.put("files.trimFinalNewlines", true);
|
||||||
|
jc.put("editor.suggest.showKeywords", false);
|
||||||
|
jc.put("editor.suggest.showSnippets", false);
|
||||||
|
jc.put("editor.suggest.showWords", false);
|
||||||
|
JSONObject st = new JSONObject();
|
||||||
|
st.put("strings", true);
|
||||||
|
jc.put("editor.quickSuggestions", st);
|
||||||
|
jc.put("editor.suggest.insertMode", "replace");
|
||||||
|
s.put("[json]", jc);
|
||||||
s.put("json.schemas", buildSchemas());
|
s.put("json.schemas", buildSchemas());
|
||||||
j.put("settings", s);
|
j.put("settings", s);
|
||||||
IO.writeAll(ws, j.toString(4));
|
IO.writeAll(ws, j.toString(4));
|
||||||
@@ -589,11 +610,16 @@ public class ProjectManager {
|
|||||||
|
|
||||||
JSONObject properties = new JSONObject();
|
JSONObject properties = new JSONObject();
|
||||||
JSONArray req = new JSONArray();
|
JSONArray req = new JSONArray();
|
||||||
|
JSONObject deps = new JSONObject();
|
||||||
|
|
||||||
for (java.lang.reflect.Field k : i.getDeclaredFields()) {
|
for (java.lang.reflect.Field k : i.getDeclaredFields()) {
|
||||||
JSONObject prop = new JSONObject();
|
JSONObject prop = new JSONObject();
|
||||||
|
|
||||||
if (k.isAnnotationPresent(Desc.class)) {
|
if (k.isAnnotationPresent(Desc.class)) {
|
||||||
|
|
||||||
|
if (k.isAnnotationPresent(DependsOn.class)) {
|
||||||
|
deps.put(k.getName(), new JSONArray(k.getDeclaredAnnotation(DependsOn.class).value()));
|
||||||
|
}
|
||||||
|
|
||||||
String tp = "object";
|
String tp = "object";
|
||||||
|
|
||||||
if (k.getType().equals(int.class) || k.getType().equals(long.class)) {
|
if (k.getType().equals(int.class) || k.getType().equals(long.class)) {
|
||||||
@@ -672,6 +698,7 @@ public class ProjectManager {
|
|||||||
|
|
||||||
if (tp.equals("object")) {
|
if (tp.equals("object")) {
|
||||||
if (k.getType().isAnnotationPresent(Desc.class)) {
|
if (k.getType().isAnnotationPresent(Desc.class)) {
|
||||||
|
prop.put("additionalProperties", false);
|
||||||
prop.put("properties",
|
prop.put("properties",
|
||||||
getSchemaFor(k.getType(), step - 1, def).getJSONObject("properties"));
|
getSchemaFor(k.getType(), step - 1, def).getJSONObject("properties"));
|
||||||
}
|
}
|
||||||
@@ -778,8 +805,10 @@ public class ProjectManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
schema.put("additionalProperties", false);
|
||||||
schema.put("properties", properties);
|
schema.put("properties", properties);
|
||||||
schema.put("required", req);
|
schema.put("required", req);
|
||||||
|
schema.put("dependencies", deps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return schema;
|
return schema;
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import com.volmit.iris.util.Command;
|
|||||||
import com.volmit.iris.util.MortarCommand;
|
import com.volmit.iris.util.MortarCommand;
|
||||||
import com.volmit.iris.util.MortarSender;
|
import com.volmit.iris.util.MortarSender;
|
||||||
|
|
||||||
public class CommandIrisStudio extends MortarCommand
|
public class CommandIrisStudio extends MortarCommand {
|
||||||
{
|
|
||||||
@Command
|
@Command
|
||||||
private CommandIrisStudioCreate create;
|
private CommandIrisStudioCreate create;
|
||||||
|
|
||||||
@@ -18,31 +17,31 @@ public class CommandIrisStudio extends MortarCommand
|
|||||||
|
|
||||||
@Command
|
@Command
|
||||||
private CommandIrisStudioPackage pkg;
|
private CommandIrisStudioPackage pkg;
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
private CommandIrisStudioVerify verify;
|
private CommandIrisStudioVerify verify;
|
||||||
|
|
||||||
|
@Command
|
||||||
|
private CommandIrisStudioUpdate update;
|
||||||
|
|
||||||
@Command
|
@Command
|
||||||
private CommandIrisStudioList list;
|
private CommandIrisStudioList list;
|
||||||
|
|
||||||
public CommandIrisStudio()
|
public CommandIrisStudio() {
|
||||||
{
|
|
||||||
super("studio", "std");
|
super("studio", "std");
|
||||||
requiresPermission(Iris.perm.studio);
|
requiresPermission(Iris.perm.studio);
|
||||||
setCategory("Studio");
|
setCategory("Studio");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(MortarSender sender, String[] args)
|
public boolean handle(MortarSender sender, String[] args) {
|
||||||
{
|
|
||||||
sender.sendMessage("Iris Studio Commands");
|
sender.sendMessage("Iris Studio Commands");
|
||||||
printHelp(sender);
|
printHelp(sender);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getArgsUsage()
|
protected String getArgsUsage() {
|
||||||
{
|
|
||||||
return "[subcommand]";
|
return "[subcommand]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.volmit.iris.command;
|
||||||
|
|
||||||
|
import com.volmit.iris.Iris;
|
||||||
|
import com.volmit.iris.util.MortarCommand;
|
||||||
|
import com.volmit.iris.util.MortarSender;
|
||||||
|
|
||||||
|
public class CommandIrisStudioUpdate extends MortarCommand {
|
||||||
|
public CommandIrisStudioUpdate() {
|
||||||
|
super("update", "upd");
|
||||||
|
requiresPermission(Iris.perm.studio);
|
||||||
|
setDescription("Update your dimension project.");
|
||||||
|
setCategory("Studio");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean handle(MortarSender sender, String[] args) {
|
||||||
|
if (args.length == 0) {
|
||||||
|
sender.sendMessage("/iris std package <DIMENSION>");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Iris.proj.updateWorkspace(Iris.proj.getWorkspaceFile(args[0]));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getArgsUsage() {
|
||||||
|
return "[dimension]";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -311,4 +311,8 @@ public class CNG {
|
|||||||
oct = octaves;
|
oct = octaves;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getScale() {
|
||||||
|
return scale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.volmit.iris.object;
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.DontObfuscate;
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
import com.volmit.iris.util.M;
|
import com.volmit.iris.util.M;
|
||||||
@@ -18,6 +19,7 @@ public class IrisAxisRotationClamp
|
|||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
|
@DependsOn({"max"})
|
||||||
@MinNumber(-360)
|
@MinNumber(-360)
|
||||||
@MaxNumber(360)
|
@MaxNumber(360)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@@ -25,6 +27,7 @@ public class IrisAxisRotationClamp
|
|||||||
private double min = 0;
|
private double min = 0;
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
|
@DependsOn({"min"})
|
||||||
@MinNumber(-360)
|
@MinNumber(-360)
|
||||||
@MaxNumber(360)
|
@MaxNumber(360)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@@ -32,6 +35,7 @@ public class IrisAxisRotationClamp
|
|||||||
private double max = 0;
|
private double max = 0;
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
|
@DependsOn({"min", "max"})
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(360)
|
@MaxNumber(360)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.volmit.iris.gen.atomics.AtomicCache;
|
|||||||
import com.volmit.iris.noise.CNG;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.noise.RarityCellGenerator;
|
import com.volmit.iris.noise.RarityCellGenerator;
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.ArrayType;
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.DontObfuscate;
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
import com.volmit.iris.util.IRare;
|
import com.volmit.iris.util.IRare;
|
||||||
@@ -39,11 +40,13 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
private KList<IrisEffect> effects = new KList<>();
|
private KList<IrisEffect> effects = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
||||||
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
|
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
|
||||||
private NoiseStyle biomeStyle = NoiseStyle.SIMPLEX;
|
private NoiseStyle biomeStyle = NoiseStyle.SIMPLEX;
|
||||||
|
|
||||||
@MinNumber(0.0001)
|
@MinNumber(0.0001)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
||||||
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
|
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
|
||||||
private double biomeZoom = 1;
|
private double biomeZoom = 1;
|
||||||
|
|
||||||
@@ -73,6 +76,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
private KList<Biome> biomeSkyScatter = new KList<>();
|
private KList<Biome> biomeSkyScatter = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@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.")
|
@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;
|
private double childShrinkFactor = 1.5;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.volmit.iris.gen.atomics.AtomicCache;
|
|||||||
import com.volmit.iris.noise.CNG;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.ArrayType;
|
||||||
import com.volmit.iris.util.B;
|
import com.volmit.iris.util.B;
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.DontObfuscate;
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
import com.volmit.iris.util.KList;
|
import com.volmit.iris.util.KList;
|
||||||
@@ -28,6 +29,7 @@ public class IrisBiomeDecorator {
|
|||||||
@Desc("Dispersion is used to pick places to spawn. Scatter randomly places them (vanilla) or Wispy for a streak like patch system.")
|
@Desc("Dispersion is used to pick places to spawn. Scatter randomly places them (vanilla) or Wispy for a streak like patch system.")
|
||||||
private NoiseStyle dispersion = NoiseStyle.STATIC;
|
private NoiseStyle dispersion = NoiseStyle.STATIC;
|
||||||
|
|
||||||
|
@DependsOn({"stackMin", "stackMax"})
|
||||||
@DontObfuscate
|
@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")
|
@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 NoiseStyle heightVariance = NoiseStyle.STATIC;
|
private NoiseStyle heightVariance = NoiseStyle.STATIC;
|
||||||
@@ -36,12 +38,14 @@ public class IrisBiomeDecorator {
|
|||||||
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
|
@Desc("Tells iris where this decoration is a part of. I.e. SHORE_LINE or SEA_SURFACE")
|
||||||
private DecorationPart partOf = DecorationPart.NONE;
|
private DecorationPart partOf = DecorationPart.NONE;
|
||||||
|
|
||||||
|
@DependsOn({"stackMin", "stackMax"})
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The minimum repeat stack height (setting to 3 would stack 3 of <block> on top of each other")
|
@Desc("The minimum repeat stack height (setting to 3 would stack 3 of <block> on top of each other")
|
||||||
private int stackMin = 1;
|
private int stackMin = 1;
|
||||||
|
|
||||||
|
@DependsOn({"stackMin", "stackMax"})
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@@ -58,6 +62,7 @@ public class IrisBiomeDecorator {
|
|||||||
@Desc("The zoom is for zooming in or out variance. Makes patches have more or less of one type.")
|
@Desc("The zoom is for zooming in or out variance. Makes patches have more or less of one type.")
|
||||||
private double varianceZoom = 1;
|
private double varianceZoom = 1;
|
||||||
|
|
||||||
|
@DependsOn({"stackMin", "stackMax"})
|
||||||
@MinNumber(0.0001)
|
@MinNumber(0.0001)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The vertical zoom is for wispy stack heights. Zooming this in makes stack heights more slowly change over a distance")
|
@Desc("The vertical zoom is for wispy stack heights. Zooming this in makes stack heights more slowly change over a distance")
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.volmit.iris.object;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.gen.ContextualChunkGenerator;
|
import com.volmit.iris.gen.ContextualChunkGenerator;
|
||||||
import com.volmit.iris.gen.atomics.AtomicCache;
|
import com.volmit.iris.gen.atomics.AtomicCache;
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.DontObfuscate;
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
import com.volmit.iris.util.IrisInterpolation;
|
import com.volmit.iris.util.IrisInterpolation;
|
||||||
@@ -14,12 +15,12 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Desc("This represents a link to a generator for a biome")
|
@Desc("This represents a link to a generator for a biome")
|
||||||
@Data
|
@Data
|
||||||
public class IrisBiomeGeneratorLink
|
public class IrisBiomeGeneratorLink {
|
||||||
{
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The generator id")
|
@Desc("The generator id")
|
||||||
private String generator = "default";
|
private String generator = "default";
|
||||||
|
|
||||||
|
@DependsOn({ "min", "max" })
|
||||||
@Required
|
@Required
|
||||||
@MinNumber(-256)
|
@MinNumber(-256)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@@ -27,6 +28,7 @@ public class IrisBiomeGeneratorLink
|
|||||||
@Desc("The min block value (value + fluidHeight)")
|
@Desc("The min block value (value + fluidHeight)")
|
||||||
private int min = 0;
|
private int min = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "min", "max" })
|
||||||
@Required
|
@Required
|
||||||
@MinNumber(-256)
|
@MinNumber(-256)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@@ -36,19 +38,16 @@ public class IrisBiomeGeneratorLink
|
|||||||
|
|
||||||
private transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
|
private transient AtomicCache<IrisGenerator> gen = new AtomicCache<>();
|
||||||
|
|
||||||
public IrisBiomeGeneratorLink()
|
public IrisBiomeGeneratorLink() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IrisGenerator getCachedGenerator(ContextualChunkGenerator g)
|
public IrisGenerator getCachedGenerator(ContextualChunkGenerator g) {
|
||||||
{
|
return gen.aquire(() -> {
|
||||||
return gen.aquire(() ->
|
IrisGenerator gen = g != null ? g.loadGenerator(getGenerator())
|
||||||
{
|
: Iris.globaldata.getGeneratorLoader().load(getGenerator());
|
||||||
IrisGenerator gen = g != null ? g.loadGenerator(getGenerator()) : Iris.globaldata.getGeneratorLoader().load(getGenerator());
|
|
||||||
|
|
||||||
if(gen == null)
|
if (gen == null) {
|
||||||
{
|
|
||||||
gen = new IrisGenerator();
|
gen = new IrisGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,8 +55,7 @@ public class IrisBiomeGeneratorLink
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getHeight(ContextualChunkGenerator xg, double x, double z, long seed)
|
public double getHeight(ContextualChunkGenerator xg, double x, double z, long seed) {
|
||||||
{
|
|
||||||
double g = getCachedGenerator(xg).getHeight(x, z, seed);
|
double g = getCachedGenerator(xg).getHeight(x, z, seed);
|
||||||
g = g < 0 ? 0 : g;
|
g = g < 0 ? 0 : g;
|
||||||
g = g > 1 ? 1 : g;
|
g = g > 1 ? 1 : g;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.volmit.iris.gen.atomics.AtomicCache;
|
|||||||
import com.volmit.iris.noise.CNG;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.ArrayType;
|
||||||
import com.volmit.iris.util.B;
|
import com.volmit.iris.util.B;
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.DontObfuscate;
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
import com.volmit.iris.util.KList;
|
import com.volmit.iris.util.KList;
|
||||||
@@ -23,12 +24,14 @@ public class IrisBiomePaletteLayer {
|
|||||||
@Desc("The style of noise")
|
@Desc("The style of noise")
|
||||||
private NoiseStyle style = NoiseStyle.STATIC;
|
private NoiseStyle style = NoiseStyle.STATIC;
|
||||||
|
|
||||||
|
@DependsOn({"minHeight", "maxHeight"})
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The min thickness of this layer")
|
@Desc("The min thickness of this layer")
|
||||||
private int minHeight = 1;
|
private int minHeight = 1;
|
||||||
|
|
||||||
|
@DependsOn({"minHeight", "maxHeight"})
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.volmit.iris.Iris;
|
|||||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||||
import com.volmit.iris.gen.atomics.AtomicCache;
|
import com.volmit.iris.gen.atomics.AtomicCache;
|
||||||
import com.volmit.iris.util.ChronoLatch;
|
import com.volmit.iris.util.ChronoLatch;
|
||||||
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
import com.volmit.iris.util.DontObfuscate;
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
import com.volmit.iris.util.MaxNumber;
|
import com.volmit.iris.util.MaxNumber;
|
||||||
@@ -22,8 +23,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Desc("An iris effect")
|
@Desc("An iris effect")
|
||||||
@Data
|
@Data
|
||||||
public class IrisEffect
|
public class IrisEffect {
|
||||||
{
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The potion effect to apply in this area")
|
@Desc("The potion effect to apply in this area")
|
||||||
private String potionEffect = "";
|
private String potionEffect = "";
|
||||||
@@ -32,38 +32,45 @@ public class IrisEffect
|
|||||||
@Desc("The particle effect to apply in the area")
|
@Desc("The particle effect to apply in the area")
|
||||||
private Particle particleEffect = null;
|
private Particle particleEffect = null;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(-32)
|
@MinNumber(-32)
|
||||||
@MaxNumber(32)
|
@MaxNumber(32)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Randomly offset from the surface to this surface+value")
|
@Desc("Randomly offset from the surface to this surface+value")
|
||||||
private int particleOffset = 0;
|
private int particleOffset = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(-8)
|
@MinNumber(-8)
|
||||||
@MaxNumber(8)
|
@MaxNumber(8)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
|
@Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
|
||||||
private double particleAltX = 0;
|
private double particleAltX = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(-8)
|
@MinNumber(-8)
|
||||||
@MaxNumber(8)
|
@MaxNumber(8)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
|
@Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
|
||||||
private double particleAltY = 0;
|
private double particleAltY = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(-8)
|
@MinNumber(-8)
|
||||||
@MaxNumber(8)
|
@MaxNumber(8)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
|
@Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
|
||||||
private double particleAltZ = 0;
|
private double particleAltZ = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Randomize the altX by -altX to altX")
|
@Desc("Randomize the altX by -altX to altX")
|
||||||
private boolean randomAltX = true;
|
private boolean randomAltX = true;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Randomize the altY by -altY to altY")
|
@Desc("Randomize the altY by -altY to altY")
|
||||||
private boolean randomAltY = false;
|
private boolean randomAltY = false;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Randomize the altZ by -altZ to altZ")
|
@Desc("Randomize the altZ by -altZ to altZ")
|
||||||
private boolean randomAltZ = true;
|
private boolean randomAltZ = true;
|
||||||
@@ -72,63 +79,74 @@ public class IrisEffect
|
|||||||
@Desc("The sound to play")
|
@Desc("The sound to play")
|
||||||
private Sound sound = null;
|
private Sound sound = null;
|
||||||
|
|
||||||
|
@DependsOn({ "sound" })
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(512)
|
@MaxNumber(512)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The max distance from the player the sound will play")
|
@Desc("The max distance from the player the sound will play")
|
||||||
private int soundDistance = 12;
|
private int soundDistance = 12;
|
||||||
|
|
||||||
|
@DependsOn({ "sound", "maxPitch" })
|
||||||
@MinNumber(0.01)
|
@MinNumber(0.01)
|
||||||
@MaxNumber(1.99)
|
@MaxNumber(1.99)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The minimum sound pitch")
|
@Desc("The minimum sound pitch")
|
||||||
private double minPitch = 0.5D;
|
private double minPitch = 0.5D;
|
||||||
|
|
||||||
|
@DependsOn({ "sound", "minVolume" })
|
||||||
@MinNumber(0.01)
|
@MinNumber(0.01)
|
||||||
@MaxNumber(1.99)
|
@MaxNumber(1.99)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The max sound pitch")
|
@Desc("The max sound pitch")
|
||||||
private double maxPitch = 1.5D;
|
private double maxPitch = 1.5D;
|
||||||
|
|
||||||
|
@DependsOn({ "sound" })
|
||||||
@MinNumber(0.001)
|
@MinNumber(0.001)
|
||||||
@MaxNumber(512)
|
@MaxNumber(512)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The sound volume.")
|
@Desc("The sound volume.")
|
||||||
private double volume = 1.5D;
|
private double volume = 1.5D;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(512)
|
@MaxNumber(512)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The particle count. Try setting to zero for using the alt xyz to a motion value instead of an offset")
|
@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;
|
private int particleCount = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(64)
|
@MaxNumber(64)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("How far away from the player particles can play")
|
@Desc("How far away from the player particles can play")
|
||||||
private int particleDistance = 20;
|
private int particleDistance = 20;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(128)
|
@MaxNumber(128)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("How wide the particles can play (player's view left and right) RADIUS")
|
@Desc("How wide the particles can play (player's view left and right) RADIUS")
|
||||||
private int particleDistanceWidth = 24;
|
private int particleDistanceWidth = 24;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("An extra value for some particles... Which bukkit doesn't even document.")
|
@Desc("An extra value for some particles... Which bukkit doesn't even document.")
|
||||||
private double extra = 0;
|
private double extra = 0;
|
||||||
|
|
||||||
|
@DependsOn({ "potionEffect" })
|
||||||
@MinNumber(-1)
|
@MinNumber(-1)
|
||||||
@MaxNumber(1024)
|
@MaxNumber(1024)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The Potion Strength or -1 to disable")
|
@Desc("The Potion Strength or -1 to disable")
|
||||||
private int potionStrength = -1;
|
private int potionStrength = -1;
|
||||||
|
|
||||||
|
@DependsOn({ "potionEffect", "potionTicksMin" })
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The max time the potion will last for")
|
@Desc("The max time the potion will last for")
|
||||||
private int potionTicksMax = 155;
|
private int potionTicksMax = 155;
|
||||||
|
|
||||||
|
@DependsOn({ "potionEffect", "potionTicksMax" })
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The min time the potion will last for")
|
@Desc("The min time the potion will last for")
|
||||||
@@ -140,6 +158,7 @@ public class IrisEffect
|
|||||||
@Desc("The effect interval in milliseconds")
|
@Desc("The effect interval in milliseconds")
|
||||||
private int interval = 150;
|
private int interval = 150;
|
||||||
|
|
||||||
|
@DependsOn({ "particleEffect" })
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@MaxNumber(16)
|
@MaxNumber(16)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@@ -155,33 +174,25 @@ public class IrisEffect
|
|||||||
private transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
|
private transient AtomicCache<PotionEffectType> pt = new AtomicCache<>();
|
||||||
private transient AtomicCache<ChronoLatch> latch = new AtomicCache<>();
|
private transient AtomicCache<ChronoLatch> latch = new AtomicCache<>();
|
||||||
|
|
||||||
public IrisEffect()
|
public IrisEffect() {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canTick()
|
public boolean canTick() {
|
||||||
{
|
|
||||||
return latch.aquire(() -> new ChronoLatch(interval)).flip();
|
return latch.aquire(() -> new ChronoLatch(interval)).flip();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PotionEffectType getRealType()
|
public PotionEffectType getRealType() {
|
||||||
{
|
return pt.aquire(() -> {
|
||||||
return pt.aquire(() ->
|
|
||||||
{
|
|
||||||
PotionEffectType t = PotionEffectType.LUCK;
|
PotionEffectType t = PotionEffectType.LUCK;
|
||||||
|
|
||||||
if(getPotionEffect().isEmpty())
|
if (getPotionEffect().isEmpty()) {
|
||||||
{
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
for (PotionEffectType i : PotionEffectType.values()) {
|
||||||
for(PotionEffectType i : PotionEffectType.values())
|
if (i.getName().toUpperCase().replaceAll("\\Q \\E", "_").equals(getPotionEffect())) {
|
||||||
{
|
|
||||||
if(i.getName().toUpperCase().replaceAll("\\Q \\E", "_").equals(getPotionEffect()))
|
|
||||||
{
|
|
||||||
t = i;
|
t = i;
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
@@ -189,8 +200,7 @@ public class IrisEffect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Throwable e)
|
catch (Throwable e) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,55 +210,57 @@ public class IrisEffect
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void apply(Player p, IrisChunkGenerator g)
|
public void apply(Player p, IrisChunkGenerator g) {
|
||||||
{
|
if (!canTick()) {
|
||||||
if(!canTick())
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(RNG.r.nextInt(chance) != 0)
|
if (RNG.r.nextInt(chance) != 0) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sound != null)
|
if (sound != null) {
|
||||||
{
|
Location part = p.getLocation().clone().add(RNG.r.i(-soundDistance, soundDistance),
|
||||||
Location part = p.getLocation().clone().add(RNG.r.i(-soundDistance, soundDistance), RNG.r.i(-soundDistance, soundDistance), RNG.r.i(-soundDistance, soundDistance));
|
RNG.r.i(-soundDistance, soundDistance), RNG.r.i(-soundDistance, soundDistance));
|
||||||
p.playSound(part, getSound(), (float) volume, (float) RNG.r.d(minPitch, maxPitch));
|
p.playSound(part, getSound(), (float) volume, (float) RNG.r.d(minPitch, maxPitch));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(particleEffect != null)
|
if (particleEffect != null) {
|
||||||
{
|
Location part = p.getLocation().clone()
|
||||||
Location part = p.getLocation().clone().add(p.getLocation().getDirection().clone().multiply(RNG.r.i(particleDistance) + particleAway)).clone().add(p.getLocation().getDirection().clone().rotateAroundY(Math.toRadians(90)).multiply(RNG.r.d(-particleDistanceWidth, particleDistanceWidth)));
|
.add(p.getLocation().getDirection().clone().multiply(RNG.r.i(particleDistance) + particleAway))
|
||||||
|
.clone().add(p.getLocation().getDirection().clone().rotateAroundY(Math.toRadians(90))
|
||||||
|
.multiply(RNG.r.d(-particleDistanceWidth, particleDistanceWidth)));
|
||||||
|
|
||||||
part.setY(Math.round(g.getTerrainHeight(part.getBlockX(), part.getBlockZ())) + 1);
|
part.setY(Math.round(g.getTerrainHeight(part.getBlockX(), part.getBlockZ())) + 1);
|
||||||
part.add(RNG.r.d(), 0, RNG.r.d());
|
part.add(RNG.r.d(), 0, RNG.r.d());
|
||||||
if(extra != 0)
|
if (extra != 0) {
|
||||||
{
|
p.spawnParticle(particleEffect, part.getX(), part.getY() + RNG.r.i(particleOffset), part.getZ(),
|
||||||
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);
|
particleCount, randomAltX ? RNG.r.d(-particleAltX, particleAltX) : particleAltX,
|
||||||
|
randomAltY ? RNG.r.d(-particleAltY, particleAltY) : particleAltY,
|
||||||
|
randomAltZ ? RNG.r.d(-particleAltZ, particleAltZ) : particleAltZ, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else {
|
||||||
{
|
p.spawnParticle(particleEffect, part.getX(), part.getY() + RNG.r.i(particleOffset), part.getZ(),
|
||||||
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);
|
particleCount, randomAltX ? RNG.r.d(-particleAltX, particleAltX) : particleAltX,
|
||||||
|
randomAltY ? RNG.r.d(-particleAltY, particleAltY) : particleAltY,
|
||||||
|
randomAltZ ? RNG.r.d(-particleAltZ, particleAltZ) : particleAltZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(potionStrength > -1)
|
if (potionStrength > -1) {
|
||||||
{
|
if (p.hasPotionEffect(getRealType())) {
|
||||||
if(p.hasPotionEffect(getRealType()))
|
|
||||||
{
|
|
||||||
PotionEffect e = p.getPotionEffect(getRealType());
|
PotionEffect e = p.getPotionEffect(getRealType());
|
||||||
if(e.getAmplifier() > getPotionStrength())
|
if (e.getAmplifier() > getPotionStrength()) {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.removePotionEffect(getRealType());
|
p.removePotionEffect(getRealType());
|
||||||
}
|
}
|
||||||
|
|
||||||
p.addPotionEffect(new PotionEffect(getRealType(), RNG.r.i(Math.min(potionTicksMax, potionTicksMin), Math.max(potionTicksMax, potionTicksMin)), getPotionStrength(), true, false, false));
|
p.addPotionEffect(new PotionEffect(getRealType(),
|
||||||
|
RNG.r.i(Math.min(potionTicksMax, potionTicksMin), Math.max(potionTicksMax, potionTicksMin)),
|
||||||
|
getPotionStrength(), true, false, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class IrisNoiseGenerator
|
|||||||
@Desc("Enable / disable. Outputs offsetY if disabled")
|
@Desc("Enable / disable. Outputs offsetY if disabled")
|
||||||
private boolean enabled = true;
|
private boolean enabled = true;
|
||||||
|
|
||||||
|
@Required
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The Noise Style")
|
@Desc("The Noise Style")
|
||||||
private NoiseStyle style = NoiseStyle.IRIS;
|
private NoiseStyle style = NoiseStyle.IRIS;
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.volmit.iris.util;
|
||||||
|
|
||||||
|
import static java.lang.annotation.ElementType.FIELD;
|
||||||
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RUNTIME)
|
||||||
|
@Target({ FIELD })
|
||||||
|
public @interface DependsOn {
|
||||||
|
String[] value();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user