mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-05 15:26:28 +00:00
Cleanup
This commit is contained in:
@@ -144,8 +144,7 @@ public class B {
|
||||
|
||||
BlockData bx = Bukkit.createBlockData(ix);
|
||||
|
||||
if(bx instanceof Leaves)
|
||||
{
|
||||
if (bx instanceof Leaves) {
|
||||
((Leaves) bx).setPersistent(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,13 +33,13 @@ import org.jetbrains.annotations.NotNull;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
public class MCATerrainChunk implements TerrainChunk {
|
||||
private NBTWorld writer;
|
||||
private BiomeBaseInjector injector;
|
||||
private int ox;
|
||||
private int oz;
|
||||
private int minHeight;
|
||||
private int maxHeight;
|
||||
private Chunk mcaChunk;
|
||||
private final NBTWorld writer;
|
||||
private final BiomeBaseInjector injector;
|
||||
private final int ox;
|
||||
private final int oz;
|
||||
private final int minHeight;
|
||||
private final int maxHeight;
|
||||
private final Chunk mcaChunk;
|
||||
|
||||
@Override
|
||||
public BiomeBaseInjector getBiomeBaseInjector() {
|
||||
|
||||
@@ -93,27 +93,19 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
J.a(() -> Iris.warn("Couldn't Load " + resourceTypeName + " file: " + path.getPath() + ": " + e.getMessage()));
|
||||
}
|
||||
|
||||
private KList<File> matchAllFiles(File root, Predicate<File> f)
|
||||
{
|
||||
private KList<File> matchAllFiles(File root, Predicate<File> f) {
|
||||
KList<File> fx = new KList<>();
|
||||
matchFiles(root, fx, f);
|
||||
return fx;
|
||||
}
|
||||
|
||||
private void matchFiles(File at, KList<File> files, Predicate<File> f)
|
||||
{
|
||||
if(at.isDirectory())
|
||||
{
|
||||
for(File i : at.listFiles())
|
||||
{
|
||||
private void matchFiles(File at, KList<File> files, Predicate<File> f) {
|
||||
if (at.isDirectory()) {
|
||||
for (File i : at.listFiles()) {
|
||||
matchFiles(i, files, f);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(f.test(at))
|
||||
{
|
||||
} else {
|
||||
if (f.test(at)) {
|
||||
files.add(at);
|
||||
}
|
||||
}
|
||||
@@ -127,10 +119,8 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
Iris.info("Building " + resourceTypeName + " Registry Lists");
|
||||
KSet<String> m = new KSet<>();
|
||||
|
||||
for(File i : getFolders())
|
||||
{
|
||||
for(File j : matchAllFiles(i, (f) -> f.getName().endsWith(".json")))
|
||||
{
|
||||
for (File i : getFolders()) {
|
||||
for (File j : matchAllFiles(i, (f) -> f.getName().endsWith(".json"))) {
|
||||
m.add(i.toURI().relativize(j.toURI()).getPath().replaceAll("\\Q.json\\E", ""));
|
||||
}
|
||||
}
|
||||
@@ -308,10 +298,8 @@ public class ResourceLoader<T extends IrisRegistrant> {
|
||||
public KList<String> getPossibleKeys(String arg) {
|
||||
KList<String> f = new KList<>();
|
||||
|
||||
for(String i : getPossibleKeys())
|
||||
{
|
||||
if(i.equalsIgnoreCase(arg) || i.toLowerCase(Locale.ROOT).startsWith(arg.toLowerCase(Locale.ROOT)) || i.toLowerCase(Locale.ROOT).contains(arg.toLowerCase(Locale.ROOT)) || arg.toLowerCase(Locale.ROOT).contains(i.toLowerCase(Locale.ROOT)))
|
||||
{
|
||||
for (String i : getPossibleKeys()) {
|
||||
if (i.equalsIgnoreCase(arg) || i.toLowerCase(Locale.ROOT).startsWith(arg.toLowerCase(Locale.ROOT)) || i.toLowerCase(Locale.ROOT).contains(arg.toLowerCase(Locale.ROOT)) || arg.toLowerCase(Locale.ROOT).contains(i.toLowerCase(Locale.ROOT))) {
|
||||
f.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,8 +634,7 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public void cleanupPalettesAndBlockStates() {
|
||||
for (int i = 0; i < sections.length(); i++)
|
||||
{
|
||||
for (int i = 0; i < sections.length(); i++) {
|
||||
Section section = sections.get(i);
|
||||
if (section != null) {
|
||||
section.cleanupPaletteAndBlockStates();
|
||||
@@ -691,12 +690,10 @@ public class Chunk {
|
||||
}
|
||||
|
||||
public void runLighting() {
|
||||
for(int s = 15; s >= 0; s--)
|
||||
{
|
||||
for (int s = 15; s >= 0; s--) {
|
||||
Section section = getSection(s);
|
||||
|
||||
if(section != null)
|
||||
{
|
||||
if (section != null) {
|
||||
section.runLighting();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.volmit.iris.engine.data.nbt.tag.ListTag;
|
||||
import com.volmit.iris.engine.data.nbt.tag.LongArrayTag;
|
||||
import com.volmit.iris.util.collection.KMap;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -108,12 +107,9 @@ public class Section {
|
||||
}
|
||||
|
||||
public void runLighting() {
|
||||
for(int x = 1; x < 14; x++)
|
||||
{
|
||||
for(int z = 1; z < 14; z++)
|
||||
{
|
||||
for(int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 1; x < 14; x++) {
|
||||
for (int z = 1; z < 14; z++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -444,8 +440,7 @@ public class Section {
|
||||
if (blockStates != null) {
|
||||
long[] c = new long[blockStates.length()];
|
||||
|
||||
for(int i = 0; i < c.length; i++)
|
||||
{
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
c[i] = blockStates.get(i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user