mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-07-12 18:04:01 +00:00
Logging Facade
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
|
||||
public class EnginePanic {
|
||||
@@ -35,14 +35,14 @@ public class EnginePanic {
|
||||
|
||||
public static void lastPanic() {
|
||||
for (String i : last.keySet()) {
|
||||
Iris.error("Last Panic " + i + ": " + stuff.get(i));
|
||||
IrisLogging.error("Last Panic " + i + ": " + stuff.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public static void panic() {
|
||||
lastPanic();
|
||||
for (String i : stuff.keySet()) {
|
||||
Iris.error("Engine Panic " + i + ": " + stuff.get(i));
|
||||
IrisLogging.error("Engine Panic " + i + ": " + stuff.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.IrisBiome;
|
||||
@@ -28,6 +27,7 @@ import art.arcane.iris.engine.object.IrisOreGenerator;
|
||||
import art.arcane.iris.engine.object.IrisProceduralObjects;
|
||||
import art.arcane.iris.engine.object.IrisProceduralPlacement;
|
||||
import art.arcane.iris.engine.object.IrisRegion;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.M;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
@@ -64,11 +64,11 @@ public final class GenerationCacheWarmer {
|
||||
|
||||
warmOres(engine.getDimension().getOres(), root, counter, data);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.warn("Generation cache warm pass failed: " + e.getMessage());
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.warn("Generation cache warm pass failed: " + e.getMessage());
|
||||
}
|
||||
|
||||
Iris.debug("[IrisEngine timing] cache warm " + counter[0] + " configs=" + (M.ms() - start) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] cache warm " + counter[0] + " configs=" + (M.ms() - start) + "ms");
|
||||
}
|
||||
|
||||
private static void warmPlacements(KList<IrisObjectPlacement> placements, RNG root, int[] counter, IrisData data) {
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
package art.arcane.iris.engine;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.Cache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.*;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBiome;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBiome;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
@@ -406,9 +406,9 @@ public class IrisComplex implements DataProvider {
|
||||
GeneratorBounds bounds = resolveGeneratorBounds(engine, generators, bx, cachedBounds, localBounds);
|
||||
return bounds.noiseBounds;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error("Failed to sample interpolated biome bounds at " + xx + " " + zz + "...");
|
||||
IrisLogging.error("Failed to sample interpolated biome bounds at " + xx + " " + zz + "...");
|
||||
}
|
||||
|
||||
return ZERO_NOISE_BOUNDS;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.google.gson.Gson;
|
||||
import art.arcane.iris.Iris;
|
||||
@@ -132,7 +133,7 @@ public class IrisEngine implements Engine {
|
||||
generated = new AtomicInteger(0);
|
||||
long _t0 = M.ms();
|
||||
mantle = new IrisEngineMantle(this);
|
||||
Iris.debug("[IrisEngine timing] new IrisEngineMantle=" + (M.ms() - _t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] new IrisEngineMantle=" + (M.ms() - _t0) + "ms");
|
||||
context = new IrisContext(this);
|
||||
cleaning = new AtomicBoolean(false);
|
||||
modeFallbackLogged = new AtomicBoolean(false);
|
||||
@@ -141,29 +142,29 @@ public class IrisEngine implements Engine {
|
||||
getData().dump();
|
||||
getData().clearLists();
|
||||
getTarget().setDimension(getData().getDimensionLoader().load(getDimension().getLoadKey()));
|
||||
Iris.debug("[IrisEngine timing] dump+clearLists+reload=" + (M.ms() - _t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] dump+clearLists+reload=" + (M.ms() - _t0) + "ms");
|
||||
}
|
||||
context.touch();
|
||||
getData().setEngine(this);
|
||||
_t0 = M.ms();
|
||||
getData().loadPrefetch(this);
|
||||
Iris.debug("[IrisEngine timing] loadPrefetch=" + (M.ms() - _t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] loadPrefetch=" + (M.ms() - _t0) + "ms");
|
||||
try {
|
||||
StructureIndexService.writeOnce(getData());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
Iris.info("Engine init: " + target.getWorld().name() + "/" + target.getDimension().getLoadKey() + " seed=" + getSeedManager().getSeed());
|
||||
IrisLogging.info("Engine init: " + target.getWorld().name() + "/" + target.getDimension().getLoadKey() + " seed=" + getSeedManager().getSeed());
|
||||
failing = false;
|
||||
closed = false;
|
||||
art = J.ar(this::tickRandomPlayer, 0);
|
||||
_t0 = M.ms();
|
||||
setupEngine();
|
||||
Iris.debug("[IrisEngine timing] setupEngine total=" + (M.ms() - _t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] setupEngine total=" + (M.ms() - _t0) + "ms");
|
||||
_t0 = M.ms();
|
||||
GenerationCacheWarmer.warm(this);
|
||||
Iris.debug("[IrisEngine timing] cache warm total=" + (M.ms() - _t0) + "ms");
|
||||
Iris.debug("Engine Initialized " + getCacheID());
|
||||
IrisLogging.debug("[IrisEngine timing] cache warm total=" + (M.ms() - _t0) + "ms");
|
||||
IrisLogging.debug("Engine Initialized " + getCacheID());
|
||||
}
|
||||
|
||||
private void verifySeed() {
|
||||
@@ -223,29 +224,29 @@ public class IrisEngine implements Engine {
|
||||
try {
|
||||
generationSessions.activateNextSession();
|
||||
closing.set(false);
|
||||
Iris.debug("Setup Engine " + getCacheID());
|
||||
IrisLogging.debug("Setup Engine " + getCacheID());
|
||||
cacheId = RNG.r.nextInt();
|
||||
long t0 = M.ms();
|
||||
complex = ensureComplex();
|
||||
Iris.debug("[IrisEngine timing] ensureComplex=" + (M.ms() - t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] ensureComplex=" + (M.ms() - t0) + "ms");
|
||||
t0 = M.ms();
|
||||
upperContext = buildUpperContext();
|
||||
Iris.debug("[IrisEngine timing] buildUpperContext=" + (M.ms() - t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] buildUpperContext=" + (M.ms() - t0) + "ms");
|
||||
t0 = M.ms();
|
||||
effects = new IrisEngineEffects(this);
|
||||
Iris.debug("[IrisEngine timing] IrisEngineEffects=" + (M.ms() - t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] IrisEngineEffects=" + (M.ms() - t0) + "ms");
|
||||
hash32 = new CompletableFuture<>();
|
||||
t0 = M.ms();
|
||||
mantle.hotload();
|
||||
Iris.debug("[IrisEngine timing] mantle.hotload=" + (M.ms() - t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] mantle.hotload=" + (M.ms() - t0) + "ms");
|
||||
t0 = M.ms();
|
||||
setupMode();
|
||||
Iris.debug("[IrisEngine timing] setupMode=" + (M.ms() - t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] setupMode=" + (M.ms() - t0) + "ms");
|
||||
t0 = M.ms();
|
||||
IrisWorldManager manager = new IrisWorldManager(this);
|
||||
worldManager = manager;
|
||||
manager.startManager();
|
||||
Iris.debug("[IrisEngine timing] IrisWorldManager=" + (M.ms() - t0) + "ms");
|
||||
IrisLogging.debug("[IrisEngine timing] IrisWorldManager=" + (M.ms() - t0) + "ms");
|
||||
J.a(this::computeBiomeMaxes);
|
||||
J.a(() -> {
|
||||
File[] roots = getData().getLoaders()
|
||||
@@ -260,11 +261,11 @@ public class IrisEngine implements Engine {
|
||||
});
|
||||
J.a(() -> DatapackIngestService.refreshWorkspace(getData()));
|
||||
} catch (Throwable e) {
|
||||
Iris.error("FAILED TO SETUP ENGINE!");
|
||||
IrisLogging.error("FAILED TO SETUP ENGINE!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Iris.debug("Engine Setup Complete " + getCacheID());
|
||||
IrisLogging.debug("Engine Setup Complete " + getCacheID());
|
||||
}
|
||||
|
||||
private UpperDimensionContext buildUpperContext() {
|
||||
@@ -278,11 +279,11 @@ public class IrisEngine implements Engine {
|
||||
: IrisData.loadAnyDimension(upperKey, getData());
|
||||
if (upperDim != null) {
|
||||
UpperDimensionContext ctx = UpperDimensionContext.create(this, upperDim);
|
||||
Iris.info("Upper dimension enabled: " + upperKey
|
||||
IrisLogging.info("Upper dimension enabled: " + upperKey
|
||||
+ (ctx.isSelfReferencing() ? " (self-referencing)" : " (cross-referencing)"));
|
||||
return ctx;
|
||||
}
|
||||
Iris.warn("Upper dimension '" + upperKey + "' could not be resolved, skipping upper terrain.");
|
||||
IrisLogging.warn("Upper dimension '" + upperKey + "' could not be resolved, skipping upper terrain.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -325,9 +326,9 @@ public class IrisEngine implements Engine {
|
||||
throw new IllegalStateException("Dimension mode factory returned null");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
if (modeFallbackLogged.compareAndSet(false, true)) {
|
||||
Iris.warn("Failed to initialize configured dimension mode for " + getDimension().getLoadKey() + ", falling back to OVERWORLD mode.");
|
||||
IrisLogging.warn("Failed to initialize configured dimension mode for " + getDimension().getLoadKey() + ", falling back to OVERWORLD mode.");
|
||||
}
|
||||
currentMode = IrisDimensionModeType.OVERWORLD.create(this);
|
||||
}
|
||||
@@ -423,7 +424,7 @@ public class IrisEngine implements Engine {
|
||||
try {
|
||||
data = new Gson().fromJson(IO.readAll(f), IrisEngineData.class);
|
||||
if (data == null) {
|
||||
Iris.error("Failed to read Engine Data! Corrupted File? recreating...");
|
||||
IrisLogging.error("Failed to read Engine Data! Corrupted File? recreating...");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -436,7 +437,7 @@ public class IrisEngine implements Engine {
|
||||
data.getStatistics().setMCVersion(Iris.instance.getMCVersion());
|
||||
data.getStatistics().setUpgradedVersion(Iris.instance.getIrisVersion());
|
||||
if (data.getStatistics().getVersion() == -1 || data.getStatistics().getMCVersion() == -1 ) {
|
||||
Iris.error("Failed to setup Engine Data!");
|
||||
IrisLogging.error("Failed to setup Engine Data!");
|
||||
}
|
||||
|
||||
if (f.getParentFile().exists() || f.getParentFile().mkdirs()) {
|
||||
@@ -446,7 +447,7 @@ public class IrisEngine implements Engine {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Iris.error("Failed to setup Engine Data!");
|
||||
IrisLogging.error("Failed to setup Engine Data!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,7 +602,7 @@ public class IrisEngine implements Engine {
|
||||
getData().dump();
|
||||
getData().clearLists();
|
||||
Iris.service(PreservationSVC.class).dereference();
|
||||
Iris.debug("Engine Fully Shutdown!");
|
||||
IrisLogging.debug("Engine Fully Shutdown!");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -640,8 +641,8 @@ public class IrisEngine implements Engine {
|
||||
try {
|
||||
getData().getObjectLoader().clean();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Cleanup failed! Enable debug to see stacktrace.");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Cleanup failed! Enable debug to see stacktrace.");
|
||||
}
|
||||
|
||||
cleaning.lazySet(false);
|
||||
@@ -687,7 +688,7 @@ public class IrisEngine implements Engine {
|
||||
} catch (GenerationSessionException e) {
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
fail("Failed to generate " + x + ", " + z, e);
|
||||
}
|
||||
}
|
||||
@@ -704,9 +705,9 @@ public class IrisEngine implements Engine {
|
||||
f.getParentFile().mkdirs();
|
||||
try {
|
||||
IO.writeAll(f, new Gson().toJson(getEngineData()));
|
||||
Iris.debug("Saved Engine Data");
|
||||
IrisLogging.debug("Saved Engine Data");
|
||||
} catch (IOException e) {
|
||||
Iris.error("Failed to save Engine Data");
|
||||
IrisLogging.error("Failed to save Engine Data");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -737,7 +738,7 @@ public class IrisEngine implements Engine {
|
||||
@Override
|
||||
public void fail(String error, Throwable e) {
|
||||
failing = true;
|
||||
Iris.error(error);
|
||||
IrisLogging.error(error);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import art.arcane.iris.engine.mantle.components.MantleFloatingObjectComponent;
|
||||
import art.arcane.iris.engine.mantle.components.MantleFluidBodyComponent;
|
||||
import art.arcane.iris.engine.mantle.components.MantleObjectComponent;
|
||||
import art.arcane.iris.engine.mantle.components.IrisStructureComponent;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.matter.IrisMatterSupport;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -283,10 +284,10 @@ public class IrisEngineMantle implements EngineMantle {
|
||||
long end,
|
||||
art.arcane.volmlib.util.io.CountingDataInputStream din,
|
||||
IOException error) {
|
||||
Iris.error("Failed to read chunk section, skipping it.");
|
||||
IrisLogging.error("Failed to read chunk section, skipping it.");
|
||||
Iris.addPanic("read.byte.range", start + " " + end);
|
||||
Iris.addPanic("read.byte.current", din.count() + "");
|
||||
Iris.reportError(error);
|
||||
IrisLogging.reportError(error);
|
||||
error.printStackTrace();
|
||||
Iris.panic();
|
||||
TectonicPlate.addError();
|
||||
@@ -308,10 +309,10 @@ public class IrisEngineMantle implements EngineMantle {
|
||||
long end,
|
||||
art.arcane.volmlib.util.io.CountingDataInputStream din,
|
||||
Throwable error) {
|
||||
Iris.error("Failed to read chunk, creating a new chunk instead.");
|
||||
IrisLogging.error("Failed to read chunk, creating a new chunk instead.");
|
||||
Iris.addPanic("read.byte.range", start + " " + end);
|
||||
Iris.addPanic("read.byte.current", din.count() + "");
|
||||
Iris.reportError(error);
|
||||
IrisLogging.reportError(error);
|
||||
error.printStackTrace();
|
||||
Iris.panic();
|
||||
}
|
||||
@@ -328,17 +329,17 @@ public class IrisEngineMantle implements EngineMantle {
|
||||
|
||||
@Override
|
||||
public void onDebug(String message) {
|
||||
Iris.debug(message);
|
||||
IrisLogging.debug(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarn(String message) {
|
||||
Iris.warn(message);
|
||||
IrisLogging.warn(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable throwable) {
|
||||
Iris.reportError(throwable);
|
||||
IrisLogging.reportError(throwable);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -356,9 +357,9 @@ public class IrisEngineMantle implements EngineMantle {
|
||||
String message = "Acquired Channel for " + C.DARK_GREEN + name + C.RED + " in " + Form.duration(millis, 2)
|
||||
+ C.GRAY + " thread=" + threadName;
|
||||
if (millis >= 1000L) {
|
||||
Iris.warn(message);
|
||||
IrisLogging.warn(message);
|
||||
} else {
|
||||
Iris.debug(message);
|
||||
IrisLogging.debug(message);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -375,7 +376,7 @@ public class IrisEngineMantle implements EngineMantle {
|
||||
File dump = Iris.instance.getDataFolder("dump", name + ".bin");
|
||||
worker.dumpDecoded(name, dump.toPath());
|
||||
} else {
|
||||
Iris.debug("Read Tectonic Plate " + C.DARK_GREEN + name + C.RED + " in " + Form.duration(stopwatch.getMilliseconds(), 2));
|
||||
IrisLogging.debug("Read Tectonic Plate " + C.DARK_GREEN + name + C.RED + " in " + Form.duration(stopwatch.getMilliseconds(), 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,7 +385,7 @@ public class IrisEngineMantle implements EngineMantle {
|
||||
public void write(String name, TectonicPlate<Matter> region) throws Exception {
|
||||
PrecisionStopwatch stopwatch = PrecisionStopwatch.start();
|
||||
worker.write(name, "iris", ".bin", region, TectonicPlate::write);
|
||||
Iris.debug("Saved Tectonic Plate " + C.DARK_GREEN + name + C.RED + " in " + Form.duration(stopwatch.getMilliseconds(), 2));
|
||||
IrisLogging.debug("Saved Tectonic Plate " + C.DARK_GREEN + name + C.RED + " in " + Form.duration(stopwatch.getMilliseconds(), 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,6 +27,7 @@ import art.arcane.iris.engine.data.cache.Cache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.EngineAssignedWorldManager;
|
||||
import art.arcane.iris.engine.object.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.volmlib.util.collection.KSet;
|
||||
@@ -231,7 +232,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
mantle.flag(chunkX, chunkZ, MantleFlag.DISCOVERED, true);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
} finally {
|
||||
discoveredFlagQueue.remove(key);
|
||||
}
|
||||
@@ -341,7 +342,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
raised = true;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
} finally {
|
||||
markerFlagQueue.remove(key);
|
||||
}
|
||||
@@ -369,7 +370,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
try {
|
||||
getMantle().getChunk(chunkX, chunkZ);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
} finally {
|
||||
mantleWarmupQueue.remove(key);
|
||||
}
|
||||
@@ -389,14 +390,14 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
actuallySpawned = 0;
|
||||
|
||||
if (!getEngine().getWorld().hasRealWorld()) {
|
||||
Iris.debug("Can't spawn. No real world");
|
||||
IrisLogging.debug("Can't spawn. No real world");
|
||||
J.sleep(5000);
|
||||
return false;
|
||||
}
|
||||
|
||||
double epx = getEntitySaturation();
|
||||
if (epx > IrisSettings.get().getWorld().getTargetSpawnEntitiesPerChunk()) {
|
||||
Iris.debug("Can't spawn. The entity per chunk ratio is at " + Form.pc(epx, 2) + " > 100% (total entities " + entityCount + ")");
|
||||
IrisLogging.debug("Can't spawn. The entity per chunk ratio is at " + Form.pc(epx, 2) + " > 100% (total entities " + entityCount + ")");
|
||||
J.sleep(5000);
|
||||
return false;
|
||||
}
|
||||
@@ -433,7 +434,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
Chunk[] cc = getLoadedChunksSnapshot(world);
|
||||
while (spawnBuffer-- > 0) {
|
||||
if (cc.length == 0) {
|
||||
Iris.debug("Can't spawn. No chunks!");
|
||||
IrisLogging.debug("Can't spawn. No chunks!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -479,7 +480,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
try {
|
||||
return future.get(2, TimeUnit.SECONDS);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
return new Chunk[0];
|
||||
}
|
||||
}
|
||||
@@ -546,7 +547,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
try {
|
||||
future.get(5, TimeUnit.SECONDS);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,7 +773,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
Thread.currentThread().interrupt();
|
||||
Iris.verbose("Chunk warmup interrupted while loading async teleport chunk.");
|
||||
} catch (ExecutionException ex) {
|
||||
Iris.reportError(ex);
|
||||
IrisLogging.reportError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -816,7 +817,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
for (String i : mark.getSpawners()) {
|
||||
IrisSpawner m = getData().getSpawnerLoader().load(i);
|
||||
if (m == null) {
|
||||
Iris.error("Cannot load spawner: " + i + " for marker on " + getName());
|
||||
IrisLogging.error("Cannot load spawner: " + i + " for marker on " + getName());
|
||||
continue;
|
||||
}
|
||||
m.setReferenceMarker(mark);
|
||||
@@ -889,7 +890,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
});
|
||||
});
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
} finally {
|
||||
markerScanQueue.remove(key);
|
||||
}
|
||||
@@ -915,7 +916,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
for (String i : mark.getSpawners()) {
|
||||
IrisSpawner spawner = getData().getSpawnerLoader().load(i);
|
||||
if (spawner == null) {
|
||||
Iris.error("Cannot load spawner: " + i + " for marker on " + getName());
|
||||
IrisLogging.error("Cannot load spawner: " + i + " for marker on " + getName());
|
||||
continue;
|
||||
}
|
||||
spawner.setReferenceMarker(mark);
|
||||
@@ -948,7 +949,7 @@ public class IrisWorldManager extends EngineAssignedWorldManager {
|
||||
try {
|
||||
getMantle().remove(marker.getX(), marker.getY(), marker.getZ(), MatterMarker.class);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package art.arcane.iris.engine;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.volmlib.util.collection.KSet;
|
||||
@@ -212,7 +212,7 @@ public class UpperDimensionContext implements DataProvider {
|
||||
}
|
||||
return new NoiseBounds(bMin, bMax);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
return ZERO_NOISE_BOUNDS;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.data.cache;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.function.NastySupplier;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -96,7 +96,7 @@ public class AtomicCache<T> {
|
||||
set.set(true);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.error("Atomic cache failure!");
|
||||
IrisLogging.error("Atomic cache failure!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
package art.arcane.iris.engine.decorator;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.mantle.EngineMantle;
|
||||
import art.arcane.iris.engine.object.IrisBiome;
|
||||
import art.arcane.iris.engine.object.IrisDecorationPart;
|
||||
import art.arcane.iris.engine.object.IrisDecorator;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -83,7 +83,7 @@ final class DecoratorCore {
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ final class DecoratorCore {
|
||||
data.set(x, height + 2, z, BukkitBlockState.of(top));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
BlockData bottom = rawBd.clone();
|
||||
((Bisected) bottom).setHalf(Bisected.Half.BOTTOM);
|
||||
@@ -160,7 +160,7 @@ final class DecoratorCore {
|
||||
data.set(x, height + 2, z, BukkitBlockState.of(top));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
BlockData bottom = rawBd.clone();
|
||||
((Bisected) bottom).setHalf(Bisected.Half.BOTTOM);
|
||||
@@ -291,7 +291,7 @@ final class DecoratorCore {
|
||||
data.set(xf, height + 2, zf, BukkitBlockState.of(top));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
BlockData bottom = rawBd.clone();
|
||||
((Bisected) bottom).setHalf(Bisected.Half.BOTTOM);
|
||||
|
||||
@@ -38,6 +38,7 @@ import art.arcane.iris.engine.data.chunk.TerrainChunk;
|
||||
import art.arcane.iris.engine.mantle.EngineMantle;
|
||||
import art.arcane.iris.engine.object.*;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBiome;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.project.matter.TileWrapper;
|
||||
@@ -345,14 +346,14 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
if (c.getWorld().isChunkLoaded(c.getX() + x, c.getZ() + z))
|
||||
continue;
|
||||
var msg = "Chunk %s, %s [%s, %s] is not loaded".formatted(c.getX() + x, c.getZ() + z, x, z);
|
||||
Iris.debug(msg);
|
||||
IrisLogging.debug(msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var mantle = getMantle().getMantle();
|
||||
if (!mantle.isLoaded(c)) {
|
||||
var msg = "Mantle Chunk " + c.getX() + "," + c.getZ() + " is not loaded";
|
||||
Iris.debug(msg);
|
||||
IrisLogging.debug(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -362,7 +363,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
try {
|
||||
scheduled.join();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -378,7 +379,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
NamespacedKey tileTypeKey = KeyedType.getKey(v.getData().getMaterial());
|
||||
String blockType = blockTypeKey == null ? block.getType().name() : blockTypeKey.toString();
|
||||
String tileType = tileTypeKey == null ? v.getData().getMaterial().name() : tileTypeKey.toString();
|
||||
Iris.warn("Failed to set tile entity data at [%d %d %d | %s] for tile %s!", block.getX(), block.getY(), block.getZ(), blockType, tileType);
|
||||
IrisLogging.warn("Failed to set tile entity data at [%d %d %d | %s] for tile %s!", block.getX(), block.getY(), block.getZ(), blockType, tileType);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -455,7 +456,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
semaphore.acquire(1024);
|
||||
} catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
Iris.reportError(ex);
|
||||
IrisLogging.reportError(ex);
|
||||
}
|
||||
} finally {
|
||||
chunk.release();
|
||||
@@ -528,7 +529,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
addItems(false, m.getInventory(), rx, tables, slot, c.getWorld(), x, y, z, 15);
|
||||
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -758,7 +759,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
|
||||
default IrisPosition lookForBiome(IrisBiome biome, long timeout, Consumer<Integer> triesc) {
|
||||
if (!getWorld().hasRealWorld()) {
|
||||
Iris.error("Cannot GOTO without a bound world (headless mode)");
|
||||
IrisLogging.error("Cannot GOTO without a bound world (headless mode)");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -798,13 +799,13 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
|
||||
tries.getAndIncrement();
|
||||
} catch (Throwable ex) {
|
||||
Iris.reportError(ex);
|
||||
IrisLogging.reportError(ex);
|
||||
ex.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
@@ -829,7 +830,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
|
||||
default IrisPosition lookForRegion(IrisRegion reg, long timeout, Consumer<Integer> triesc) {
|
||||
if (!getWorld().hasRealWorld()) {
|
||||
Iris.error("Cannot GOTO without a bound world (headless mode)");
|
||||
IrisLogging.error("Cannot GOTO without a bound world (headless mode)");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -865,7 +866,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
|
||||
tries.getAndIncrement();
|
||||
} catch (Throwable xe) {
|
||||
Iris.reportError(xe);
|
||||
IrisLogging.reportError(xe);
|
||||
xe.printStackTrace();
|
||||
return;
|
||||
}
|
||||
@@ -1054,12 +1055,12 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
CompletableFuture<Boolean> teleportFuture = PaperLib.teleportAsync(player, location);
|
||||
if (teleportFuture != null) {
|
||||
teleportFuture.exceptionally(throwable -> {
|
||||
Iris.reportError(throwable);
|
||||
IrisLogging.reportError(throwable);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
} catch (Throwable throwable) {
|
||||
Iris.reportError(throwable);
|
||||
IrisLogging.reportError(throwable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1071,7 +1072,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
|
||||
} catch (NoSuchMethodException ignored) {
|
||||
return false;
|
||||
} catch (Throwable throwable) {
|
||||
Iris.reportError(throwable);
|
||||
IrisLogging.reportError(throwable);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.math.RollingSequence;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -33,7 +33,7 @@ public class EngineAssignedComponent implements EngineComponent {
|
||||
private final String name;
|
||||
|
||||
public EngineAssignedComponent(Engine engine, String name) {
|
||||
Iris.debug("Engine: " + engine.getCacheID() + " Starting " + name);
|
||||
IrisLogging.debug("Engine: " + engine.getCacheID() + " Starting " + name);
|
||||
this.engine = engine;
|
||||
this.metrics = new RollingSequence(16);
|
||||
this.name = name;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
import art.arcane.volmlib.util.documentation.BlockCoordinates;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -36,7 +36,7 @@ public abstract class EngineAssignedModifier<T> extends EngineAssignedComponent
|
||||
try {
|
||||
onModify(x, z, output, multicore, context);
|
||||
} catch (Throwable e) {
|
||||
Iris.error("Modifier Failure: " + getName());
|
||||
IrisLogging.error("Modifier Failure: " + getName());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.object.IrisDimension;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.math.RollingSequence;
|
||||
import art.arcane.iris.util.common.parallel.MultiBurst;
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface EngineComponent {
|
||||
try {
|
||||
BukkitPlatform.unregisterListener(this);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import com.google.gson.Gson;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.IrisPosition;
|
||||
import art.arcane.volmlib.util.io.IO;
|
||||
import lombok.Data;
|
||||
@@ -39,7 +39,7 @@ public class EngineData {
|
||||
f.getParentFile().mkdirs();
|
||||
return new Gson().fromJson(IO.readAll(f), EngineData.class);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class EngineData {
|
||||
f.getParentFile().mkdirs();
|
||||
IO.writeAll(f, new Gson().toJson(this));
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
import art.arcane.iris.engine.object.IrisBiome;
|
||||
import art.arcane.iris.engine.object.IrisEffect;
|
||||
import art.arcane.iris.engine.object.IrisRegion;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.math.M;
|
||||
import art.arcane.iris.util.common.scheduling.J;
|
||||
import lombok.Data;
|
||||
@@ -56,7 +56,7 @@ public class EnginePlayer {
|
||||
try {
|
||||
j.apply(player, getEngine());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class EnginePlayer {
|
||||
try {
|
||||
j.apply(player, getEngine());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class EnginePlayer {
|
||||
}
|
||||
return false;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
|
||||
public interface Fallible {
|
||||
default void fail(String error) {
|
||||
try {
|
||||
throw new RuntimeException();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
fail(error, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.framework;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.object.IrisDirection;
|
||||
import art.arcane.iris.engine.object.IrisJigsawConnector;
|
||||
@@ -29,6 +28,7 @@ import art.arcane.iris.engine.object.IrisObject;
|
||||
import art.arcane.iris.engine.object.IrisObjectRotation;
|
||||
import art.arcane.iris.engine.object.IrisStructure;
|
||||
import art.arcane.iris.engine.object.JigsawJoint;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.engine.object.IrisPosition;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
@@ -59,7 +59,7 @@ public final class StructureAssembler {
|
||||
public KList<PlacedStructurePiece> assemble(RNG rng) {
|
||||
IrisJigsawPool startPool = IrisData.loadAnyJigsawPool(structure.getStartPool(), data);
|
||||
if (startPool == null || startPool.getPieces().isEmpty()) {
|
||||
Iris.warn("Structure " + structure.getLoadKey() + " has no resolvable start pool '" + structure.getStartPool() + "'");
|
||||
IrisLogging.warn("Structure " + structure.getLoadKey() + " has no resolvable start pool '" + structure.getStartPool() + "'");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public final class StructureAssembler {
|
||||
}
|
||||
IrisObject startObject = IrisData.loadAnyObject(startPiece.getObject(), data);
|
||||
if (startObject == null) {
|
||||
Iris.warn("Jigsaw piece references missing object '" + startPiece.getObject() + "'");
|
||||
IrisLogging.warn("Jigsaw piece references missing object '" + startPiece.getObject() + "'");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package art.arcane.iris.engine.framework.placer;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.tools.IrisToolbelt;
|
||||
import art.arcane.iris.engine.data.cache.Cache;
|
||||
@@ -12,6 +11,7 @@ import art.arcane.iris.engine.object.InventorySlotType;
|
||||
import art.arcane.iris.engine.object.IrisLootTable;
|
||||
import art.arcane.iris.engine.object.TileData;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
@@ -65,7 +65,7 @@ public class WorldObjectPlacer implements IObjectPlacer {
|
||||
|
||||
if (d instanceof IrisCustomData data) {
|
||||
block.setBlockData(data.getBase(), false);
|
||||
Iris.warn("Tried to place custom block at " + x + ", " + y + ", " + z + " which is not supported!");
|
||||
IrisLogging.warn("Tried to place custom block at " + x + ", " + y + ", " + z + " which is not supported!");
|
||||
} else block.setBlockData(d, false);
|
||||
|
||||
if (slot != null) {
|
||||
@@ -76,7 +76,7 @@ public class WorldObjectPlacer implements IObjectPlacer {
|
||||
Bukkit.getPluginManager().callEvent(new IrisLootEvent(engine, block, slot, tables));
|
||||
|
||||
if (!tables.isEmpty()){
|
||||
Iris.debug("IrisLootEvent has been accessed");
|
||||
IrisLogging.debug("IrisLootEvent has been accessed");
|
||||
}
|
||||
|
||||
if (tables.isEmpty())
|
||||
@@ -84,7 +84,7 @@ public class WorldObjectPlacer implements IObjectPlacer {
|
||||
InventoryHolder m = (InventoryHolder) block.getState();
|
||||
engine.addItems(false, m.getInventory(), rx, tables, slot, world, x, y, z, 15);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.engine.mantle;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.matter.TileWrapper;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
import art.arcane.iris.core.tools.IrisToolbelt;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
@@ -76,7 +76,7 @@ public class MantleWriter implements IObjectPlacer, AutoCloseable {
|
||||
&& IrisToolbelt.isWorldMaintenanceActive(engineMantle.getEngine().getWorld().realWorld());
|
||||
final int parallelism = foliaMaintenance ? 1 : (multicore ? Runtime.getRuntime().availableProcessors() / 2 : 4);
|
||||
if (foliaMaintenance && IrisSettings.get().getGeneral().isDebug()) {
|
||||
Iris.info("MantleWriter using sequential chunk prefetch for maintenance regen at " + x + "," + z + ".");
|
||||
IrisLogging.info("MantleWriter using sequential chunk prefetch for maintenance regen at " + x + "," + z + ".");
|
||||
}
|
||||
final var map = multicore ? cachedChunks : new KMap<Long, MantleChunk<Matter>>(d * d, 1f, parallelism);
|
||||
mantle.getChunks(
|
||||
@@ -244,7 +244,7 @@ public class MantleWriter implements IObjectPlacer, AutoCloseable {
|
||||
public MantleChunk<Matter> acquireChunk(int cx, int cz) {
|
||||
if (cx < this.x - radius || cx > this.x + radius
|
||||
|| cz < this.z - radius || cz > this.z + radius) {
|
||||
Iris.error("Mantle Writer Accessed chunk out of bounds" + cx + "," + cz);
|
||||
IrisLogging.error("Mantle Writer Accessed chunk out of bounds" + cx + "," + cz);
|
||||
return null;
|
||||
}
|
||||
final Long key = Cache.key(cx, cz);
|
||||
@@ -758,7 +758,7 @@ public class MantleWriter implements IObjectPlacer, AutoCloseable {
|
||||
try {
|
||||
setData(pos.getX(), pos.getY(), pos.getZ(), data);
|
||||
} catch (Throwable e) {
|
||||
Iris.error("No set? " + data.toString() + " for " + pos.toString());
|
||||
IrisLogging.error("No set? " + data.toString() + " for " + pos.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.mantle.components;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.data.cache.Cache;
|
||||
@@ -37,6 +36,7 @@ import art.arcane.iris.engine.object.ObjectPlaceMode;
|
||||
import art.arcane.iris.engine.object.IrisRegion;
|
||||
import art.arcane.iris.engine.object.IrisStructure;
|
||||
import art.arcane.iris.engine.object.IrisStructurePlacement;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
@@ -90,7 +90,7 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
|
||||
boolean trace = IrisSettings.get().getGeneral().isDebug();
|
||||
if (trace) {
|
||||
Iris.info("[StructTrace] ORIGIN chunk=" + cx + "," + cz + " structures=" + placement.getStructures()
|
||||
IrisLogging.info("[StructTrace] ORIGIN chunk=" + cx + "," + cz + " structures=" + placement.getStructures()
|
||||
+ " underground=" + placement.isUnderground() + " band=" + placement.getMinHeight() + ".." + placement.getMaxHeight());
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
int bandMax = Math.min(worldMaxY, Math.max(placement.getMinHeight(), placement.getMaxHeight()));
|
||||
if (bandMin > bandMax) {
|
||||
if (trace) {
|
||||
Iris.info("[StructTrace] BAIL band-inverted chunk=" + cx + "," + cz + " bandMin=" + bandMin + " bandMax=" + bandMax
|
||||
IrisLogging.info("[StructTrace] BAIL band-inverted chunk=" + cx + "," + cz + " bandMin=" + bandMin + " bandMax=" + bandMax
|
||||
+ " worldMinY=" + worldMinY + " worldMaxY=" + worldMaxY);
|
||||
}
|
||||
return;
|
||||
@@ -122,7 +122,7 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
IrisStructure structure = art.arcane.iris.core.loader.IrisData.loadAnyStructure(key, getData());
|
||||
if (structure == null) {
|
||||
if (trace) {
|
||||
Iris.info("[StructTrace] BAIL structure-load-null chunk=" + cx + "," + cz + " key=" + key);
|
||||
IrisLogging.info("[StructTrace] BAIL structure-load-null chunk=" + cx + "," + cz + " key=" + key);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -131,13 +131,13 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
KList<PlacedStructurePiece> pieces = assembler.assemble(rng);
|
||||
if (pieces == null || pieces.isEmpty()) {
|
||||
if (trace) {
|
||||
Iris.info("[StructTrace] BAIL no-pieces chunk=" + cx + "," + cz + " key=" + key + " baseY=" + baseY
|
||||
IrisLogging.info("[StructTrace] BAIL no-pieces chunk=" + cx + "," + cz + " key=" + key + " baseY=" + baseY
|
||||
+ " pieces=" + (pieces == null ? "null" : "empty"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (trace) {
|
||||
Iris.info("[StructTrace] ASSEMBLED chunk=" + cx + "," + cz + " key=" + key + " baseY=" + baseY + " pieces=" + pieces.size());
|
||||
IrisLogging.info("[StructTrace] ASSEMBLED chunk=" + cx + "," + cz + " key=" + key + " baseY=" + baseY + " pieces=" + pieces.size());
|
||||
}
|
||||
|
||||
if (placement.isOverbore()) {
|
||||
@@ -192,7 +192,7 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
}
|
||||
long volume = (long) (maxX - minX + 1) * (long) (maxY - minY + 1) * (long) (maxZ - minZ + 1);
|
||||
if (volume > MAX_BORE_VOLUME) {
|
||||
Iris.warn("Skipping structure bore of " + volume + " blocks (cap " + MAX_BORE_VOLUME + "); use a smaller structure or larger spacing.");
|
||||
IrisLogging.warn("Skipping structure bore of " + volume + " blocks (cap " + MAX_BORE_VOLUME + "); use a smaller structure or larger spacing.");
|
||||
return;
|
||||
}
|
||||
int mantleOffset = getEngineMantle().getEngine().getMinHeight();
|
||||
@@ -236,7 +236,7 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
work += wx * wy * wz;
|
||||
}
|
||||
if (work > MAX_OVERBORE_VOLUME) {
|
||||
Iris.warn("Skipping structure overbore of " + work + " blocks (cap " + MAX_OVERBORE_VOLUME + "); reduce overboreRadius/overboreHeight or use larger spacing.");
|
||||
IrisLogging.warn("Skipping structure overbore of " + work + " blocks (cap " + MAX_OVERBORE_VOLUME + "); reduce overboreRadius/overboreHeight or use larger spacing.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public class IrisStructureComponent extends IrisMantleComponent {
|
||||
CNG roll = CNG.signature(noiseRng.nextParallelRNG(0x2A17));
|
||||
|
||||
if (IrisSettings.get().getGeneral().isDebug()) {
|
||||
Iris.info("Overbore carving organic cavern: pieces=" + pieces.size() + " margin=" + margin + " head=" + head + " floorCut=" + floorCut + " work=" + work);
|
||||
IrisLogging.info("Overbore carving organic cavern: pieces=" + pieces.size() + " margin=" + margin + " head=" + head + " floorCut=" + floorCut + " work=" + work);
|
||||
}
|
||||
|
||||
for (PlacedStructurePiece p : pieces) {
|
||||
|
||||
+4
-4
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.mantle.components;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.data.cache.Cache;
|
||||
@@ -37,6 +36,7 @@ import art.arcane.iris.engine.object.IrisObjectPlacement;
|
||||
import art.arcane.iris.engine.object.IrisObjectRotation;
|
||||
import art.arcane.iris.engine.object.IrisObjectTranslate;
|
||||
import art.arcane.iris.engine.object.ObjectPlaceMode;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.common.data.IrisCustomData;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
@@ -204,7 +204,7 @@ public class MantleFloatingObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
}, null, data);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ public class MantleFloatingObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
}, null, data);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -377,7 +377,7 @@ public class MantleFloatingObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
}, null, data);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+57
-57
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.mantle.components;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.IrisSettings;
|
||||
import art.arcane.iris.engine.data.cache.Cache;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
@@ -30,6 +29,7 @@ import art.arcane.iris.engine.mantle.MantleWriter;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.volmlib.util.collection.KSet;
|
||||
@@ -117,7 +117,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
String fingerprint = context + "|" + (object == null ? "<null>" : object.getClass().getSimpleName());
|
||||
if (MISSING_LOAD_KEY_WARNED.add(fingerprint)) {
|
||||
java.io.File file = object == null ? null : object.getLoadFile();
|
||||
Iris.warn("Skipping placement marker write: IrisObject has no loadKey (context=" + context
|
||||
IrisLogging.warn("Skipping placement marker write: IrisObject has no loadKey (context=" + context
|
||||
+ ", file=" + (file == null ? "<unknown>" : file.getPath()) + "). "
|
||||
+ "This would previously produce 'Couldn't find Object: null' warnings on chunk reload.");
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
carvedBlocks++;
|
||||
}
|
||||
}
|
||||
Iris.info("Cave object diag: chunk=" + x + "," + z
|
||||
IrisLogging.info("Cave object diag: chunk=" + x + "," + z
|
||||
+ " surfaceBiome=" + surfaceBiome.getLoadKey()
|
||||
+ " caveBiome=" + caveBiome.getLoadKey()
|
||||
+ " surfaceY=" + surfaceY
|
||||
@@ -158,7 +158,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
+ " sameBiome=" + (caveBiome == surfaceBiome || java.util.Objects.equals(caveBiome.getLoadKey(), surfaceBiome.getLoadKey())));
|
||||
}
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object layer start: chunk=" + x + "," + z
|
||||
IrisLogging.info("Regen object layer start: chunk=" + x + "," + z
|
||||
+ " surfaceBiome=" + surfaceBiome.getLoadKey()
|
||||
+ " caveBiome=" + caveBiome.getLoadKey()
|
||||
+ " region=" + region.getLoadKey()
|
||||
@@ -175,7 +175,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
placeUpperObjects(writer, rng, x, z, xxx, zzz, surfaceY, upperCtx, dimension, complex, traceRegen);
|
||||
}
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object layer done: chunk=" + x + "," + z
|
||||
IrisLogging.info("Regen object layer done: chunk=" + x + "," + z
|
||||
+ " biomeSurfacePlacersChecked=" + summary.biomeSurfacePlacersChecked()
|
||||
+ " biomeSurfacePlacersTriggered=" + summary.biomeSurfacePlacersTriggered()
|
||||
+ " biomeCavePlacersChecked=" + summary.biomeCavePlacersChecked()
|
||||
@@ -256,7 +256,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
biomeSurfaceChecked++;
|
||||
boolean chance = rng.chance(i.getChance() + rng.d(-0.005, 0.005));
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
IrisLogging.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
+ " scope=biome-surface"
|
||||
+ " chanceResult=" + chance
|
||||
+ " chanceBase=" + i.getChance()
|
||||
@@ -274,10 +274,10 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
errors += result.errors();
|
||||
} catch (Throwable e) {
|
||||
errors++;
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place objects in the following biome: " + surfaceBiome.getName());
|
||||
Iris.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
Iris.error("Are these objects missing?");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place objects in the following biome: " + surfaceBiome.getName());
|
||||
IrisLogging.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
IrisLogging.error("Are these objects missing?");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -290,7 +290,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
biomeCaveChecked++;
|
||||
boolean chance = rng.chance(i.getChance());
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
IrisLogging.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
+ " scope=biome-cave"
|
||||
+ " chanceResult=" + chance
|
||||
+ " chanceBase=" + i.getChance()
|
||||
@@ -308,10 +308,10 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
errors += result.errors();
|
||||
} catch (Throwable e) {
|
||||
errors++;
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place cave objects in the following biome: " + caveBiome.getName());
|
||||
Iris.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
Iris.error("Are these objects missing?");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place cave objects in the following biome: " + caveBiome.getName());
|
||||
IrisLogging.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
IrisLogging.error("Are these objects missing?");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
regionSurfaceChecked++;
|
||||
boolean chance = rng.chance(i.getChance() + rng.d(-0.005, 0.005));
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
IrisLogging.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
+ " scope=region-surface"
|
||||
+ " chanceResult=" + chance
|
||||
+ " chanceBase=" + i.getChance()
|
||||
@@ -339,10 +339,10 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
errors += result.errors();
|
||||
} catch (Throwable e) {
|
||||
errors++;
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place objects in the following region: " + region.getName());
|
||||
Iris.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
Iris.error("Are these objects missing?");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place objects in the following region: " + region.getName());
|
||||
IrisLogging.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
IrisLogging.error("Are these objects missing?");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
regionCaveChecked++;
|
||||
boolean chance = rng.chance(i.getChance());
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
IrisLogging.info("Regen object placer chance: chunk=" + x + "," + z
|
||||
+ " scope=region-cave"
|
||||
+ " chanceResult=" + chance
|
||||
+ " chanceBase=" + i.getChance()
|
||||
@@ -373,10 +373,10 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
errors += result.errors();
|
||||
} catch (Throwable e) {
|
||||
errors++;
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place cave objects in the following region: " + region.getName());
|
||||
Iris.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
Iris.error("Are these objects missing?");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place cave objects in the following region: " + region.getName());
|
||||
IrisLogging.error("Object(s) " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ").");
|
||||
IrisLogging.error("Are these objects missing?");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -420,7 +420,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
for (IrisProceduralPlacement p : proceduralObjects.getAllPlacements()) {
|
||||
boolean chancePassed = rng.chance(p.getChance() + rng.d(-0.005, 0.005));
|
||||
if (golden) {
|
||||
Iris.info("Goldendebug procedural chance: chunk=" + x + "," + z
|
||||
IrisLogging.info("Goldendebug procedural chance: chunk=" + x + "," + z
|
||||
+ " scope=" + scope
|
||||
+ " placement=" + p.getName()
|
||||
+ " passed=" + chancePassed);
|
||||
@@ -443,7 +443,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
IrisObject variant = p.getVariantObject(getData(), rng);
|
||||
if (variant == null) {
|
||||
if (golden) {
|
||||
Iris.info("Goldendebug procedural pick: chunk=" + x + "," + z
|
||||
IrisLogging.info("Goldendebug procedural pick: chunk=" + x + "," + z
|
||||
+ " placement=" + p.getName()
|
||||
+ " densityIndex=" + i
|
||||
+ " variant=null");
|
||||
@@ -455,7 +455,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
int id = rng.i(0, Integer.MAX_VALUE);
|
||||
if (golden) {
|
||||
KList<IrisObject> pool = p.getVariantObjects(getData());
|
||||
Iris.info("Goldendebug procedural pick: chunk=" + x + "," + z
|
||||
IrisLogging.info("Goldendebug procedural pick: chunk=" + x + "," + z
|
||||
+ " placement=" + p.getName()
|
||||
+ " densityIndex=" + i
|
||||
+ " variant=" + variant.getLoadKey()
|
||||
@@ -470,7 +470,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
if (carving) {
|
||||
int caveFloorY = findNearestCaveFloor(writer, xx, zz);
|
||||
if (golden) {
|
||||
Iris.info("Goldendebug procedural caveFloor: chunk=" + x + "," + z
|
||||
IrisLogging.info("Goldendebug procedural caveFloor: chunk=" + x + "," + z
|
||||
+ " placement=" + p.getName()
|
||||
+ " xx=" + xx
|
||||
+ " zz=" + zz
|
||||
@@ -493,7 +493,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}, null, getData());
|
||||
}
|
||||
if (golden) {
|
||||
Iris.info("Goldendebug procedural result: chunk=" + x + "," + z
|
||||
IrisLogging.info("Goldendebug procedural result: chunk=" + x + "," + z
|
||||
+ " placement=" + p.getName()
|
||||
+ " variant=" + variant.getLoadKey()
|
||||
+ " xx=" + xx
|
||||
@@ -501,8 +501,8 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
+ " resultY=" + placeResult);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place procedural object '" + p.getName() + "' in " + scope);
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place procedural object '" + p.getName() + "' in " + scope);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -538,7 +538,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
if (v == null) {
|
||||
nullObjects++;
|
||||
if (traceRegen) {
|
||||
Iris.warn("Regen object placement null object: chunk=" + chunkX + "," + chunkZ
|
||||
IrisLogging.warn("Regen object placement null object: chunk=" + chunkX + "," + chunkZ
|
||||
+ " scope=" + scope
|
||||
+ " densityIndex=" + i
|
||||
+ " density=" + density
|
||||
@@ -558,7 +558,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
IObjectPlacer placePlacer = golden ? new GoldenDebugPlacer(writer, scope + "/" + v.getLoadKey()) : writer;
|
||||
if (golden) {
|
||||
Iris.info("Goldendebug object attempt: chunk=" + chunkX + "," + chunkZ
|
||||
IrisLogging.info("Goldendebug object attempt: chunk=" + chunkX + "," + chunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + v.getLoadKey()
|
||||
+ " densityIndex=" + i
|
||||
@@ -623,7 +623,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
|
||||
if (golden) {
|
||||
Iris.info("Goldendebug object result: chunk=" + chunkX + "," + chunkZ
|
||||
IrisLogging.info("Goldendebug object result: chunk=" + chunkX + "," + chunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + v.getLoadKey()
|
||||
+ " resultY=" + result
|
||||
@@ -631,7 +631,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen object placement result: chunk=" + chunkX + "," + chunkZ
|
||||
IrisLogging.info("Regen object placement result: chunk=" + chunkX + "," + chunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + v.getLoadKey()
|
||||
+ " resultY=" + result
|
||||
@@ -644,8 +644,8 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
errors++;
|
||||
Iris.reportError(e);
|
||||
Iris.error("Regen object placement exception: chunk=" + chunkX + "," + chunkZ
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Regen object placement exception: chunk=" + chunkX + "," + chunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + v.getLoadKey()
|
||||
+ " densityIndex=" + i
|
||||
@@ -715,7 +715,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
if (object == null) {
|
||||
nullObjects++;
|
||||
if (traceRegen) {
|
||||
Iris.warn("Regen cave object placement null object: chunk=" + metricChunkX + "," + metricChunkZ
|
||||
IrisLogging.warn("Regen cave object placement null object: chunk=" + metricChunkX + "," + metricChunkZ
|
||||
+ " scope=" + scope
|
||||
+ " densityIndex=" + i
|
||||
+ " density=" + density
|
||||
@@ -836,7 +836,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
|
||||
if (traceRegen) {
|
||||
Iris.info("Regen cave object placement result: chunk=" + metricChunkX + "," + metricChunkZ
|
||||
IrisLogging.info("Regen cave object placement result: chunk=" + metricChunkX + "," + metricChunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + object.getLoadKey()
|
||||
+ " resultY=" + result
|
||||
@@ -849,8 +849,8 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
errors++;
|
||||
Iris.reportError(e);
|
||||
Iris.error("Regen cave object placement exception: chunk=" + metricChunkX + "," + metricChunkZ
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Regen cave object placement exception: chunk=" + metricChunkX + "," + metricChunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + object.getLoadKey()
|
||||
+ " densityIndex=" + i
|
||||
@@ -907,8 +907,8 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
try {
|
||||
placeUpperObject(writer, rng, chunkX, chunkZ, i, upperCtx, dimension, complex, forcePlace, traceRegen, "upper-biome-surface");
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place upper-dimension objects in biome " + upperBiome.getName()
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place upper-dimension objects in biome " + upperBiome.getName()
|
||||
+ ": " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ")");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -923,8 +923,8 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
try {
|
||||
placeUpperObject(writer, rng, chunkX, chunkZ, i, upperCtx, dimension, complex, forcePlace, traceRegen, "upper-region-surface");
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to place upper-dimension objects in region " + upperRegion.getName()
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to place upper-dimension objects in region " + upperRegion.getName()
|
||||
+ ": " + i.getPlace().toString(", ") + " (" + e.getClass().getSimpleName() + ")");
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -993,7 +993,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
}, null, getData());
|
||||
|
||||
if (traceRegen) {
|
||||
Iris.info("Upper object placement: chunk=" + chunkX + "," + chunkZ
|
||||
IrisLogging.info("Upper object placement: chunk=" + chunkX + "," + chunkZ
|
||||
+ " scope=" + scope
|
||||
+ " object=" + v.getLoadKey()
|
||||
+ " anchorY=" + anchorY
|
||||
@@ -1052,7 +1052,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
int suppressed = state.suppressed.getAndSet(0);
|
||||
String anchorYText = anchorY == null ? "none" : String.valueOf(anchorY);
|
||||
String errorText = error == null ? "none" : error.getClass().getSimpleName() + ":" + String.valueOf(error.getMessage());
|
||||
Iris.warn("Cave object reject: scope=" + scope
|
||||
IrisLogging.warn("Cave object reject: scope=" + scope
|
||||
+ " reason=" + reason
|
||||
+ " chunk=" + chunkX + "," + chunkZ
|
||||
+ " object=" + objectKey
|
||||
@@ -1136,14 +1136,14 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
@Override
|
||||
public int getHighest(int x, int z, IrisData data) {
|
||||
int result = delegate.getHighest(x, z, data);
|
||||
Iris.info("Goldendebug query: tag=" + tag + " getHighest(" + x + "," + z + ")=" + result);
|
||||
IrisLogging.info("Goldendebug query: tag=" + tag + " getHighest(" + x + "," + z + ")=" + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHighest(int x, int z, IrisData data, boolean ignoreFluid) {
|
||||
int result = delegate.getHighest(x, z, data, ignoreFluid);
|
||||
Iris.info("Goldendebug query: tag=" + tag + " getHighest(" + x + "," + z + ",ignoreFluid=" + ignoreFluid + ")=" + result);
|
||||
IrisLogging.info("Goldendebug query: tag=" + tag + " getHighest(" + x + "," + z + ",ignoreFluid=" + ignoreFluid + ")=" + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1165,14 +1165,14 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
@Override
|
||||
public boolean isCarved(int x, int y, int z) {
|
||||
boolean result = delegate.isCarved(x, y, z);
|
||||
Iris.info("Goldendebug query: tag=" + tag + " isCarved(" + x + "," + y + "," + z + ")=" + result);
|
||||
IrisLogging.info("Goldendebug query: tag=" + tag + " isCarved(" + x + "," + y + "," + z + ")=" + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSolid(int x, int y, int z) {
|
||||
boolean result = delegate.isSolid(x, y, z);
|
||||
Iris.info("Goldendebug query: tag=" + tag + " isSolid(" + x + "," + y + "," + z + ")=" + result);
|
||||
IrisLogging.info("Goldendebug query: tag=" + tag + " isSolid(" + x + "," + y + "," + z + ")=" + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1648,16 +1648,16 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
|
||||
if (Math.max(bv.getBlockX(), bv.getBlockZ()) > 128) {
|
||||
if (scale > 1D) {
|
||||
Iris.warn("Object " + objectKey + " has a large size (" + bv + ") and may increase memory usage! (Object scaled up to " + Form.pc(scale, 2) + ")");
|
||||
IrisLogging.warn("Object " + objectKey + " has a large size (" + bv + ") and may increase memory usage! (Object scaled up to " + Form.pc(scale, 2) + ")");
|
||||
} else {
|
||||
Iris.warn("Object " + objectKey + " has a large size (" + bv + ") and may increase memory usage!");
|
||||
IrisLogging.warn("Object " + objectKey + " has a large size (" + bv + ") and may increase memory usage!");
|
||||
}
|
||||
}
|
||||
|
||||
xg.getAndSet(Math.max((int) Math.ceil(bv.getBlockX() * scale), xg.get()));
|
||||
zg.getAndSet(Math.max((int) Math.ceil(bv.getBlockZ() * scale), zg.get()));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1685,7 +1685,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
xg.getAndSet(Math.max(reachX, xg.get()));
|
||||
zg.getAndSet(Math.max(reachZ, zg.get()));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1695,7 +1695,7 @@ public class MantleObjectComponent extends IrisMantleComponent {
|
||||
try {
|
||||
return IrisObject.sampleSize(getData().getObjectLoader().findFile(objectKey));
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import art.arcane.iris.engine.framework.EngineMode;
|
||||
import art.arcane.iris.engine.framework.EngineStage;
|
||||
import art.arcane.iris.engine.framework.IrisEngineMode;
|
||||
import art.arcane.iris.engine.modifier.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.common.scheduling.J;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
@@ -118,7 +119,7 @@ public class ModeOverworld extends IrisEngineMode implements EngineMode {
|
||||
long now = System.currentTimeMillis();
|
||||
long last = lastMaintenanceBypassLog.get();
|
||||
if (now - last >= 5000L && lastMaintenanceBypassLog.compareAndSet(last, now)) {
|
||||
art.arcane.iris.Iris.info("Maintenance regen bypass: skipping mantle-backed overworld stages for Folia safety.");
|
||||
IrisLogging.info("Maintenance regen bypass: skipping mantle-backed overworld stages for Folia safety.");
|
||||
}
|
||||
}
|
||||
return active;
|
||||
|
||||
+5
-5
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.decorator.FloatingDecorator;
|
||||
@@ -36,6 +35,7 @@ import art.arcane.iris.engine.object.IrisDecorationPart;
|
||||
import art.arcane.iris.engine.object.IrisDimension;
|
||||
import art.arcane.iris.engine.object.IrisFloatingChildBiomes;
|
||||
import art.arcane.iris.engine.object.IrisSlopeClip;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -101,7 +101,7 @@ public class IrisFloatingChildBiomeModifier extends EngineAssignedModifier<Platf
|
||||
try {
|
||||
generated.add(layer.get(random.nextParallelRNG(i + j), (wx + j) / layer.getZoom(), j, (wz - j) / layer.getZoom(), data));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public class IrisFloatingChildBiomeModifier extends EngineAssignedModifier<Platf
|
||||
RNG colRng = rng.nextParallelRNG((int) FloatingIslandSample.columnSeed(baseSeed, wx, wz));
|
||||
FloatingDecorator.decorateColumn(getEngine(), target, IrisDecorationPart.NONE, xf, zf, wx, wz, topY, max, output, colRng, NOOP_DECORATION_MISS);
|
||||
} catch (Throwable e) {
|
||||
art.arcane.iris.Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,7 +360,7 @@ public class IrisFloatingChildBiomeModifier extends EngineAssignedModifier<Platf
|
||||
try {
|
||||
seaSurfaceDecorator.decorate(xf, zf, wx, wx + 1, wx - 1, wz, wz + 1, wz - 1, output, target, fluidTopY, chunkHeight);
|
||||
} catch (Throwable e) {
|
||||
art.arcane.iris.Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ public class IrisFloatingChildBiomeModifier extends EngineAssignedModifier<Platf
|
||||
getEngine().getMantle().getMantle().set(wx, y, wz, matter);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
art.arcane.iris.Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
|
||||
@@ -90,7 +90,7 @@ public final class FloatingIslandSample {
|
||||
private static void warnNullCng(String styleField, IrisBiome parent) {
|
||||
if (NULL_CNG_WARNED.compareAndSet(false, true)) {
|
||||
String biomeKey = parent == null ? "<unknown>" : parent.getLoadKey();
|
||||
Iris.warn("Floating child biome on " + biomeKey + " has a null CNG for " + styleField
|
||||
IrisLogging.warn("Floating child biome on " + biomeKey + " has a null CNG for " + styleField
|
||||
+ " (style factory returned null or AtomicCache swallowed an exception); skipping floating sampling until pack is fixed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.gui.components.RenderType;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
@@ -26,6 +25,7 @@ import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -434,7 +434,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);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -480,7 +480,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
try {
|
||||
data.add(getCaveCeilingLayers().get(i).get(random.nextParallelRNG(i + j), (wx + j) / caveCeilingLayers.get(i).getZoom(), j, (wz - j) / caveCeilingLayers.get(i).getZoom(), rdata));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,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);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -603,7 +603,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) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -749,7 +749,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
if (this.color == null) {
|
||||
RandomColor randomColor = new RandomColor(getName().hashCode());
|
||||
if (this.getVanillaDerivative() == null) {
|
||||
Iris.warn("No vanilla biome found for " + getName());
|
||||
IrisLogging.warn("No vanilla biome found for " + getName());
|
||||
return new Color(randomColor.randomColor());
|
||||
}
|
||||
RandomColor.Color col = VanillaBiomeMap.getColorType(this.getVanillaDerivative());
|
||||
@@ -763,7 +763,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
try {
|
||||
return Color.decode(this.color);
|
||||
} catch (NumberFormatException e) {
|
||||
Iris.warn("Could not parse color \"" + this.color + "\" for biome " + getName());
|
||||
IrisLogging.warn("Could not parse color \"" + this.color + "\" for biome " + getName());
|
||||
return new Color(new RandomColor(getName().hashCode()).randomColor());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.nms.datapack.IDataFixer;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.volmlib.util.json.JSONArray;
|
||||
@@ -149,7 +149,7 @@ public class IrisBiomeCustom {
|
||||
}
|
||||
EntityType type = i.getType();
|
||||
if (type == null) {
|
||||
Iris.warn("Skipping custom biome spawn with null entity type in biome " + getId());
|
||||
IrisLogging.warn("Skipping custom biome spawn with null entity type in biome " + getId());
|
||||
continue;
|
||||
}
|
||||
IrisBiomeCustomSpawnType group = i.getGroup() == null ? IrisBiomeCustomSpawnType.MISC : i.getGroup();
|
||||
@@ -157,7 +157,7 @@ public class IrisBiomeCustom {
|
||||
JSONObject o = new JSONObject();
|
||||
NamespacedKey key = type.getKey();
|
||||
if (key == null) {
|
||||
Iris.warn("Skipping custom biome spawn with unresolved entity key in biome " + getId());
|
||||
IrisLogging.warn("Skipping custom biome spawn with unresolved entity key in biome " + getId());
|
||||
continue;
|
||||
}
|
||||
o.put("type", key.toString());
|
||||
@@ -182,8 +182,8 @@ public class IrisBiomeCustom {
|
||||
try {
|
||||
return Color.decode(v).getRGB();
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Error Parsing '''color''', (" + c + ")");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Error Parsing '''color''', (" + c + ")");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.link.Identifier;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
@@ -26,6 +25,7 @@ import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -170,7 +170,7 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
String sx = keyify(st) + computeProperties(cdata);
|
||||
|
||||
if (debug) {
|
||||
Iris.debug("Block Data used " + sx + " (CUSTOM)");
|
||||
IrisLogging.debug("Block Data used " + sx + " (CUSTOM)");
|
||||
}
|
||||
|
||||
BlockData bx = B.get(sx);
|
||||
@@ -189,7 +189,7 @@ public class IrisBlockData extends IrisRegistrant {
|
||||
b = B.get(ss);
|
||||
|
||||
if (debug) {
|
||||
Iris.debug("Block Data used " + ss);
|
||||
IrisLogging.debug("Block Data used " + ss);
|
||||
}
|
||||
|
||||
if (b != null) {
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MaxNumber;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -87,7 +87,7 @@ public class IrisColor {
|
||||
try {
|
||||
return Color.decode(v);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import com.google.gson.Gson;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.volmlib.util.io.IO;
|
||||
@@ -53,8 +53,8 @@ public class IrisCompat {
|
||||
try {
|
||||
IO.writeAll(f, defa);
|
||||
} catch (IOException e) {
|
||||
Iris.error("Failed to writeNodeData to compat file");
|
||||
Iris.reportError(e);
|
||||
IrisLogging.error("Failed to writeNodeData to compat file");
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -72,7 +72,7 @@ public class IrisCompat {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ public class IrisCompat {
|
||||
searching:
|
||||
while (true) {
|
||||
if (err-- <= 0) {
|
||||
Iris.error("Can't find block data for " + n);
|
||||
IrisLogging.error("Can't find block data for " + n);
|
||||
return B.getNoCompat("STONE");
|
||||
}
|
||||
String m = buf;
|
||||
@@ -299,7 +299,7 @@ public class IrisCompat {
|
||||
}
|
||||
}
|
||||
|
||||
Iris.error("Can't find block data for " + n);
|
||||
IrisLogging.error("Can't find block data for " + n);
|
||||
return B.getNoCompat("STONE");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.Required;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -63,7 +63,7 @@ public class IrisCompatabilityBlockFilter {
|
||||
return null;
|
||||
}
|
||||
|
||||
Iris.warn("Compat: Using '%s' in place of '%s' since this server doesnt support '%s'", supplement, when, when);
|
||||
IrisLogging.warn("Compat: Using '%s' in place of '%s' since this server doesnt support '%s'", supplement, when, when);
|
||||
|
||||
return b;
|
||||
});
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
@@ -157,7 +157,7 @@ public class IrisDecorator {
|
||||
|
||||
public PlatformBlockState getBlockData100(IrisBiome b, RNG rng, double x, double y, double z, IrisData data) {
|
||||
if (getBlockData(data).isEmpty()) {
|
||||
Iris.warn("Empty Block Data for " + b.getName());
|
||||
IrisLogging.warn("Empty Block Data for " + b.getName());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import art.arcane.iris.core.ServerConfigurator.DimensionHeight;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
import art.arcane.iris.core.nms.datapack.IDataFixer;
|
||||
@@ -500,7 +501,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
try {
|
||||
IO.writeAll(output, json);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -562,7 +563,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
try {
|
||||
IO.writeAll(output, json);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -608,7 +609,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
try {
|
||||
IO.writeAll(mcm, raw);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
Iris.verbose(" Installing Data Pack MCMeta: " + mcm.getPath());
|
||||
@@ -624,7 +625,7 @@ public class IrisDimension extends IrisRegistrant {
|
||||
try {
|
||||
IO.writeAll(dimTypeVanilla, json);
|
||||
} catch (IOException e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.volmlib.util.scheduling.ChronoLatch;
|
||||
import art.arcane.iris.util.common.scheduling.J;
|
||||
@@ -168,11 +168,11 @@ public class IrisEffect {
|
||||
return resolved;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
if (PotionEffectTypes.shouldWarn(getPotionEffect())) {
|
||||
Iris.warn("Unknown Potion Effect Type: \"" + getPotionEffect() + "\". Valid types: " + PotionEffectTypes.knownTypesList());
|
||||
IrisLogging.warn("Unknown Potion Effect Type: \"" + getPotionEffect() + "\". Valid types: " + PotionEffectTypes.knownTypesList());
|
||||
}
|
||||
|
||||
return PotionEffectType.LUCK;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -61,7 +61,7 @@ public class IrisEnchantment {
|
||||
try {
|
||||
Enchantment enchant = Registry.ENCHANTMENT.get(NamespacedKey.minecraft(getEnchantment()));
|
||||
if (enchant == null) {
|
||||
Iris.warn("Unknown Enchantment: " + getEnchantment());
|
||||
IrisLogging.warn("Unknown Enchantment: " + getEnchantment());
|
||||
return;
|
||||
}
|
||||
if (rng.nextDouble() < chance) {
|
||||
@@ -72,7 +72,7 @@ public class IrisEnchantment {
|
||||
meta.addEnchant(enchant, getLevel(rng), true);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.common.format.C;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.volmlib.util.math.Vector3d;
|
||||
@@ -169,7 +169,7 @@ public class IrisEntitySpawn implements IRare {
|
||||
try {
|
||||
IrisEntity irisEntity = getRealEntity(g);
|
||||
if (irisEntity == null) { // No entity
|
||||
Iris.debug(" You are trying to spawn an entity that does not exist!");
|
||||
IrisLogging.debug(" You are trying to spawn an entity that does not exist!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -187,14 +187,14 @@ public class IrisEntitySpawn implements IRare {
|
||||
|
||||
Entity e = irisEntity.spawn(g, at.add(0.5, 0.5, 0.5), rng.aquire(() -> new RNG(g.getSeedManager().getEntity())));
|
||||
if (e != null) {
|
||||
Iris.debug("Spawned " + C.DARK_AQUA + "Entity<" + getEntity() + "> " + C.GREEN + e.getType() + C.LIGHT_PURPLE + " @ " + C.GRAY + e.getLocation().getX() + ", " + e.getLocation().getY() + ", " + e.getLocation().getZ());
|
||||
IrisLogging.debug("Spawned " + C.DARK_AQUA + "Entity<" + getEntity() + "> " + C.GREEN + e.getType() + C.LIGHT_PURPLE + " @ " + C.GRAY + e.getLocation().getX() + ", " + e.getLocation().getY() + ", " + e.getLocation().getZ());
|
||||
}
|
||||
|
||||
return e;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
Iris.error(" Failed to retrieve real entity @ " + at + " (entity: " + getEntity() + ")");
|
||||
IrisLogging.error(" Failed to retrieve real entity @ " + at + " (entity: " + getEntity() + ")");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import com.dfsek.paralithic.Expression;
|
||||
import com.dfsek.paralithic.eval.parser.Parser;
|
||||
import com.dfsek.paralithic.eval.parser.Scope;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.IrisExpressionFunction.FunctionContext;
|
||||
@@ -77,7 +77,7 @@ public class IrisExpression extends IrisRegistrant {
|
||||
scope.addInvocationVariable("z");
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.error("Script Variable load error in " + getLoadFile().getPath());
|
||||
IrisLogging.error("Script Variable load error in " + getLoadFile().getPath());
|
||||
}
|
||||
|
||||
for (IrisExpressionFunction f : functions) {
|
||||
@@ -90,7 +90,7 @@ public class IrisExpression extends IrisRegistrant {
|
||||
return parser.parse(getExpression(), scope);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.error("Script load error in " + getLoadFile().getPath());
|
||||
IrisLogging.error("Script load error in " + getLoadFile().getPath());
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
import art.arcane.iris.util.project.noise.ExpressionNoise;
|
||||
@@ -146,7 +146,7 @@ public class IrisGeneratorStyle {
|
||||
}
|
||||
|
||||
if (!file.delete()) {
|
||||
Iris.debug("Unable to delete stale noise cache " + file.getName());
|
||||
IrisLogging.debug("Unable to delete stale noise cache " + file.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.json.JSONObject;
|
||||
import art.arcane.iris.util.common.plugin.VolmitSender;
|
||||
|
||||
@@ -134,7 +134,7 @@ public class IrisImage extends IrisRegistrant {
|
||||
}
|
||||
}
|
||||
ImageIO.write(b, "png", at);
|
||||
Iris.warn("Debug image written to " + at.getPath() + " for channel " + channel.name());
|
||||
IrisLogging.warn("Debug image written to " + at.getPath() + " for channel " + channel.name());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.RegistryListResource;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.interpolation.InterpolationMethod;
|
||||
import art.arcane.iris.util.project.interpolation.IrisInterpolation;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -67,7 +67,7 @@ public class IrisImageMap {
|
||||
public double getNoise(IrisData data, int x, int z) {
|
||||
IrisImage i = imageCache.aquire(() -> data.getImageLoader().load(image));
|
||||
if (i == null) {
|
||||
Iris.error("NULL IMAGE FOR " + image);
|
||||
IrisLogging.error("NULL IMAGE FOR " + image);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,240 +1,241 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.link.Identifier;
|
||||
import art.arcane.iris.core.service.ExternalDataSVC;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.common.format.C;
|
||||
import art.arcane.volmlib.util.format.Form;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
|
||||
import org.bukkit.material.Colorable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Snippet("loot")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Represents a loot entry")
|
||||
@Data
|
||||
public class IrisLoot {
|
||||
private final transient AtomicCache<CNG> chance = new AtomicCache<>();
|
||||
@Desc("The target inventory slot types to fill this loot with")
|
||||
private InventorySlotType slotTypes = InventorySlotType.STORAGE;
|
||||
@MinNumber(1)
|
||||
@Desc("The sub rarity of this loot. Calculated after this loot table has been picked.")
|
||||
private int rarity = 1;
|
||||
@MinNumber(1)
|
||||
@Desc("Minimum amount of this loot")
|
||||
private int minAmount = 1;
|
||||
@MinNumber(1)
|
||||
@Desc("Maximum amount of this loot")
|
||||
private int maxAmount = 1;
|
||||
@MinNumber(1)
|
||||
@Desc("The display name of this item")
|
||||
private String displayName = null;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Minimum durability percent")
|
||||
private double minDurability = 0;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Maximum durability percent")
|
||||
private double maxDurability = 1;
|
||||
@Desc("Define a custom model identifier 1.14+ only")
|
||||
private Integer customModel = null;
|
||||
@Desc("Set this to true to prevent it from being broken")
|
||||
private boolean unbreakable = false;
|
||||
@ArrayType(min = 1, type = ItemFlag.class)
|
||||
@Desc("The item flags to add")
|
||||
private KList<ItemFlag> itemFlags = new KList<>();
|
||||
@Desc("Apply enchantments to this item")
|
||||
@ArrayType(min = 1, type = IrisEnchantment.class)
|
||||
private KList<IrisEnchantment> enchantments = new KList<>();
|
||||
@Desc("Apply attribute modifiers to this item")
|
||||
@ArrayType(min = 1, type = IrisAttributeModifier.class)
|
||||
private KList<IrisAttributeModifier> attributes = new KList<>();
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Add lore to this item")
|
||||
private KList<String> lore = new KList<>();
|
||||
@RegistryListItemType
|
||||
@Required
|
||||
@Desc("This is the item or block type. Does not accept minecraft:*, only materials such as DIAMOND_SWORD or DIRT. The exception are modded materials, as they require a namespace.")
|
||||
private String type = "";
|
||||
@Desc("The dye color")
|
||||
private DyeColor dyeColor = null;
|
||||
@Desc("The leather armor color")
|
||||
private String leatherColor = null;
|
||||
@Desc("Defines a custom NBT Tag for the item.")
|
||||
private KMap<String, Object> customNbt;
|
||||
|
||||
public Material getType() {
|
||||
return B.getMaterial(type);
|
||||
}
|
||||
|
||||
public ItemStack get(boolean debug, RNG rng) {
|
||||
try {
|
||||
ItemStack is = getItemStack(rng);
|
||||
if (is == null)
|
||||
return new ItemStack(Material.AIR);
|
||||
is.setItemMeta(applyProperties(is, rng, debug, null));
|
||||
return BukkitPlatform.applyCustomNbt(is, customNbt);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack get(boolean debug, boolean giveSomething, IrisLootTable table, RNG rng, int x, int y, int z) {
|
||||
if (debug) {
|
||||
chance.reset();
|
||||
}
|
||||
|
||||
if (giveSomething || chance.aquire(() -> NoiseStyle.STATIC.create(rng)).fit(1, rarity * table.getRarity(), x, y, z) == 1) {
|
||||
try {
|
||||
ItemStack is = getItemStack(rng);
|
||||
if (is == null)
|
||||
return null;
|
||||
is.setItemMeta(applyProperties(is, rng, debug, table));
|
||||
return BukkitPlatform.applyCustomNbt(is, customNbt);
|
||||
} catch (Throwable e) {
|
||||
//Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO Better Third Party Item Acquisition
|
||||
private ItemStack getItemStack(RNG rng) {
|
||||
if (!type.startsWith("minecraft:") && type.contains(":")) {
|
||||
Optional<ItemStack> opt = Iris.service(ExternalDataSVC.class).getItemStack(Identifier.fromString(type), customNbt);
|
||||
if (opt.isEmpty()) {
|
||||
Iris.warn("Unknown Material: " + type);
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
ItemStack is = opt.get();
|
||||
is.setAmount(Math.max(1, rng.i(getMinAmount(), getMaxAmount())));
|
||||
return is;
|
||||
}
|
||||
return new ItemStack(getType(), Math.max(1, rng.i(getMinAmount(), getMaxAmount())));
|
||||
}
|
||||
|
||||
private ItemMeta applyProperties(ItemStack is, RNG rng, boolean debug, IrisLootTable table) {
|
||||
ItemMeta m = is.getItemMeta();
|
||||
if (m == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (IrisEnchantment i : getEnchantments()) {
|
||||
i.apply(rng, m);
|
||||
}
|
||||
|
||||
for (IrisAttributeModifier i : getAttributes()) {
|
||||
i.apply(rng, m);
|
||||
}
|
||||
|
||||
m.setUnbreakable(isUnbreakable());
|
||||
for (ItemFlag i : getItemFlags()) {
|
||||
m.addItemFlags(i);
|
||||
}
|
||||
|
||||
if (getCustomModel() != null) {
|
||||
CustomModelDataComponent customModelData = m.getCustomModelDataComponent();
|
||||
customModelData.setFloats(List.of(getCustomModel().floatValue()));
|
||||
m.setCustomModelDataComponent(customModelData);
|
||||
}
|
||||
|
||||
if (is.getType().getMaxDurability() > 0 && m instanceof Damageable d) {
|
||||
int max = is.getType().getMaxDurability();
|
||||
d.setDamage((int) Math.round(Math.max(0, Math.min(max, (1D - rng.d(getMinDurability(), getMaxDurability())) * max))));
|
||||
}
|
||||
|
||||
if (getLeatherColor() != null && m instanceof LeatherArmorMeta leather) {
|
||||
Color c = Color.decode(getLeatherColor());
|
||||
leather.setColor(org.bukkit.Color.fromRGB(c.getRed(), c.getGreen(), c.getBlue()));
|
||||
}
|
||||
|
||||
if (getDyeColor() != null && m instanceof Colorable colorable) {
|
||||
colorable.setColor(getDyeColor());
|
||||
}
|
||||
|
||||
if (displayName != null) {
|
||||
m.setDisplayName(C.translateAlternateColorCodes('&', displayName));
|
||||
}
|
||||
|
||||
KList<String> lore = new KList<>();
|
||||
|
||||
getLore().forEach((i) ->
|
||||
{
|
||||
String mf = C.translateAlternateColorCodes('&', i);
|
||||
|
||||
if (mf.length() > 24) {
|
||||
for (String g : Form.wrapWords(mf, 24).split("\\Q\n\\E")) {
|
||||
lore.add(g.trim());
|
||||
}
|
||||
} else {
|
||||
lore.add(mf);
|
||||
}
|
||||
});
|
||||
|
||||
if (debug) {
|
||||
if (table == null) {
|
||||
if (lore.isNotEmpty()) {
|
||||
lore.add(C.GRAY + "--------------------");
|
||||
}
|
||||
lore.add(C.GRAY + "1 in " + (getRarity()) + " Chance (" + Form.pc(1D / (getRarity()), 5) + ")");
|
||||
} else {
|
||||
if (lore.isNotEmpty()) {
|
||||
lore.add(C.GRAY + "--------------------");
|
||||
}
|
||||
|
||||
lore.add(C.GRAY + "From: " + table.getName() + " (" + Form.pc(1D / table.getRarity(), 5) + ")");
|
||||
lore.add(C.GRAY + "1 in " + (table.getRarity() * getRarity()) + " Chance (" + Form.pc(1D / (table.getRarity() * getRarity()), 5) + ")");
|
||||
}
|
||||
}
|
||||
|
||||
m.setLore(lore);
|
||||
|
||||
return m;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2022 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.link.Identifier;
|
||||
import art.arcane.iris.core.service.ExternalDataSVC;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import art.arcane.iris.util.common.format.C;
|
||||
import art.arcane.volmlib.util.format.Form;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.iris.util.project.noise.CNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
|
||||
import org.bukkit.material.Colorable;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@Snippet("loot")
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Represents a loot entry")
|
||||
@Data
|
||||
public class IrisLoot {
|
||||
private final transient AtomicCache<CNG> chance = new AtomicCache<>();
|
||||
@Desc("The target inventory slot types to fill this loot with")
|
||||
private InventorySlotType slotTypes = InventorySlotType.STORAGE;
|
||||
@MinNumber(1)
|
||||
@Desc("The sub rarity of this loot. Calculated after this loot table has been picked.")
|
||||
private int rarity = 1;
|
||||
@MinNumber(1)
|
||||
@Desc("Minimum amount of this loot")
|
||||
private int minAmount = 1;
|
||||
@MinNumber(1)
|
||||
@Desc("Maximum amount of this loot")
|
||||
private int maxAmount = 1;
|
||||
@MinNumber(1)
|
||||
@Desc("The display name of this item")
|
||||
private String displayName = null;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Minimum durability percent")
|
||||
private double minDurability = 0;
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("Maximum durability percent")
|
||||
private double maxDurability = 1;
|
||||
@Desc("Define a custom model identifier 1.14+ only")
|
||||
private Integer customModel = null;
|
||||
@Desc("Set this to true to prevent it from being broken")
|
||||
private boolean unbreakable = false;
|
||||
@ArrayType(min = 1, type = ItemFlag.class)
|
||||
@Desc("The item flags to add")
|
||||
private KList<ItemFlag> itemFlags = new KList<>();
|
||||
@Desc("Apply enchantments to this item")
|
||||
@ArrayType(min = 1, type = IrisEnchantment.class)
|
||||
private KList<IrisEnchantment> enchantments = new KList<>();
|
||||
@Desc("Apply attribute modifiers to this item")
|
||||
@ArrayType(min = 1, type = IrisAttributeModifier.class)
|
||||
private KList<IrisAttributeModifier> attributes = new KList<>();
|
||||
@ArrayType(min = 1, type = String.class)
|
||||
@Desc("Add lore to this item")
|
||||
private KList<String> lore = new KList<>();
|
||||
@RegistryListItemType
|
||||
@Required
|
||||
@Desc("This is the item or block type. Does not accept minecraft:*, only materials such as DIAMOND_SWORD or DIRT. The exception are modded materials, as they require a namespace.")
|
||||
private String type = "";
|
||||
@Desc("The dye color")
|
||||
private DyeColor dyeColor = null;
|
||||
@Desc("The leather armor color")
|
||||
private String leatherColor = null;
|
||||
@Desc("Defines a custom NBT Tag for the item.")
|
||||
private KMap<String, Object> customNbt;
|
||||
|
||||
public Material getType() {
|
||||
return B.getMaterial(type);
|
||||
}
|
||||
|
||||
public ItemStack get(boolean debug, RNG rng) {
|
||||
try {
|
||||
ItemStack is = getItemStack(rng);
|
||||
if (is == null)
|
||||
return new ItemStack(Material.AIR);
|
||||
is.setItemMeta(applyProperties(is, rng, debug, null));
|
||||
return BukkitPlatform.applyCustomNbt(is, customNbt);
|
||||
} catch (Throwable e) {
|
||||
IrisLogging.reportError(e);
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack get(boolean debug, boolean giveSomething, IrisLootTable table, RNG rng, int x, int y, int z) {
|
||||
if (debug) {
|
||||
chance.reset();
|
||||
}
|
||||
|
||||
if (giveSomething || chance.aquire(() -> NoiseStyle.STATIC.create(rng)).fit(1, rarity * table.getRarity(), x, y, z) == 1) {
|
||||
try {
|
||||
ItemStack is = getItemStack(rng);
|
||||
if (is == null)
|
||||
return null;
|
||||
is.setItemMeta(applyProperties(is, rng, debug, table));
|
||||
return BukkitPlatform.applyCustomNbt(is, customNbt);
|
||||
} catch (Throwable e) {
|
||||
//Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO Better Third Party Item Acquisition
|
||||
private ItemStack getItemStack(RNG rng) {
|
||||
if (!type.startsWith("minecraft:") && type.contains(":")) {
|
||||
Optional<ItemStack> opt = Iris.service(ExternalDataSVC.class).getItemStack(Identifier.fromString(type), customNbt);
|
||||
if (opt.isEmpty()) {
|
||||
IrisLogging.warn("Unknown Material: " + type);
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
ItemStack is = opt.get();
|
||||
is.setAmount(Math.max(1, rng.i(getMinAmount(), getMaxAmount())));
|
||||
return is;
|
||||
}
|
||||
return new ItemStack(getType(), Math.max(1, rng.i(getMinAmount(), getMaxAmount())));
|
||||
}
|
||||
|
||||
private ItemMeta applyProperties(ItemStack is, RNG rng, boolean debug, IrisLootTable table) {
|
||||
ItemMeta m = is.getItemMeta();
|
||||
if (m == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (IrisEnchantment i : getEnchantments()) {
|
||||
i.apply(rng, m);
|
||||
}
|
||||
|
||||
for (IrisAttributeModifier i : getAttributes()) {
|
||||
i.apply(rng, m);
|
||||
}
|
||||
|
||||
m.setUnbreakable(isUnbreakable());
|
||||
for (ItemFlag i : getItemFlags()) {
|
||||
m.addItemFlags(i);
|
||||
}
|
||||
|
||||
if (getCustomModel() != null) {
|
||||
CustomModelDataComponent customModelData = m.getCustomModelDataComponent();
|
||||
customModelData.setFloats(List.of(getCustomModel().floatValue()));
|
||||
m.setCustomModelDataComponent(customModelData);
|
||||
}
|
||||
|
||||
if (is.getType().getMaxDurability() > 0 && m instanceof Damageable d) {
|
||||
int max = is.getType().getMaxDurability();
|
||||
d.setDamage((int) Math.round(Math.max(0, Math.min(max, (1D - rng.d(getMinDurability(), getMaxDurability())) * max))));
|
||||
}
|
||||
|
||||
if (getLeatherColor() != null && m instanceof LeatherArmorMeta leather) {
|
||||
Color c = Color.decode(getLeatherColor());
|
||||
leather.setColor(org.bukkit.Color.fromRGB(c.getRed(), c.getGreen(), c.getBlue()));
|
||||
}
|
||||
|
||||
if (getDyeColor() != null && m instanceof Colorable colorable) {
|
||||
colorable.setColor(getDyeColor());
|
||||
}
|
||||
|
||||
if (displayName != null) {
|
||||
m.setDisplayName(C.translateAlternateColorCodes('&', displayName));
|
||||
}
|
||||
|
||||
KList<String> lore = new KList<>();
|
||||
|
||||
getLore().forEach((i) ->
|
||||
{
|
||||
String mf = C.translateAlternateColorCodes('&', i);
|
||||
|
||||
if (mf.length() > 24) {
|
||||
for (String g : Form.wrapWords(mf, 24).split("\\Q\n\\E")) {
|
||||
lore.add(g.trim());
|
||||
}
|
||||
} else {
|
||||
lore.add(mf);
|
||||
}
|
||||
});
|
||||
|
||||
if (debug) {
|
||||
if (table == null) {
|
||||
if (lore.isNotEmpty()) {
|
||||
lore.add(C.GRAY + "--------------------");
|
||||
}
|
||||
lore.add(C.GRAY + "1 in " + (getRarity()) + " Chance (" + Form.pc(1D / (getRarity()), 5) + ")");
|
||||
} else {
|
||||
if (lore.isNotEmpty()) {
|
||||
lore.add(C.GRAY + "--------------------");
|
||||
}
|
||||
|
||||
lore.add(C.GRAY + "From: " + table.getName() + " (" + Form.pc(1D / table.getRarity(), 5) + ")");
|
||||
lore.add(C.GRAY + "1 in " + (table.getRarity() * getRarity()) + " Chance (" + Form.pc(1D / (table.getRarity() * getRarity()), 5) + ")");
|
||||
}
|
||||
}
|
||||
|
||||
m.setLore(lore);
|
||||
|
||||
return m;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
@@ -27,6 +26,7 @@ import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.PlacedObject;
|
||||
import art.arcane.iris.engine.framework.placer.HeightmapObjectPlacer;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -193,7 +193,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
AtomicInteger applied = new AtomicInteger();
|
||||
if (blocks.isEmpty()) {
|
||||
writeLock.unlock();
|
||||
Iris.warn("Cannot Smart Bore " + getLoadKey() + " because it has 0 blocks in it.");
|
||||
IrisLogging.warn("Cannot Smart Bore " + getLoadKey() + " because it has 0 blocks in it.");
|
||||
smartBored = true;
|
||||
return;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
burst.complete();
|
||||
smartBored = true;
|
||||
writeLock.unlock();
|
||||
Iris.debug("Smart Bore: " + getLoadKey() + " in " + Form.duration(p.getMilliseconds(), 2) + " (" + Form.f(applied.get()) + ")");
|
||||
IrisLogging.debug("Smart Bore: " + getLoadKey() + " in " + Form.duration(p.getMilliseconds(), 2) + " (" + Form.f(applied.get()) + ")");
|
||||
}
|
||||
|
||||
public synchronized IrisObject copy() {
|
||||
@@ -345,7 +345,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
states.put(new Vector3i(din.readShort(), din.readShort(), din.readShort()), TileData.read(din));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
read(fin);
|
||||
} catch (Throwable e) {
|
||||
if (!(e instanceof HeaderException))
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
try (var fin = new BufferedInputStream(new FileInputStream(file))) {
|
||||
readLegacy(fin);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
blocks.put(v, BukkitBlockState.of(data));
|
||||
TileData state = TileData.getTileState(block, legacy);
|
||||
if (state != null) {
|
||||
Iris.debug("Saved State " + v);
|
||||
IrisLogging.debug("Saved State " + v);
|
||||
states.put(v, state);
|
||||
}
|
||||
}
|
||||
@@ -1032,13 +1032,13 @@ public class IrisObject extends IrisRegistrant {
|
||||
d = entry.getValue();
|
||||
tile = states.get(g);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (cme)");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (cme)");
|
||||
d = AIR;
|
||||
}
|
||||
|
||||
if (d == null) {
|
||||
Iris.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (null)");
|
||||
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (null)");
|
||||
d = AIR;
|
||||
}
|
||||
|
||||
@@ -1170,7 +1170,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
readLock.unlock();
|
||||
|
||||
@@ -1221,13 +1221,13 @@ public class IrisObject extends IrisRegistrant {
|
||||
try {
|
||||
sourceData = blocks.get(g);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (stilt cme)");
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (stilt cme)");
|
||||
sourceData = AIR;
|
||||
}
|
||||
|
||||
if (sourceData == null) {
|
||||
Iris.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (stilt null)");
|
||||
IrisLogging.warn("Failed to read block node " + g.getBlockX() + "," + g.getBlockY() + "," + g.getBlockZ() + " in object " + getLoadKey() + " (stilt null)");
|
||||
sourceData = AIR;
|
||||
}
|
||||
|
||||
@@ -1446,7 +1446,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
return;
|
||||
}
|
||||
IMPLAUSIBLE_BEDROCK_WARNS.put(fingerprint, now);
|
||||
Iris.warn("Implausible object placement rejected: "
|
||||
IrisLogging.warn("Implausible object placement rejected: "
|
||||
+ (key == null ? "<no loadKey>" : key)
|
||||
+ " resolved anchorY=" + y + " at (" + x + "," + z + ") mode=" + config.getMode()
|
||||
+ " carving=" + config.getCarvingSupport()
|
||||
@@ -1606,7 +1606,7 @@ public class IrisObject extends IrisRegistrant {
|
||||
b.setBlockData((BlockData) Objects.requireNonNull(entry.getValue()).nativeHandle(), false);
|
||||
|
||||
if (states.containsKey(i)) {
|
||||
Iris.info(Objects.requireNonNull(states.get(i)).toString());
|
||||
IrisLogging.info(Objects.requireNonNull(states.get(i)).toString());
|
||||
Objects.requireNonNull(states.get(i)).toBukkitTry(b);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -267,7 +267,7 @@ public class IrisObjectPlacement {
|
||||
continue;
|
||||
IrisLootTable table = loader.apply(loot.getName());
|
||||
if (table == null) {
|
||||
Iris.warn("Couldn't find loot table " + loot.getName());
|
||||
IrisLogging.warn("Couldn't find loot table " + loot.getName());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.annotations.Desc;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -352,7 +352,7 @@ public class IrisObjectRotation {
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -69,11 +69,11 @@ public class IrisPotionEffect {
|
||||
return resolved;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
if (PotionEffectTypes.shouldWarn(getPotionEffect())) {
|
||||
Iris.warn("Unknown Potion Effect Type: \"" + getPotionEffect() + "\". Valid types: " + PotionEffectTypes.knownTypesList());
|
||||
IrisLogging.warn("Unknown Potion Effect Type: \"" + getPotionEffect() + "\". Valid types: " + PotionEffectTypes.knownTypesList());
|
||||
}
|
||||
|
||||
return PotionEffectType.LUCK;
|
||||
|
||||
@@ -27,6 +27,7 @@ import art.arcane.iris.engine.object.annotations.MinNumber;
|
||||
import art.arcane.iris.engine.object.annotations.Required;
|
||||
import art.arcane.iris.engine.object.annotations.Snippet;
|
||||
import art.arcane.iris.engine.object.tree.ProceduralTreeGenerator;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -286,7 +287,7 @@ public class IrisProceduralTree implements IrisProceduralPlacement {
|
||||
long position = ((long) vector.getBlockX() << 40) ^ ((long) vector.getBlockY() << 20) ^ vector.getBlockZ();
|
||||
digest[0] ^= Long.rotateLeft(position * 0x9E3779B97F4A7C15L ^ state.key().hashCode(), (int) (position & 63));
|
||||
});
|
||||
art.arcane.iris.Iris.info("Goldendebug bake: " + object.getLoadKey() + " blocks=" + object.getBlocks().size() + " digest=" + Long.toHexString(digest[0]));
|
||||
IrisLogging.info("Goldendebug bake: " + object.getLoadKey() + " blocks=" + object.getBlocks().size() + " digest=" + Long.toHexString(digest[0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.gui.components.RenderType;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.core.loader.IrisRegistrant;
|
||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||
@@ -442,14 +442,14 @@ public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
biomes.remove(index);
|
||||
}
|
||||
|
||||
Iris.warn("Couldn't find a suitable color for region " + getName());
|
||||
IrisLogging.warn("Couldn't find a suitable color for region " + getName());
|
||||
return new Color(new RandomColor(rand).randomColor());
|
||||
}
|
||||
|
||||
try {
|
||||
return Color.decode(this.color);
|
||||
} catch (NumberFormatException e) {
|
||||
Iris.warn("Could not parse color \"" + this.color + "\" for region " + getName());
|
||||
IrisLogging.warn("Could not parse color \"" + this.color + "\" for region " + getName());
|
||||
return Color.WHITE;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.annotations.*;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -111,8 +111,8 @@ public class IrisVillagerTrade {
|
||||
if (warnings.isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
Iris.warn("Faulty item in cartographer item overrides: " + this);
|
||||
warnings.forEach(w -> Iris.warn(" " + w));
|
||||
IrisLogging.warn("Faulty item in cartographer item overrides: " + this);
|
||||
warnings.forEach(w -> IrisLogging.warn(" " + w));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.tools.IrisToolbelt;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -127,7 +127,7 @@ public class IrisWorld {
|
||||
return realWorld().getSpawnLocation();
|
||||
}
|
||||
|
||||
Iris.error("This world is not real yet, cannot get spawn location! HEADLESS!");
|
||||
IrisLogging.error("This world is not real yet, cannot get spawn location! HEADLESS!");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.Strictness;
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||
import art.arcane.iris.util.common.reflect.KeyedType;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
@@ -108,7 +108,7 @@ public class TileData implements Cloneable {
|
||||
toBukkit(block);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -120,7 +120,7 @@ public class TileData implements Cloneable {
|
||||
fromBukkit(block);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import art.arcane.iris.engine.object.VanillaStructureMode;
|
||||
import art.arcane.iris.engine.object.IrisWorld;
|
||||
import art.arcane.iris.engine.object.StudioMode;
|
||||
import art.arcane.iris.engine.platform.studio.StudioGenerator;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBiome;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
@@ -130,10 +131,10 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
world.setRawWorldSeed(event.getWorld().getSeed());
|
||||
if (initialize(event.getWorld())) return;
|
||||
|
||||
Iris.warn("Failed to get Engine for " + event.getWorld().getName() + " re-trying...");
|
||||
IrisLogging.warn("Failed to get Engine for " + event.getWorld().getName() + " re-trying...");
|
||||
J.s(() -> {
|
||||
if (!initialize(event.getWorld())) {
|
||||
Iris.error("Failed to get Engine for " + event.getWorld().getName() + "!");
|
||||
IrisLogging.error("Failed to get Engine for " + event.getWorld().getName() + "!");
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
@@ -143,13 +144,13 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
if (engine == null) return false;
|
||||
try {
|
||||
INMS.get().inject(world.getSeed(), engine, world);
|
||||
Iris.debug("Injected Iris Biome Source into " + world.getName());
|
||||
IrisLogging.debug("Injected Iris Biome Source into " + world.getName());
|
||||
if (!studio) {
|
||||
J.s(() -> updateSpawnLocation(world), 1);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
Iris.error("Failed to inject biome source into " + world.getName());
|
||||
IrisLogging.reportError(e);
|
||||
IrisLogging.error("Failed to inject biome source into " + world.getName());
|
||||
e.printStackTrace();
|
||||
}
|
||||
spawnChunks.complete(INMS.get().getSpawnChunkCount(world));
|
||||
@@ -240,23 +241,23 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
IrisDimension dimension = data.getDimensionLoader().load(dimensionKey);
|
||||
|
||||
if (dimension == null) {
|
||||
Iris.error("Oh No! There's no pack in " + data.getDataFolder().getPath() + " or... there's no dimension for the key " + dimensionKey);
|
||||
IrisLogging.error("Oh No! There's no pack in " + data.getDataFolder().getPath() + " or... there's no dimension for the key " + dimensionKey);
|
||||
IrisDimension test = IrisData.loadAnyDimension(dimensionKey, null);
|
||||
|
||||
if (test != null) {
|
||||
Iris.warn("Looks like " + dimensionKey + " exists in " + test.getLoadFile().getPath() + " ");
|
||||
IrisLogging.warn("Looks like " + dimensionKey + " exists in " + test.getLoadFile().getPath() + " ");
|
||||
test = Iris.service(StudioSVC.class).installInto(Iris.getSender(), dimensionKey, dataLocation);
|
||||
Iris.warn("Attempted to install into " + data.getDataFolder().getPath());
|
||||
IrisLogging.warn("Attempted to install into " + data.getDataFolder().getPath());
|
||||
|
||||
if (test != null) {
|
||||
Iris.success("Woo! Patched the Engine!");
|
||||
dimension = test;
|
||||
} else {
|
||||
Iris.error("Failed to patch dimension!");
|
||||
IrisLogging.error("Failed to patch dimension!");
|
||||
throw new RuntimeException("Missing Dimension: " + dimensionKey);
|
||||
}
|
||||
} else {
|
||||
Iris.error("Nope, you don't have an installation containing " + dimensionKey + " try downloading it?");
|
||||
IrisLogging.error("Nope, you don't have an installation containing " + dimensionKey + " try downloading it?");
|
||||
throw new RuntimeException("Missing Dimension: " + dimensionKey);
|
||||
}
|
||||
}
|
||||
@@ -330,7 +331,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
activeHotloader.join(1000L);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,7 +376,7 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
r.run();
|
||||
loadLock.release(LOAD_LOCKS);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -422,16 +423,16 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
blocks.apply();
|
||||
}
|
||||
|
||||
Iris.debug("Generated " + x + " " + z);
|
||||
IrisLogging.debug("Generated " + x + " " + z);
|
||||
} catch (GenerationSessionException e) {
|
||||
if (closing || isExpectedTeardown(engine, e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Iris.error("======================================");
|
||||
IrisLogging.error("======================================");
|
||||
e.printStackTrace();
|
||||
Iris.reportErrorChunk(x, z, e, "CHUNK");
|
||||
Iris.error("======================================");
|
||||
IrisLogging.error("======================================");
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
for (int j = 0; j < 16; j++) {
|
||||
@@ -439,10 +440,10 @@ public class BukkitChunkGenerator extends ChunkGenerator implements PlatformChun
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Iris.error("======================================");
|
||||
IrisLogging.error("======================================");
|
||||
e.printStackTrace();
|
||||
Iris.reportErrorChunk(x, z, e, "CHUNK");
|
||||
Iris.error("======================================");
|
||||
IrisLogging.error("======================================");
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
for (int j = 0; j < 16; j++) {
|
||||
|
||||
+3
-3
@@ -18,7 +18,6 @@
|
||||
|
||||
package art.arcane.iris.engine.platform.studio.generators;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.runtime.ObjectStudioActivation;
|
||||
import art.arcane.iris.core.runtime.ObjectStudioLayout;
|
||||
@@ -31,6 +30,7 @@ import art.arcane.iris.engine.object.IrisObject;
|
||||
import art.arcane.iris.engine.platform.studio.EnginedStudioGenerator;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBiome;
|
||||
import art.arcane.iris.platform.bukkit.BukkitBlockState;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBiome;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.data.VectorMap;
|
||||
@@ -253,12 +253,12 @@ public class ObjectStudioGenerator extends EnginedStudioGenerator {
|
||||
try {
|
||||
ObjectStudioSaveService.get().register(engine, this);
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
int cellCount = layout.cells().size();
|
||||
BlockVector worldExtent = computeExtent(layout);
|
||||
Iris.info("Object Studio layout built: %d cells from %d pack(s), extent %d x %d blocks",
|
||||
IrisLogging.info("Object Studio layout built: %d cells from %d pack(s), extent %d x %d blocks",
|
||||
cellCount, sources.size(), worldExtent.getBlockX(), worldExtent.getBlockZ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +183,11 @@ public final class BukkitPlatform implements IrisPlatform {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportError(Throwable error) {
|
||||
Iris.reportError(error);
|
||||
}
|
||||
|
||||
private static final class BukkitCapabilities implements PlatformCapabilities {
|
||||
@Override
|
||||
public boolean customBiomes() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package art.arcane.iris.util.project.agent;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import net.bytebuddy.agent.ByteBuddyAgent;
|
||||
import net.bytebuddy.dynamic.loading.ClassReloadingStrategy;
|
||||
|
||||
@@ -36,12 +37,12 @@ public class Agent {
|
||||
return false;
|
||||
|
||||
try {
|
||||
Iris.info("Installing Java Agent...");
|
||||
Iris.info("Note: JVM [Attach Listener/ERROR] [STDERR] warning lines during this step are expected and not Iris errors.");
|
||||
IrisLogging.info("Installing Java Agent...");
|
||||
IrisLogging.info("Note: JVM [Attach Listener/ERROR] [STDERR] warning lines during this step are expected and not Iris errors.");
|
||||
ByteBuddyAgent.attach(AGENT_JAR, ByteBuddyAgent.ProcessProvider.ForCurrentVm.INSTANCE);
|
||||
} catch (Throwable e) {
|
||||
Iris.error("Failed to install Java Agent: " + e.getMessage());
|
||||
Iris.reportError(e);
|
||||
IrisLogging.error("Failed to install Java Agent: " + e.getMessage());
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
return doGetInstrumentation() != null;
|
||||
}
|
||||
@@ -49,26 +50,26 @@ public class Agent {
|
||||
private static boolean ensureAgentJar() {
|
||||
File parent = AGENT_JAR.getParentFile();
|
||||
if (parent != null && !parent.exists() && !parent.mkdirs() && !parent.exists()) {
|
||||
Iris.error("Failed to create Iris plugin data folder for Java agent: " + parent.getAbsolutePath());
|
||||
IrisLogging.error("Failed to create Iris plugin data folder for Java agent: " + parent.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
|
||||
try (InputStream in = openBundledAgentJar()) {
|
||||
if (in == null) {
|
||||
if (AGENT_JAR.isFile() && AGENT_JAR.length() > 0) {
|
||||
Iris.warn("Bundled agent.jar not found in Iris plugin jar. Reusing existing " + AGENT_JAR.getAbsolutePath());
|
||||
IrisLogging.warn("Bundled agent.jar not found in Iris plugin jar. Reusing existing " + AGENT_JAR.getAbsolutePath());
|
||||
return true;
|
||||
}
|
||||
|
||||
Iris.error("Bundled agent.jar was not found in Iris plugin jar. Rebuild/deploy Iris with embedded agent.jar.");
|
||||
IrisLogging.error("Bundled agent.jar was not found in Iris plugin jar. Rebuild/deploy Iris with embedded agent.jar.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Files.copy(in, AGENT_JAR.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
Iris.error("Failed to prepare Java agent jar: " + e.getMessage());
|
||||
Iris.reportError(e);
|
||||
IrisLogging.error("Failed to prepare Java agent jar: " + e.getMessage());
|
||||
IrisLogging.reportError(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
package art.arcane.iris.util.project.context;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.volmlib.util.scheduling.ChronoLatch;
|
||||
import lombok.Data;
|
||||
@@ -76,7 +76,7 @@ public class IrisContext {
|
||||
}
|
||||
|
||||
if (!thread.isAlive() || context.engine.isClosed()) {
|
||||
Iris.debug("Dereferenced Context<Engine> " + thread.getName() + " " + thread.threadId());
|
||||
IrisLogging.debug("Dereferenced Context<Engine> " + thread.getName() + " " + thread.threadId());
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.util.project.hunk;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.data.chunk.TerrainChunk;
|
||||
import art.arcane.iris.engine.object.IrisPosition;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.function.*;
|
||||
import art.arcane.volmlib.util.hunk.HunkComputeSupport;
|
||||
import art.arcane.volmlib.util.hunk.HunkCoreSupport;
|
||||
@@ -991,7 +991,7 @@ public interface Hunk<T> extends HunkLike<T> {
|
||||
*/
|
||||
default void set(int x, int y, int z, T t) {
|
||||
if (!contains(x, y, z)) {
|
||||
Iris.warn("OUT OF BOUNDS " + x + " " + y + " " + z + " in bounds " + getWidth() + " " + getHeight() + " " + getDepth());
|
||||
IrisLogging.warn("OUT OF BOUNDS " + x + " " + y + " " + z + " in bounds " + getWidth() + " " + getHeight() + " " + getDepth());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.util.project.matter;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.IrisObject;
|
||||
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.matter.slices.EntityMatter;
|
||||
import art.arcane.iris.util.project.matter.slices.IdentifierMatter;
|
||||
import art.arcane.iris.util.project.matter.slices.SpawnerMatter;
|
||||
@@ -90,9 +90,9 @@ public final class IrisMatterSupport {
|
||||
long oldSize = folder.length();
|
||||
object.read(folder);
|
||||
from(object).write(folder);
|
||||
Iris.info("Converted " + folder.getPath() + " Saved " + (oldSize - folder.length()));
|
||||
IrisLogging.info("Converted " + folder.getPath() + " Saved " + (oldSize - folder.length()));
|
||||
} catch (Throwable e) {
|
||||
Iris.error("Failed to convert " + folder.getPath());
|
||||
IrisLogging.error("Failed to convert " + folder.getPath());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.util.project.matter;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.TileData;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.data.Cuboid;
|
||||
import art.arcane.volmlib.util.matter.IrisMatter;
|
||||
import art.arcane.volmlib.util.matter.Matter;
|
||||
@@ -47,7 +47,7 @@ public class WorldMatter {
|
||||
IrisMatterSupport.ensureRegistered();
|
||||
Cuboid c = new Cuboid(a, b);
|
||||
Matter s = new IrisMatter(c.getSizeX(), c.getSizeY(), c.getSizeZ());
|
||||
Iris.info(s.getWidth() + " " + s.getHeight() + " " + s.getDepth());
|
||||
IrisLogging.info(s.getWidth() + " " + s.getHeight() + " " + s.getDepth());
|
||||
s.getHeader().setAuthor(author);
|
||||
s.slice(BlockData.class).readFrom(c.getLowerNE());
|
||||
s.slice(MatterEntityGroup.class).readFrom(c.getLowerNE());
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
package art.arcane.iris.util.project.noise;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.IRare;
|
||||
import art.arcane.iris.engine.object.NoiseStyle;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.cache.FloatCache;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.format.Form;
|
||||
@@ -286,7 +286,7 @@ public class CNG {
|
||||
fbc.writeCache(dos);
|
||||
dos.close();
|
||||
if (!quiet) {
|
||||
Iris.info("Saved Noise Cache " + f.getName());
|
||||
IrisLogging.info("Saved Noise Cache " + f.getName());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
@@ -509,7 +509,7 @@ public class CNG {
|
||||
try {
|
||||
return values.get(fit2D(0, values.size() - 1, x, z));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
return values.get(0);
|
||||
@@ -548,7 +548,7 @@ public class CNG {
|
||||
try {
|
||||
return v.get(fit(0, v.size() - 1, dim));
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
return v.get(0);
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
package art.arcane.iris.util.project.stream;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.data.cache.Cache;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.IRare;
|
||||
import art.arcane.iris.engine.object.IrisStyledRange;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.stream.ProceduralLayer;
|
||||
import art.arcane.volmlib.util.stream.Significance;
|
||||
@@ -51,8 +51,8 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
try {
|
||||
return of(f, Interpolated.DOUBLE);
|
||||
} catch (IncompatibleClassChangeError e) {
|
||||
Iris.warn(f.toString());
|
||||
Iris.reportError(e);
|
||||
IrisLogging.warn(f.toString());
|
||||
IrisLogging.reportError(e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@
|
||||
|
||||
package art.arcane.iris.util.project.stream.interpolation;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.engine.object.CaveResult;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
@@ -62,7 +62,7 @@ public interface Interpolated<T> {
|
||||
return new InterpolatorFactory<>((ProceduralStream<T>) this);
|
||||
}
|
||||
|
||||
Iris.warn("Cannot interpolate " + this.getClass().getCanonicalName() + "!");
|
||||
IrisLogging.warn("Cannot interpolate " + this.getClass().getCanonicalName() + "!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.util.project.stream.utility;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.format.Form;
|
||||
import art.arcane.volmlib.util.math.RollingSequence;
|
||||
@@ -133,7 +133,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
try {
|
||||
metrics.put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
return t;
|
||||
@@ -146,7 +146,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
try {
|
||||
metrics.put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
Iris.reportError(e);
|
||||
IrisLogging.reportError(e);
|
||||
}
|
||||
|
||||
return t;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package art.arcane.iris.util.project.stream.utility;
|
||||
|
||||
import art.arcane.iris.Iris;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.collection.KMap;
|
||||
import art.arcane.iris.util.project.stream.BasicStream;
|
||||
@@ -23,19 +23,19 @@ public class WasteDetector<T> extends BasicStream<T> {
|
||||
|
||||
public static void printAll() {
|
||||
if (checking) {
|
||||
Iris.warn("=========================================================");
|
||||
IrisLogging.warn("=========================================================");
|
||||
for (String i : allAccesses.sortKNumber().reverse()) {
|
||||
Iris.warn(i + ": " + allAccesses.get(i) + " Time(s)");
|
||||
IrisLogging.warn(i + ": " + allAccesses.get(i) + " Time(s)");
|
||||
}
|
||||
Iris.warn("=========================================================");
|
||||
IrisLogging.warn("=========================================================");
|
||||
for (String i : allAccesses.sortKNumber().reverse()) {
|
||||
Iris.warn("======== " + i + " ========");
|
||||
IrisLogging.warn("======== " + i + " ========");
|
||||
for (Throwable j : allThrows.get(i)) {
|
||||
j.printStackTrace();
|
||||
}
|
||||
Iris.warn("---------------------------------------------------------");
|
||||
IrisLogging.warn("---------------------------------------------------------");
|
||||
}
|
||||
Iris.warn("=========================================================");
|
||||
IrisLogging.warn("=========================================================");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Bukkit Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.spi;
|
||||
|
||||
import java.util.IllegalFormatException;
|
||||
|
||||
public final class IrisLogging {
|
||||
private IrisLogging() {
|
||||
}
|
||||
|
||||
public static void info(String format, Object... args) {
|
||||
emit(LogLevel.INFO, safeFormat(format, args));
|
||||
}
|
||||
|
||||
public static void debug(String message) {
|
||||
emit(LogLevel.DEBUG, message);
|
||||
}
|
||||
|
||||
public static void warn(String format, Object... args) {
|
||||
emit(LogLevel.WARN, safeFormat(format, args));
|
||||
}
|
||||
|
||||
public static void error(String format, Object... args) {
|
||||
emit(LogLevel.ERROR, safeFormat(format, args));
|
||||
}
|
||||
|
||||
public static void reportError(Throwable error) {
|
||||
if (IrisPlatforms.isBound()) {
|
||||
IrisPlatforms.get().reportError(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (error != null) {
|
||||
System.out.println("[Iris/ERROR] " + error.getClass().getName() + (error.getMessage() == null ? "" : ": " + error.getMessage()));
|
||||
error.printStackTrace(System.out);
|
||||
}
|
||||
}
|
||||
|
||||
private static void emit(LogLevel level, String message) {
|
||||
if (IrisPlatforms.isBound()) {
|
||||
IrisPlatforms.get().log(level, message);
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("[Iris/" + level + "] " + message);
|
||||
}
|
||||
|
||||
private static String safeFormat(String format, Object... args) {
|
||||
if (format == null) {
|
||||
return "null";
|
||||
}
|
||||
|
||||
if (args == null || args.length == 0) {
|
||||
return format;
|
||||
}
|
||||
|
||||
try {
|
||||
return String.format(format, args);
|
||||
} catch (IllegalFormatException ignored) {
|
||||
return format;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,4 +43,6 @@ public interface IrisPlatform {
|
||||
void dispatchConsoleCommand(String command);
|
||||
|
||||
void log(LogLevel level, String message);
|
||||
|
||||
void reportError(Throwable error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user