mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-25 10:09:14 +00:00
Cleanup
This commit is contained in:
@@ -6,6 +6,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
@@ -115,10 +116,16 @@ public class Iris extends MortarPlugin
|
||||
board = new IrisBoardManager();
|
||||
linkMultiverseCore = new MultiverseCoreLink();
|
||||
J.a(() -> IO.delete(getTemp()));
|
||||
J.a(() -> bstats());
|
||||
J.s(this::splash, 20);
|
||||
super.onEnable();
|
||||
}
|
||||
|
||||
private void bstats()
|
||||
{
|
||||
new Metrics(this, 8757);
|
||||
}
|
||||
|
||||
public static File getTemp()
|
||||
{
|
||||
return instance.getDataFolder("cache", "temp");
|
||||
|
||||
@@ -42,6 +42,10 @@ public class IrisSettings
|
||||
@Desc("When using studio open or create, open the codeworkspace automatically.")
|
||||
public boolean openVSCode = true;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Collects anonymous metrics for bstats")
|
||||
public boolean metrics = true;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Used to activate Iris")
|
||||
public String activationCode = "";
|
||||
|
||||
@@ -7,6 +7,11 @@ public class PermissionIris extends MortarPermission
|
||||
{
|
||||
@Permission
|
||||
public PermissionIrisStudio studio;
|
||||
|
||||
public PermissionIris()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getNode()
|
||||
|
||||
@@ -4,6 +4,11 @@ import com.volmit.iris.util.MortarPermission;
|
||||
|
||||
public class PermissionIrisStudio extends MortarPermission
|
||||
{
|
||||
public PermissionIrisStudio()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getNode()
|
||||
{
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public abstract class A implements Runnable
|
||||
{
|
||||
public A()
|
||||
{
|
||||
J.a(this);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public enum Axis
|
||||
{
|
||||
X(1, 0, 0),
|
||||
Y(0, 1, 0),
|
||||
Z(0, 0, 1);
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
|
||||
private Axis(int x, int y, int z)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Vector positive()
|
||||
{
|
||||
return new Vector(x, y, z);
|
||||
}
|
||||
|
||||
public Vector negative()
|
||||
{
|
||||
return VectorMath.reverse(positive());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
|
||||
public class BiomeDominance extends KMap<IrisBiome, Double>
|
||||
{
|
||||
private static final long serialVersionUID = 9055245062942178392L;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BiomeResult
|
||||
{
|
||||
private IrisBiome biome;
|
||||
private double distance;
|
||||
|
||||
public BiomeResult(IrisBiome biome, double distance)
|
||||
{
|
||||
this.biome = biome;
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public boolean is(BiomeResult r)
|
||||
{
|
||||
return biome.getName().equals(r.biome.getName());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface BorderCheck<T>
|
||||
{
|
||||
public T get(double x, double z);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class Borders
|
||||
{
|
||||
public static <T> double getDistanceToBorder(double x, double z, int samples, double minRadius, double maxRadius, double jump, BorderCheck<T> check)
|
||||
{
|
||||
double offset = 0;
|
||||
double fract = 1;
|
||||
|
||||
for(double i = minRadius; i < maxRadius; i += jump * fract)
|
||||
{
|
||||
offset += jump / 3D;
|
||||
fract += 0.333;
|
||||
|
||||
if(isBorderWithin(x, z, samples, maxRadius, offset, check))
|
||||
{
|
||||
return minRadius;
|
||||
}
|
||||
}
|
||||
|
||||
return maxRadius;
|
||||
}
|
||||
|
||||
public static <T> boolean isBorderWithin(double x, double z, int samples, double radius, double offset, BorderCheck<T> check)
|
||||
{
|
||||
T center = check.get(x, z);
|
||||
double ajump = Math.toRadians(360D / (double) samples) + offset;
|
||||
|
||||
for(int i = 0; i < samples; i++)
|
||||
{
|
||||
double dx = M.sin((float) ajump * i) * radius;
|
||||
double dz = M.cos((float) ajump * i) * radius;
|
||||
|
||||
if(!center.equals(check.get(x + dx, z + dz)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user