mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-25 21:40:05 +00:00
Plugin Eviction
This commit is contained in:
1 parent
88c87175b3
commit
5142c048c7
59 files changed
+457
-256
No files matched your search
@@ -16,3 +16,5 @@ DataPackExamples/
|
|||||||
|
|
||||||
TreeGenStuff/
|
TreeGenStuff/
|
||||||
dist/
|
dist/
|
||||||
|
core/plugins/
|
||||||
|
adapters/bukkit/plugin/plugins/
|
||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
package art.arcane.iris.core.nms.v1_21_R7;
|
package art.arcane.iris.core.nms.v1_21_R7;
|
||||||
|
|
||||||
import com.mojang.serialization.MapCodec;
|
import com.mojang.serialization.MapCodec;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||||
import art.arcane.iris.engine.framework.Engine;
|
import art.arcane.iris.engine.framework.Engine;
|
||||||
import art.arcane.iris.engine.object.IrisBiome;
|
import art.arcane.iris.engine.object.IrisBiome;
|
||||||
@@ -101,7 +101,7 @@ public class CustomBiomeSource extends BiomeSource {
|
|||||||
if (i.getReturnType().equals(returns)) {
|
if (i.getReturnType().equals(returns)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
IrisLogging.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
||||||
return i.invoke(in);
|
return i.invoke(in);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -118,7 +118,7 @@ public class CustomBiomeSource extends BiomeSource {
|
|||||||
if (i.getType().equals(returnType)) {
|
if (i.getType().equals(returnType)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
IrisLogging.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
||||||
return (T) i.get(in);
|
return (T) i.get(in);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -152,7 +152,7 @@ public class CustomBiomeSource extends BiomeSource {
|
|||||||
if (fallback != null) {
|
if (fallback != null) {
|
||||||
m.put(j.getId(), fallback);
|
m.put(j.getId(), fallback);
|
||||||
}
|
}
|
||||||
Iris.error("Cannot find biome for IrisBiomeCustom " + j.getId() + " from engine " + engine.getName());
|
IrisLogging.error("Cannot find biome for IrisBiomeCustom " + j.getId() + " from engine " + engine.getName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m.put(j.getId(), holder);
|
m.put(j.getId(), holder);
|
||||||
|
|||||||
+5
-5
@@ -2,7 +2,7 @@ package art.arcane.iris.core.nms.v1_21_R7;
|
|||||||
|
|
||||||
import com.mojang.datafixers.util.Pair;
|
import com.mojang.datafixers.util.Pair;
|
||||||
import com.mojang.serialization.MapCodec;
|
import com.mojang.serialization.MapCodec;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.engine.framework.Engine;
|
import art.arcane.iris.engine.framework.Engine;
|
||||||
import art.arcane.iris.engine.object.IrisImportedStructureControl;
|
import art.arcane.iris.engine.object.IrisImportedStructureControl;
|
||||||
import art.arcane.iris.util.common.reflect.WrappedField;
|
import art.arcane.iris.util.common.reflect.WrappedField;
|
||||||
@@ -93,7 +93,7 @@ public class IrisChunkGenerator extends CustomChunkGenerator {
|
|||||||
return Pair.of(best, bestHolder);
|
return Pair.of(best, bestHolder);
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
if (!importedControl().active()) {
|
if (!importedControl().active()) {
|
||||||
return null;
|
return null;
|
||||||
@@ -105,8 +105,8 @@ public class IrisChunkGenerator extends CustomChunkGenerator {
|
|||||||
try {
|
try {
|
||||||
return delegate.findNearestMapStructure(level, reachable, pos, radius, findUnexplored);
|
return delegate.findNearestMapStructure(level, reachable, pos, radius, findUnexplored);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error("Vanilla structure locate failed near " + pos.getX() + ", " + pos.getZ() + ": " + e);
|
IrisLogging.error("Vanilla structure locate failed near " + pos.getX() + ", " + pos.getZ() + ": " + e);
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ public class IrisChunkGenerator extends CustomChunkGenerator {
|
|||||||
structureManager.startsForStructure(sectionPos, structure)
|
structureManager.startsForStructure(sectionPos, structure)
|
||||||
.forEach(start -> start.placeInChunk(target, structureManager, this, random, placeArea, chunkPos));
|
.forEach(start -> start.placeInChunk(target, structureManager, this, random, placeArea, chunkPos));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
|||||||
+20
-20
@@ -1,7 +1,7 @@
|
|||||||
package art.arcane.iris.core.nms.v1_21_R7;
|
package art.arcane.iris.core.nms.v1_21_R7;
|
||||||
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.core.nms.INMSBinding;
|
import art.arcane.iris.core.nms.INMSBinding;
|
||||||
import art.arcane.iris.core.nms.container.BiomeColor;
|
import art.arcane.iris.core.nms.container.BiomeColor;
|
||||||
import art.arcane.iris.core.nms.container.Pair;
|
import art.arcane.iris.core.nms.container.Pair;
|
||||||
@@ -120,7 +120,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (i.getReturnType().equals(returns)) {
|
if (i.getReturnType().equals(returns)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
IrisLogging.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
||||||
return i.invoke(in);
|
return i.invoke(in);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -141,7 +141,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (i.getType().equals(returnType)) {
|
if (i.getType().equals(returnType)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
IrisLogging.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
||||||
return (T) i.get(in);
|
return (T) i.get(in);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -223,7 +223,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
var level = ((CraftWorld) pos.getWorld()).getHandle();
|
var level = ((CraftWorld) pos.getWorld()).getHandle();
|
||||||
var blockPos = new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
var blockPos = new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||||
if (!J.runAt(pos, () -> merge(level, blockPos, tag))) {
|
if (!J.runAt(pos, () -> merge(level, blockPos, tag))) {
|
||||||
Iris.warn("[NMS] Failed to schedule tile deserialize at " + blockPos + " in world " + pos.getWorld().getName());
|
IrisLogging.warn("[NMS] Failed to schedule tile deserialize at " + blockPos + " in world " + pos.getWorld().getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
var blockEntity = level.getBlockEntity(blockPos);
|
var blockEntity = level.getBlockEntity(blockPos);
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
Iris.warn("[NMS] BlockEntity not found at " + blockPos);
|
IrisLogging.warn("[NMS] BlockEntity not found at " + blockPos);
|
||||||
var state = level.getBlockState(blockPos);
|
var state = level.getBlockState(blockPos);
|
||||||
if (!state.hasBlockEntity()) {
|
if (!state.hasBlockEntity()) {
|
||||||
return;
|
return;
|
||||||
@@ -248,8 +248,8 @@ public class NMSBinding implements INMSBinding {
|
|||||||
var accessor = new BlockDataAccessor(blockEntity, blockPos);
|
var accessor = new BlockDataAccessor(blockEntity, blockPos);
|
||||||
accessor.setData(accessor.getData().merge(tag));
|
accessor.setData(accessor.getData().merge(tag));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.warn("[NMS] Failed to merge tile data at " + blockPos + ": " + e.getMessage());
|
IrisLogging.warn("[NMS] Failed to merge tile data at " + blockPos + ": " + e.getMessage());
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
registry().lookupOrThrow(Registries.STRUCTURE).keySet().forEach(k -> keys.add(k.toString()));
|
registry().lookupOrThrow(Registries.STRUCTURE).keySet().forEach(k -> keys.add(k.toString()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -409,7 +409,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
registry().lookupOrThrow(Registries.STRUCTURE_SET).keySet().forEach(k -> keys.add(k.toString()));
|
registry().lookupOrThrow(Registries.STRUCTURE_SET).keySet().forEach(k -> keys.add(k.toString()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -422,7 +422,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
||||||
keys.addAll(VanillaStructureBiomes.reachableStructureKeys(level, source));
|
keys.addAll(VanillaStructureBiomes.reachableStructureKeys(level, source));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -433,7 +433,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
keys.addAll(VanillaStructureBiomes.structureBiomeKeys(registry(), structureKey));
|
keys.addAll(VanillaStructureBiomes.structureBiomeKeys(registry(), structureKey));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -446,7 +446,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
||||||
keys.addAll(VanillaStructureBiomes.possibleBiomeKeys(source));
|
keys.addAll(VanillaStructureBiomes.possibleBiomeKeys(source));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -530,7 +530,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.incrementAndGet();
|
a.incrementAndGet();
|
||||||
Iris.debug("Custom Biome: " + i);
|
IrisLogging.debug("Custom Biome: " + i);
|
||||||
});
|
});
|
||||||
|
|
||||||
return a.get();
|
return a.get();
|
||||||
@@ -617,12 +617,12 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (dimensionType != null) {
|
if (dimensionType != null) {
|
||||||
String actualDimensionType = dimensionType.identifier().toString();
|
String actualDimensionType = dimensionType.identifier().toString();
|
||||||
if (!dimensionType.identifier().getNamespace().equals("iris")) {
|
if (!dimensionType.identifier().getNamespace().equals("iris")) {
|
||||||
Iris.error("Loaded world %s with invalid dimension type! expected=%s actual=%s", world.getName(), expectedDimensionType, actualDimensionType);
|
IrisLogging.error("Loaded world %s with invalid dimension type! expected=%s actual=%s", world.getName(), expectedDimensionType, actualDimensionType);
|
||||||
} else {
|
} else {
|
||||||
Iris.debug("Loaded world " + world.getName() + " with Iris dimension type " + actualDimensionType);
|
IrisLogging.debug("Loaded world " + world.getName() + " with Iris dimension type " + actualDimensionType);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Iris.error("Loaded world %s with unknown dimension type! expected=%s", world.getName(), expectedDimensionType);
|
IrisLogging.error("Loaded world %s with unknown dimension type! expected=%s", world.getName(), expectedDimensionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
IrisChunkGenerator irisGenerator = new IrisChunkGenerator(worldGenContext.generator(), seed, engine, world);
|
IrisChunkGenerator irisGenerator = new IrisChunkGenerator(worldGenContext.generator(), seed, engine, world);
|
||||||
@@ -673,8 +673,8 @@ public class NMSBinding implements INMSBinding {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error("Unable to get entity dimensions for " + entity + "!");
|
IrisLogging.error("Unable to get entity dimensions for " + entity + "!");
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -800,7 +800,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (injected.getAndSet(true))
|
if (injected.getAndSet(true))
|
||||||
return true;
|
return true;
|
||||||
try {
|
try {
|
||||||
Iris.info("Injecting Bukkit");
|
IrisLogging.info("Injecting Bukkit");
|
||||||
var buddy = new ByteBuddy();
|
var buddy = new ByteBuddy();
|
||||||
buddy.redefine(ServerLevel.class)
|
buddy.redefine(ServerLevel.class)
|
||||||
.visit(Advice.to(ServerLevelAdvice.class).on(ElementMatchers.isConstructor()
|
.visit(Advice.to(ServerLevelAdvice.class).on(ElementMatchers.isConstructor()
|
||||||
@@ -817,7 +817,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error(C.RED + "Failed to inject Bukkit");
|
IrisLogging.error(C.RED + "Failed to inject Bukkit");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
package art.arcane.iris.core.nms.v26_1_R1;
|
package art.arcane.iris.core.nms.v26_1_R1;
|
||||||
|
|
||||||
import com.mojang.serialization.MapCodec;
|
import com.mojang.serialization.MapCodec;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||||
import art.arcane.iris.engine.framework.Engine;
|
import art.arcane.iris.engine.framework.Engine;
|
||||||
import art.arcane.iris.engine.object.IrisBiome;
|
import art.arcane.iris.engine.object.IrisBiome;
|
||||||
@@ -101,7 +101,7 @@ public class CustomBiomeSource extends BiomeSource {
|
|||||||
if (i.getReturnType().equals(returns)) {
|
if (i.getReturnType().equals(returns)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
IrisLogging.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
||||||
return i.invoke(in);
|
return i.invoke(in);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -118,7 +118,7 @@ public class CustomBiomeSource extends BiomeSource {
|
|||||||
if (i.getType().equals(returnType)) {
|
if (i.getType().equals(returnType)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
IrisLogging.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
||||||
return (T) i.get(in);
|
return (T) i.get(in);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -152,7 +152,7 @@ public class CustomBiomeSource extends BiomeSource {
|
|||||||
if (fallback != null) {
|
if (fallback != null) {
|
||||||
m.put(j.getId(), fallback);
|
m.put(j.getId(), fallback);
|
||||||
}
|
}
|
||||||
Iris.error("Cannot find biome for IrisBiomeCustom " + j.getId() + " from engine " + engine.getName());
|
IrisLogging.error("Cannot find biome for IrisBiomeCustom " + j.getId() + " from engine " + engine.getName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m.put(j.getId(), holder);
|
m.put(j.getId(), holder);
|
||||||
|
|||||||
+5
-5
@@ -2,7 +2,7 @@ package art.arcane.iris.core.nms.v26_1_R1;
|
|||||||
|
|
||||||
import com.mojang.datafixers.util.Pair;
|
import com.mojang.datafixers.util.Pair;
|
||||||
import com.mojang.serialization.MapCodec;
|
import com.mojang.serialization.MapCodec;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.engine.framework.Engine;
|
import art.arcane.iris.engine.framework.Engine;
|
||||||
import art.arcane.iris.engine.object.IrisImportedStructureControl;
|
import art.arcane.iris.engine.object.IrisImportedStructureControl;
|
||||||
import art.arcane.iris.util.common.reflect.WrappedField;
|
import art.arcane.iris.util.common.reflect.WrappedField;
|
||||||
@@ -93,7 +93,7 @@ public class IrisChunkGenerator extends CustomChunkGenerator {
|
|||||||
return Pair.of(best, bestHolder);
|
return Pair.of(best, bestHolder);
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
if (!importedControl().active()) {
|
if (!importedControl().active()) {
|
||||||
return null;
|
return null;
|
||||||
@@ -105,8 +105,8 @@ public class IrisChunkGenerator extends CustomChunkGenerator {
|
|||||||
try {
|
try {
|
||||||
return delegate.findNearestMapStructure(level, reachable, pos, radius, findUnexplored);
|
return delegate.findNearestMapStructure(level, reachable, pos, radius, findUnexplored);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error("Vanilla structure locate failed near " + pos.getX() + ", " + pos.getZ() + ": " + e);
|
IrisLogging.error("Vanilla structure locate failed near " + pos.getX() + ", " + pos.getZ() + ": " + e);
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,7 +254,7 @@ public class IrisChunkGenerator extends CustomChunkGenerator {
|
|||||||
structureManager.startsForStructure(sectionPos, structure)
|
structureManager.startsForStructure(sectionPos, structure)
|
||||||
.forEach(start -> start.placeInChunk(target, structureManager, this, random, placeArea, chunkPos));
|
.forEach(start -> start.placeInChunk(target, structureManager, this, random, placeArea, chunkPos));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
|||||||
+25
-25
@@ -1,7 +1,7 @@
|
|||||||
package art.arcane.iris.core.nms.v26_1_R1;
|
package art.arcane.iris.core.nms.v26_1_R1;
|
||||||
|
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.core.nms.INMSBinding;
|
import art.arcane.iris.core.nms.INMSBinding;
|
||||||
import art.arcane.iris.core.nms.container.BiomeColor;
|
import art.arcane.iris.core.nms.container.BiomeColor;
|
||||||
import art.arcane.iris.core.nms.container.Pair;
|
import art.arcane.iris.core.nms.container.Pair;
|
||||||
@@ -132,7 +132,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (i.getReturnType().equals(returns)) {
|
if (i.getReturnType().equals(returns)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
IrisLogging.debug("[NMS] Found " + returns.getSimpleName() + " in " + in.getClass().getSimpleName() + "." + i.getName() + "()");
|
||||||
return i.invoke(in);
|
return i.invoke(in);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -153,7 +153,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (i.getType().equals(returnType)) {
|
if (i.getType().equals(returnType)) {
|
||||||
i.setAccessible(true);
|
i.setAccessible(true);
|
||||||
try {
|
try {
|
||||||
Iris.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
IrisLogging.debug("[NMS] Found " + returnType.getSimpleName() + " in " + sourceType.getSimpleName() + "." + i.getName());
|
||||||
return (T) i.get(in);
|
return (T) i.get(in);
|
||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -235,7 +235,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
var level = ((CraftWorld) pos.getWorld()).getHandle();
|
var level = ((CraftWorld) pos.getWorld()).getHandle();
|
||||||
var blockPos = new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
var blockPos = new BlockPos(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||||
if (!J.runAt(pos, () -> merge(level, blockPos, tag))) {
|
if (!J.runAt(pos, () -> merge(level, blockPos, tag))) {
|
||||||
Iris.warn("[NMS] Failed to schedule tile deserialize at " + blockPos + " in world " + pos.getWorld().getName());
|
IrisLogging.warn("[NMS] Failed to schedule tile deserialize at " + blockPos + " in world " + pos.getWorld().getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
var blockEntity = level.getBlockEntity(blockPos);
|
var blockEntity = level.getBlockEntity(blockPos);
|
||||||
if (blockEntity == null) {
|
if (blockEntity == null) {
|
||||||
Iris.warn("[NMS] BlockEntity not found at " + blockPos);
|
IrisLogging.warn("[NMS] BlockEntity not found at " + blockPos);
|
||||||
var state = level.getBlockState(blockPos);
|
var state = level.getBlockState(blockPos);
|
||||||
if (!state.hasBlockEntity()) {
|
if (!state.hasBlockEntity()) {
|
||||||
return;
|
return;
|
||||||
@@ -260,8 +260,8 @@ public class NMSBinding implements INMSBinding {
|
|||||||
var accessor = new BlockDataAccessor(blockEntity, blockPos);
|
var accessor = new BlockDataAccessor(blockEntity, blockPos);
|
||||||
accessor.setData(accessor.getData().merge(tag));
|
accessor.setData(accessor.getData().merge(tag));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.warn("[NMS] Failed to merge tile data at " + blockPos + ": " + e.getMessage());
|
IrisLogging.warn("[NMS] Failed to merge tile data at " + blockPos + ": " + e.getMessage());
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,7 +410,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
registry().lookupOrThrow(Registries.STRUCTURE).keySet().forEach(k -> keys.add(k.toString()));
|
registry().lookupOrThrow(Registries.STRUCTURE).keySet().forEach(k -> keys.add(k.toString()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -421,7 +421,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
registry().lookupOrThrow(Registries.STRUCTURE_SET).keySet().forEach(k -> keys.add(k.toString()));
|
registry().lookupOrThrow(Registries.STRUCTURE_SET).keySet().forEach(k -> keys.add(k.toString()));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -434,7 +434,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
||||||
keys.addAll(VanillaStructureBiomes.reachableStructureKeys(level, source));
|
keys.addAll(VanillaStructureBiomes.reachableStructureKeys(level, source));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -445,7 +445,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
try {
|
try {
|
||||||
keys.addAll(VanillaStructureBiomes.structureBiomeKeys(registry(), structureKey));
|
keys.addAll(VanillaStructureBiomes.structureBiomeKeys(registry(), structureKey));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -458,7 +458,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
BiomeSource source = level.getChunkSource().getGenerator().getBiomeSource();
|
||||||
keys.addAll(VanillaStructureBiomes.possibleBiomeKeys(source));
|
keys.addAll(VanillaStructureBiomes.possibleBiomeKeys(source));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -480,7 +480,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
keys.add(group + "|" + id);
|
keys.add(group + "|" + id);
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
@@ -511,7 +511,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
WorldgenRandom random = new WorldgenRandom(new XoroshiroRandomSource(seed));
|
WorldgenRandom random = new WorldgenRandom(new XoroshiroRandomSource(seed));
|
||||||
return cf.place(level, generator, random, new BlockPos(x, y, z));
|
return cf.place(level, generator, random, new BlockPos(x, y, z));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
}
|
}
|
||||||
return new int[]{box.minX(), box.minY(), box.minZ(), box.maxX(), box.maxY(), box.maxZ()};
|
return new int[]{box.minX(), box.minY(), box.minZ(), box.maxX(), box.maxY(), box.maxZ()};
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -665,7 +665,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.incrementAndGet();
|
a.incrementAndGet();
|
||||||
Iris.debug("Custom Biome: " + i);
|
IrisLogging.debug("Custom Biome: " + i);
|
||||||
});
|
});
|
||||||
|
|
||||||
return a.get();
|
return a.get();
|
||||||
@@ -767,7 +767,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
finishChunkRewrite(level, chunk);
|
finishChunkRewrite(level, chunk);
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -798,7 +798,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
finishChunkRewrite(level, chunk);
|
finishChunkRewrite(level, chunk);
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -846,12 +846,12 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (dimensionType != null) {
|
if (dimensionType != null) {
|
||||||
String actualDimensionType = dimensionType.identifier().toString();
|
String actualDimensionType = dimensionType.identifier().toString();
|
||||||
if (!dimensionType.identifier().getNamespace().equals("iris")) {
|
if (!dimensionType.identifier().getNamespace().equals("iris")) {
|
||||||
Iris.error("Loaded world %s with invalid dimension type! expected=%s actual=%s", world.getName(), expectedDimensionType, actualDimensionType);
|
IrisLogging.error("Loaded world %s with invalid dimension type! expected=%s actual=%s", world.getName(), expectedDimensionType, actualDimensionType);
|
||||||
} else {
|
} else {
|
||||||
Iris.debug("Loaded world " + world.getName() + " with Iris dimension type " + actualDimensionType);
|
IrisLogging.debug("Loaded world " + world.getName() + " with Iris dimension type " + actualDimensionType);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Iris.error("Loaded world %s with unknown dimension type! expected=%s", world.getName(), expectedDimensionType);
|
IrisLogging.error("Loaded world %s with unknown dimension type! expected=%s", world.getName(), expectedDimensionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
IrisChunkGenerator irisGenerator = new IrisChunkGenerator(worldGenContext.generator(), seed, engine, world);
|
IrisChunkGenerator irisGenerator = new IrisChunkGenerator(worldGenContext.generator(), seed, engine, world);
|
||||||
@@ -902,8 +902,8 @@ public class NMSBinding implements INMSBinding {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error("Unable to get entity dimensions for " + entity + "!");
|
IrisLogging.error("Unable to get entity dimensions for " + entity + "!");
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1029,7 +1029,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
if (injected.getAndSet(true))
|
if (injected.getAndSet(true))
|
||||||
return true;
|
return true;
|
||||||
try {
|
try {
|
||||||
Iris.info("Injecting Bukkit");
|
IrisLogging.info("Injecting Bukkit");
|
||||||
var buddy = new ByteBuddy();
|
var buddy = new ByteBuddy();
|
||||||
buddy.redefine(ServerLevel.class)
|
buddy.redefine(ServerLevel.class)
|
||||||
.visit(Advice.to(ServerLevelAdvice.class).on(ElementMatchers.isConstructor()
|
.visit(Advice.to(ServerLevelAdvice.class).on(ElementMatchers.isConstructor()
|
||||||
@@ -1046,7 +1046,7 @@ public class NMSBinding implements INMSBinding {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error(C.RED + "Failed to inject Bukkit");
|
IrisLogging.error(C.RED + "Failed to inject Bukkit");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
def apiVersion = '26.1'
|
||||||
|
def mainClass = 'art.arcane.iris.Iris'
|
||||||
|
|
||||||
|
String volmLibCoordinate = providers.gradleProperty('volmLibCoordinate')
|
||||||
|
.orElse('com.github.VolmitSoftware:VolmLib:master-SNAPSHOT')
|
||||||
|
.get()
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly(project(':core'))
|
||||||
|
compileOnly(volmLibCoordinate) {
|
||||||
|
changing = true
|
||||||
|
transitive = false
|
||||||
|
}
|
||||||
|
compileOnly(libs.spigot)
|
||||||
|
testImplementation('junit:junit:4.13.2')
|
||||||
|
testImplementation(libs.spigot)
|
||||||
|
testImplementation(libs.bstats)
|
||||||
|
testImplementation(libs.sentry)
|
||||||
|
testImplementation(project(':core'))
|
||||||
|
testImplementation(volmLibCoordinate) {
|
||||||
|
changing = true
|
||||||
|
transitive = false
|
||||||
|
}
|
||||||
|
compileOnly(libs.placeholderApi)
|
||||||
|
compileOnly(libs.multiverseCore)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('processResources').configure {
|
||||||
|
def pluginProperties = [
|
||||||
|
name : rootProject.name,
|
||||||
|
version : rootProject.version,
|
||||||
|
apiVersion: apiVersion,
|
||||||
|
main : mainClass,
|
||||||
|
]
|
||||||
|
inputs.properties(pluginProperties)
|
||||||
|
filesMatching('**/plugin.yml') {
|
||||||
|
expand(pluginProperties)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('jar', Jar).configure {
|
||||||
|
archiveBaseName.set('iris-bukkit-plugin')
|
||||||
|
}
|
||||||
+2
-2
@@ -78,7 +78,6 @@ import art.arcane.iris.util.common.misc.ServerProperties;
|
|||||||
import art.arcane.iris.util.simd.SimdSupport;
|
import art.arcane.iris.util.simd.SimdSupport;
|
||||||
import art.arcane.volmlib.util.scheduling.Queue;
|
import art.arcane.volmlib.util.scheduling.Queue;
|
||||||
import art.arcane.volmlib.util.scheduling.ShurikenQueue;
|
import art.arcane.volmlib.util.scheduling.ShurikenQueue;
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@@ -593,6 +592,7 @@ public class Iris extends VolmitPlugin implements Listener, ReloadAware {
|
|||||||
tickets = new ChunkTickets();
|
tickets = new ChunkTickets();
|
||||||
linkMultiverseCore = new MultiverseCoreLink();
|
linkMultiverseCore = new MultiverseCoreLink();
|
||||||
IrisServices.register(MultiverseCoreLink.class, linkMultiverseCore);
|
IrisServices.register(MultiverseCoreLink.class, linkMultiverseCore);
|
||||||
|
IrisServices.register(art.arcane.iris.core.runtime.WorldDeletionQueue.class, (art.arcane.iris.core.runtime.WorldDeletionQueue) Iris::queueWorldDeletionOnStartup);
|
||||||
settingsFile = getDataFile("settings.json");
|
settingsFile = getDataFile("settings.json");
|
||||||
configHotloadEngine = new ConfigHotloadEngine(
|
configHotloadEngine = new ConfigHotloadEngine(
|
||||||
Iris::isSettingsFile,
|
Iris::isSettingsFile,
|
||||||
@@ -912,7 +912,7 @@ public class Iris extends VolmitPlugin implements Listener, ReloadAware {
|
|||||||
for (Player i : getServer().getOnlinePlayers()) {
|
for (Player i : getServer().getOnlinePlayers()) {
|
||||||
final Runnable playerTask = () -> {
|
final Runnable playerTask = () -> {
|
||||||
i.setGameMode(GameMode.SPECTATOR);
|
i.setGameMode(GameMode.SPECTATOR);
|
||||||
PaperLib.teleportAsync(i, spawn);
|
BukkitPlatform.teleportAsync(i, spawn);
|
||||||
};
|
};
|
||||||
if (!J.runEntity(i, playerTask)) {
|
if (!J.runEntity(i, playerTask)) {
|
||||||
playerTask.run();
|
playerTask.run();
|
||||||
File renamed without changes.
+2
-1
@@ -22,6 +22,7 @@ import com.google.gson.JsonArray;
|
|||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.Iris;
|
||||||
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.ServerConfigurator;
|
import art.arcane.iris.core.ServerConfigurator;
|
||||||
import art.arcane.iris.core.nms.datapack.DataVersion;
|
import art.arcane.iris.core.nms.datapack.DataVersion;
|
||||||
@@ -116,7 +117,7 @@ public class CommandDeveloper implements DirectorExecutor {
|
|||||||
for (int rz = centerZ - radius; rz <= centerZ + radius; rz++) {
|
for (int rz = centerZ - radius; rz <= centerZ + radius; rz++) {
|
||||||
org.bukkit.ChunkSnapshot snapshot;
|
org.bukkit.ChunkSnapshot snapshot;
|
||||||
try {
|
try {
|
||||||
org.bukkit.Chunk loaded = io.papermc.lib.PaperLib.getChunkAtAsync(world, rx, rz, true).get();
|
org.bukkit.Chunk loaded = art.arcane.iris.platform.bukkit.BukkitPlatform.chunkAtAsync(world, rx, rz, true).get();
|
||||||
snapshot = loaded.getChunkSnapshot(false, false, false);
|
snapshot = loaded.getChunkSnapshot(false, false, false);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
Iris.reportError(e);
|
||||||
File renamed without changes.
+2
-2
@@ -19,6 +19,7 @@
|
|||||||
package art.arcane.iris.core.commands;
|
package art.arcane.iris.core.commands;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.Iris;
|
||||||
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
import art.arcane.iris.core.service.ObjectStudioSaveService;
|
import art.arcane.iris.core.service.ObjectStudioSaveService;
|
||||||
import art.arcane.iris.engine.framework.Engine;
|
import art.arcane.iris.engine.framework.Engine;
|
||||||
import art.arcane.iris.engine.framework.IrisStructureLocator;
|
import art.arcane.iris.engine.framework.IrisStructureLocator;
|
||||||
@@ -34,7 +35,6 @@ import art.arcane.volmlib.util.collection.KList;
|
|||||||
import art.arcane.volmlib.util.director.DirectorOrigin;
|
import art.arcane.volmlib.util.director.DirectorOrigin;
|
||||||
import art.arcane.volmlib.util.director.annotations.Director;
|
import art.arcane.volmlib.util.director.annotations.Director;
|
||||||
import art.arcane.volmlib.util.director.annotations.Param;
|
import art.arcane.volmlib.util.director.annotations.Param;
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.Registry;
|
import org.bukkit.Registry;
|
||||||
@@ -145,7 +145,7 @@ public class CommandFind implements DirectorExecutor {
|
|||||||
Location at = result.getLocation();
|
Location at = result.getLocation();
|
||||||
int y = target.getWorld().getHighestBlockYAt(at.getBlockX(), at.getBlockZ()) + 2;
|
int y = target.getWorld().getHighestBlockYAt(at.getBlockX(), at.getBlockZ()) + 2;
|
||||||
Location dest = new Location(target.getWorld(), at.getBlockX() + 0.5, y, at.getBlockZ() + 0.5);
|
Location dest = new Location(target.getWorld(), at.getBlockX() + 0.5, y, at.getBlockZ() + 0.5);
|
||||||
PaperLib.teleportAsync(target, dest);
|
BukkitPlatform.teleportAsync(target, dest);
|
||||||
sender().sendMessage(C.GREEN + "Teleported to " + structure + " @ " + at.getBlockX() + ", " + at.getBlockZ());
|
sender().sendMessage(C.GREEN + "Teleported to " + structure + " @ " + at.getBlockX() + ", " + at.getBlockZ());
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
sender().sendMessage(C.RED + "Could not locate " + structure + ": " + t.getClass().getSimpleName());
|
sender().sendMessage(C.RED + "Could not locate " + structure + ": " + t.getClass().getSimpleName());
|
||||||
+2
-2
@@ -19,6 +19,7 @@
|
|||||||
package art.arcane.iris.core.commands;
|
package art.arcane.iris.core.commands;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.Iris;
|
||||||
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.IrisWorlds;
|
import art.arcane.iris.core.IrisWorlds;
|
||||||
import art.arcane.iris.core.ServerConfigurator;
|
import art.arcane.iris.core.ServerConfigurator;
|
||||||
@@ -45,7 +46,6 @@ import art.arcane.iris.util.common.parallel.SyncExecutor;
|
|||||||
import art.arcane.iris.util.common.misc.ServerProperties;
|
import art.arcane.iris.util.common.misc.ServerProperties;
|
||||||
import art.arcane.iris.util.common.plugin.VolmitSender;
|
import art.arcane.iris.util.common.plugin.VolmitSender;
|
||||||
import art.arcane.iris.util.common.scheduling.J;
|
import art.arcane.iris.util.common.scheduling.J;
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@@ -294,7 +294,7 @@ public class CommandIris implements DirectorExecutor {
|
|||||||
|
|
||||||
final Location spawn = world.getSpawnLocation();
|
final Location spawn = world.getSpawnLocation();
|
||||||
final Runnable teleportTask = () -> {
|
final Runnable teleportTask = () -> {
|
||||||
PaperLib.teleportAsync(target, spawn);
|
BukkitPlatform.teleportAsync(target, spawn);
|
||||||
new VolmitSender(target).sendMessage(C.GREEN + "You have been teleported to " + world.getName() + ".");
|
new VolmitSender(target).sendMessage(C.GREEN + "You have been teleported to " + world.getName() + ".");
|
||||||
};
|
};
|
||||||
if (!J.runEntity(target, teleportTask)) {
|
if (!J.runEntity(target, teleportTask)) {
|
||||||
+2
-2
@@ -19,6 +19,7 @@
|
|||||||
package art.arcane.iris.core.commands;
|
package art.arcane.iris.core.commands;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.Iris;
|
||||||
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
import art.arcane.iris.core.link.WorldEditLink;
|
import art.arcane.iris.core.link.WorldEditLink;
|
||||||
import art.arcane.iris.core.loader.IrisData;
|
import art.arcane.iris.core.loader.IrisData;
|
||||||
import art.arcane.iris.core.loader.ResourceLoader;
|
import art.arcane.iris.core.loader.ResourceLoader;
|
||||||
@@ -49,7 +50,6 @@ import art.arcane.iris.util.common.director.specialhandlers.ObjectTargetHandler;
|
|||||||
import art.arcane.iris.util.common.format.C;
|
import art.arcane.iris.util.common.format.C;
|
||||||
import art.arcane.iris.util.common.math.Direction;
|
import art.arcane.iris.util.common.math.Direction;
|
||||||
import art.arcane.volmlib.util.math.RNG;
|
import art.arcane.volmlib.util.math.RNG;
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.data.BlockData;
|
import org.bukkit.block.data.BlockData;
|
||||||
@@ -148,7 +148,7 @@ public class CommandObject implements DirectorExecutor {
|
|||||||
if (p != null) {
|
if (p != null) {
|
||||||
Location target = new Location(world, 0.5D, 66D, 0.5D);
|
Location target = new Location(world, 0.5D, 66D, 0.5D);
|
||||||
J.runEntity(p, () -> {
|
J.runEntity(p, () -> {
|
||||||
PaperLib.teleportAsync(p, target).thenRun(() -> p.setGameMode(GameMode.CREATIVE));
|
BukkitPlatform.teleportAsync(p, target).thenRun(() -> p.setGameMode(GameMode.CREATIVE));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-3
@@ -19,6 +19,7 @@
|
|||||||
package art.arcane.iris.core.commands;
|
package art.arcane.iris.core.commands;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.Iris;
|
||||||
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.gui.NoiseExplorerGUI;
|
import art.arcane.iris.core.gui.NoiseExplorerGUI;
|
||||||
import art.arcane.iris.core.gui.VisionGUI;
|
import art.arcane.iris.core.gui.VisionGUI;
|
||||||
@@ -63,7 +64,6 @@ import art.arcane.iris.util.common.scheduling.J;
|
|||||||
import art.arcane.volmlib.util.scheduling.O;
|
import art.arcane.volmlib.util.scheduling.O;
|
||||||
import art.arcane.volmlib.util.scheduling.PrecisionStopwatch;
|
import art.arcane.volmlib.util.scheduling.PrecisionStopwatch;
|
||||||
import art.arcane.iris.util.common.scheduling.jobs.ParallelRadiusJob;
|
import art.arcane.iris.util.common.scheduling.jobs.ParallelRadiusJob;
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
@@ -615,7 +615,7 @@ public class CommandStudio implements DirectorExecutor {
|
|||||||
|
|
||||||
sender().sendMessage(C.GREEN + "Sending you to the studio world!");
|
sender().sendMessage(C.GREEN + "Sending you to the studio world!");
|
||||||
var player = player();
|
var player = player();
|
||||||
PaperLib.teleportAsync(player(), Iris.service(StudioSVC.class)
|
BukkitPlatform.teleportAsync(player(), Iris.service(StudioSVC.class)
|
||||||
.getActiveProject()
|
.getActiveProject()
|
||||||
.getActiveProvider()
|
.getActiveProvider()
|
||||||
.getTarget()
|
.getTarget()
|
||||||
@@ -674,7 +674,7 @@ public class CommandStudio implements DirectorExecutor {
|
|||||||
pw.println("Iris Version: " + Iris.instance.getDescription().getVersion());
|
pw.println("Iris Version: " + Iris.instance.getDescription().getVersion());
|
||||||
pw.println("Bukkit Version: " + Bukkit.getBukkitVersion());
|
pw.println("Bukkit Version: " + Bukkit.getBukkitVersion());
|
||||||
pw.println("MC Version: " + Bukkit.getVersion());
|
pw.println("MC Version: " + Bukkit.getVersion());
|
||||||
pw.println("PaperSpigot: " + (PaperLib.isPaper() ? "Yup!" : "Nope!"));
|
pw.println("PaperSpigot: " + (BukkitPlatform.isPaperServer() ? "Yup!" : "Nope!"));
|
||||||
pw.println("Report Captured At: " + new Date());
|
pw.println("Report Captured At: " + new Date());
|
||||||
pw.println("Chunks: (" + chunks.size() + "): ");
|
pw.println("Chunks: (" + chunks.size() + "): ");
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -102,6 +102,7 @@ dependencies {
|
|||||||
add('included', project(path: ":adapters:bukkit:nms:${key}", configuration: 'runtimeElements'))
|
add('included', project(path: ":adapters:bukkit:nms:${key}", configuration: 'runtimeElements'))
|
||||||
}
|
}
|
||||||
add('included', project(path: ':core', configuration: 'shadow'))
|
add('included', project(path: ':core', configuration: 'shadow'))
|
||||||
|
add('included', project(path: ':adapters:bukkit:plugin', configuration: 'runtimeElements'))
|
||||||
add('jarJar', project(':core:agent'))
|
add('jarJar', project(':core:agent'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-17
@@ -39,8 +39,6 @@ plugins {
|
|||||||
alias(libs.plugins.kotlin.lombok)
|
alias(libs.plugins.kotlin.lombok)
|
||||||
}
|
}
|
||||||
|
|
||||||
def apiVersion = '26.1'
|
|
||||||
def mainClass = 'art.arcane.iris.Iris'
|
|
||||||
def lib = 'art.arcane.iris.util'
|
def lib = 'art.arcane.iris.util'
|
||||||
String volmLibCoordinate = providers.gradleProperty('volmLibCoordinate')
|
String volmLibCoordinate = providers.gradleProperty('volmLibCoordinate')
|
||||||
.orElse('com.github.VolmitSoftware:VolmLib:master-SNAPSHOT')
|
.orElse('com.github.VolmitSoftware:VolmLib:master-SNAPSHOT')
|
||||||
@@ -225,21 +223,7 @@ tasks.named('test', Test).configure {
|
|||||||
jvmArgs('--add-modules', 'jdk.incubator.vector')
|
jvmArgs('--add-modules', 'jdk.incubator.vector')
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named('processResources').configure {
|
configurations.matching { it.name.startsWith('slim') }.all { }
|
||||||
/**
|
|
||||||
* Expand properties into plugin yml
|
|
||||||
*/
|
|
||||||
def pluginProperties = [
|
|
||||||
name : rootProject.name,
|
|
||||||
version : rootProject.version,
|
|
||||||
apiVersion: apiVersion,
|
|
||||||
main : mainClass,
|
|
||||||
]
|
|
||||||
inputs.properties(pluginProperties)
|
|
||||||
filesMatching('**/plugin.yml') {
|
|
||||||
expand(pluginProperties)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def runningTestTasks = gradle.startParameter.taskNames.any { String taskName -> taskName.toLowerCase().contains('test') }
|
def runningTestTasks = gradle.startParameter.taskNames.any { String taskName -> taskName.toLowerCase().contains('test') }
|
||||||
if (runningTestTasks) {
|
if (runningTestTasks) {
|
||||||
|
|||||||
@@ -1,22 +1,10 @@
|
|||||||
art/arcane/iris/core/commands/CommandDeveloper.java
|
|
||||||
art/arcane/iris/core/commands/CommandFind.java
|
|
||||||
art/arcane/iris/core/commands/CommandIris.java
|
|
||||||
art/arcane/iris/core/commands/CommandObject.java
|
|
||||||
art/arcane/iris/core/commands/CommandPregen.java
|
|
||||||
art/arcane/iris/core/commands/CommandStructure.java
|
|
||||||
art/arcane/iris/core/commands/CommandStudio.java
|
|
||||||
art/arcane/iris/core/commands/CommandWhat.java
|
|
||||||
art/arcane/iris/core/datapack/DatapackIngestService.java
|
art/arcane/iris/core/datapack/DatapackIngestService.java
|
||||||
art/arcane/iris/core/edit/BlockEditor.java
|
|
||||||
art/arcane/iris/core/edit/BlockSignal.java
|
art/arcane/iris/core/edit/BlockSignal.java
|
||||||
art/arcane/iris/core/edit/BukkitBlockEditor.java
|
|
||||||
art/arcane/iris/core/edit/DustRevealer.java
|
art/arcane/iris/core/edit/DustRevealer.java
|
||||||
art/arcane/iris/core/events/IrisEngineEvent.java
|
art/arcane/iris/core/events/IrisEngineEvent.java
|
||||||
art/arcane/iris/core/events/IrisEngineHotloadEvent.java
|
art/arcane/iris/core/events/IrisEngineHotloadEvent.java
|
||||||
art/arcane/iris/core/events/IrisLootEvent.java
|
art/arcane/iris/core/events/IrisLootEvent.java
|
||||||
art/arcane/iris/core/gui/NoiseExplorerGUI.java
|
|
||||||
art/arcane/iris/core/gui/PregeneratorJob.java
|
art/arcane/iris/core/gui/PregeneratorJob.java
|
||||||
art/arcane/iris/core/gui/VisionGUI.java
|
|
||||||
art/arcane/iris/core/IrisRuntimeSchedulerMode.java
|
art/arcane/iris/core/IrisRuntimeSchedulerMode.java
|
||||||
art/arcane/iris/core/IrisWorlds.java
|
art/arcane/iris/core/IrisWorlds.java
|
||||||
art/arcane/iris/core/lifecycle/BukkitPublicBackend.java
|
art/arcane/iris/core/lifecycle/BukkitPublicBackend.java
|
||||||
@@ -42,7 +30,6 @@ art/arcane/iris/core/link/data/MythicMobsDataProvider.java
|
|||||||
art/arcane/iris/core/link/data/NexoDataProvider.java
|
art/arcane/iris/core/link/data/NexoDataProvider.java
|
||||||
art/arcane/iris/core/link/ExternalDataProvider.java
|
art/arcane/iris/core/link/ExternalDataProvider.java
|
||||||
art/arcane/iris/core/link/Identifier.java
|
art/arcane/iris/core/link/Identifier.java
|
||||||
art/arcane/iris/core/link/IrisPapiExpansion.java
|
|
||||||
art/arcane/iris/core/link/MultiverseCoreLink.java
|
art/arcane/iris/core/link/MultiverseCoreLink.java
|
||||||
art/arcane/iris/core/link/WorldEditLink.java
|
art/arcane/iris/core/link/WorldEditLink.java
|
||||||
art/arcane/iris/core/nms/datapack/v1206/DataFixerV1206.java
|
art/arcane/iris/core/nms/datapack/v1206/DataFixerV1206.java
|
||||||
@@ -72,17 +59,12 @@ art/arcane/iris/core/safeguard/Mode.java
|
|||||||
art/arcane/iris/core/safeguard/task/Tasks.java
|
art/arcane/iris/core/safeguard/task/Tasks.java
|
||||||
art/arcane/iris/core/ServerConfigurator.java
|
art/arcane/iris/core/ServerConfigurator.java
|
||||||
art/arcane/iris/core/service/BoardSVC.java
|
art/arcane/iris/core/service/BoardSVC.java
|
||||||
art/arcane/iris/core/service/CommandSVC.java
|
|
||||||
art/arcane/iris/core/service/EditSVC.java
|
|
||||||
art/arcane/iris/core/service/ExternalDataSVC.java
|
art/arcane/iris/core/service/ExternalDataSVC.java
|
||||||
art/arcane/iris/core/service/GlobalCacheSVC.java
|
art/arcane/iris/core/service/GlobalCacheSVC.java
|
||||||
art/arcane/iris/core/service/IrisEngineSVC.java
|
|
||||||
art/arcane/iris/core/service/IrisIntegrationService.java
|
|
||||||
art/arcane/iris/core/service/ObjectStudioSaveService.java
|
art/arcane/iris/core/service/ObjectStudioSaveService.java
|
||||||
art/arcane/iris/core/service/ObjectSVC.java
|
art/arcane/iris/core/service/ObjectSVC.java
|
||||||
art/arcane/iris/core/service/StudioSVC.java
|
art/arcane/iris/core/service/StudioSVC.java
|
||||||
art/arcane/iris/core/service/TreeSVC.java
|
art/arcane/iris/core/service/TreeSVC.java
|
||||||
art/arcane/iris/core/service/WandSVC.java
|
|
||||||
art/arcane/iris/core/structure/BulkStructureImporter.java
|
art/arcane/iris/core/structure/BulkStructureImporter.java
|
||||||
art/arcane/iris/core/structure/FeatureImporter.java
|
art/arcane/iris/core/structure/FeatureImporter.java
|
||||||
art/arcane/iris/core/structure/StructureCaptureImporter.java
|
art/arcane/iris/core/structure/StructureCaptureImporter.java
|
||||||
@@ -95,7 +77,6 @@ art/arcane/iris/core/tools/IrisReflectiveAPI.java
|
|||||||
art/arcane/iris/core/tools/IrisToolbelt.java
|
art/arcane/iris/core/tools/IrisToolbelt.java
|
||||||
art/arcane/iris/core/tools/IrisWorldCreator.java
|
art/arcane/iris/core/tools/IrisWorldCreator.java
|
||||||
art/arcane/iris/core/tools/TreePlausibilizer.java
|
art/arcane/iris/core/tools/TreePlausibilizer.java
|
||||||
art/arcane/iris/core/wand/WandSelection.java
|
|
||||||
art/arcane/iris/engine/actuator/IrisBiomeActuator.java
|
art/arcane/iris/engine/actuator/IrisBiomeActuator.java
|
||||||
art/arcane/iris/engine/data/chunk/LinkedTerrainChunk.java
|
art/arcane/iris/engine/data/chunk/LinkedTerrainChunk.java
|
||||||
art/arcane/iris/engine/data/chunk/TerrainChunk.java
|
art/arcane/iris/engine/data/chunk/TerrainChunk.java
|
||||||
@@ -171,7 +152,6 @@ art/arcane/iris/engine/platform/BukkitChunkGenerator.java
|
|||||||
art/arcane/iris/engine/platform/DummyBiomeProvider.java
|
art/arcane/iris/engine/platform/DummyBiomeProvider.java
|
||||||
art/arcane/iris/engine/platform/DummyChunkGenerator.java
|
art/arcane/iris/engine/platform/DummyChunkGenerator.java
|
||||||
art/arcane/iris/engine/platform/studio/generators/ObjectStudioGenerator.java
|
art/arcane/iris/engine/platform/studio/generators/ObjectStudioGenerator.java
|
||||||
art/arcane/iris/Iris.java
|
|
||||||
art/arcane/iris/platform/bukkit/BukkitBiome.java
|
art/arcane/iris/platform/bukkit/BukkitBiome.java
|
||||||
art/arcane/iris/platform/bukkit/BukkitBlockState.java
|
art/arcane/iris/platform/bukkit/BukkitBlockState.java
|
||||||
art/arcane/iris/platform/bukkit/BukkitEntityType.java
|
art/arcane/iris/platform/bukkit/BukkitEntityType.java
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ package art.arcane.iris.core;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.loader.IrisData;
|
import art.arcane.iris.core.loader.IrisData;
|
||||||
import art.arcane.iris.engine.data.cache.AtomicCache;
|
import art.arcane.iris.engine.data.cache.AtomicCache;
|
||||||
import art.arcane.iris.engine.object.IrisDimension;
|
import art.arcane.iris.engine.object.IrisDimension;
|
||||||
@@ -36,7 +37,7 @@ public class IrisWorlds {
|
|||||||
|
|
||||||
public static IrisWorlds get() {
|
public static IrisWorlds get() {
|
||||||
return cache.aquire(() -> {
|
return cache.aquire(() -> {
|
||||||
File file = Iris.instance.getDataFile("worlds.json");
|
File file = IrisPlatforms.get().dataFile("worlds.json");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
return new IrisWorlds(new KMap<>());
|
return new IrisWorlds(new KMap<>());
|
||||||
}
|
}
|
||||||
@@ -46,9 +47,9 @@ public class IrisWorlds {
|
|||||||
KMap<String, String> worlds = GSON.fromJson(json, TYPE);
|
KMap<String, String> worlds = GSON.fromJson(json, TYPE);
|
||||||
return new IrisWorlds(Objects.requireNonNullElseGet(worlds, KMap::new));
|
return new IrisWorlds(Objects.requireNonNullElseGet(worlds, KMap::new));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.error("Failed to load worlds.json!");
|
IrisLogging.error("Failed to load worlds.json!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new IrisWorlds(new KMap<>());
|
return new IrisWorlds(new KMap<>());
|
||||||
@@ -81,7 +82,7 @@ public class IrisWorlds {
|
|||||||
return getWorlds()
|
return getWorlds()
|
||||||
.entrySet()
|
.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.map(entry -> Iris.loadDimension(entry.getKey(), entry.getValue()))
|
.map(entry -> loadDimension(entry.getKey(), entry.getValue()))
|
||||||
.filter(Objects::nonNull);
|
.filter(Objects::nonNull);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,12 +94,12 @@ public class IrisWorlds {
|
|||||||
clean();
|
clean();
|
||||||
if (!dirty) return;
|
if (!dirty) return;
|
||||||
try {
|
try {
|
||||||
IO.write(Iris.instance.getDataFile("worlds.json"), OutputStreamWriter::new, writer -> GSON.toJson(worlds, TYPE, writer));
|
IO.write(IrisPlatforms.get().dataFile("worlds.json"), OutputStreamWriter::new, writer -> GSON.toJson(worlds, TYPE, writer));
|
||||||
dirty = false;
|
dirty = false;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.error("Failed to save worlds.json!");
|
IrisLogging.error("Failed to save worlds.json!");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,4 +135,21 @@ public class IrisWorlds {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static art.arcane.iris.engine.object.IrisDimension loadDimension(String worldName, String id) {
|
||||||
|
java.io.File pack = new java.io.File(org.bukkit.Bukkit.getWorldContainer(), String.join(java.io.File.separator, worldName, "iris", "pack"));
|
||||||
|
art.arcane.iris.engine.object.IrisDimension dimension = pack.isDirectory() ? art.arcane.iris.core.loader.IrisData.get(pack).getDimensionLoader().load(id) : null;
|
||||||
|
if (dimension == null) {
|
||||||
|
dimension = art.arcane.iris.core.loader.IrisData.loadAnyDimension(id, null);
|
||||||
|
}
|
||||||
|
if (dimension == null) {
|
||||||
|
IrisLogging.warn("Unable to find dimension type " + id + " Looking for online packs...");
|
||||||
|
art.arcane.iris.spi.IrisServices.get(art.arcane.iris.core.service.StudioSVC.class).downloadSearch(new art.arcane.iris.util.common.plugin.VolmitSender(org.bukkit.Bukkit.getConsoleSender()), id, false);
|
||||||
|
dimension = art.arcane.iris.core.loader.IrisData.loadAnyDimension(id, null);
|
||||||
|
if (dimension != null) {
|
||||||
|
IrisLogging.info("Resolved missing dimension, proceeding.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dimension;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
package art.arcane.iris.core;
|
package art.arcane.iris.core;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.datapack.DatapackIngestService;
|
import art.arcane.iris.core.datapack.DatapackIngestService;
|
||||||
import art.arcane.iris.core.loader.IrisData;
|
import art.arcane.iris.core.loader.IrisData;
|
||||||
import art.arcane.iris.core.nms.INMS;
|
import art.arcane.iris.core.nms.INMS;
|
||||||
@@ -98,8 +99,8 @@ public class ServerConfigurator {
|
|||||||
long spigotTimeout = TimeUnit.MINUTES.toSeconds(5);
|
long spigotTimeout = TimeUnit.MINUTES.toSeconds(5);
|
||||||
|
|
||||||
if (tt < spigotTimeout) {
|
if (tt < spigotTimeout) {
|
||||||
Iris.warn("Updating spigot.yml timeout-time: " + tt + " -> " + spigotTimeout + " (5 minutes)");
|
IrisLogging.warn("Updating spigot.yml timeout-time: " + tt + " -> " + spigotTimeout + " (5 minutes)");
|
||||||
Iris.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value.");
|
IrisLogging.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value.");
|
||||||
f.set("settings.timeout-time", spigotTimeout);
|
f.set("settings.timeout-time", spigotTimeout);
|
||||||
f.save(spigotConfig);
|
f.save(spigotConfig);
|
||||||
}
|
}
|
||||||
@@ -113,8 +114,8 @@ public class ServerConfigurator {
|
|||||||
|
|
||||||
long watchdog = TimeUnit.MINUTES.toMillis(3);
|
long watchdog = TimeUnit.MINUTES.toMillis(3);
|
||||||
if (tt < watchdog) {
|
if (tt < watchdog) {
|
||||||
Iris.warn("Updating paper.yml watchdog early-warning-delay: " + tt + " -> " + watchdog + " (3 minutes)");
|
IrisLogging.warn("Updating paper.yml watchdog early-warning-delay: " + tt + " -> " + watchdog + " (3 minutes)");
|
||||||
Iris.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value.");
|
IrisLogging.warn("You can disable this change (autoconfigureServer) in Iris settings, then change back the value.");
|
||||||
f.set("watchdog.early-warning-delay", watchdog);
|
f.set("watchdog.early-warning-delay", watchdog);
|
||||||
f.save(spigotConfig);
|
f.save(spigotConfig);
|
||||||
}
|
}
|
||||||
@@ -141,7 +142,7 @@ public class ServerConfigurator {
|
|||||||
IDataFixer fixer = DataVersion.getDefault();
|
IDataFixer fixer = DataVersion.getDefault();
|
||||||
if (fixer == null) {
|
if (fixer == null) {
|
||||||
DataVersion fallback = DataVersion.getLatest();
|
DataVersion fallback = DataVersion.getLatest();
|
||||||
Iris.warn("Primary datapack fixer was null, forcing latest fixer: " + fallback.getVersion());
|
IrisLogging.warn("Primary datapack fixer was null, forcing latest fixer: " + fallback.getVersion());
|
||||||
fixer = fallback.get();
|
fixer = fallback.get();
|
||||||
}
|
}
|
||||||
return installDataPacks(fixer, fullInstall);
|
return installDataPacks(fixer, fullInstall);
|
||||||
@@ -149,13 +150,13 @@ public class ServerConfigurator {
|
|||||||
|
|
||||||
public static boolean installDataPacks(IDataFixer fixer, boolean fullInstall) {
|
public static boolean installDataPacks(IDataFixer fixer, boolean fullInstall) {
|
||||||
if (fixer == null) {
|
if (fixer == null) {
|
||||||
Iris.error("Unable to install datapacks, fixer is null!");
|
IrisLogging.error("Unable to install datapacks, fixer is null!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (fullInstall) {
|
if (fullInstall) {
|
||||||
Iris.info("Checking Data Packs...");
|
IrisLogging.info("Checking Data Packs...");
|
||||||
} else {
|
} else {
|
||||||
Iris.verbose("Checking Data Packs...");
|
IrisLogging.debug("Checking Data Packs...");
|
||||||
}
|
}
|
||||||
DimensionHeight height = new DimensionHeight(fixer);
|
DimensionHeight height = new DimensionHeight(fixer);
|
||||||
KList<File> folders = getDatapacksFolder();
|
KList<File> folders = getDatapacksFolder();
|
||||||
@@ -166,25 +167,25 @@ public class ServerConfigurator {
|
|||||||
stream.flatMap(height::merge)
|
stream.flatMap(height::merge)
|
||||||
.parallel()
|
.parallel()
|
||||||
.forEach(dim -> {
|
.forEach(dim -> {
|
||||||
Iris.verbose(" Checking Dimension " + dim.getLoadFile().getPath());
|
IrisLogging.debug(" Checking Dimension " + dim.getLoadFile().getPath());
|
||||||
dim.installBiomes(fixer, dim::getLoader, folders, biomes.computeIfAbsent(dim.getLoadKey(), k -> new KSet<>()));
|
dim.installBiomes(fixer, dim::getLoader, folders, biomes.computeIfAbsent(dim.getLoadKey(), k -> new KSet<>()));
|
||||||
dim.installDimensionType(fixer, folders);
|
dim.installDimensionType(fixer, folders);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
IrisDimension.writeShared(folders, height);
|
IrisDimension.writeShared(folders, height);
|
||||||
if (fullInstall) {
|
if (fullInstall) {
|
||||||
Iris.info("Data Packs Setup!");
|
IrisLogging.info("Data Packs Setup!");
|
||||||
} else {
|
} else {
|
||||||
Iris.verbose("Data Packs Setup!");
|
IrisLogging.debug("Data Packs Setup!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return fullInstall && verifyDataPacksPost(IrisSettings.get().getAutoConfiguration().isAutoRestartOnCustomBiomeInstall());
|
return fullInstall && verifyDataPacksPost(IrisSettings.get().getAutoConfiguration().isAutoRestartOnCustomBiomeInstall());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean installDataPacksIfChanged(boolean fullInstall) {
|
public static boolean installDataPacksIfChanged(boolean fullInstall) {
|
||||||
File packsDir = Iris.instance.getDataFolder("packs");
|
File packsDir = IrisPlatforms.get().dataFolder("packs");
|
||||||
String current = computePackFingerprint(packsDir);
|
String current = computePackFingerprint(packsDir);
|
||||||
File cacheFile = new File(Iris.instance.getDataFolder("cache"), "datapack-fingerprint");
|
File cacheFile = new File(IrisPlatforms.get().dataFolder("cache"), "datapack-fingerprint");
|
||||||
String cached = "";
|
String cached = "";
|
||||||
if (cacheFile.exists()) {
|
if (cacheFile.exists()) {
|
||||||
try {
|
try {
|
||||||
@@ -194,7 +195,7 @@ public class ServerConfigurator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!current.isEmpty() && current.equals(cached)) {
|
if (!current.isEmpty() && current.equals(cached)) {
|
||||||
Iris.verbose("Data packs unchanged, skipping install.");
|
IrisLogging.debug("Data packs unchanged, skipping install.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean result = installDataPacks(fullInstall);
|
boolean result = installDataPacks(fullInstall);
|
||||||
@@ -202,7 +203,7 @@ public class ServerConfigurator {
|
|||||||
cacheFile.getParentFile().mkdirs();
|
cacheFile.getParentFile().mkdirs();
|
||||||
Files.writeString(cacheFile.toPath(), current, StandardCharsets.UTF_8);
|
Files.writeString(cacheFile.toPath(), current, StandardCharsets.UTF_8);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.warn("Failed to write datapack fingerprint cache: " + e.getMessage());
|
IrisLogging.warn("Failed to write datapack fingerprint cache: " + e.getMessage());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -286,7 +287,7 @@ public class ServerConfigurator {
|
|||||||
try (Stream<IrisData> stream = allPacks()) {
|
try (Stream<IrisData> stream = allPacks()) {
|
||||||
boolean bad = stream
|
boolean bad = stream
|
||||||
.map(data -> {
|
.map(data -> {
|
||||||
Iris.verbose("Checking Pack: " + data.getDataFolder().getPath());
|
IrisLogging.debug("Checking Pack: " + data.getDataFolder().getPath());
|
||||||
var loader = data.getDimensionLoader();
|
var loader = data.getDimensionLoader();
|
||||||
return loader.loadAll(loader.getPossibleKeys())
|
return loader.loadAll(loader.getPossibleKeys())
|
||||||
.stream()
|
.stream()
|
||||||
@@ -304,16 +305,16 @@ public class ServerConfigurator {
|
|||||||
if (allowRestarting) {
|
if (allowRestarting) {
|
||||||
restart();
|
restart();
|
||||||
} else if (INMS.get().supportsDataPacks()) {
|
} else if (INMS.get().supportsDataPacks()) {
|
||||||
Iris.error("============================================================================");
|
IrisLogging.error("============================================================================");
|
||||||
Iris.error(C.ITALIC + "You need to restart your server to properly generate custom biomes.");
|
IrisLogging.error(C.ITALIC + "You need to restart your server to properly generate custom biomes.");
|
||||||
Iris.error(C.ITALIC + "By continuing, Iris will use backup biomes in place of the custom biomes.");
|
IrisLogging.error(C.ITALIC + "By continuing, Iris will use backup biomes in place of the custom biomes.");
|
||||||
Iris.error("----------------------------------------------------------------------------");
|
IrisLogging.error("----------------------------------------------------------------------------");
|
||||||
Iris.error(C.UNDERLINE + "IT IS HIGHLY RECOMMENDED YOU RESTART THE SERVER BEFORE GENERATING!");
|
IrisLogging.error(C.UNDERLINE + "IT IS HIGHLY RECOMMENDED YOU RESTART THE SERVER BEFORE GENERATING!");
|
||||||
Iris.error("============================================================================");
|
IrisLogging.error("============================================================================");
|
||||||
|
|
||||||
for (Player i : Bukkit.getOnlinePlayers()) {
|
for (Player i : Bukkit.getOnlinePlayers()) {
|
||||||
if (i.isOp() || i.hasPermission("iris.all")) {
|
if (i.isOp() || i.hasPermission("iris.all")) {
|
||||||
VolmitSender sender = new VolmitSender(i, Iris.instance.getTag("WARNING"));
|
VolmitSender sender = new VolmitSender(i, art.arcane.iris.platform.bukkit.BukkitPlatform.volmitPlugin().getTag("WARNING"));
|
||||||
sender.sendMessage("There are some Iris Packs that have custom biomes in them");
|
sender.sendMessage("There are some Iris Packs that have custom biomes in them");
|
||||||
sender.sendMessage("You need to restart your server to use these packs.");
|
sender.sendMessage("You need to restart your server to use these packs.");
|
||||||
}
|
}
|
||||||
@@ -326,11 +327,11 @@ public class ServerConfigurator {
|
|||||||
|
|
||||||
public static void restart() {
|
public static void restart() {
|
||||||
J.s(() -> {
|
J.s(() -> {
|
||||||
Iris.warn("New data pack entries have been installed in Iris! Restarting server!");
|
IrisLogging.warn("New data pack entries have been installed in Iris! Restarting server!");
|
||||||
Iris.warn("This will only happen when your pack changes (updates/first time setup)");
|
IrisLogging.warn("This will only happen when your pack changes (updates/first time setup)");
|
||||||
Iris.warn("(You can disable this auto restart in iris settings)");
|
IrisLogging.warn("(You can disable this auto restart in iris settings)");
|
||||||
J.s(() -> {
|
J.s(() -> {
|
||||||
Iris.warn("Looks like the restart command didn't work. Stopping the server instead!");
|
IrisLogging.warn("Looks like the restart command didn't work. Stopping the server instead!");
|
||||||
Bukkit.shutdown();
|
Bukkit.shutdown();
|
||||||
}, 100);
|
}, 100);
|
||||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "restart");
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "restart");
|
||||||
@@ -354,11 +355,11 @@ public class ServerConfigurator {
|
|||||||
|
|
||||||
if (!INMS.get().supportsDataPacks()) {
|
if (!INMS.get().supportsDataPacks()) {
|
||||||
if (!keys.isEmpty()) {
|
if (!keys.isEmpty()) {
|
||||||
Iris.warn("===================================================================================");
|
IrisLogging.warn("===================================================================================");
|
||||||
Iris.warn("Pack " + key + " has " + keys.size() + " custom biome(s). ");
|
IrisLogging.warn("Pack " + key + " has " + keys.size() + " custom biome(s). ");
|
||||||
Iris.warn("Your server version does not yet support datapacks for iris.");
|
IrisLogging.warn("Your server version does not yet support datapacks for iris.");
|
||||||
Iris.warn("The world will generate these biomes as backup biomes.");
|
IrisLogging.warn("The world will generate these biomes as backup biomes.");
|
||||||
Iris.warn("====================================================================================");
|
IrisLogging.warn("====================================================================================");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -368,26 +369,26 @@ public class ServerConfigurator {
|
|||||||
Object o = INMS.get().getCustomBiomeBaseFor(i);
|
Object o = INMS.get().getCustomBiomeBaseFor(i);
|
||||||
|
|
||||||
if (o == null) {
|
if (o == null) {
|
||||||
Iris.warn("The Biome " + i + " is not registered on the server.");
|
IrisLogging.warn("The Biome " + i + " is not registered on the server.");
|
||||||
warn = true;
|
warn = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (INMS.get().missingDimensionTypes(dimension.getDimensionTypeKey())) {
|
if (INMS.get().missingDimensionTypes(dimension.getDimensionTypeKey())) {
|
||||||
Iris.warn("The Dimension Type for " + dimension.getLoadFile() + " is not registered on the server.");
|
IrisLogging.warn("The Dimension Type for " + dimension.getLoadFile() + " is not registered on the server.");
|
||||||
warn = true;
|
warn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (warn) {
|
if (warn) {
|
||||||
Iris.error("The Pack " + key + " is INCAPABLE of generating custom biomes");
|
IrisLogging.error("The Pack " + key + " is INCAPABLE of generating custom biomes");
|
||||||
Iris.error("If not done automatically, restart your server before generating with this pack!");
|
IrisLogging.error("If not done automatically, restart your server before generating with this pack!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return !warn;
|
return !warn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Stream<IrisData> allPacks() {
|
public static Stream<IrisData> allPacks() {
|
||||||
File[] packs = Iris.instance.getDataFolder("packs").listFiles(File::isDirectory);
|
File[] packs = IrisPlatforms.get().dataFolder("packs").listFiles(File::isDirectory);
|
||||||
Stream<File> locals = packs == null ? Stream.empty() : Arrays.stream(packs);
|
Stream<File> locals = packs == null ? Stream.empty() : Arrays.stream(packs);
|
||||||
return Stream.concat(locals
|
return Stream.concat(locals
|
||||||
.filter( base -> {
|
.filter( base -> {
|
||||||
@@ -422,7 +423,7 @@ public class ServerConfigurator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Stream<IrisDimension> merge(IrisData data) {
|
public Stream<IrisDimension> merge(IrisData data) {
|
||||||
Iris.verbose("Checking Pack: " + data.getDataFolder().getPath());
|
IrisLogging.debug("Checking Pack: " + data.getDataFolder().getPath());
|
||||||
var loader = data.getDimensionLoader();
|
var loader = data.getDimensionLoader();
|
||||||
return loader.loadAll(loader.getPossibleKeys())
|
return loader.loadAll(loader.getPossibleKeys())
|
||||||
.stream()
|
.stream()
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
package art.arcane.iris.core.edit;
|
package art.arcane.iris.core.edit;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.core.nms.INMS;
|
import art.arcane.iris.core.nms.INMS;
|
||||||
import art.arcane.iris.core.tools.IrisToolbelt;
|
import art.arcane.iris.core.tools.IrisToolbelt;
|
||||||
import art.arcane.iris.engine.framework.Engine;
|
import art.arcane.iris.engine.framework.Engine;
|
||||||
@@ -101,7 +102,7 @@ public class DustRevealer {
|
|||||||
is(new BlockPosition(block.getX() + 1, block.getY() - 1, block.getZ() - 1));
|
is(new BlockPosition(block.getX() + 1, block.getY() - 1, block.getZ() - 1));
|
||||||
is(new BlockPosition(block.getX() + 1, block.getY() - 1, block.getZ() + 1));
|
is(new BlockPosition(block.getX() + 1, block.getY() - 1, block.getZ() + 1));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -195,7 +196,7 @@ public class DustRevealer {
|
|||||||
lines.add("Server biome: " + INMS.get().getTrueBiomeBaseKey(block.getLocation())
|
lines.add("Server biome: " + INMS.get().getTrueBiomeBaseKey(block.getLocation())
|
||||||
+ " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(block.getLocation())) + ")");
|
+ " (ID: " + INMS.get().getTrueBiomeBaseId(INMS.get().getTrueBiomeBase(block.getLocation())) + ")");
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (region != null) {
|
if (region != null) {
|
||||||
@@ -255,7 +256,7 @@ public class DustRevealer {
|
|||||||
try {
|
try {
|
||||||
return supplier.get();
|
return supplier.get();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -269,9 +270,9 @@ public class DustRevealer {
|
|||||||
.color(NamedTextColor.GREEN)
|
.color(NamedTextColor.GREEN)
|
||||||
.clickEvent(ClickEvent.copyToClipboard(payload))
|
.clickEvent(ClickEvent.copyToClipboard(payload))
|
||||||
.hoverEvent(HoverEvent.showText(Component.text("Copy block stats to clipboard")));
|
.hoverEvent(HoverEvent.showText(Component.text("Copy block stats to clipboard")));
|
||||||
Iris.audiences.player(sender.player()).sendMessage(button);
|
BukkitPlatform.audiences().player(sender.player()).sendMessage(button);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
package art.arcane.iris.core.gui;
|
package art.arcane.iris.core.gui;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.pregenerator.IrisPregenerator;
|
import art.arcane.iris.core.pregenerator.IrisPregenerator;
|
||||||
import art.arcane.iris.core.pregenerator.PregenListener;
|
import art.arcane.iris.core.pregenerator.PregenListener;
|
||||||
@@ -183,8 +185,8 @@ public class PregeneratorJob implements PregenListener {
|
|||||||
try {
|
try {
|
||||||
return Color.decode(v);
|
return Color.decode(v);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
Iris.error("Error Parsing 'color', (" + c + ")");
|
IrisLogging.error("Error Parsing 'color', (" + c + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Color.RED;
|
return Color.RED;
|
||||||
@@ -217,7 +219,7 @@ public class PregeneratorJob implements PregenListener {
|
|||||||
renderer.func.accept(new Position2(x, z), color);
|
renderer.func.accept(new Position2(x, z), color);
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
Iris.error("Failed to draw pregen");
|
IrisLogging.error("Failed to draw pregen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +238,7 @@ public class PregeneratorJob implements PregenListener {
|
|||||||
J.sleep(3000);
|
J.sleep(3000);
|
||||||
frame.setVisible(false);
|
frame.setVisible(false);
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
Iris.error("Error closing pregen gui");
|
IrisLogging.error("Error closing pregen gui");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -259,7 +261,7 @@ public class PregeneratorJob implements PregenListener {
|
|||||||
frame.setSize(1000, 1000);
|
frame.setSize(1000, 1000);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
Iris.error("Error opening pregen gui");
|
IrisLogging.error("Error opening pregen gui");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -421,7 +423,7 @@ public class PregeneratorJob implements PregenListener {
|
|||||||
try {
|
try {
|
||||||
order.pop().run();
|
order.pop().run();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package art.arcane.iris.core.lifecycle;
|
package art.arcane.iris.core.lifecycle;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import io.papermc.lib.PaperLib;
|
import io.papermc.lib.PaperLib;
|
||||||
import io.papermc.lib.environments.PaperEnvironment;
|
import io.papermc.lib.environments.PaperEnvironment;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -30,7 +32,7 @@ public final class PaperLibBootstrap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PaperLib.setCustomEnvironment(new ModernPaperEnvironment());
|
PaperLib.setCustomEnvironment(new ModernPaperEnvironment());
|
||||||
Iris.info("PaperLib version detection failed for MC " + bukkitVersion + "; forced modern Paper environment");
|
IrisLogging.info("PaperLib version detection failed for MC " + bukkitVersion + "; forced modern Paper environment");
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean isModernVersionScheme(String bukkitVersion) {
|
static boolean isModernVersionScheme(String bukkitVersion) {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package art.arcane.iris.core.lifecycle;
|
package art.arcane.iris.core.lifecycle;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
@@ -44,7 +46,7 @@ final class PaperLikeRuntimeBackend implements WorldLifecycleBackend {
|
|||||||
WorldLifecycleStaging.stageGenerator(request.worldName(), request.generator(), request.biomeProvider());
|
WorldLifecycleStaging.stageGenerator(request.worldName(), request.generator(), request.biomeProvider());
|
||||||
WorldLifecycleSupport.stageRuntimeConfiguration(request.worldName());
|
WorldLifecycleSupport.stageRuntimeConfiguration(request.worldName());
|
||||||
|
|
||||||
Iris.debug("WorldLifecycle runtime LevelStem: world=" + request.worldName()
|
IrisLogging.debug("WorldLifecycle runtime LevelStem: world=" + request.worldName()
|
||||||
+ ", backend=paper_like_runtime, flavor=" + capabilities.paperLikeFlavor().name().toLowerCase(Locale.ROOT)
|
+ ", backend=paper_like_runtime, flavor=" + capabilities.paperLikeFlavor().name().toLowerCase(Locale.ROOT)
|
||||||
+ ", registrySource=" + WorldLifecycleSupport.runtimeLevelStemRegistrySource(request));
|
+ ", registrySource=" + WorldLifecycleSupport.runtimeLevelStemRegistrySource(request));
|
||||||
Object levelStem = WorldLifecycleSupport.resolveRuntimeLevelStem(capabilities, request);
|
Object levelStem = WorldLifecycleSupport.resolveRuntimeLevelStem(capabilities, request);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package art.arcane.iris.core.lifecycle;
|
package art.arcane.iris.core.lifecycle;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.util.common.scheduling.J;
|
import art.arcane.iris.util.common.scheduling.J;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ public final class WorldLifecycleService {
|
|||||||
|
|
||||||
CapabilitySnapshot capabilities = CapabilitySnapshot.probe();
|
CapabilitySnapshot capabilities = CapabilitySnapshot.probe();
|
||||||
instance = new WorldLifecycleService(capabilities);
|
instance = new WorldLifecycleService(capabilities);
|
||||||
Iris.info("WorldLifecycle capabilities: %s", capabilities.describe());
|
IrisLogging.info("WorldLifecycle capabilities: %s", capabilities.describe());
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,18 +58,18 @@ public final class WorldLifecycleService {
|
|||||||
try {
|
try {
|
||||||
backend = selectCreateBackend(request);
|
backend = selectCreateBackend(request);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("WorldLifecycle create backend selection failed for world=\"" + request.worldName()
|
IrisLogging.reportError("WorldLifecycle create backend selection failed for world=\"" + request.worldName()
|
||||||
+ "\", caller=" + request.callerKind().name().toLowerCase() + ".", e);
|
+ "\", caller=" + request.callerKind().name().toLowerCase() + ".", e);
|
||||||
return CompletableFuture.failedFuture(e);
|
return CompletableFuture.failedFuture(e);
|
||||||
}
|
}
|
||||||
Iris.info("WorldLifecycle create: world=%s, caller=%s, backend=%s",
|
IrisLogging.info("WorldLifecycle create: world=%s, caller=%s, backend=%s",
|
||||||
request.worldName(),
|
request.worldName(),
|
||||||
request.callerKind().name().toLowerCase(),
|
request.callerKind().name().toLowerCase(),
|
||||||
backend.backendName());
|
backend.backendName());
|
||||||
return backend.create(request).whenComplete((world, throwable) -> {
|
return backend.create(request).whenComplete((world, throwable) -> {
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
Throwable cause = WorldLifecycleSupport.unwrap(throwable);
|
Throwable cause = WorldLifecycleSupport.unwrap(throwable);
|
||||||
Iris.reportError("WorldLifecycle create failed: world=\"" + request.worldName()
|
IrisLogging.reportError("WorldLifecycle create failed: world=\"" + request.worldName()
|
||||||
+ "\", caller=" + request.callerKind().name().toLowerCase()
|
+ "\", caller=" + request.callerKind().name().toLowerCase()
|
||||||
+ ", backend=" + backend.backendName()
|
+ ", backend=" + backend.backendName()
|
||||||
+ ", family=" + capabilities.serverFamily().id() + ".", cause);
|
+ ", family=" + capabilities.serverFamily().id() + ".", cause);
|
||||||
@@ -105,14 +107,14 @@ public final class WorldLifecycleService {
|
|||||||
|
|
||||||
private boolean unloadDirect(World world, boolean save) {
|
private boolean unloadDirect(World world, boolean save) {
|
||||||
WorldLifecycleBackend backend = selectUnloadBackend(world.getName());
|
WorldLifecycleBackend backend = selectUnloadBackend(world.getName());
|
||||||
Iris.info("WorldLifecycle unload: world=%s, backend=%s",
|
IrisLogging.info("WorldLifecycle unload: world=%s, backend=%s",
|
||||||
world.getName(),
|
world.getName(),
|
||||||
backend.backendName());
|
backend.backendName());
|
||||||
boolean unloaded;
|
boolean unloaded;
|
||||||
try {
|
try {
|
||||||
unloaded = backend.unload(world, save);
|
unloaded = backend.unload(world, save);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("WorldLifecycle unload failed: world=\"" + world.getName()
|
IrisLogging.reportError("WorldLifecycle unload failed: world=\"" + world.getName()
|
||||||
+ "\", backend=" + backend.backendName()
|
+ "\", backend=" + backend.backendName()
|
||||||
+ ", family=" + capabilities.serverFamily().id() + ".", e);
|
+ ", family=" + capabilities.serverFamily().id() + ".", e);
|
||||||
if (e instanceof RuntimeException runtimeException) {
|
if (e instanceof RuntimeException runtimeException) {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package art.arcane.iris.core.lifecycle;
|
package art.arcane.iris.core.lifecycle;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.link.Identifier;
|
import art.arcane.iris.core.link.Identifier;
|
||||||
import art.arcane.iris.core.nms.INMS;
|
import art.arcane.iris.core.nms.INMS;
|
||||||
import art.arcane.iris.core.nms.INMSBinding;
|
import art.arcane.iris.core.nms.INMSBinding;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package art.arcane.iris.core.runtime;
|
package art.arcane.iris.core.runtime;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.lifecycle.WorldLifecycleService;
|
import art.arcane.iris.core.lifecycle.WorldLifecycleService;
|
||||||
import art.arcane.iris.core.project.IrisProject;
|
import art.arcane.iris.core.project.IrisProject;
|
||||||
import art.arcane.iris.core.tools.IrisCreator;
|
import art.arcane.iris.core.tools.IrisCreator;
|
||||||
@@ -87,7 +89,7 @@ public final class StudioOpenCoordinator {
|
|||||||
try {
|
try {
|
||||||
long openStart = System.currentTimeMillis();
|
long openStart = System.currentTimeMillis();
|
||||||
long t = openStart;
|
long t = openStart;
|
||||||
Iris.debug("[Studio timing] ===== studio open START: " + request.worldName() + " =====");
|
IrisLogging.debug("[Studio timing] ===== studio open START: " + request.worldName() + " =====");
|
||||||
updateStage(request, "resolve_dimension", 0.04D);
|
updateStage(request, "resolve_dimension", 0.04D);
|
||||||
if (IrisToolbelt.getDimension(request.dimensionKey()) == null) {
|
if (IrisToolbelt.getDimension(request.dimensionKey()) == null) {
|
||||||
throw new IrisException("Dimension cannot be found for id " + request.dimensionKey() + ".");
|
throw new IrisException("Dimension cannot be found for id " + request.dimensionKey() + ".");
|
||||||
@@ -186,16 +188,16 @@ public final class StudioOpenCoordinator {
|
|||||||
}
|
}
|
||||||
t = logStudioPhase("finalize + openVSCode", t, openStart);
|
t = logStudioPhase("finalize + openVSCode", t, openStart);
|
||||||
|
|
||||||
Iris.info("Studio open: " + world.getName() + " ready in " + (System.currentTimeMillis() - openStart) + "ms");
|
IrisLogging.info("Studio open: " + world.getName() + " ready in " + (System.currentTimeMillis() - openStart) + "ms");
|
||||||
future.complete(new StudioOpenResult(world, safeEntry));
|
future.complete(new StudioOpenResult(world, safeEntry));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Studio open failed for world \"" + request.worldName() + "\".", e);
|
IrisLogging.reportError("Studio open failed for world \"" + request.worldName() + "\".", e);
|
||||||
if (!request.retainOnFailure()) {
|
if (!request.retainOnFailure()) {
|
||||||
try {
|
try {
|
||||||
updateStage(request, "cleanup", 1.00D);
|
updateStage(request, "cleanup", 1.00D);
|
||||||
closeWorld(provider, request.worldName(), world, true, request.project());
|
closeWorld(provider, request.worldName(), world, true, request.project());
|
||||||
} catch (Throwable cleanupError) {
|
} catch (Throwable cleanupError) {
|
||||||
Iris.reportError("Studio cleanup failed for world \"" + request.worldName() + "\".", cleanupError);
|
IrisLogging.reportError("Studio cleanup failed for world \"" + request.worldName() + "\".", cleanupError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
future.completeExceptionally(e);
|
future.completeExceptionally(e);
|
||||||
@@ -204,7 +206,7 @@ public final class StudioOpenCoordinator {
|
|||||||
|
|
||||||
private long logStudioPhase(String phase, long t, long openStart) {
|
private long logStudioPhase(String phase, long t, long openStart) {
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
Iris.debug("[Studio timing] " + phase + " = " + (now - t) + "ms (cumulative " + (now - openStart) + "ms)");
|
IrisLogging.debug("[Studio timing] " + phase + " = " + (now - t) + "ms (cumulative " + (now - openStart) + "ms)");
|
||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +221,7 @@ public final class StudioOpenCoordinator {
|
|||||||
CompletableFuture<Void> loaded = new CompletableFuture<>();
|
CompletableFuture<Void> loaded = new CompletableFuture<>();
|
||||||
J.s(() -> {
|
J.s(() -> {
|
||||||
try {
|
try {
|
||||||
world.addPluginChunkTicket(chunkX, chunkZ, Iris.instance);
|
world.addPluginChunkTicket(chunkX, chunkZ, art.arcane.iris.platform.bukkit.BukkitPlatform.plugin());
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
loaded.completeExceptionally(t);
|
loaded.completeExceptionally(t);
|
||||||
return;
|
return;
|
||||||
@@ -331,7 +333,7 @@ public final class StudioOpenCoordinator {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iris.linkMultiverseCore.removeFromConfig(familyWorld);
|
IrisServices.get(art.arcane.iris.core.link.MultiverseCoreLink.class).removeFromConfig(familyWorld);
|
||||||
WorldLifecycleService.get().unload(familyWorld, false);
|
WorldLifecycleService.get().unload(familyWorld, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -353,7 +355,7 @@ public final class StudioOpenCoordinator {
|
|||||||
deleteWorldFolderAsync(folder, 40).get(15L, TimeUnit.SECONDS);
|
deleteWorldFolderAsync(folder, 40).get(15L, TimeUnit.SECONDS);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
liveDeleted = false;
|
liveDeleted = false;
|
||||||
Iris.reportError("Studio folder deletion retries failed for \"" + folder.getAbsolutePath() + "\".", unwrapFailure(e));
|
IrisLogging.reportError("Studio folder deletion retries failed for \"" + folder.getAbsolutePath() + "\".", unwrapFailure(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folder.exists()) {
|
if (folder.exists()) {
|
||||||
@@ -366,11 +368,11 @@ public final class StudioOpenCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Iris.queueWorldDeletionOnStartup(Collections.singleton(worldName));
|
IrisServices.get(WorldDeletionQueue.class).queueForStartupDeletion(Collections.singleton(worldName));
|
||||||
return new WorldFamilyDeleteResult(false, true);
|
return new WorldFamilyDeleteResult(false, true);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (unloadCompletedLive) {
|
if (unloadCompletedLive) {
|
||||||
Iris.reportError("Failed to queue deferred deletion for world \"" + worldName + "\".", e);
|
IrisLogging.reportError("Failed to queue deferred deletion for world \"" + worldName + "\".", e);
|
||||||
}
|
}
|
||||||
return new WorldFamilyDeleteResult(false, false);
|
return new WorldFamilyDeleteResult(false, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* 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.core.runtime;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Queues world folders for deletion at next startup.
|
||||||
|
*/
|
||||||
|
public interface WorldDeletionQueue {
|
||||||
|
int queueForStartupDeletion(Collection<String> worldNames) throws IOException;
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package art.arcane.iris.core.runtime;
|
package art.arcane.iris.core.runtime;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.lifecycle.CapabilitySnapshot;
|
import art.arcane.iris.core.lifecycle.CapabilitySnapshot;
|
||||||
import art.arcane.iris.core.lifecycle.ServerFamily;
|
import art.arcane.iris.core.lifecycle.ServerFamily;
|
||||||
@@ -58,7 +60,7 @@ public final class WorldRuntimeControlService {
|
|||||||
|
|
||||||
CapabilitySnapshot capabilities = WorldLifecycleService.get().capabilities();
|
CapabilitySnapshot capabilities = WorldLifecycleService.get().capabilities();
|
||||||
instance = new WorldRuntimeControlService(capabilities);
|
instance = new WorldRuntimeControlService(capabilities);
|
||||||
Iris.info("WorldRuntimeControl capabilities: %s", instance.capabilityDescription);
|
IrisLogging.info("WorldRuntimeControl capabilities: %s", instance.capabilityDescription);
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +82,7 @@ public final class WorldRuntimeControlService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iris.linkMultiverseCore.removeFromConfig(world);
|
IrisServices.get(art.arcane.iris.core.link.MultiverseCoreLink.class).removeFromConfig(world);
|
||||||
setIntGameRule(world, 0, "SPAWN_CHUNK_RADIUS", "spawnChunkRadius");
|
setIntGameRule(world, 0, "SPAWN_CHUNK_RADIUS", "spawnChunkRadius");
|
||||||
if (!IrisSettings.get().getStudio().isDisableTimeAndWeather()) {
|
if (!IrisSettings.get().getStudio().isDisableTimeAndWeather()) {
|
||||||
return true;
|
return true;
|
||||||
@@ -157,7 +159,7 @@ public final class WorldRuntimeControlService {
|
|||||||
backend.syncTime(world);
|
backend.syncTime(world);
|
||||||
return true;
|
return true;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Runtime time control failed for world \"" + world.getName() + "\".", e);
|
IrisLogging.reportError("Runtime time control failed for world \"" + world.getName() + "\".", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,7 +187,7 @@ public final class WorldRuntimeControlService {
|
|||||||
engine.getMantle().getComponents();
|
engine.getMantle().getComponents();
|
||||||
engine.getMantle().getRealRadius();
|
engine.getMantle().getRealRadius();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Failed to prepare generator state for world \"" + world.getName() + "\".", e);
|
IrisLogging.reportError("Failed to prepare generator state for world \"" + world.getName() + "\".", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +265,7 @@ public final class WorldRuntimeControlService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Boolean.TRUE.equals(success)) {
|
if (Boolean.TRUE.equals(success)) {
|
||||||
J.runEntity(player, () -> Iris.service(BoardSVC.class).updatePlayer(player));
|
J.runEntity(player, () -> IrisServices.get(BoardSVC.class).updatePlayer(player));
|
||||||
future.complete(true);
|
future.complete(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package art.arcane.iris.core.safeguard.task;
|
package art.arcane.iris.core.safeguard.task;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
import art.arcane.iris.util.common.format.C;
|
import art.arcane.iris.util.common.format.C;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
@@ -82,11 +82,11 @@ public class Diagnostic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum Logger {
|
public enum Logger {
|
||||||
DEBUG(Iris::debug),
|
DEBUG(IrisLogging::debug),
|
||||||
RAW(Iris::msg),
|
RAW(IrisLogging::msg),
|
||||||
INFO(Iris::info),
|
INFO(IrisLogging::info),
|
||||||
WARN(Iris::warn),
|
WARN(IrisLogging::warn),
|
||||||
ERROR(Iris::error);
|
ERROR(IrisLogging::error);
|
||||||
|
|
||||||
private final Consumer<String> logger;
|
private final Consumer<String> logger;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package art.arcane.iris.core.safeguard.task;
|
package art.arcane.iris.core.safeguard.task;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.platform.bukkit.BukkitPlatform;
|
||||||
import art.arcane.iris.core.IrisWorlds;
|
import art.arcane.iris.core.IrisWorlds;
|
||||||
import art.arcane.iris.core.nms.INMS;
|
import art.arcane.iris.core.nms.INMS;
|
||||||
import art.arcane.iris.core.nms.v1X.NMSBinding1X;
|
import art.arcane.iris.core.nms.v1X.NMSBinding1X;
|
||||||
@@ -85,7 +85,7 @@ public final class Tasks {
|
|||||||
});
|
});
|
||||||
|
|
||||||
private static final Task VERSION = Task.of("version", () -> {
|
private static final Task VERSION = Task.of("version", () -> {
|
||||||
String[] parts = Iris.instance.getDescription().getVersion().split("-");
|
String[] parts = BukkitPlatform.plugin().getDescription().getVersion().split("-");
|
||||||
String supportedVersions;
|
String supportedVersions;
|
||||||
if (parts.length >= 3) {
|
if (parts.length >= 3) {
|
||||||
String minVersion = parts[1];
|
String minVersion = parts[1];
|
||||||
@@ -147,7 +147,7 @@ public final class Tasks {
|
|||||||
});
|
});
|
||||||
|
|
||||||
private static final Task JAVA = Task.of("java", () -> {
|
private static final Task JAVA = Task.of("java", () -> {
|
||||||
int version = Iris.getJavaVersion();
|
int version = javaVersion();
|
||||||
if (version == 25) {
|
if (version == 25) {
|
||||||
return withDiagnostics(Mode.STABLE);
|
return withDiagnostics(Mode.STABLE);
|
||||||
}
|
}
|
||||||
@@ -208,4 +208,17 @@ public final class Tasks {
|
|||||||
private static ValueWithDiagnostics<Mode> withDiagnostics(Mode mode, List<Diagnostic> diagnostics) {
|
private static ValueWithDiagnostics<Mode> withDiagnostics(Mode mode, List<Diagnostic> diagnostics) {
|
||||||
return new ValueWithDiagnostics<>(mode, diagnostics);
|
return new ValueWithDiagnostics<>(mode, diagnostics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int javaVersion() {
|
||||||
|
String version = System.getProperty("java.version");
|
||||||
|
if (version.startsWith("1.")) {
|
||||||
|
version = version.substring(2, 3);
|
||||||
|
} else {
|
||||||
|
int dot = version.indexOf(".");
|
||||||
|
if (dot != -1) {
|
||||||
|
version = version.substring(0, dot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Integer.parseInt(version);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,9 @@
|
|||||||
|
|
||||||
package art.arcane.iris.core.service;
|
package art.arcane.iris.core.service;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.loader.IrisData;
|
import art.arcane.iris.core.loader.IrisData;
|
||||||
import art.arcane.iris.core.tools.IrisToolbelt;
|
import art.arcane.iris.core.tools.IrisToolbelt;
|
||||||
@@ -65,7 +67,7 @@ public class BoardSVC implements IrisService, BoardProvider {
|
|||||||
|
|
||||||
cleanupLeakedMainScoreboard();
|
cleanupLeakedMainScoreboard();
|
||||||
|
|
||||||
for (Player player : Iris.instance.getServer().getOnlinePlayers()) {
|
for (Player player : art.arcane.iris.platform.bukkit.BukkitPlatform.volmitPlugin().getServer().getOnlinePlayers()) {
|
||||||
J.runEntity(player, () -> updatePlayer(player));
|
J.runEntity(player, () -> updatePlayer(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,7 +97,7 @@ public class BoardSVC implements IrisService, BoardProvider {
|
|||||||
team.unregister();
|
team.unregister();
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
package art.arcane.iris.core.service;
|
package art.arcane.iris.core.service;
|
||||||
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import art.arcane.iris.Iris;
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisServices;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
import art.arcane.iris.core.IrisSettings;
|
import art.arcane.iris.core.IrisSettings;
|
||||||
import art.arcane.iris.core.ServerConfigurator;
|
import art.arcane.iris.core.ServerConfigurator;
|
||||||
import art.arcane.iris.core.lifecycle.WorldLifecycleService;
|
import art.arcane.iris.core.lifecycle.WorldLifecycleService;
|
||||||
@@ -71,11 +73,11 @@ public class StudioSVC implements IrisService {
|
|||||||
|
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
if (pack.equals("overworld")) {
|
if (pack.equals("overworld")) {
|
||||||
Iris.info("Downloading Default Pack " + pack + " (latest on master)");
|
IrisLogging.info("Downloading Default Pack " + pack + " (latest on master)");
|
||||||
Iris.service(StudioSVC.class).downloadBranch(Iris.getSender(), "IrisDimensions/overworld", "master", false);
|
IrisServices.get(StudioSVC.class).downloadBranch(art.arcane.iris.platform.bukkit.BukkitPlatform.console(), "IrisDimensions/overworld", "master", false);
|
||||||
ServerConfigurator.installDataPacksIfChanged(true);
|
ServerConfigurator.installDataPacksIfChanged(true);
|
||||||
} else {
|
} else {
|
||||||
Iris.warn("Default pack '" + pack + "' is not installed. Please download it manually with /iris download " + pack);
|
IrisLogging.warn("Default pack '" + pack + "' is not installed. Please download it manually with /iris download " + pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -83,7 +85,7 @@ public class StudioSVC implements IrisService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
Iris.debug("Studio Mode Active: Closing Projects");
|
IrisLogging.debug("Studio Mode Active: Closing Projects");
|
||||||
boolean stopping = IrisToolbelt.isServerStopping();
|
boolean stopping = IrisToolbelt.isServerStopping();
|
||||||
LinkedHashSet<String> worldNamesToDelete = new LinkedHashSet<>(TransientWorldCleanupSupport.collectTransientStudioWorldNames(Bukkit.getWorldContainer()));
|
LinkedHashSet<String> worldNamesToDelete = new LinkedHashSet<>(TransientWorldCleanupSupport.collectTransientStudioWorldNames(Bukkit.getWorldContainer()));
|
||||||
|
|
||||||
@@ -113,7 +115,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
generator.close();
|
generator.close();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Failed to close studio generator for \"" + i.getName() + "\" during shutdown.", e);
|
IrisLogging.reportError("Failed to close studio generator for \"" + i.getName() + "\" during shutdown.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +125,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
art.arcane.iris.core.tools.IrisCreator.removeTransientStudioWorldsFromBukkitYml();
|
art.arcane.iris.core.tools.IrisCreator.removeTransientStudioWorldsFromBukkitYml();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Failed to unregister transient studio worlds from bukkit.yml during shutdown.", e);
|
IrisLogging.reportError("Failed to unregister transient studio worlds from bukkit.yml during shutdown.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
queueStudioWorldDeletionOnStartup(worldNamesToDelete);
|
queueStudioWorldDeletionOnStartup(worldNamesToDelete);
|
||||||
@@ -155,7 +157,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
FileUtils.copyDirectory(f, folder);
|
FileUtils.copyDirectory(f, folder);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,14 +175,14 @@ public class StudioSVC implements IrisService {
|
|||||||
FileUtils.copyFile(i, new File(folder, i.getName()));
|
FileUtils.copyFile(i, new File(folder, i.getName()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
FileUtils.copyDirectory(i, new File(folder, i.getName()));
|
FileUtils.copyDirectory(i, new File(folder, i.getName()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,13 +223,13 @@ public class StudioSVC implements IrisService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iris.info("Resolved pack '" + key + "' to " + url);
|
IrisLogging.info("Resolved pack '" + key + "' to " + url);
|
||||||
String[] nodes = url.split("\\Q/\\E");
|
String[] nodes = url.split("\\Q/\\E");
|
||||||
String repo = nodes.length == 1 ? "IrisDimensions/" + nodes[0] : nodes[0] + "/" + nodes[1];
|
String repo = nodes.length == 1 ? "IrisDimensions/" + nodes[0] : nodes[0] + "/" + nodes[1];
|
||||||
String branch = nodes.length > 2 ? nodes[2] : "stable";
|
String branch = nodes.length > 2 ? nodes[2] : "stable";
|
||||||
download(sender, repo, branch, forceOverwrite, false);
|
download(sender, repo, branch, forceOverwrite, false);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
sender.sendMessage("Failed to download '" + key + "'.");
|
sender.sendMessage("Failed to download '" + key + "'.");
|
||||||
}
|
}
|
||||||
@@ -237,7 +239,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
download(sender, "IrisDimensions", url, forceOverwrite, true);
|
download(sender, "IrisDimensions", url, forceOverwrite, true);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
sender.sendMessage("Failed to download 'IrisDimensions/overworld' from " + url + ".");
|
sender.sendMessage("Failed to download 'IrisDimensions/overworld' from " + url + ".");
|
||||||
}
|
}
|
||||||
@@ -247,7 +249,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
download(sender, repo, branch, forceOverwrite, false);
|
download(sender, repo, branch, forceOverwrite, false);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
sender.sendMessage("Failed to download '" + repo + "' (branch " + branch + ").");
|
sender.sendMessage("Failed to download '" + repo + "' (branch " + branch + ").");
|
||||||
}
|
}
|
||||||
@@ -260,8 +262,8 @@ public class StudioSVC implements IrisService {
|
|||||||
public void download(VolmitSender sender, String repo, String branch, boolean forceOverwrite, boolean directUrl) throws JsonSyntaxException, IOException {
|
public void download(VolmitSender sender, String repo, String branch, boolean forceOverwrite, boolean directUrl) throws JsonSyntaxException, IOException {
|
||||||
String url = directUrl ? branch : "https://codeload.github.com/" + repo + "/zip/refs/heads/" + branch;
|
String url = directUrl ? branch : "https://codeload.github.com/" + repo + "/zip/refs/heads/" + branch;
|
||||||
sender.sendMessage("Downloading " + url + " "); //The extra space stops a bug in adventure API from repeating the last letter of the URL
|
sender.sendMessage("Downloading " + url + " "); //The extra space stops a bug in adventure API from repeating the last letter of the URL
|
||||||
File zip = Iris.getNonCachedFile("pack-" + repo, url);
|
File zip = art.arcane.iris.util.common.misc.WebCache.getNonCachedFile("pack-" + repo, url);
|
||||||
File temp = Iris.getTemp();
|
File temp = art.arcane.iris.util.common.misc.WebCache.getTemp();
|
||||||
File work = new File(temp, "dl-" + UUID.randomUUID());
|
File work = new File(temp, "dl-" + UUID.randomUUID());
|
||||||
File packs = getWorkspaceFolder();
|
File packs = getWorkspaceFolder();
|
||||||
|
|
||||||
@@ -275,7 +277,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
ZipUtil.unpack(zip, work);
|
ZipUtil.unpack(zip, work);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
"""
|
"""
|
||||||
@@ -298,7 +300,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
dir = zipFiles.length > 1 ? work : zipFiles[0].isDirectory() ? zipFiles[0] : null;
|
dir = zipFiles.length > 1 ? work : zipFiles[0].isDirectory() ? zipFiles[0] : null;
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
sender.sendMessage("Error when finding home directory. Are there any non-text characters in the file name?");
|
sender.sendMessage("Error when finding home directory. Are there any non-text characters in the file name?");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -358,9 +360,9 @@ public class StudioSVC implements IrisService {
|
|||||||
JSONObject a;
|
JSONObject a;
|
||||||
|
|
||||||
if (cached) {
|
if (cached) {
|
||||||
a = new JSONObject(Iris.getCached("cachedlisting", LISTING));
|
a = new JSONObject(art.arcane.iris.util.common.misc.WebCache.getCached("cachedlisting", LISTING));
|
||||||
} else {
|
} else {
|
||||||
a = new JSONObject(Iris.getNonCached(true + "listing", LISTING));
|
a = new JSONObject(art.arcane.iris.util.common.misc.WebCache.getNonCached(true + "listing", LISTING));
|
||||||
}
|
}
|
||||||
|
|
||||||
KMap<String, String> l = new KMap<>();
|
KMap<String, String> l = new KMap<>();
|
||||||
@@ -386,7 +388,7 @@ public class StudioSVC implements IrisService {
|
|||||||
open(sender, seed, dimm, (w) -> {
|
open(sender, seed, dimm, (w) -> {
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Iris.reportError("Failed to open studio world \"" + dimm + "\".", e);
|
IrisLogging.reportError("Failed to open studio world \"" + dimm + "\".", e);
|
||||||
sender.sendMessage("Failed to open studio world: " + e.getMessage());
|
sender.sendMessage("Failed to open studio world: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,14 +413,14 @@ public class StudioSVC implements IrisService {
|
|||||||
CompletableFuture<art.arcane.iris.core.runtime.StudioOpenCoordinator.StudioCloseResult> pendingClose = close();
|
CompletableFuture<art.arcane.iris.core.runtime.StudioOpenCoordinator.StudioCloseResult> pendingClose = close();
|
||||||
pendingClose.whenComplete((closeResult, closeThrowable) -> {
|
pendingClose.whenComplete((closeResult, closeThrowable) -> {
|
||||||
if (closeThrowable != null) {
|
if (closeThrowable != null) {
|
||||||
Iris.reportError("Failed while closing an existing studio project before opening \"" + dimm + "\".", closeThrowable);
|
IrisLogging.reportError("Failed while closing an existing studio project before opening \"" + dimm + "\".", closeThrowable);
|
||||||
J.s(() -> sender.sendMessage("Failed to close the existing studio project: " + closeThrowable.getMessage()));
|
J.s(() -> sender.sendMessage("Failed to close the existing studio project: " + closeThrowable.getMessage()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closeResult != null && closeResult.failureCause() != null) {
|
if (closeResult != null && closeResult.failureCause() != null) {
|
||||||
Throwable failure = closeResult.failureCause();
|
Throwable failure = closeResult.failureCause();
|
||||||
Iris.reportError("Failed while closing an existing studio project before opening \"" + dimm + "\".", failure);
|
IrisLogging.reportError("Failed while closing an existing studio project before opening \"" + dimm + "\".", failure);
|
||||||
J.s(() -> sender.sendMessage("Failed to close the existing studio project: " + failure.getMessage()));
|
J.s(() -> sender.sendMessage("Failed to close the existing studio project: " + failure.getMessage()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -449,11 +451,11 @@ public class StudioSVC implements IrisService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public File getWorkspaceFolder(String... sub) {
|
public File getWorkspaceFolder(String... sub) {
|
||||||
return Iris.instance.getDataFolderList(WORKSPACE_NAME, sub);
|
return art.arcane.iris.platform.bukkit.BukkitPlatform.volmitPlugin().getDataFolderList(WORKSPACE_NAME, sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getWorkspaceFile(String... sub) {
|
public File getWorkspaceFile(String... sub) {
|
||||||
return Iris.instance.getDataFileList(WORKSPACE_NAME, sub);
|
return art.arcane.iris.platform.bukkit.BukkitPlatform.volmitPlugin().getDataFileList(WORKSPACE_NAME, sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompletableFuture<art.arcane.iris.core.runtime.StudioOpenCoordinator.StudioCloseResult> close() {
|
public CompletableFuture<art.arcane.iris.core.runtime.StudioOpenCoordinator.StudioCloseResult> close() {
|
||||||
@@ -465,7 +467,7 @@ public class StudioSVC implements IrisService {
|
|||||||
return CompletableFuture.completedFuture(new art.arcane.iris.core.runtime.StudioOpenCoordinator.StudioCloseResult(null, true, true, false, null));
|
return CompletableFuture.completedFuture(new art.arcane.iris.core.runtime.StudioOpenCoordinator.StudioCloseResult(null, true, true, false, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
Iris.debug("Closing Active Project");
|
IrisLogging.debug("Closing Active Project");
|
||||||
IrisProject project = activeProject;
|
IrisProject project = activeProject;
|
||||||
activeProject = null;
|
activeProject = null;
|
||||||
activeClose = project.close();
|
activeClose = project.close();
|
||||||
@@ -477,21 +479,21 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
IrisToolbelt.evacuate(world);
|
IrisToolbelt.evacuate(world);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Failed to evacuate studio world \"" + world.getName() + "\" during shutdown cleanup.", e);
|
IrisLogging.reportError("Failed to evacuate studio world \"" + world.getName() + "\" during shutdown cleanup.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generator != null) {
|
if (generator != null) {
|
||||||
try {
|
try {
|
||||||
generator.close();
|
generator.close();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Failed to close studio generator for \"" + world.getName() + "\" during shutdown cleanup.", e);
|
IrisLogging.reportError("Failed to close studio generator for \"" + world.getName() + "\" during shutdown cleanup.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
WorldLifecycleService.get().unload(world, false);
|
WorldLifecycleService.get().unload(world, false);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Iris.reportError("Failed to unload studio world \"" + world.getName() + "\" during shutdown cleanup.", e);
|
IrisLogging.reportError("Failed to unload studio world \"" + world.getName() + "\" during shutdown cleanup.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteTransientStudioFolders(world.getName());
|
deleteTransientStudioFolders(world.getName());
|
||||||
@@ -536,9 +538,9 @@ public class StudioSVC implements IrisService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Iris.queueWorldDeletionOnStartup(List.copyOf(normalizedNames));
|
IrisServices.get(art.arcane.iris.core.runtime.WorldDeletionQueue.class).queueForStartupDeletion(List.copyOf(normalizedNames));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.reportError("Failed to queue studio world deletion on startup.", e);
|
IrisLogging.reportError("Failed to queue studio world deletion on startup.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,14 +553,14 @@ public class StudioSVC implements IrisService {
|
|||||||
File newPack = getWorkspaceFolder(newName);
|
File newPack = getWorkspaceFolder(newName);
|
||||||
|
|
||||||
if (importPack.listFiles().length == 0) {
|
if (importPack.listFiles().length == 0) {
|
||||||
Iris.warn("Couldn't find the pack to create a new dimension from.");
|
IrisLogging.warn("Couldn't find the pack to create a new dimension from.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FileUtils.copyDirectory(importPack, newPack, pathname -> !pathname.getAbsolutePath().contains(".git"), false);
|
FileUtils.copyDirectory(importPack, newPack, pathname -> !pathname.getAbsolutePath().contains(".git"), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -569,7 +571,7 @@ public class StudioSVC implements IrisService {
|
|||||||
try {
|
try {
|
||||||
FileUtils.copyFile(dimFile, newDimFile);
|
FileUtils.copyFile(dimFile, newDimFile);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,7 +585,7 @@ public class StudioSVC implements IrisService {
|
|||||||
IO.writeAll(newDimFile, json.toString(4));
|
IO.writeAll(newDimFile, json.toString(4));
|
||||||
}
|
}
|
||||||
} catch (JSONException | IOException e) {
|
} catch (JSONException | IOException e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +594,7 @@ public class StudioSVC implements IrisService {
|
|||||||
JSONObject ws = p.createCodeWorkspaceConfig();
|
JSONObject ws = p.createCodeWorkspaceConfig();
|
||||||
IO.writeAll(getWorkspaceFile(newName, newName + ".code-workspace"), ws.toString(0));
|
IO.writeAll(getWorkspaceFile(newName, newName + ".code-workspace"), ws.toString(0));
|
||||||
} catch (JSONException | IOException e) {
|
} catch (JSONException | IOException e) {
|
||||||
Iris.reportError(e);
|
IrisLogging.reportError(e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -952,7 +952,6 @@ public class IrisObject extends IrisRegistrant {
|
|||||||
String key = o.getLoadKey();
|
String key = o.getLoadKey();
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
if (config.getForbiddenCollisions().contains(key) && !config.getAllowedCollisions().contains(key)) {
|
if (config.getForbiddenCollisions().contains(key) && !config.getAllowedCollisions().contains(key)) {
|
||||||
// Iris.debug("%s collides with %s (%s / %s / %s)", getLoadKey(), key, i, j, k);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,6 +209,18 @@ public final class BukkitPlatform implements IrisPlatform {
|
|||||||
return INMS.get().getDataVersion().getPackFormat();
|
return INMS.get().getDataVersion().getPackFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static java.util.concurrent.CompletableFuture<Boolean> teleportAsync(Entity entity, Location destination) {
|
||||||
|
return io.papermc.lib.PaperLib.teleportAsync(entity, destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isPaperServer() {
|
||||||
|
return io.papermc.lib.PaperLib.isPaper();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static java.util.concurrent.CompletableFuture<org.bukkit.Chunk> chunkAtAsync(World world, int x, int z, boolean generate) {
|
||||||
|
return io.papermc.lib.PaperLib.getChunkAtAsync(world, x, z, generate);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String platformName() {
|
public String platformName() {
|
||||||
return "bukkit";
|
return "bukkit";
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
* 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.util.common.misc;
|
||||||
|
|
||||||
|
import art.arcane.iris.spi.IrisLogging;
|
||||||
|
import art.arcane.iris.spi.IrisPlatforms;
|
||||||
|
import art.arcane.volmlib.util.io.IO;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Download cache helpers over the platform data folder.
|
||||||
|
*/
|
||||||
|
public final class WebCache {
|
||||||
|
private WebCache() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getTemp() {
|
||||||
|
return IrisPlatforms.get().dataFolder("cache", "temp");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getCached(String name, String url) {
|
||||||
|
String h = IO.hash(name + "@" + url);
|
||||||
|
File f = IrisPlatforms.get().dataFile("cache", h.substring(0, 2), h.substring(3, 5), h);
|
||||||
|
|
||||||
|
if (!f.exists()) {
|
||||||
|
try (BufferedInputStream in = new BufferedInputStream(URI.create(url).toURL().openStream()); FileOutputStream fileOutputStream = new FileOutputStream(f)) {
|
||||||
|
byte[] dataBuffer = new byte[1024];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {
|
||||||
|
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
||||||
|
IrisLogging.debug("Aquiring " + name);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
IrisLogging.reportError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return f.exists() ? f : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getNonCached(String name, String url) {
|
||||||
|
String h = IO.hash(name + "*" + url);
|
||||||
|
File f = IrisPlatforms.get().dataFile("cache", h.substring(0, 2), h.substring(3, 5), h);
|
||||||
|
|
||||||
|
try (BufferedInputStream in = new BufferedInputStream(URI.create(url).toURL().openStream()); FileOutputStream fileOutputStream = new FileOutputStream(f)) {
|
||||||
|
byte[] dataBuffer = new byte[1024];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {
|
||||||
|
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
IrisLogging.reportError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getNonCachedFile(String name, String url) {
|
||||||
|
String h = IO.hash(name + "*" + url);
|
||||||
|
File f = IrisPlatforms.get().dataFile("cache", h.substring(0, 2), h.substring(3, 5), h);
|
||||||
|
IrisLogging.debug("Download " + name + " -> " + url);
|
||||||
|
try (BufferedInputStream in = new BufferedInputStream(URI.create(url).toURL().openStream()); FileOutputStream fileOutputStream = new FileOutputStream(f)) {
|
||||||
|
byte[] dataBuffer = new byte[1024];
|
||||||
|
int bytesRead;
|
||||||
|
while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {
|
||||||
|
fileOutputStream.write(dataBuffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
fileOutputStream.flush();
|
||||||
|
} catch (IOException e) {
|
||||||
|
IrisLogging.reportError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
}
|
||||||
-4
@@ -1,6 +1,5 @@
|
|||||||
package art.arcane.iris.util.project.context;
|
package art.arcane.iris.util.project.context;
|
||||||
|
|
||||||
import art.arcane.iris.Iris;
|
|
||||||
import art.arcane.iris.engine.IrisComplex;
|
import art.arcane.iris.engine.IrisComplex;
|
||||||
import art.arcane.iris.engine.object.IrisBiome;
|
import art.arcane.iris.engine.object.IrisBiome;
|
||||||
import art.arcane.iris.engine.object.IrisRegion;
|
import art.arcane.iris.engine.object.IrisRegion;
|
||||||
@@ -167,14 +166,12 @@ public class ChunkContextPrefillPlanTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void assertPrefillAsyncDecision(String threadName, boolean expected) throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException {
|
private void assertPrefillAsyncDecision(String threadName, boolean expected) throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException {
|
||||||
Iris previous = Iris.instance;
|
|
||||||
ExecutorService executor = Executors.newSingleThreadExecutor(runnable -> {
|
ExecutorService executor = Executors.newSingleThreadExecutor(runnable -> {
|
||||||
Thread thread = new Thread(runnable);
|
Thread thread = new Thread(runnable);
|
||||||
thread.setName(threadName);
|
thread.setName(threadName);
|
||||||
return thread;
|
return thread;
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
Iris.instance = mock(Iris.class);
|
|
||||||
Future<Boolean> future = executor.submit(() -> ChunkContext.shouldPrefillAsync(2));
|
Future<Boolean> future = executor.submit(() -> ChunkContext.shouldPrefillAsync(2));
|
||||||
boolean actual = future.get(10, TimeUnit.SECONDS);
|
boolean actual = future.get(10, TimeUnit.SECONDS);
|
||||||
if (expected) {
|
if (expected) {
|
||||||
@@ -183,7 +180,6 @@ public class ChunkContextPrefillPlanTest {
|
|||||||
assertFalse(actual);
|
assertFalse(actual);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
Iris.instance = previous;
|
|
||||||
executor.shutdownNow();
|
executor.shutdownNow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ if (useLocalVolmLib && localVolmLibDirectory != null) {
|
|||||||
|
|
||||||
include(':core', ':core:agent')
|
include(':core', ':core:agent')
|
||||||
include(':spi')
|
include(':spi')
|
||||||
|
include(':adapters:bukkit:plugin')
|
||||||
include(':adapters:bukkit:nms:v1_21_R7')
|
include(':adapters:bukkit:nms:v1_21_R7')
|
||||||
include(':adapters:bukkit:nms:v26_1_R1')
|
include(':adapters:bukkit:nms:v26_1_R1')
|
||||||
include(':adapters:fabric')
|
include(':adapters:fabric')
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ public final class IrisLogging {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
System.out.println("[Iris/ERROR] " + error.getClass().getName() + (error.getMessage() == null ? "" : ": " + error.getMessage()));
|
System.err.println("[Iris/ERROR] " + error.getClass().getName() + (error.getMessage() == null ? "" : ": " + error.getMessage()));
|
||||||
error.printStackTrace(System.out);
|
error.printStackTrace(System.err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +82,11 @@ public final class IrisLogging {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (level == LogLevel.WARN || level == LogLevel.ERROR) {
|
||||||
|
System.err.println("[Iris/" + level + "] " + message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("[Iris/" + level + "] " + message);
|
System.out.println("[Iris/" + level + "] " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user