mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Random variable tweaks & opts
This commit is contained in:
parent
62c2757afc
commit
32a0fc9b17
@ -90,12 +90,10 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
|
|||||||
private boolean lowtile = false;
|
private boolean lowtile = false;
|
||||||
private boolean follow = false;
|
private boolean follow = false;
|
||||||
private boolean alt = false;
|
private boolean alt = false;
|
||||||
private int posX = 0;
|
|
||||||
private IrisRenderer renderer;
|
private IrisRenderer renderer;
|
||||||
private IrisWorld world;
|
private IrisWorld world;
|
||||||
private double velocity = 0;
|
private double velocity = 0;
|
||||||
private int lowq = 12;
|
private int lowq = 12;
|
||||||
private int posZ = 0;
|
|
||||||
private double scale = 128;
|
private double scale = 128;
|
||||||
private double mscale = 4D;
|
private double mscale = 4D;
|
||||||
private int w = 0;
|
private int w = 0;
|
||||||
@ -501,8 +499,8 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
|
|||||||
int iscale = (int) scale;
|
int iscale = (int) scale;
|
||||||
g.setColor(Color.white);
|
g.setColor(Color.white);
|
||||||
g.clearRect(0, 0, w, h);
|
g.clearRect(0, 0, w, h);
|
||||||
posX = (int) oxp;
|
int posX = (int) oxp;
|
||||||
posZ = (int) ozp;
|
int posZ = (int) ozp;
|
||||||
m.set(3);
|
m.set(3);
|
||||||
|
|
||||||
for(int r = 0; r < Math.max(w, h); r += iscale) {
|
for(int r = 0; r < Math.max(w, h); r += iscale) {
|
||||||
|
@ -36,7 +36,7 @@ public class INMS {
|
|||||||
return binding;
|
return binding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String getNMSTag() {
|
public static String getNMSTag() {
|
||||||
if(IrisSettings.get().getGeneral().isDisableNMS()) {
|
if(IrisSettings.get().getGeneral().isDisableNMS()) {
|
||||||
return "BUKKIT";
|
return "BUKKIT";
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ public class INMS {
|
|||||||
return "BUKKIT";
|
return "BUKKIT";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final INMSBinding bind() {
|
private static INMSBinding bind() {
|
||||||
String code = getNMSTag();
|
String code = getNMSTag();
|
||||||
Iris.info("Locating NMS Binding for " + code);
|
Iris.info("Locating NMS Binding for " + code);
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ import com.volmit.iris.util.mantle.Mantle;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
public class HeadlessPregenMethod implements PregeneratorMethod {
|
public class HeadlessPregenMethod implements PregeneratorMethod {
|
||||||
private final HeadlessWorld world;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final HeadlessGenerator generator;
|
private final HeadlessGenerator generator;
|
||||||
@ -36,7 +35,6 @@ public class HeadlessPregenMethod implements PregeneratorMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HeadlessPregenMethod(HeadlessWorld world, HeadlessGenerator generator) {
|
public HeadlessPregenMethod(HeadlessWorld world, HeadlessGenerator generator) {
|
||||||
this.world = world;
|
|
||||||
this.generator = generator;
|
this.generator = generator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class WandSVC implements IrisService {
|
public class WandSVC implements IrisService {
|
||||||
private static ItemStack wand;
|
|
||||||
private static ItemStack dust;
|
private static ItemStack dust;
|
||||||
|
|
||||||
public static void pasteSchematic(IrisObject s, Location at) {
|
public static void pasteSchematic(IrisObject s, Location at) {
|
||||||
@ -268,7 +267,7 @@ public class WandSVC implements IrisService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
wand = createWand();
|
ItemStack wand = createWand();
|
||||||
dust = createDust();
|
dust = createDust();
|
||||||
|
|
||||||
J.ar(() -> {
|
J.ar(() -> {
|
||||||
|
@ -81,15 +81,6 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
|
|||||||
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
|
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
|
||||||
Object biomeBase = INMS.get().getCustomBiomeBaseFor(getDimension().getLoadKey() + ":" + custom.getId());
|
Object biomeBase = INMS.get().getCustomBiomeBaseFor(getDimension().getLoadKey() + ":" + custom.getId());
|
||||||
//
|
//
|
||||||
// int m = hits.size();
|
|
||||||
// String str = ib.getLoadKey() + ":custom:" + custom.getId();
|
|
||||||
// hits.add(str);
|
|
||||||
//
|
|
||||||
// if(m != hits.size())
|
|
||||||
// {
|
|
||||||
// Iris.info("Added " + str);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) {
|
if(biomeBase == null || !injectBiome(h, x, 0, z, biomeBase)) {
|
||||||
throw new RuntimeException("Cant inject biome!");
|
throw new RuntimeException("Cant inject biome!");
|
||||||
}
|
}
|
||||||
|
@ -31,13 +31,11 @@ public class HeightmapObjectPlacer implements IObjectPlacer {
|
|||||||
private final long s;
|
private final long s;
|
||||||
private final IrisObjectPlacement config;
|
private final IrisObjectPlacement config;
|
||||||
private final IObjectPlacer oplacer;
|
private final IObjectPlacer oplacer;
|
||||||
private final Engine engine;
|
|
||||||
|
|
||||||
public HeightmapObjectPlacer(Engine engine, RNG rng, int x, int yv, int z, IrisObjectPlacement config, IObjectPlacer oplacer) {
|
public HeightmapObjectPlacer(Engine engine, RNG rng, int x, int yv, int z, IrisObjectPlacement config, IObjectPlacer oplacer) {
|
||||||
s = rng.nextLong() + yv + z - x;
|
s = rng.nextLong() + yv + z - x;
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.oplacer = oplacer;
|
this.oplacer = oplacer;
|
||||||
this.engine = engine;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHighest(int param1Int1, int param1Int2, IrisData data) {
|
public int getHighest(int param1Int1, int param1Int2, IrisData data) {
|
||||||
|
@ -50,7 +50,6 @@ public class Board {
|
|||||||
|
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private final Objective objective;
|
private final Objective objective;
|
||||||
private final Team team;
|
|
||||||
@Setter
|
@Setter
|
||||||
private BoardSettings boardSettings;
|
private BoardSettings boardSettings;
|
||||||
private boolean ready;
|
private boolean ready;
|
||||||
@ -61,11 +60,11 @@ public class Board {
|
|||||||
this.boardSettings = boardSettings;
|
this.boardSettings = boardSettings;
|
||||||
this.objective = this.getScoreboard().getObjective("board") == null ? this.getScoreboard().registerNewObjective("board", "dummy") : this.getScoreboard().getObjective("board");
|
this.objective = this.getScoreboard().getObjective("board") == null ? this.getScoreboard().registerNewObjective("board", "dummy") : this.getScoreboard().getObjective("board");
|
||||||
this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
this.team = this.getScoreboard().getTeam("board") == null ? this.getScoreboard().registerNewTeam("board") : this.getScoreboard().getTeam("board");
|
Team team = this.getScoreboard().getTeam("board") == null ? this.getScoreboard().registerNewTeam("board") : this.getScoreboard().getTeam("board");
|
||||||
this.team.setAllowFriendlyFire(true);
|
team.setAllowFriendlyFire(true);
|
||||||
this.team.setCanSeeFriendlyInvisibles(false);
|
team.setCanSeeFriendlyInvisibles(false);
|
||||||
this.team.setPrefix("");
|
team.setPrefix("");
|
||||||
this.team.setSuffix("");
|
team.setSuffix("");
|
||||||
this.ready = true;
|
this.ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
|||||||
data = new NibbleArray(CAPACITY, i);
|
data = new NibbleArray(CAPACITY, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void expand() {
|
private void expand() {
|
||||||
if(bpb < 8) {
|
if(bpb < 8) {
|
||||||
changeBitsPerBlock(bpb + 1);
|
changeBitsPerBlock(bpb + 1);
|
||||||
} else {
|
} else {
|
||||||
@ -90,7 +90,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
|||||||
changeBitsPerBlock(targetBits);
|
changeBitsPerBlock(targetBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void changeBitsPerBlock(int bits) {
|
private void changeBitsPerBlock(int bits) {
|
||||||
bpb = bits;
|
bpb = bits;
|
||||||
data = new NibbleArray(bpb, CAPACITY, data);
|
data = new NibbleArray(bpb, CAPACITY, data);
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
|||||||
return palette.get(data.get(getCoordinateIndex(x, y, z)));
|
return palette.get(data.get(getCoordinateIndex(x, y, z)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private final int getPaletteId(T d) {
|
private int getPaletteId(T d) {
|
||||||
int index = palette.indexOf(d);
|
int index = palette.indexOf(d);
|
||||||
|
|
||||||
if(index == -1) {
|
if(index == -1) {
|
||||||
@ -118,7 +118,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
|
|||||||
return index + Byte.MIN_VALUE;
|
return index + Byte.MIN_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final int getCoordinateIndex(int x, int y, int z) {
|
private int getCoordinateIndex(int x, int y, int z) {
|
||||||
return y << 8 | z << 4 | x;
|
return y << 8 | z << 4 | x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ import java.io.File;
|
|||||||
|
|
||||||
public class FileWatcher {
|
public class FileWatcher {
|
||||||
protected final File file;
|
protected final File file;
|
||||||
private boolean exists;
|
|
||||||
private long lastModified;
|
private long lastModified;
|
||||||
private long size;
|
private long size;
|
||||||
|
|
||||||
@ -32,7 +31,7 @@ public class FileWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void readProperties() {
|
protected void readProperties() {
|
||||||
exists = file.exists();
|
boolean exists = file.exists();
|
||||||
lastModified = exists ? file.lastModified() : -1;
|
lastModified = exists ? file.lastModified() : -1;
|
||||||
size = exists ? file.isDirectory() ? -2 : file.length() : -1;
|
size = exists ? file.isDirectory() ? -2 : file.length() : -1;
|
||||||
}
|
}
|
||||||
|
@ -376,9 +376,7 @@ public class IrisMathHelper {
|
|||||||
var9 = var5;
|
var9 = var5;
|
||||||
var10 = var6;
|
var10 = var6;
|
||||||
}
|
}
|
||||||
default -> {
|
default -> throw new RuntimeException("Something went wrong when converting from HSV to RGB. Input was " + var0 + ", " + var1 + ", " + var2);
|
||||||
throw new RuntimeException("Something went wrong when converting from HSV to RGB. Input was " + var0 + ", " + var1 + ", " + var2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
final int var11 = clamp((int) (var8 * 255.0f), 0, 255);
|
final int var11 = clamp((int) (var8 * 255.0f), 0, 255);
|
||||||
final int var12 = clamp((int) (var9 * 255.0f), 0, 255);
|
final int var12 = clamp((int) (var9 * 255.0f), 0, 255);
|
||||||
|
@ -30,7 +30,6 @@ public class Section {
|
|||||||
private MCAPaletteAccess palette;
|
private MCAPaletteAccess palette;
|
||||||
private byte[] blockLight;
|
private byte[] blockLight;
|
||||||
private byte[] skyLight;
|
private byte[] skyLight;
|
||||||
private int dataVersion;
|
|
||||||
|
|
||||||
public Section(CompoundTag sectionRoot, int dataVersion) {
|
public Section(CompoundTag sectionRoot, int dataVersion) {
|
||||||
this(sectionRoot, dataVersion, LoadFlags.ALL_DATA);
|
this(sectionRoot, dataVersion, LoadFlags.ALL_DATA);
|
||||||
@ -38,7 +37,6 @@ public class Section {
|
|||||||
|
|
||||||
public Section(CompoundTag sectionRoot, int dataVersion, long loadFlags) {
|
public Section(CompoundTag sectionRoot, int dataVersion, long loadFlags) {
|
||||||
data = sectionRoot;
|
data = sectionRoot;
|
||||||
this.dataVersion = dataVersion;
|
|
||||||
ListTag<?> rawPalette = sectionRoot.getListTag("Palette");
|
ListTag<?> rawPalette = sectionRoot.getListTag("Palette");
|
||||||
if(rawPalette == null) {
|
if(rawPalette == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -1190,9 +1190,6 @@ public class FastNoise {
|
|||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private final static float F2 = (float) (1.0 / 2.0);
|
|
||||||
// private final static float G2 = (float) (1.0 / 4.0);
|
|
||||||
|
|
||||||
public float GetSimplex(float x, float y) {
|
public float GetSimplex(float x, float y) {
|
||||||
return SingleSimplex(m_seed, x * m_frequency, y * m_frequency);
|
return SingleSimplex(m_seed, x * m_frequency, y * m_frequency);
|
||||||
}
|
}
|
||||||
|
@ -43,15 +43,29 @@ public class SemaphoreStream<T> extends BasicStream<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T get(double x, double z) {
|
public T get(double x, double z) {
|
||||||
synchronized(getTypedSource()) {
|
try {
|
||||||
return getTypedSource().get(x, z);
|
semaphore.acquire();
|
||||||
|
T t = getTypedSource().get(x, z);
|
||||||
|
semaphore.release();
|
||||||
|
return t;
|
||||||
|
} catch(InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T get(double x, double y, double z) {
|
public T get(double x, double y, double z) {
|
||||||
synchronized(getTypedSource()) {
|
try {
|
||||||
return getTypedSource().get(x, y, z);
|
semaphore.acquire();
|
||||||
|
T t = getTypedSource().get(x, y, z);
|
||||||
|
semaphore.release();
|
||||||
|
return t;
|
||||||
|
} catch(InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user