Random variable tweaks & opts

This commit is contained in:
cyberpwn 2022-01-13 07:14:16 -05:00
parent 62c2757afc
commit 32a0fc9b17
13 changed files with 34 additions and 45 deletions

View File

@ -90,12 +90,10 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
private boolean lowtile = false;
private boolean follow = false;
private boolean alt = false;
private int posX = 0;
private IrisRenderer renderer;
private IrisWorld world;
private double velocity = 0;
private int lowq = 12;
private int posZ = 0;
private double scale = 128;
private double mscale = 4D;
private int w = 0;
@ -501,8 +499,8 @@ public class VisionGUI extends JPanel implements MouseWheelListener, KeyListener
int iscale = (int) scale;
g.setColor(Color.white);
g.clearRect(0, 0, w, h);
posX = (int) oxp;
posZ = (int) ozp;
int posX = (int) oxp;
int posZ = (int) ozp;
m.set(3);
for(int r = 0; r < Math.max(w, h); r += iscale) {

View File

@ -36,7 +36,7 @@ public class INMS {
return binding;
}
public static final String getNMSTag() {
public static String getNMSTag() {
if(IrisSettings.get().getGeneral().isDisableNMS()) {
return "BUKKIT";
}
@ -52,7 +52,7 @@ public class INMS {
return "BUKKIT";
}
private static final INMSBinding bind() {
private static INMSBinding bind() {
String code = getNMSTag();
Iris.info("Locating NMS Binding for " + code);

View File

@ -26,7 +26,6 @@ import com.volmit.iris.util.mantle.Mantle;
import lombok.Getter;
public class HeadlessPregenMethod implements PregeneratorMethod {
private final HeadlessWorld world;
@Getter
private final HeadlessGenerator generator;
@ -36,7 +35,6 @@ public class HeadlessPregenMethod implements PregeneratorMethod {
}
public HeadlessPregenMethod(HeadlessWorld world, HeadlessGenerator generator) {
this.world = world;
this.generator = generator;
}

View File

@ -54,7 +54,6 @@ import java.util.ArrayList;
import java.util.Objects;
public class WandSVC implements IrisService {
private static ItemStack wand;
private static ItemStack dust;
public static void pasteSchematic(IrisObject s, Location at) {
@ -268,7 +267,7 @@ public class WandSVC implements IrisService {
@Override
public void onEnable() {
wand = createWand();
ItemStack wand = createWand();
dust = createDust();
J.ar(() -> {

View File

@ -81,15 +81,6 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
IrisBiomeCustom custom = ib.getCustomBiome(rng, x, 0, z);
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)) {
throw new RuntimeException("Cant inject biome!");
}

View File

@ -31,13 +31,11 @@ public class HeightmapObjectPlacer implements IObjectPlacer {
private final long s;
private final IrisObjectPlacement config;
private final IObjectPlacer oplacer;
private final Engine engine;
public HeightmapObjectPlacer(Engine engine, RNG rng, int x, int yv, int z, IrisObjectPlacement config, IObjectPlacer oplacer) {
s = rng.nextLong() + yv + z - x;
this.config = config;
this.oplacer = oplacer;
this.engine = engine;
}
public int getHighest(int param1Int1, int param1Int2, IrisData data) {

View File

@ -50,7 +50,6 @@ public class Board {
private final Player player;
private final Objective objective;
private final Team team;
@Setter
private BoardSettings boardSettings;
private boolean ready;
@ -61,11 +60,11 @@ public class Board {
this.boardSettings = boardSettings;
this.objective = this.getScoreboard().getObjective("board") == null ? this.getScoreboard().registerNewObjective("board", "dummy") : this.getScoreboard().getObjective("board");
this.objective.setDisplaySlot(DisplaySlot.SIDEBAR);
this.team = this.getScoreboard().getTeam("board") == null ? this.getScoreboard().registerNewTeam("board") : this.getScoreboard().getTeam("board");
this.team.setAllowFriendlyFire(true);
this.team.setCanSeeFriendlyInvisibles(false);
this.team.setPrefix("");
this.team.setSuffix("");
Team team = this.getScoreboard().getTeam("board") == null ? this.getScoreboard().registerNewTeam("board") : this.getScoreboard().getTeam("board");
team.setAllowFriendlyFire(true);
team.setCanSeeFriendlyInvisibles(false);
team.setPrefix("");
team.setSuffix("");
this.ready = true;
}

View File

@ -68,7 +68,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
data = new NibbleArray(CAPACITY, i);
}
private final void expand() {
private void expand() {
if(bpb < 8) {
changeBitsPerBlock(bpb + 1);
} else {
@ -90,7 +90,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
changeBitsPerBlock(targetBits);
}
private final void changeBitsPerBlock(int bits) {
private void changeBitsPerBlock(int bits) {
bpb = bits;
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)));
}
private final int getPaletteId(T d) {
private int getPaletteId(T d) {
int index = palette.indexOf(d);
if(index == -1) {
@ -118,7 +118,7 @@ public abstract class NibbleDataPalette<T> implements Writable {
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;
}
}

View File

@ -22,7 +22,6 @@ import java.io.File;
public class FileWatcher {
protected final File file;
private boolean exists;
private long lastModified;
private long size;
@ -32,7 +31,7 @@ public class FileWatcher {
}
protected void readProperties() {
exists = file.exists();
boolean exists = file.exists();
lastModified = exists ? file.lastModified() : -1;
size = exists ? file.isDirectory() ? -2 : file.length() : -1;
}

View File

@ -376,9 +376,7 @@ public class IrisMathHelper {
var9 = var5;
var10 = var6;
}
default -> {
throw new RuntimeException("Something went wrong when converting from HSV to RGB. Input was " + var0 + ", " + var1 + ", " + var2);
}
default -> 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 var12 = clamp((int) (var9 * 255.0f), 0, 255);

View File

@ -30,7 +30,6 @@ public class Section {
private MCAPaletteAccess palette;
private byte[] blockLight;
private byte[] skyLight;
private int dataVersion;
public Section(CompoundTag sectionRoot, int dataVersion) {
this(sectionRoot, dataVersion, LoadFlags.ALL_DATA);
@ -38,7 +37,6 @@ public class Section {
public Section(CompoundTag sectionRoot, int dataVersion, long loadFlags) {
data = sectionRoot;
this.dataVersion = dataVersion;
ListTag<?> rawPalette = sectionRoot.getListTag("Palette");
if(rawPalette == null) {
return;

View File

@ -1190,9 +1190,6 @@ public class FastNoise {
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) {
return SingleSimplex(m_seed, x * m_frequency, y * m_frequency);
}

View File

@ -43,15 +43,29 @@ public class SemaphoreStream<T> extends BasicStream<T> {
@Override
public T get(double x, double z) {
synchronized(getTypedSource()) {
return getTypedSource().get(x, z);
try {
semaphore.acquire();
T t = getTypedSource().get(x, z);
semaphore.release();
return t;
} catch(InterruptedException e) {
e.printStackTrace();
}
return null;
}
@Override
public T get(double x, double y, double z) {
synchronized(getTypedSource()) {
return getTypedSource().get(x, y, z);
try {
semaphore.acquire();
T t = getTypedSource().get(x, y, z);
semaphore.release();
return t;
} catch(InterruptedException e) {
e.printStackTrace();
}
return null;
}
}