mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Merge branch 'master' into map-1.17
This commit is contained in:
commit
2b45056842
@ -43,11 +43,9 @@ import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings("CanBeFinal")
|
||||
public class Iris extends VolmitPlugin implements Listener {
|
||||
@ -102,6 +100,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -154,8 +153,8 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
|
||||
|
||||
return v >= 15;
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -166,8 +165,8 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
|
||||
|
||||
return v >= 14;
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -178,8 +177,8 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
|
||||
|
||||
return v >= 15;
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -205,7 +204,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
try {
|
||||
compat = IrisCompat.configured(getDataFile("compat.json"));
|
||||
} catch (IOException e) {
|
||||
// Do nothing. Everything continues properly but the exception is still there.
|
||||
Iris.reportError(e);
|
||||
}
|
||||
proj = new ProjectManager();
|
||||
convert = new ConversionManager();
|
||||
@ -278,6 +277,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
Iris.syncJobs.next().run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -332,6 +332,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
Bukkit.getConsoleSender().sendMessage(msg);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("[Iris]: " + string);
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,8 +348,8 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
||||
Iris.verbose("Aquiring " + name);
|
||||
}
|
||||
} catch (IOException ignored) {
|
||||
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,14 +366,14 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {
|
||||
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
||||
}
|
||||
} catch (IOException ignored) {
|
||||
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
try {
|
||||
return IO.readAll(f);
|
||||
} catch (IOException ignored) {
|
||||
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return "";
|
||||
@ -390,6 +391,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return f;
|
||||
@ -403,6 +405,15 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
msg(C.RED + string);
|
||||
}
|
||||
|
||||
public static void debug(String string) {
|
||||
if(!IrisSettings.get().getGeneral().isDebug())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
msg( C.LIGHT_PURPLE+ "" + C.BOLD+ string);
|
||||
}
|
||||
|
||||
public static void verbose(String string) {
|
||||
try {
|
||||
if (IrisSettings.get().getGeneral().isVerbose()) {
|
||||
@ -410,6 +421,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
msg(C.GRAY + string);
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -473,6 +485,7 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
object.run();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}, RNG.r.i(100, 1200));
|
||||
}
|
||||
@ -503,4 +516,32 @@ public class Iris extends VolmitPlugin implements Listener {
|
||||
public boolean isMCA() {
|
||||
return IrisSettings.get().getGenerator().isMcaPregenerator();
|
||||
}
|
||||
|
||||
public static synchronized void reportError(Throwable e)
|
||||
{
|
||||
if(IrisSettings.get().getGeneral().isDebug())
|
||||
{
|
||||
String n = e.getClass().getCanonicalName() + "-" + e.getStackTrace()[0].getClassName() + "-" + e.getStackTrace()[0].getLineNumber();
|
||||
|
||||
if(e.getCause() != null)
|
||||
{
|
||||
n += "-" + e.getCause().getStackTrace()[0].getClassName() + "-" + e.getCause().getStackTrace()[0].getLineNumber();
|
||||
}
|
||||
|
||||
File f = instance.getDataFile("debug", "caught-exceptions", n + ".txt");
|
||||
|
||||
if(!f.exists())
|
||||
{
|
||||
J.attempt(() -> {
|
||||
PrintWriter pw = new PrintWriter(f);
|
||||
pw.println("Thread: " + Thread.currentThread().getName());
|
||||
pw.println("First: " + new Date(M.ms()));
|
||||
e.printStackTrace(pw);
|
||||
pw.close();
|
||||
});
|
||||
}
|
||||
|
||||
Iris.debug("Exception Logged: " + e.getClass().getSimpleName() + ": " + C.RESET + "" + C.LIGHT_PURPLE + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,8 +36,6 @@ public class IrisSettings {
|
||||
private IrisSettingsGUI gui = new IrisSettingsGUI();
|
||||
private IrisSettingsGenerator generator = new IrisSettingsGenerator();
|
||||
private IrisSettingsStudio studio = new IrisSettingsStudio();
|
||||
|
||||
|
||||
public int configurationVersion = 3;
|
||||
|
||||
public boolean isStudio() {
|
||||
@ -55,44 +53,28 @@ public class IrisSettings {
|
||||
|
||||
@Data
|
||||
public static class IrisSettingsCache {
|
||||
|
||||
public int streamingCacheSize = 8192;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class IrisSettingsConcurrency {
|
||||
|
||||
public int threadCount = -1;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class IrisSettingsParallax {
|
||||
|
||||
public int parallaxRegionEvictionMS = 15000;
|
||||
|
||||
|
||||
public int parallaxChunkEvictionMS = 5000;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class IrisSettingsGeneral {
|
||||
|
||||
|
||||
public boolean commandSounds = true;
|
||||
|
||||
|
||||
public boolean debug = false;
|
||||
public boolean verbose = false;
|
||||
|
||||
|
||||
public boolean ignoreWorldEdit = false;
|
||||
|
||||
|
||||
public boolean disableNMS = false;
|
||||
|
||||
|
||||
public boolean pluginMetrics = true;
|
||||
|
||||
|
||||
public boolean splashLogoStartup = true;
|
||||
}
|
||||
|
||||
@ -100,11 +82,7 @@ public class IrisSettings {
|
||||
public static class IrisSettingsGUI {
|
||||
|
||||
public boolean useServerLaunchedGuis = true;
|
||||
|
||||
|
||||
public boolean maximumPregenGuiFPS = false;
|
||||
|
||||
|
||||
public boolean localPregenGui = true;
|
||||
}
|
||||
|
||||
@ -112,34 +90,18 @@ public class IrisSettings {
|
||||
public static class IrisSettingsGenerator {
|
||||
|
||||
public String defaultWorldType = "overworld";
|
||||
|
||||
|
||||
public boolean mcaPregenerator = false;
|
||||
|
||||
|
||||
public boolean systemEffects = true;
|
||||
|
||||
|
||||
public boolean systemEntitySpawnOverrides = true;
|
||||
|
||||
|
||||
public boolean systemEntityInitialSpawns = true;
|
||||
|
||||
|
||||
public int maxBiomeChildDepth = 5;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class IrisSettingsStudio {
|
||||
|
||||
|
||||
public boolean studio = true;
|
||||
|
||||
|
||||
public boolean openVSCode = true;
|
||||
|
||||
|
||||
public boolean disableTimeAndWeather = true;
|
||||
}
|
||||
|
||||
@ -160,6 +122,7 @@ public class IrisSettings {
|
||||
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
|
||||
} catch (JSONException | IOException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
@ -193,9 +156,11 @@ public class IrisSettings {
|
||||
Iris.info("Updated Configuration Files");
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
} catch (Throwable ee) {
|
||||
Iris.reportError(ee);
|
||||
Iris.error("Configuration Error in settings.json! " + ee.getClass().getSimpleName() + ": " + ee.getMessage());
|
||||
Iris.warn("Attempting to fix configuration while retaining valid in-memory settings...");
|
||||
|
||||
@ -203,12 +168,14 @@ public class IrisSettings {
|
||||
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
|
||||
Iris.info("Configuration Fixed!");
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error("ERROR! CONFIGURATION IMPOSSIBLE TO READ! Using an unmodifiable configuration from memory. Please delete the settings.json at some point to try to restore configurability!");
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Throwable ee) {
|
||||
Iris.reportError(ee);
|
||||
Iris.error("Configuration Error in settings.json! " + ee.getClass().getSimpleName() + ": " + ee.getMessage());
|
||||
Iris.warn("Attempting to fix configuration while retaining valid in-memory settings...");
|
||||
|
||||
@ -216,6 +183,7 @@ public class IrisSettings {
|
||||
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
|
||||
Iris.info("Configuration Fixed!");
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error("ERROR! CONFIGURATION IMPOSSIBLE TO READ! Using an unmodifiable configuration from memory. Please delete the settings.json at some point to try to restore configurability!");
|
||||
}
|
||||
@ -226,6 +194,7 @@ public class IrisSettings {
|
||||
try {
|
||||
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
|
||||
} catch (JSONException | IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -333,6 +333,7 @@ public class IrisComplex implements DataProvider {
|
||||
|
||||
return bx.getGenLinkMax(gen.getLoadKey());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.warn("Failed to sample hi biome at " + xx + " " + zz + " using the generator " + gen.getLoadKey());
|
||||
}
|
||||
@ -347,6 +348,7 @@ public class IrisComplex implements DataProvider {
|
||||
|
||||
return bx.getGenLinkMin(gen.getLoadKey());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.warn("Failed to sample lo biome at " + xx + " " + zz + " using the generator " + gen.getLoadKey());
|
||||
}
|
||||
|
@ -130,6 +130,7 @@ public class IrisEngine extends BlockPopulator implements Engine {
|
||||
getFramework().getDepositModifier().modify(x, z, blocks);
|
||||
getMetrics().getTotal().put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
fail("Failed to generate " + x + ", " + z, e);
|
||||
}
|
||||
}
|
||||
|
@ -102,6 +102,7 @@ public class IrisEngineFramework implements EngineFramework {
|
||||
getEngine().getParallax().cleanup();
|
||||
getData().getObjectLoader().clean();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Cleanup failed!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.generator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.object.*;
|
||||
import com.volmit.iris.scaffold.cache.Cache;
|
||||
@ -127,8 +128,8 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable ee) {
|
||||
Iris.reportError(ee);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.generator.actuator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.nms.INMS;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.object.IrisBiomeCustom;
|
||||
@ -54,6 +55,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -82,6 +84,7 @@ public class IrisBiomeActuator extends EngineAssignedActuator<Biome> {
|
||||
injectBiome(h, xf, i, zf, biomeBase);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Biome v = ib.getSkyBiome(rng, x, 0, z);
|
||||
for (int i = 0; i < h.getHeight(); i++) {
|
||||
|
@ -54,6 +54,7 @@ public abstract class IrisEngineDecorator extends EngineAssignedComponent implem
|
||||
v.add(i);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("PART OF: " + biome.getLoadFile().getAbsolutePath() + " HAS AN INVALID DECORATOR near 'partOf'!!!");
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.generator.decorator;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.DecorationPart;
|
||||
import com.volmit.iris.object.InferredType;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
@ -59,8 +60,8 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
|
||||
((Bisected) bd).setHalf(Bisected.Half.TOP);
|
||||
try {
|
||||
data.set(x, height + 2, z, bd);
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
bd = bd.clone();
|
||||
((Bisected) bd).setHalf(Bisected.Half.BOTTOM);
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.generator.modifier;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.scaffold.engine.Engine;
|
||||
import com.volmit.iris.scaffold.engine.EngineAssignedModifier;
|
||||
@ -345,7 +346,8 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
||||
Slab slab = (Slab) d.clone();
|
||||
slab.setType(Slab.Type.TOP);
|
||||
setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
try {
|
||||
Slab slab = (Slab) d.clone();
|
||||
|
||||
@ -353,8 +355,8 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
||||
slab.setType(Slab.Type.TOP);
|
||||
setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
|
||||
}
|
||||
} catch (Throwable ignored2) {
|
||||
|
||||
} catch (Throwable ee) {
|
||||
Iris.reportError(ee);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.generator.noise;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.stream.ProceduralStream;
|
||||
import com.volmit.iris.scaffold.stream.arithmetic.FittedStream;
|
||||
import com.volmit.iris.scaffold.stream.sources.CNGStream;
|
||||
@ -304,8 +305,8 @@ public class CNG {
|
||||
|
||||
try {
|
||||
return v.get(fit(0, v.size() - 1, dim));
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return v.get(0);
|
||||
|
@ -196,6 +196,7 @@ public class ConversionManager {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
});
|
||||
|
||||
@ -204,6 +205,7 @@ public class ConversionManager {
|
||||
IO.writeAll(new File(destPools, i + ".json"), new JSONObject(new Gson().toJson(pools.get(i))).toString(4));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,7 @@ public class EditManager implements Listener {
|
||||
try {
|
||||
e = new WEBlockEditor(world);
|
||||
} catch (Throwable ex) {
|
||||
Iris.reportError(ex);
|
||||
e = new BukkitBlockEditor(world);
|
||||
}
|
||||
} else {
|
||||
|
@ -193,6 +193,7 @@ public class IrisDataManager {
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,7 @@ public class IrisProject {
|
||||
try {
|
||||
IO.writeAll(ff, createCodeWorkspaceConfig());
|
||||
} catch (IOException e1) {
|
||||
Iris.reportError(e1);
|
||||
e1.printStackTrace();
|
||||
}
|
||||
sender.sendMessage("Updating Workspace...");
|
||||
@ -224,6 +225,7 @@ public class IrisProject {
|
||||
sender.sendMessage("Workspace Updated");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
@ -337,11 +339,13 @@ public class IrisProject {
|
||||
Iris.info("Building Workspace: " + ws.getPath() + " took " + Form.duration(p.getMilliseconds(), 2));
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.warn("Project invalid: " + ws.getAbsolutePath() + " Re-creating. You may loose some vs-code workspace settings! But not your actual project!");
|
||||
ws.delete();
|
||||
try {
|
||||
IO.writeAll(ws, createCodeWorkspaceConfig());
|
||||
} catch (IOException e1) {
|
||||
Iris.reportError(e1);
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -503,8 +507,8 @@ public class IrisProject {
|
||||
ggg.set(0);
|
||||
sender.sendMessage("Wrote another " + g + " Objects");
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
})));
|
||||
|
||||
@ -521,8 +525,8 @@ public class IrisProject {
|
||||
ggg.set(0);
|
||||
sender.sendMessage("Wrote another " + g + " Objects");
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
})));
|
||||
|
||||
@ -591,6 +595,7 @@ public class IrisProject {
|
||||
sender.sendMessage("Package Compiled!");
|
||||
return p;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
sender.sendMessage("Failed!");
|
||||
|
@ -52,8 +52,8 @@ public class ProjectManager {
|
||||
if (m != null) {
|
||||
try {
|
||||
IO.copyFile(m, ignore);
|
||||
} catch (IOException ignored) {
|
||||
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,12 +72,12 @@ public class ProjectManager {
|
||||
if (i.isDirectory() && i.list().length > 0 && !Iris.proj.getListing(true).containsKey(i.getName())) {
|
||||
v++;
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return v;
|
||||
@ -104,8 +104,8 @@ public class ProjectManager {
|
||||
|
||||
try {
|
||||
FileUtils.copyDirectory(f, irispack);
|
||||
} catch (IOException ignored) {
|
||||
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,12 +121,14 @@ public class ProjectManager {
|
||||
FileUtils.copyFile(i, new File(irispack, i.getName()));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
FileUtils.copyDirectory(i, new File(irispack, i.getName()));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -168,6 +170,7 @@ public class ProjectManager {
|
||||
branch = nodes.length > 2 ? nodes[2] : branch;
|
||||
download(sender, repo, branch, trim, forceOverwrite);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
sender.sendMessage("Failed to download '" + key + "' from " + url + ".");
|
||||
}
|
||||
@ -188,6 +191,7 @@ public class ProjectManager {
|
||||
try {
|
||||
ZipUtil.unpack(zip, work);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
sender.sendMessage(
|
||||
"""
|
||||
@ -210,6 +214,7 @@ public class ProjectManager {
|
||||
try {
|
||||
dir = zipFiles.length == 1 && zipFiles[0].isDirectory() ? zipFiles[0] : null;
|
||||
} catch (NullPointerException e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Error when finding home directory. Are there any non-text characters in the file name?");
|
||||
return;
|
||||
}
|
||||
@ -307,6 +312,7 @@ public class ProjectManager {
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Error when creating studio world:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -353,6 +359,7 @@ public class ProjectManager {
|
||||
try {
|
||||
FileUtils.copyDirectory(importPack, newPack, pathname -> !pathname.getAbsolutePath().contains(".git"), false);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -363,6 +370,7 @@ public class ProjectManager {
|
||||
try {
|
||||
FileUtils.copyFile(dimFile, newDimFile);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -376,6 +384,7 @@ public class ProjectManager {
|
||||
IO.writeAll(newDimFile, json.toString(4));
|
||||
}
|
||||
} catch (JSONException | IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -384,6 +393,7 @@ public class ProjectManager {
|
||||
JSONObject ws = p.createCodeWorkspaceConfig();
|
||||
IO.writeAll(getWorkspaceFile(newName, newName + ".code-workspace"), ws.toString(0));
|
||||
} catch (JSONException | IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -383,6 +383,7 @@ public class SchemaBuilder {
|
||||
j.put("description", dd == null ? ("No Description for " + name) : dd.value());
|
||||
a.put(j);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
@ -697,6 +698,7 @@ public class SchemaBuilder {
|
||||
j.put("description", dd == null ? ("No Description for " + name) : dd.value());
|
||||
a.put(j);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
@ -746,8 +748,8 @@ public class SchemaBuilder {
|
||||
d.add("* Default Value is " + value);
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
description.forEach((g) -> d.add(g.trim()));
|
||||
|
@ -61,8 +61,8 @@ public class WandManager implements Listener {
|
||||
Location[] d = getCuboid(p.getInventory().getItemInMainHand());
|
||||
draw(d, p);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,8 +164,8 @@ public class WandManager implements Listener {
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable xx) {
|
||||
Iris.reportError(xx);
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +194,7 @@ public class WandManager implements Listener {
|
||||
return s;
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -205,6 +206,7 @@ public class WandManager implements Listener {
|
||||
String[] g = f[0].split("\\Q,\\E");
|
||||
return new Location(Bukkit.getWorld(f[1]), Integer.parseInt(g[0]), Integer.parseInt(g[1]), Integer.parseInt(g[2]));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ public class CommandIrisMetrics extends MortarCommand {
|
||||
try {
|
||||
g.printMetrics(sender);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("You must be in an iris world.");
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,7 @@ public class CommandIrisObjectSave extends MortarCommand {
|
||||
sender.sendMessage("Saved " + args[1]);
|
||||
p.getWorld().playSound(p.getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.5f);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Failed to save " + args[1] + ". Are you holding your wand?");
|
||||
|
||||
e.printStackTrace();
|
||||
|
@ -77,6 +77,7 @@ public class CommandIrisStudioBeautify extends MortarCommand {
|
||||
try {
|
||||
IO.writeAll(clean, new JSONObject(IO.readAll(clean)).toString(4));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to beautify " + clean.getAbsolutePath() + " You may have errors in your json!");
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,7 @@ public class CommandIrisStudioEditBiome extends MortarCommand {
|
||||
File f = Iris.proj.getActiveProject().getActiveProvider().getBiome(p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ()).getLoadFile();
|
||||
Desktop.getDesktop().open(f);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Cant find the file. Are you in an Iris Studio world?");
|
||||
}
|
||||
|
||||
|
@ -133,6 +133,7 @@ public class CommandIrisStudioGoto extends MortarCommand {
|
||||
sender.sendMessage("Players only.");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed goto!");
|
||||
e.printStackTrace();
|
||||
sender.sendMessage("We cant seem to aquire a lock on the biome cache. Please report the error in the console to our github. Thanks!");
|
||||
|
@ -65,6 +65,7 @@ public class CommandIrisStudioLoot extends MortarCommand {
|
||||
try {
|
||||
Iris.proj.getActiveProject().getActiveProvider().getCompound().getEngine(p.getLocation().getBlockY()).addItems(true, inv, RNG.r, tables, InventorySlotType.STORAGE, p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ(), 1);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("You can only use /iris loot in a studio world of iris.");
|
||||
return true;
|
||||
}
|
||||
|
@ -105,6 +105,15 @@ public class CommandIrisStudioMap extends MortarCommand
|
||||
FakeWorld world = new FakeWorld(dim.getName(), 0, 256, seed, new File(dim.getName()), dim.getEnvironment());
|
||||
FakeEngine engine = new FakeEngine(dim, world);
|
||||
complex = new IrisComplex(engine, true);
|
||||
|
||||
try {
|
||||
IrisAccess g = Iris.proj.getActiveProject().getActiveProvider();
|
||||
IrisVision.launch(g, 0);
|
||||
sender.sendMessage("Opening Map!");
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisAccess g = IrisWorlds.access(sender.player().getWorld());
|
||||
IrisVision.launch(g, 0);
|
||||
sender.sendMessage("Opening Map!");
|
||||
} else if (Iris.proj.isProjectOpen()) {
|
||||
IrisAccess g = Iris.proj.getActiveProject().getActiveProvider();
|
||||
|
@ -241,6 +241,7 @@ public class CommandIrisStudioProfile extends MortarCommand {
|
||||
try {
|
||||
IO.writeAll(report, v.toString("\n"));
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,7 @@ public class CommandIrisStudioTPStudio extends MortarCommand {
|
||||
sender.player().teleport(Iris.proj.getActiveProject().getActiveProvider().getTarget().getWorld().getSpawnLocation());
|
||||
sender.player().setGameMode(GameMode.SPECTATOR);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Failed to teleport to the studio world. Try re-opening the project.");
|
||||
}
|
||||
|
||||
|
@ -58,13 +58,14 @@ public class CommandIrisWhatBiome extends MortarCommand {
|
||||
sender.sendMessage("IBiome: " + b.getLoadKey() + " (" + b.getDerivative().name() + ")");
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Non-Iris Biome: " + p.getLocation().getBlock().getBiome().name());
|
||||
|
||||
if (p.getLocation().getBlock().getBiome().equals(Biome.CUSTOM)) {
|
||||
try {
|
||||
sender.sendMessage("Data Pack Biome: " + INMS.get().getTrueBiomeBaseKey(p.getLocation()) + " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(p.getLocation())) + ")");
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable ee) {
|
||||
Iris.reportError(ee);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public class CommandIrisWhatBlock extends MortarCommand {
|
||||
try {
|
||||
bd = p.getTargetBlockExact(128, FluidCollisionMode.NEVER).getBlockData();
|
||||
} catch (NullPointerException e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Please look at any block, not at the sky");
|
||||
bd = null;
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ public class CommandIrisWhatHand extends MortarCommand {
|
||||
sender.sendMessage("Please hold a block/item");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Material bd = p.getInventory().getItemInMainHand().getType();
|
||||
if (!bd.equals(Material.AIR)) {
|
||||
sender.sendMessage("Material: " + C.GREEN + bd.name());
|
||||
|
@ -79,8 +79,8 @@ public class CommandIrisWhatObjects extends MortarCommand {
|
||||
int cz = l.getChunk().getZ();
|
||||
new Spiraler(3, 3, (x, z) -> chunks.addIfMissing(world.getChunkAt(x + cx, z + cz))).drain();
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
new Spiraler(3, 3, (x, z) -> chunks.addIfMissing(world.getChunkAt(x + bx, z + bz))).drain();
|
||||
@ -111,15 +111,15 @@ public class CommandIrisWhatObjects extends MortarCommand {
|
||||
size += i.length();
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
try {
|
||||
FileTime creationTime = (FileTime) Files.getAttribute(world.getWorldFolder().toPath(), "creationTime");
|
||||
age = hrf(Duration.of(M.ms() - creationTime.toMillis(), ChronoUnit.MILLIS));
|
||||
} catch (IOException ignored) {
|
||||
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
KList<String> biomes = new KList<>();
|
||||
@ -181,6 +181,7 @@ public class CommandIrisWhatObjects extends MortarCommand {
|
||||
sender.sendMessage("Reported to: " + ff.getPath());
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -211,8 +212,8 @@ public class CommandIrisWhatObjects extends MortarCommand {
|
||||
BlockVector sz = IrisObject.sampleSize(ff);
|
||||
nn3 = i + ": size=[" + sz.getBlockX() + "," + sz.getBlockY() + "," + sz.getBlockZ() + "] location=[" + ff.getPath() + "]";
|
||||
stop.add(i);
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
String n3 = nn3;
|
||||
|
@ -139,8 +139,8 @@ public class CommandIrisCreate extends MortarCommand {
|
||||
if (sender.isPlayer()) {
|
||||
try {
|
||||
sender.player().teleport(world.get().getSpawnLocation());
|
||||
} catch (Throwable ignored) {
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,6 +61,7 @@ public class CommandIrisFix extends MortarCommand {
|
||||
});
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Not a valid Iris World (or bad argument)");
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,7 @@ public class CommandIrisPregen extends MortarCommand {
|
||||
try {
|
||||
world = Bukkit.getWorld(args[1]);
|
||||
} catch (Exception e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("Could not find specified world");
|
||||
sender.sendMessage("Please doublecheck your command. E.g. /ir pregen 5k world");
|
||||
return true;
|
||||
@ -105,13 +106,14 @@ public class CommandIrisPregen extends MortarCommand {
|
||||
}
|
||||
try {
|
||||
new Pregenerator(world, getVal(args[0]) * 2);
|
||||
} catch (NumberFormatException e) {
|
||||
} catch (NumberFormatException e) {Iris.reportError(e);
|
||||
sender.sendMessage("Invalid argument in command");
|
||||
return true;
|
||||
} catch (NullPointerException e) {
|
||||
} catch (NullPointerException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
sender.sendMessage("No radius specified (check error in console)");
|
||||
} catch (HeadlessException e) {
|
||||
Iris.reportError(e);
|
||||
sender.sendMessage("If you are seeing this and are using a hosted server, please turn off 'useServerLaunchedGUIs' in the settings");
|
||||
}
|
||||
|
||||
@ -128,12 +130,12 @@ public class CommandIrisPregen extends MortarCommand {
|
||||
World world = Bukkit.getWorld(args[1]);
|
||||
try {
|
||||
new Pregenerator(world, getVal(args[0]) * 2);
|
||||
} catch (NumberFormatException e) {
|
||||
} catch (NumberFormatException e) {Iris.reportError(e);
|
||||
sender.sendMessage("Invalid argument in command");
|
||||
return true;
|
||||
} catch (NullPointerException e) {
|
||||
} catch (NullPointerException e) {Iris.reportError(e);
|
||||
sender.sendMessage("Not all required parameters specified");
|
||||
} catch (HeadlessException e) {
|
||||
} catch (HeadlessException e) {Iris.reportError(e);
|
||||
sender.sendMessage("If you are seeing this and are using a hosted server, please turn off 'useServerLaunchedGUIs' in the settings");
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.manager.edit;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.IrisWorlds;
|
||||
import com.volmit.iris.scaffold.engine.IrisAccess;
|
||||
import com.volmit.iris.scaffold.parallax.ParallaxAccess;
|
||||
@ -89,6 +90,7 @@ public class DustRevealer {
|
||||
is(new BlockPosition(block.getX() + 1, block.getY() - 1, block.getZ() - 1));
|
||||
is(new BlockPosition(block.getX() + 1, block.getY() - 1, block.getZ() + 1));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
@ -74,7 +74,7 @@ public class JigsawEditor implements Listener {
|
||||
if (e.getPlayer().equals(player)) {
|
||||
try {
|
||||
target = player.getTargetBlockExact(7).getLocation();
|
||||
} catch (Throwable ex) {
|
||||
} catch (Throwable ex) {Iris.reportError(ex);
|
||||
target = player.getLocation();
|
||||
return;
|
||||
}
|
||||
@ -141,7 +141,7 @@ public class JigsawEditor implements Listener {
|
||||
exit();
|
||||
try {
|
||||
IO.writeAll(targetSaveLocation, new JSONObject(new Gson().toJson(piece)).toString(4));
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ public class IrisVision extends JPanel implements MouseWheelListener {
|
||||
if (file != null) {
|
||||
try {
|
||||
frame.setIconImage(ImageIO.read(file));
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
|
||||
if (file != null) {
|
||||
try {
|
||||
frame.setIconImage(ImageIO.read(file));
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
frame.setSize(1440, 820);
|
||||
@ -276,7 +276,7 @@ public class NoiseExplorer extends JPanel implements MouseWheelListener {
|
||||
if (file != null) {
|
||||
try {
|
||||
frame.setIconImage(ImageIO.read(file));
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
frame.setSize(1440, 820);
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.manager.link;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.util.KMap;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -51,6 +52,7 @@ public class MultiverseCoreLink {
|
||||
saveConfig();
|
||||
return b;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -65,7 +67,7 @@ public class MultiverseCoreLink {
|
||||
Field f = mvWorldManager.getClass().getDeclaredField("worldsFromTheConfig");
|
||||
f.setAccessible(true);
|
||||
return (Map<String, ?>) f.get(mvWorldManager);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -95,7 +97,7 @@ public class MultiverseCoreLink {
|
||||
Plugin p = getMultiverse();
|
||||
Object mvWorldManager = p.getClass().getDeclaredMethod("getMVWorldManager").invoke(p);
|
||||
mvWorldManager.getClass().getDeclaredMethod("saveWorldsConfig").invoke(mvWorldManager);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -108,7 +110,7 @@ public class MultiverseCoreLink {
|
||||
try {
|
||||
String t = worldNameTypes.get(worldName);
|
||||
return t == null ? defaultType : t;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
return defaultType;
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class INMS {
|
||||
|
||||
try {
|
||||
return Bukkit.getServer().getClass().getCanonicalName().split("\\Q.\\E")[3];
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("Failed to determine server nms version!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -61,7 +61,7 @@ public class INMS {
|
||||
Iris.info("Craftbukkit " + code + " <-> " + b.getClass().getSimpleName() + " Successfully Bound");
|
||||
|
||||
return b;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
private Object getBiomeStorage(ChunkGenerator.BiomeGrid g) {
|
||||
try {
|
||||
return getFieldForBiomeStorage(g).get(g);
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (IllegalAccessException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
f = storage.getClass().getDeclaredField("biome");
|
||||
f.setAccessible(true);
|
||||
return f;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error(storage.getClass().getCanonicalName());
|
||||
}
|
||||
@ -128,7 +128,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
f.setAccessible(true);
|
||||
//noinspection unchecked
|
||||
return (T) f.invoke(from, par);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
f.setAccessible(true);
|
||||
//noinspection unchecked
|
||||
return (T) f.invoke(null, par);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
f.setAccessible(true);
|
||||
//noinspection unchecked
|
||||
return (T) f.get(from);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
f.setAccessible(true);
|
||||
//noinspection unchecked
|
||||
return (T) f.get(null);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -230,7 +230,7 @@ public class NMSBinding17_1 implements INMSBinding {
|
||||
try {
|
||||
BiomeStorage s = (BiomeStorage) getFieldForBiomeStorage(chunk).get(chunk);
|
||||
s.setBiome(x, y, z, (BiomeBase) somethingVeryDirty);
|
||||
} catch (IllegalAccessException e) {
|
||||
} catch (IllegalAccessException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -351,6 +351,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
try {
|
||||
data.add(getLayers().get(i).get(random.nextParallelRNG(i + j), (wx + j) / layers.get(i).getZoom(), j, (wz - j) / layers.get(i).getZoom(), rdata));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -390,7 +391,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
for (int j = 0; j < d; j++) {
|
||||
try {
|
||||
data.add(getLayers().get(i).get(random.nextParallelRNG(i + j), (wx + j) / layers.get(i).getZoom(), j, (wz - j) / layers.get(i).getZoom(), rdata));
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -445,7 +446,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
|
||||
try {
|
||||
data.add(getSeaLayers().get(i).get(random.nextParallelRNG(i + j), (wx + j) / seaLayers.get(i).getZoom(), j, (wz - j) / seaLayers.get(i).getZoom(), rdata));
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class IrisBiomeCustom {
|
||||
String v = (c.startsWith("#") ? c : "#" + c).trim();
|
||||
try {
|
||||
return Color.decode(v).getRGB();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("Error Parsing '''color''', (" + c + ")");
|
||||
}
|
||||
|
||||
|
@ -197,13 +197,13 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
|
||||
try {
|
||||
return Integer.valueOf(string);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
return Double.valueOf(string).intValue();
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.util.Desc;
|
||||
import com.volmit.iris.util.MaxNumber;
|
||||
@ -66,7 +67,8 @@ public class IrisColor {
|
||||
String v = (hex.startsWith("#") ? hex : "#" + hex).trim();
|
||||
try {
|
||||
return Color.decode(v);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ package com.volmit.iris.object;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.*;
|
||||
import lombok.Data;
|
||||
import org.bukkit.Material;
|
||||
@ -167,6 +168,7 @@ public class IrisCompat {
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return def;
|
||||
|
@ -474,7 +474,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
output.getParentFile().mkdirs();
|
||||
try {
|
||||
IO.writeAll(output, j.generateJson());
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -492,7 +492,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
""");
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
Iris.verbose(" Installing Data Pack MCMeta: " + mcm.getPath());
|
||||
|
@ -190,7 +190,7 @@ public class IrisEffect {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -63,7 +64,8 @@ public class IrisEnchantment {
|
||||
}
|
||||
meta.addEnchant(getEnchant(), getLevel(rng), true);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -74,7 +76,7 @@ public class IrisEnchantment {
|
||||
try {
|
||||
return (Enchantment) i.get(null);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
e.printStackTrace();Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.util.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -63,6 +64,7 @@ public class IrisJigsawPiece extends IrisRegistrant {
|
||||
BlockVector v = IrisObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
return Math.max(v.getBlockX(), v.getBlockZ());
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -75,7 +77,7 @@ public class IrisJigsawPiece extends IrisRegistrant {
|
||||
try {
|
||||
BlockVector v = IrisObject.sampleSize(getLoader().getObjectLoader().findFile(getObject()));
|
||||
return Math.max(Math.max(v.getBlockX(), v.getBlockZ()), v.getBlockY());
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ public class IrisLoot {
|
||||
|
||||
is.setItemMeta(m);
|
||||
return is;
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ public class IrisLoot {
|
||||
m.setLore(lore);
|
||||
is.setItemMeta(m);
|
||||
return is;
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
for (int i = 0; i < size; i++) {
|
||||
getStates().put(new BlockVector(din.readShort(), din.readShort(), din.readShort()), TileData.read(din));
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -319,7 +319,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
try {
|
||||
read(fin);
|
||||
fin.close();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
fin.close();
|
||||
fin = new FileInputStream(file);
|
||||
readLegacy(fin);
|
||||
@ -572,7 +572,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
try {
|
||||
d = getBlocks().get(g);
|
||||
tile = getStates().get(g);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (cme)");
|
||||
d = AIR;
|
||||
}
|
||||
@ -665,7 +665,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
|
||||
try {
|
||||
d = getBlocks().get(g);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (stilt cme)");
|
||||
d = AIR;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.Desc;
|
||||
import com.volmit.iris.util.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -284,7 +285,8 @@ public class IrisObjectRotation {
|
||||
Axis a = !g.getAxes().contains(Axis.Y) ? axisFor(t) : axisFor2D(t);
|
||||
((Orientable) d).setAxis(a);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class IrisPotionEffect {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.object.tile;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.block.Block;
|
||||
@ -67,6 +68,7 @@ public interface TileData<T extends TileState> extends Cloneable {
|
||||
s.fromBukkitTry(block.getState());
|
||||
return s;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -88,7 +90,7 @@ public interface TileData<T extends TileState> extends Cloneable {
|
||||
//noinspection unchecked
|
||||
toBukkit((T) t);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -100,7 +102,7 @@ public interface TileData<T extends TileState> extends Cloneable {
|
||||
//noinspection unchecked
|
||||
fromBukkit((T) t);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class DirectWorldWriter {
|
||||
|
||||
MCAUtil.write(writeBuffer.get(i), f, true);
|
||||
writeBuffer.remove(i);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
@ -158,7 +158,7 @@ public class DirectWorldWriter {
|
||||
}
|
||||
|
||||
return getBlockData(tag);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
return B.get("AIR");
|
||||
|
@ -267,7 +267,7 @@ public class Pregenerator implements Listener {
|
||||
try {
|
||||
Files.move(from.toPath(), to.toPath());
|
||||
return true;
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ public class Pregenerator implements Listener {
|
||||
IO.copyFile(from, to);
|
||||
from.delete();
|
||||
return true;
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -348,7 +348,7 @@ public class Pregenerator implements Listener {
|
||||
|
||||
try {
|
||||
q.pop().run();
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -511,7 +511,7 @@ public class Pregenerator implements Listener {
|
||||
while (order.isNotEmpty()) {
|
||||
try {
|
||||
order.pop().run();
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -580,7 +580,7 @@ public class Pregenerator implements Listener {
|
||||
if (file != null) {
|
||||
try {
|
||||
frame.setIconImage(ImageIO.read(file));
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException ignored) {Iris.reportError(ignored);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.data.mca;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.data.nbt.tag.ByteArrayTag;
|
||||
import com.volmit.iris.scaffold.data.nbt.tag.CompoundTag;
|
||||
import com.volmit.iris.scaffold.data.nbt.tag.ListTag;
|
||||
@ -141,6 +142,7 @@ public class Section {
|
||||
int paletteIndex = getPaletteIndex(index);
|
||||
return palette.get(paletteIndex);
|
||||
} catch (Throwable ignored) {
|
||||
Iris.reportError(ignored);
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.data.nbt.io;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.data.io.MaxDepthIO;
|
||||
import com.volmit.iris.scaffold.data.nbt.tag.*;
|
||||
|
||||
@ -86,24 +87,25 @@ public final class SNBTParser implements MaxDepthIO {
|
||||
try {
|
||||
return new ByteTag(Byte.parseByte(s.substring(0, s.length() - 1)));
|
||||
} catch (NumberFormatException ex) {
|
||||
Iris.reportError(ex);
|
||||
throw ptr.parseException("byte not in range: \"" + s.substring(0, s.length() - 1) + "\"");
|
||||
}
|
||||
} else if (SHORT_LITERAL_PATTERN.matcher(s).matches()) {
|
||||
try {
|
||||
return new ShortTag(Short.parseShort(s.substring(0, s.length() - 1)));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException("short not in range: \"" + s.substring(0, s.length() - 1) + "\"");
|
||||
}
|
||||
} else if (LONG_LITERAL_PATTERN.matcher(s).matches()) {
|
||||
try {
|
||||
return new LongTag(Long.parseLong(s.substring(0, s.length() - 1)));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException("long not in range: \"" + s.substring(0, s.length() - 1) + "\"");
|
||||
}
|
||||
} else if (INT_LITERAL_PATTERN.matcher(s).matches()) {
|
||||
try {
|
||||
return new IntTag(Integer.parseInt(s));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException("int not in range: \"" + s.substring(0, s.length() - 1) + "\"");
|
||||
}
|
||||
} else if (DOUBLE_LITERAL_PATTERN.matcher(s).matches()) {
|
||||
@ -150,7 +152,7 @@ public final class SNBTParser implements MaxDepthIO {
|
||||
Tag<?> element = parseAnything(decrementMaxDepth(maxDepth));
|
||||
try {
|
||||
list.addUnchecked(element);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
} catch (IllegalArgumentException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException(ex.getMessage());
|
||||
}
|
||||
if (!ptr.nextArrayElement()) {
|
||||
@ -185,7 +187,7 @@ public final class SNBTParser implements MaxDepthIO {
|
||||
if (NUMBER_PATTERN.matcher(s).matches()) {
|
||||
try {
|
||||
byteList.add(Byte.parseByte(s));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException("byte not in range: \"" + s + "\"");
|
||||
}
|
||||
} else {
|
||||
@ -211,7 +213,7 @@ public final class SNBTParser implements MaxDepthIO {
|
||||
if (NUMBER_PATTERN.matcher(s).matches()) {
|
||||
try {
|
||||
intList.add(Integer.parseInt(s));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException("int not in range: \"" + s + "\"");
|
||||
}
|
||||
} else {
|
||||
@ -233,7 +235,7 @@ public final class SNBTParser implements MaxDepthIO {
|
||||
if (NUMBER_PATTERN.matcher(s).matches()) {
|
||||
try {
|
||||
longList.add(Long.parseLong(s));
|
||||
} catch (NumberFormatException ex) {
|
||||
} catch (NumberFormatException ex) {Iris.reportError(ex);
|
||||
throw ptr.parseException("long not in range: \"" + s + "\"");
|
||||
}
|
||||
} else {
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.manager.gui.Renderer;
|
||||
import com.volmit.iris.object.*;
|
||||
@ -193,6 +194,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
block.setType(Material.AIR, false);
|
||||
block.setBlockData(data, true);
|
||||
} catch (Exception e) {
|
||||
Iris.reportError(e);
|
||||
// Issue when adding block data. Suppress massive warnings and stack-traces to console.
|
||||
}
|
||||
}
|
||||
@ -217,7 +219,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
try {
|
||||
InventoryHolder m = (InventoryHolder) block.getState();
|
||||
addItems(false, m.getInventory(), rx, tables, slot, x, y, z, 15);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -255,7 +257,7 @@ public interface Engine extends DataProvider, Fallible, GeneratorAccess, LootPro
|
||||
try {
|
||||
Arrays.parallelSort(nitems, (a, b) -> rng.nextInt());
|
||||
break;
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public interface EngineComponent {
|
||||
if (this instanceof Listener) {
|
||||
Iris.instance.unregisterListener((Listener) this);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
new MortarSender(i, Iris.instance.getTag()).sendMessage("Dimension Hotloaded");
|
||||
i.playSound(i.getLocation(), Sound.ITEM_BOTTLE_FILL, 1f, 1.25f);
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
});
|
||||
@ -131,7 +131,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
J.a(() -> hotloader.check());
|
||||
getComposite().clean();
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -306,7 +306,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
populators.clear();
|
||||
populators.addAll(compound.getPopulators());
|
||||
hotloader = new ReactiveFolder(data.getDataFolder(), (a, c, d) -> hotload());
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error("FAILED TO INITIALIZE DIMENSION FROM " + world.toString());
|
||||
}
|
||||
@ -350,7 +350,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
try {
|
||||
Object o = getBP(clazz, clazzSG, clazzBP, nmsWorld, blockPosToTest, chunkGenerator);
|
||||
future.complete(o);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
future.complete(e);
|
||||
}
|
||||
@ -371,7 +371,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
strongholds.add(ipos);
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -386,7 +386,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
getComposite().saveEngineMetadata();
|
||||
});
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
strongholds.add(new IrisPosition(1337, 32, -1337));
|
||||
metadata.setStrongholdPositions(strongholds);
|
||||
Iris.warn("Couldn't properly find the stronghold position for this world. Is this headless mode? Are you not using 1.16 or higher?");
|
||||
@ -907,7 +907,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
public boolean isClosed() {
|
||||
try {
|
||||
return getComposite().getEngine(0).isClosed();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -916,7 +916,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
public EngineTarget getTarget() {
|
||||
try {
|
||||
return getComposite().getEngine(0).getTarget();
|
||||
} catch (NullPointerException e) {
|
||||
} catch (NullPointerException e) {Iris.reportError(e);
|
||||
Iris.info("Failed to get composite engine. Please re-create the world in case you notice issues");
|
||||
return null;
|
||||
}
|
||||
@ -955,7 +955,7 @@ public class EngineCompositeGenerator extends ChunkGenerator implements IrisAcce
|
||||
|
||||
try {
|
||||
dim.getDimensionalComposite().forEach((m) -> IrisDataManager.loadAnyDimension(m.getDimension()).getAllAnyBiomes().forEach((i) -> v.put(i.getLoadKey(), i)));
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable ignored) {Iris.reportError(ignored);
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.generator.actuator.IrisTerrainActuator;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
@ -141,6 +142,7 @@ public interface EngineCompound extends Listener, Hotloadable, DataProvider {
|
||||
try {
|
||||
dim.getDimensionalComposite().forEach((m) -> getData().getDimensionLoader().load(m.getDimension()).getAllBiomes(this).forEach((i) -> v.put(i.getLoadKey(), i)));
|
||||
} catch (Throwable ignored) {
|
||||
Iris.reportError(ignored);
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
package com.volmit.iris.scaffold.engine;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.IrisPosition;
|
||||
import com.volmit.iris.util.IO;
|
||||
import lombok.Data;
|
||||
@ -38,6 +39,7 @@ public class EngineData {
|
||||
f.getParentFile().mkdirs();
|
||||
IO.writeAll(f, new Gson().toJson(this));
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -46,7 +48,7 @@ public class EngineData {
|
||||
try {
|
||||
f.getParentFile().mkdirs();
|
||||
return new Gson().fromJson(IO.readAll(f), EngineData.class);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
});
|
||||
|
||||
getEngine().getMetrics().getParallaxInsert().put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("Failed to insert parallax at chunk " + (x >> 4) + " " + (z >> 4));
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -205,7 +205,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.warn("Failed to read positional features in chunk " + (i + cx) + " " + (j + cz) + "(" + e.getClass().getSimpleName() + ")");
|
||||
}
|
||||
@ -278,7 +278,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
getParallaxAccess().setChunkGenerated(x, z);
|
||||
p.end();
|
||||
getEngine().getMetrics().getParallax().put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("Failed to generate parallax in " + x + " " + z);
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -432,7 +432,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
if (rng.chance(i.getChance() + rng.d(-0.005, 0.005)) && rng.chance(getComplex().getObjectChanceStream().get(x << 4, z << 4))) {
|
||||
try {
|
||||
place(rng, x << 4, z << 4, i);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("Failed to place objects in the following biome: " + biome.getName());
|
||||
Iris.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
Iris.error("Are these objects missing?");
|
||||
@ -449,7 +449,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
if (rng.chance(i.getChance() + rng.d(-0.005, 0.005)) && rng.chance(getComplex().getObjectChanceStream().get(x << 4, z << 4))) {
|
||||
try {
|
||||
place(rng, x << 4, z << 4, i);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("Failed to place objects in the following biome: " + biome.getName());
|
||||
Iris.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
Iris.error("Are these objects missing?");
|
||||
@ -620,7 +620,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
if (getEngine().getDimension().getStronghold() != null) {
|
||||
try {
|
||||
jig = Math.max(jig, getData().getJigsawStructureLoader().load(getEngine().getDimension().getStronghold()).getMaxDimension());
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.error("THIS IS THE ONE");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -639,8 +639,8 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
|
||||
try {
|
||||
return IrisObject.sampleSize(getData().getObjectLoader().findFile(i));
|
||||
} catch (IOException ioException) {
|
||||
ioException.printStackTrace();
|
||||
} catch (IOException ex) {Iris.reportError(ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -659,7 +659,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
synchronized (zg) {
|
||||
zg.getAndSet(Math.max(bv.getBlockZ(), zg.get()));
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable ed) {Iris.reportError(ed);
|
||||
|
||||
}
|
||||
});
|
||||
@ -677,7 +677,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
|
||||
try {
|
||||
return IrisObject.sampleSize(getData().getObjectLoader().findFile(j));
|
||||
} catch (IOException ioException) {
|
||||
} catch (IOException ioException) {Iris.reportError(ioException);
|
||||
ioException.printStackTrace();
|
||||
}
|
||||
|
||||
@ -697,7 +697,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
||||
synchronized (zg) {
|
||||
zg.getAndSet((int) Math.max(Math.ceil(bv.getBlockZ() * ms), zg.get()));
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable ee) {Iris.reportError(ee);
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.object.IrisEffect;
|
||||
import com.volmit.iris.object.IrisRegion;
|
||||
@ -52,7 +53,8 @@ public class EnginePlayer {
|
||||
for (IrisEffect j : region.getEffects()) {
|
||||
try {
|
||||
j.apply(player, getEngine());
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -62,7 +64,7 @@ public class EnginePlayer {
|
||||
for (IrisEffect j : biome.getEffects()) {
|
||||
try {
|
||||
j.apply(player, getEngine());
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@ -81,7 +83,7 @@ public class EnginePlayer {
|
||||
lastSample = M.ms();
|
||||
sampleBiomeRegion();
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,11 +18,14 @@
|
||||
|
||||
package com.volmit.iris.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
public interface Fallible {
|
||||
default void fail(String error) {
|
||||
try {
|
||||
throw new RuntimeException();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
fail(error, e);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.engine;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.object.IrisRegion;
|
||||
@ -129,11 +130,12 @@ public interface IrisAccess extends Hotloadable, DataProvider {
|
||||
|
||||
tries.getAndIncrement();
|
||||
} catch (Throwable ex) {
|
||||
Iris.reportError(ex);
|
||||
ex.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
@ -193,7 +195,7 @@ public interface IrisAccess extends Hotloadable, DataProvider {
|
||||
}
|
||||
|
||||
tries.getAndIncrement();
|
||||
} catch (Throwable xe) {
|
||||
} catch (Throwable xe) {Iris.reportError(xe);
|
||||
xe.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.hunk.io;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.util.Function3;
|
||||
|
||||
@ -42,6 +43,7 @@ public abstract class BasicHunkIOAdapter<T> implements HunkIOAdapter<T> {
|
||||
dos.writeShort(z + Short.MIN_VALUE);
|
||||
write(w, dos);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
failure.set(true);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.hunk.io;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.*;
|
||||
|
||||
import java.io.File;
|
||||
@ -50,7 +51,8 @@ public class HunkRegion {
|
||||
NBTInputStream in = new NBTInputStream(new FileInputStream(f));
|
||||
compound = fix((CompoundTag) in.readTag());
|
||||
in.close();
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class HunkRegionSlice<T> {
|
||||
|
||||
try {
|
||||
lock.withNasty(i.getX(), i.getZ(), () -> save.remove(i));
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable eer) {Iris.reportError(eer);
|
||||
|
||||
}
|
||||
}
|
||||
@ -128,7 +128,7 @@ public class HunkRegionSlice<T> {
|
||||
|
||||
try {
|
||||
return adapter.read(factory, (ByteArrayTag) t);
|
||||
} catch (IOException xe) {
|
||||
} catch (IOException xe) {Iris.reportError(xe);
|
||||
e.set(xe);
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class HunkRegionSlice<T> {
|
||||
public void save(Hunk<T> region, int x, int z) {
|
||||
try {
|
||||
lock.withIO(x, z, () -> write(region, x, z));
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -209,7 +209,7 @@ public class HunkRegionSlice<T> {
|
||||
if (contains(x, z)) {
|
||||
try {
|
||||
v = read(x, z);
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.hunk.io;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.data.DataPalette;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.util.Function3;
|
||||
@ -54,6 +55,7 @@ public abstract class PaletteHunkIOAdapter<T> implements HunkIOAdapter<T> {
|
||||
dos.writeShort(z + Short.MIN_VALUE);
|
||||
dos.writeShort(palette.getIndex(w) + Short.MIN_VALUE);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
failure.set(true);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.hunk.io;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.tile.TileData;
|
||||
import org.bukkit.block.TileState;
|
||||
|
||||
@ -35,8 +36,9 @@ public class TileDataHunkIOAdapter extends PaletteHunkIOAdapter<TileData<? exten
|
||||
public TileData<? extends TileState> read(DataInputStream din) throws IOException {
|
||||
try {
|
||||
return TileData.read(din);
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
throw new IOException();
|
||||
}
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ public class LightingChunk {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
} catch (Throwable t) {Iris.reportError(t);
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import com.bergerkiller.bukkit.common.utils.WorldUtil;
|
||||
import com.bergerkiller.bukkit.common.wrappers.BlockData;
|
||||
import com.bergerkiller.bukkit.common.wrappers.ChunkSection;
|
||||
import com.bergerkiller.generated.net.minecraft.server.NibbleArrayHandle;
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@ -305,6 +306,7 @@ public class LightingCube {
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Iris.reportError(t);
|
||||
CompletableFuture<Boolean> exceptionally = new CompletableFuture<>();
|
||||
exceptionally.completeExceptionally(t);
|
||||
return exceptionally;
|
||||
|
@ -412,7 +412,7 @@ public class LightingService extends AsyncTask {
|
||||
while (paused) {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
} catch (InterruptedException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
synchronized (tasks) {
|
||||
@ -468,7 +468,7 @@ public class LightingService extends AsyncTask {
|
||||
// Process the task
|
||||
try {
|
||||
currentTask.process();
|
||||
} catch (Throwable t) {
|
||||
} catch (Throwable t) {Iris.reportError(t);
|
||||
t.printStackTrace();
|
||||
Iris.error("Failed to process task: " + currentTask.getStatus());
|
||||
}
|
||||
|
@ -239,8 +239,8 @@ public class LightingTaskBatch implements LightingTask {
|
||||
future.get(200, TimeUnit.MILLISECONDS);
|
||||
return true;
|
||||
} catch (InterruptedException | TimeoutException e1) {
|
||||
// Ignore
|
||||
} catch (ExecutionException ex) {
|
||||
Iris.reportError(e1);
|
||||
} catch (ExecutionException ex) {Iris.reportError(ex);
|
||||
ex.printStackTrace();
|
||||
Iris.error("Error while processing");
|
||||
return false;
|
||||
@ -441,15 +441,15 @@ public class LightingTaskBatch implements LightingTask {
|
||||
try {
|
||||
future.get(200, TimeUnit.MILLISECONDS);
|
||||
break;
|
||||
} catch (TimeoutException e) {
|
||||
} catch (TimeoutException e) {Iris.reportError(e);
|
||||
if (this.aborted) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
} catch (InterruptedException e) {Iris.reportError(e);
|
||||
// Ignore
|
||||
} catch (ExecutionException e) {
|
||||
} catch (ExecutionException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error("Failed to apply lighting data for " + getShortStatus());
|
||||
|
||||
|
@ -20,6 +20,7 @@ package com.volmit.iris.scaffold.lighting;
|
||||
|
||||
import com.bergerkiller.bukkit.common.utils.CommonUtil;
|
||||
import com.bergerkiller.bukkit.common.wrappers.LongHashSet;
|
||||
import com.volmit.iris.Iris;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@ -90,6 +91,7 @@ public class LightingTaskWorld implements LightingTask {
|
||||
}
|
||||
regionsLoadedFuture.complete(null);
|
||||
} catch (Throwable ex) {
|
||||
Iris.reportError(ex);
|
||||
regionsLoadedFuture.completeExceptionally(ex);
|
||||
}
|
||||
});
|
||||
@ -97,9 +99,9 @@ public class LightingTaskWorld implements LightingTask {
|
||||
// Wait until region list is loaded synchronously
|
||||
try {
|
||||
regionsLoadedFuture.get();
|
||||
} catch (InterruptedException ex) {
|
||||
} catch (InterruptedException ex) {Iris.reportError(ex);
|
||||
// Ignore
|
||||
} catch (ExecutionException ex) {
|
||||
} catch (ExecutionException ex) {Iris.reportError(ex);
|
||||
throw new RuntimeException("Failed to load regions", ex.getCause());
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.parallax;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.object.tile.TileData;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.scaffold.hunk.io.HunkIOAdapter;
|
||||
@ -117,6 +118,7 @@ public class ParallaxRegion extends HunkRegion {
|
||||
try {
|
||||
meta = metaAdapter.read((x, y, z) -> Hunk.newArrayHunk(32, 1, 32), (ByteArrayTag) t);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -143,7 +145,7 @@ public class ParallaxRegion extends HunkRegion {
|
||||
try {
|
||||
getCompound().getValue().put("meta", meta.writeByteArrayTag(metaAdapter, "meta"));
|
||||
dirtyMeta = false;
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.parallax;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.object.tile.TileData;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
@ -56,7 +57,8 @@ public class ParallaxWorld implements ParallaxAccess {
|
||||
for (ParallaxRegion i : loadedRegions.values()) {
|
||||
m += i.getChunkCount();
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -75,7 +77,7 @@ public class ParallaxWorld implements ParallaxAccess {
|
||||
public void save(ParallaxRegion region) {
|
||||
try {
|
||||
region.save();
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -220,7 +222,7 @@ public class ParallaxWorld implements ParallaxAccess {
|
||||
cc += i.cleanup(c);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.parallel;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.KList;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@ -76,6 +77,7 @@ public class BurstExecutor {
|
||||
futures.clear();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.parallel;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.hunk.Hunk;
|
||||
import com.volmit.iris.util.IORunnable;
|
||||
import com.volmit.iris.util.NastyRunnable;
|
||||
@ -81,7 +82,8 @@ public class GridLock {
|
||||
public boolean tryLock(int x, int z, long timeout) {
|
||||
try {
|
||||
return locks.get(x, 0, z).tryLock(timeout, TimeUnit.MILLISECONDS);
|
||||
} catch (InterruptedException ignored) {
|
||||
} catch (InterruptedException e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -36,7 +36,7 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
try {
|
||||
return of(f, Interpolated.DOUBLE);
|
||||
} catch (IncompatibleClassChangeError e) {
|
||||
Iris.warn(f.toString());
|
||||
Iris.warn(f.toString());Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.scaffold.stream.utility;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.scaffold.stream.BasicStream;
|
||||
import com.volmit.iris.scaffold.stream.ProceduralStream;
|
||||
import com.volmit.iris.util.Form;
|
||||
@ -60,7 +61,8 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
T t = getTypedSource().get(x, z);
|
||||
try {
|
||||
metrics.put(p.getMilliseconds());
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
return t;
|
||||
@ -72,7 +74,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
T t = getTypedSource().get(x, y, z);
|
||||
try {
|
||||
metrics.put(p.getMilliseconds());
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
}
|
||||
|
||||
return t;
|
||||
|
@ -19,6 +19,7 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDoubleArray;
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
/**
|
||||
* Provides an incredibly fast averaging object. It swaps values from a sum
|
||||
@ -71,7 +72,8 @@ public class AtomicAverage {
|
||||
lastSum = (lastSum - current) + i;
|
||||
values.set(cursor, i);
|
||||
cursor = cursor + 1 < size() ? cursor + 1 : 0;
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class B {
|
||||
Material mm = Material.valueOf(bx);
|
||||
materialCache.put(bx, mm);
|
||||
return mm;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
nullMaterialCache.add(bx);
|
||||
return null;
|
||||
}
|
||||
@ -108,7 +108,7 @@ public class B {
|
||||
}
|
||||
|
||||
return bdx;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
Iris.warn("Unknown Block Data '" + bdxf + "'");
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ public class B {
|
||||
BlockData bx = Bukkit.createBlockData(ix);
|
||||
blockDataCache.put(ix, bx);
|
||||
return bx;
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ public class B {
|
||||
try {
|
||||
BlockData bd = Material.valueOf(i).createBlockData();
|
||||
blockDataCache.put(ix, bd);
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
@ -373,6 +374,7 @@ public enum C {
|
||||
try {
|
||||
return BY_CHAR.get(code);
|
||||
} catch (Exception e) {
|
||||
Iris.reportError(e);
|
||||
return C.WHITE;
|
||||
}
|
||||
}
|
||||
@ -390,7 +392,7 @@ public enum C {
|
||||
Validate.isTrue(code.length() > 0, "Code must have at least one char");
|
||||
|
||||
return BY_CHAR.get(code.charAt(0));
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return C.WHITE;
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.Optional;
|
||||
@ -66,6 +67,7 @@ public final class FastReflection {
|
||||
try {
|
||||
return Optional.of(Class.forName(className));
|
||||
} catch (ClassNotFoundException e) {
|
||||
Iris.reportError(e);
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
@ -87,6 +89,7 @@ public class GroupedExecutor {
|
||||
try {
|
||||
r.run();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.DigestInputStream;
|
||||
@ -95,6 +97,7 @@ public class IO {
|
||||
MessageDigest d = MessageDigest.getInstance("SHA-256");
|
||||
return bytesToHex(d.digest(b.getBytes(StandardCharsets.UTF_8)));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -108,7 +111,7 @@ public class IO {
|
||||
fullTransfer(din, new VoidOutputStream(), 8192);
|
||||
din.close();
|
||||
return bytesToHex(din.getMessageDigest().digest());
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -304,7 +307,7 @@ public class IO {
|
||||
v.accept(in);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
} catch (Exception ex) {Iris.reportError(ex);
|
||||
x = ex.getCause();
|
||||
} finally {
|
||||
file.close();
|
||||
@ -326,7 +329,7 @@ public class IO {
|
||||
FileReader fr;
|
||||
try {
|
||||
fr = new FileReader(f);
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
throw e;
|
||||
}
|
||||
BufferedReader bu = new BufferedReader(fr);
|
||||
@ -481,7 +484,7 @@ public class IO {
|
||||
if (input != null) {
|
||||
input.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
@ -499,7 +502,7 @@ public class IO {
|
||||
if (output != null) {
|
||||
output.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
@ -517,7 +520,7 @@ public class IO {
|
||||
if (input != null) {
|
||||
input.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
@ -535,7 +538,7 @@ public class IO {
|
||||
if (output != null) {
|
||||
output.close();
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
@ -47,7 +48,8 @@ public class IrisLock {
|
||||
}
|
||||
try {
|
||||
lock.unlock();
|
||||
} catch (Throwable ignored) {
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class J {
|
||||
g.run();
|
||||
return true;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
} catch (NullPointerException e) {Iris.reportError(e);
|
||||
// TODO: Fix this because this is just a suppression for an NPE on g
|
||||
return false;
|
||||
}
|
||||
@ -70,7 +70,7 @@ public class J {
|
||||
e.submit(() -> {
|
||||
try {
|
||||
a.run();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
System.out.println("Failed to run async task");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class J {
|
||||
e.submit(() -> {
|
||||
try {
|
||||
a.run();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
System.out.println("Failed to run async task");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class J {
|
||||
public static <R> R attemptResult(NastyFuture<R> r, R onError) {
|
||||
try {
|
||||
return r.run();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ public class J {
|
||||
public static <T, R> R attemptFunction(NastyFunction<T, R> r, T param, R onError) {
|
||||
try {
|
||||
return r.run(param);
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ public class J {
|
||||
public static Throwable attemptCatch(NastyRunnable r) {
|
||||
try {
|
||||
r.run();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
return e;
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ public class J {
|
||||
public static <T> T attempt(Supplier<T> t, T i) {
|
||||
try {
|
||||
return t.get();
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
@ -222,6 +224,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
try {
|
||||
return object instanceof Number ? ((Number) object).doubleValue() : Double.parseDouble((String) object);
|
||||
} catch (Exception e) {
|
||||
Iris.reportError(e);
|
||||
throw new JSONException("JSONArray[" + index + "] is not a number.");
|
||||
}
|
||||
}
|
||||
@ -258,7 +261,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
Object object = this.get(index);
|
||||
try {
|
||||
return new BigDecimal(object.toString());
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONArray[" + index + "] could not convert to BigDecimal.");
|
||||
}
|
||||
}
|
||||
@ -275,7 +278,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
Object object = this.get(index);
|
||||
try {
|
||||
return new BigInteger(object.toString());
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONArray[" + index + "] could not convert to BigInteger.");
|
||||
}
|
||||
}
|
||||
@ -291,7 +294,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
Object object = this.get(index);
|
||||
try {
|
||||
return object instanceof Number ? ((Number) object).intValue() : Integer.parseInt((String) object);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONArray[" + index + "] is not a number.");
|
||||
}
|
||||
}
|
||||
@ -340,7 +343,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
Object object = this.get(index);
|
||||
try {
|
||||
return object instanceof Number ? ((Number) object).longValue() : Long.parseLong((String) object);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONArray[" + index + "] is not a number.");
|
||||
}
|
||||
}
|
||||
@ -435,7 +438,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public boolean optBoolean(int index, boolean defaultValue) {
|
||||
try {
|
||||
return this.getBoolean(index);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -464,7 +467,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public double optDouble(int index, double defaultValue) {
|
||||
try {
|
||||
return this.getDouble(index);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -493,7 +496,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public int optInt(int index, int defaultValue) {
|
||||
try {
|
||||
return this.getInt(index);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -531,9 +534,9 @@ public class JSONArray implements Iterable<Object> {
|
||||
return myE;
|
||||
}
|
||||
return Enum.valueOf(clazz, val.toString());
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalArgumentException e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
} catch (NullPointerException e) {
|
||||
} catch (NullPointerException e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -550,7 +553,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public BigInteger optBigInteger(int index, BigInteger defaultValue) {
|
||||
try {
|
||||
return this.getBigInteger(index);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -567,7 +570,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public BigDecimal optBigDecimal(int index, BigDecimal defaultValue) {
|
||||
try {
|
||||
return this.getBigDecimal(index);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -621,7 +624,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public long optLong(int index, long defaultValue) {
|
||||
try {
|
||||
return this.getLong(index);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -934,7 +937,7 @@ public class JSONArray implements Iterable<Object> {
|
||||
public String toString() {
|
||||
try {
|
||||
return this.toString(0);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
@ -157,7 +159,8 @@ public class JSONObject {
|
||||
for (int i = 0; i < names.length; i += 1) {
|
||||
try {
|
||||
this.putOnce(names[i], jo.opt(names[i]));
|
||||
} catch (Exception ignore) {
|
||||
} catch (Exception e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -280,7 +283,7 @@ public class JSONObject {
|
||||
String name = names[i];
|
||||
try {
|
||||
this.putOpt(name, c.getField(name).get(object));
|
||||
} catch (Exception ignore) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -488,7 +491,7 @@ public class JSONObject {
|
||||
Object object = this.get(key);
|
||||
try {
|
||||
return new BigInteger(object.toString());
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONObject[" + quote(key) + "] could not be converted to BigInteger.");
|
||||
}
|
||||
}
|
||||
@ -505,7 +508,7 @@ public class JSONObject {
|
||||
Object object = this.get(key);
|
||||
try {
|
||||
return new BigDecimal(object.toString());
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONObject[" + quote(key) + "] could not be converted to BigDecimal.");
|
||||
}
|
||||
}
|
||||
@ -522,7 +525,7 @@ public class JSONObject {
|
||||
Object object = this.get(key);
|
||||
try {
|
||||
return object instanceof Number ? ((Number) object).doubleValue() : Double.parseDouble((String) object);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONObject[" + quote(key) + "] is not a number.");
|
||||
}
|
||||
}
|
||||
@ -539,7 +542,7 @@ public class JSONObject {
|
||||
Object object = this.get(key);
|
||||
try {
|
||||
return object instanceof Number ? ((Number) object).intValue() : Integer.parseInt((String) object);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONObject[" + quote(key) + "] is not an int.");
|
||||
}
|
||||
}
|
||||
@ -586,7 +589,7 @@ public class JSONObject {
|
||||
Object object = this.get(key);
|
||||
try {
|
||||
return object instanceof Number ? ((Number) object).longValue() : Long.parseLong((String) object);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException("JSONObject[" + quote(key) + "] is not a long.");
|
||||
}
|
||||
}
|
||||
@ -815,9 +818,9 @@ public class JSONObject {
|
||||
return myE;
|
||||
}
|
||||
return Enum.valueOf(clazz, val.toString());
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalArgumentException e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
} catch (NullPointerException e) {
|
||||
} catch (NullPointerException e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -845,7 +848,7 @@ public class JSONObject {
|
||||
public boolean optBoolean(String key, boolean defaultValue) {
|
||||
try {
|
||||
return this.getBoolean(key);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -874,7 +877,7 @@ public class JSONObject {
|
||||
public BigInteger optBigInteger(String key, BigInteger defaultValue) {
|
||||
try {
|
||||
return this.getBigInteger(key);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -891,7 +894,7 @@ public class JSONObject {
|
||||
public BigDecimal optBigDecimal(String key, BigDecimal defaultValue) {
|
||||
try {
|
||||
return this.getBigDecimal(key);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -908,7 +911,7 @@ public class JSONObject {
|
||||
public double optDouble(String key, double defaultValue) {
|
||||
try {
|
||||
return this.getDouble(key);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -937,7 +940,7 @@ public class JSONObject {
|
||||
public int optInt(String key, int defaultValue) {
|
||||
try {
|
||||
return this.getInt(key);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -990,7 +993,7 @@ public class JSONObject {
|
||||
public long optLong(String key, long defaultValue) {
|
||||
try {
|
||||
return this.getLong(key);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
@ -1056,7 +1059,7 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1217,7 +1220,7 @@ public class JSONObject {
|
||||
synchronized (sw.getBuffer()) {
|
||||
try {
|
||||
return quote(string, sw).toString();
|
||||
} catch (IOException ignored) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
// will never happen - we are writing to a string writer
|
||||
return "";
|
||||
}
|
||||
@ -1328,7 +1331,7 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (Throwable exception) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1378,7 +1381,7 @@ public class JSONObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
}
|
||||
}
|
||||
return string;
|
||||
@ -1439,7 +1442,7 @@ public class JSONObject {
|
||||
public String toString() {
|
||||
try {
|
||||
return this.toString(0);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1493,7 +1496,7 @@ public class JSONObject {
|
||||
Object object;
|
||||
try {
|
||||
object = ((JSONString) value).toJSONString();
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
if (object instanceof String) {
|
||||
@ -1562,7 +1565,7 @@ public class JSONObject {
|
||||
return object.toString();
|
||||
}
|
||||
return new JSONObject(object);
|
||||
} catch (Exception exception) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1605,7 +1608,7 @@ public class JSONObject {
|
||||
Object o;
|
||||
try {
|
||||
o = ((JSONString) value).toJSONString();
|
||||
} catch (Exception e) {
|
||||
} catch (Exception e) {Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
writer.write(o != null ? o.toString() : quote(value.toString()));
|
||||
@ -1671,8 +1674,8 @@ public class JSONObject {
|
||||
}
|
||||
writer.write('}');
|
||||
return writer;
|
||||
} catch (IOException exception) {
|
||||
throw new JSONException(exception);
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
@ -140,8 +142,9 @@ public class JSONTokener {
|
||||
} else {
|
||||
try {
|
||||
c = this.reader.read();
|
||||
} catch (IOException exception) {
|
||||
throw new JSONException(exception);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
|
||||
if (c <= 0) { // End of stream
|
||||
@ -395,8 +398,8 @@ public class JSONTokener {
|
||||
return c;
|
||||
}
|
||||
} while (c != to);
|
||||
} catch (IOException exception) {
|
||||
throw new JSONException(exception);
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
this.back();
|
||||
return c;
|
||||
|
@ -19,6 +19,8 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
||||
@ -114,6 +116,7 @@ public class JSONWriter {
|
||||
}
|
||||
this.writer.write(string);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
if (this.mode == 'o') {
|
||||
@ -160,7 +163,7 @@ public class JSONWriter {
|
||||
this.pop(mode);
|
||||
try {
|
||||
this.writer.write(c);
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
this.comma = true;
|
||||
@ -213,7 +216,7 @@ public class JSONWriter {
|
||||
this.comma = false;
|
||||
this.mode = 'o';
|
||||
return this;
|
||||
} catch (IOException e) {
|
||||
} catch (IOException e) {Iris.reportError(e);
|
||||
throw new JSONException(e);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
@ -63,6 +65,7 @@ public class JarScanner {
|
||||
Class<?> clazz = Class.forName(c);
|
||||
classes.add(clazz);
|
||||
} catch (ClassNotFoundException e) {
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Enumeration;
|
||||
@ -57,6 +59,7 @@ public class KMap<K, V> extends ConcurrentHashMap<K, V> {
|
||||
|
||||
s.get(k).add(vs);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class LinkedTerrainChunk implements TerrainChunk {
|
||||
private ChunkData createChunkData(int maxHeight) {
|
||||
try {
|
||||
return Bukkit.createChunkData(new HeightedFakeWorld(maxHeight));
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,9 @@ public abstract class Looper extends Thread {
|
||||
|
||||
//noinspection BusyWait
|
||||
Thread.sleep(m);
|
||||
} catch (InterruptedException e) {
|
||||
} catch (InterruptedException e) {Iris.reportError(e);
|
||||
break;
|
||||
} catch (Throwable e) {
|
||||
} catch (Throwable e) {Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user