This commit is contained in:
Brian Neumann-Fopiano
2026-06-26 14:01:20 -04:00
parent f777ea6b18
commit 75e8c22268
26 changed files with 193 additions and 101 deletions
@@ -1,4 +1,4 @@
package art.arcane.iris.core.nms.v26_1_R1;
package art.arcane.iris.core.nms.v26_2_R1;
import com.mojang.serialization.MapCodec;
import art.arcane.iris.spi.IrisLogging;
@@ -1,4 +1,4 @@
package art.arcane.iris.core.nms.v26_1_R1;
package art.arcane.iris.core.nms.v26_2_R1;
import com.mojang.datafixers.util.Pair;
import com.mojang.serialization.MapCodec;
@@ -1,4 +1,4 @@
package art.arcane.iris.core.nms.v26_1_R1;
package art.arcane.iris.core.nms.v26_2_R1;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import art.arcane.iris.spi.IrisLogging;
@@ -812,11 +812,14 @@ public class NMSBinding implements INMSBinding {
int minY = craftChunkData.getMinHeight();
int height = craftChunkData.getMaxHeight() - minY;
int accessMinY = access.getMinY();
int accessMaxY = accessMinY + access.getHeight();
int yStart = Math.max(0, accessMinY - minY);
int yEnd = Math.min(height, accessMaxY - minY);
int baseX = access.getPos().getMinBlockX();
int baseZ = access.getPos().getMinBlockZ();
ChunkDataHunkHolder holder = data instanceof ChunkDataHunkHolder chunkDataHolder ? chunkDataHolder : null;
for (int z = 0; z < 16; z++) {
for (int y = 0; y < height; y++) {
for (int y = yStart; y < yEnd; y++) {
int blockY = y + minY;
int sectionIndex = (blockY - accessMinY) >> 4;
LevelChunkSection section = access.getSection(sectionIndex);
@@ -1108,7 +1111,7 @@ public class NMSBinding implements INMSBinding {
@Override
public DataVersion getDataVersion() {
return DataVersion.V26_1_2;
return DataVersion.V26_2;
}
@Override
@@ -1,4 +1,4 @@
package art.arcane.iris.core.nms.v26_1_R1;
package art.arcane.iris.core.nms.v26_2_R1;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
+1 -1
View File
@@ -1,4 +1,4 @@
def apiVersion = '26.1'
def apiVersion = '26.2'
def mainClass = 'art.arcane.iris.Iris'
String volmLibCoordinate = providers.gradleProperty('volmLibCoordinate')
+14 -14
View File
@@ -28,8 +28,8 @@ plugins {
Properties rootProperties = new Properties()
file('../../gradle.properties').withInputStream { InputStream stream -> rootProperties.load(stream) }
String irisVersion = providers.gradleProperty('irisVersion').getOrElse(rootProperties.getProperty('irisVersion', '4.0.0-26.1'))
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse(rootProperties.getProperty('minecraftVersion', '26.1.2'))
String irisVersion = providers.gradleProperty('irisVersion').getOrElse(rootProperties.getProperty('irisVersion', '4.0.0-26.2'))
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse(rootProperties.getProperty('minecraftVersion', '26.2'))
String fabricLoaderVersion = providers.gradleProperty('fabricLoaderVersion').getOrElse(rootProperties.getProperty('fabricLoaderVersion', '0.19.3'))
Closure<String> irisArtifactName = { String platform, String targetVersion ->
return "Iris v${project.version} [${platform}] ${targetVersion}.jar"
@@ -100,18 +100,18 @@ configurations.create('jij') {
dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}")
implementation("net.fabricmc:fabric-loader:${fabricLoaderVersion}")
jij('net.fabricmc.fabric-api:fabric-api-base:2.0.3+ece063234c')
jij('net.fabricmc.fabric-api:fabric-registry-sync-v0:7.1.0+2fa62b4e4c')
jij('net.fabricmc.fabric-api:fabric-resource-loader-v1:2.0.10+7c44c7324c')
jij('net.fabricmc.fabric-api:fabric-lifecycle-events-v1:4.1.0+6d50a0854c')
jij('net.fabricmc.fabric-api:fabric-command-api-v2:3.0.5+e2bdee784c')
jij('net.fabricmc.fabric-api:fabric-events-interaction-v0:5.2.2+07b380be4c')
implementation('net.fabricmc.fabric-api:fabric-api-base:2.0.3+ece063234c')
implementation('net.fabricmc.fabric-api:fabric-registry-sync-v0:7.1.0+2fa62b4e4c')
implementation('net.fabricmc.fabric-api:fabric-resource-loader-v1:2.0.10+7c44c7324c')
implementation('net.fabricmc.fabric-api:fabric-lifecycle-events-v1:4.1.0+6d50a0854c')
implementation('net.fabricmc.fabric-api:fabric-command-api-v2:3.0.5+e2bdee784c')
implementation('net.fabricmc.fabric-api:fabric-events-interaction-v0:5.2.2+07b380be4c')
jij('net.fabricmc.fabric-api:fabric-api-base:2.0.4+ece063239e')
jij('net.fabricmc.fabric-api:fabric-registry-sync-v0:7.1.0+c7bd5b8e9e')
jij('net.fabricmc.fabric-api:fabric-resource-loader-v1:2.0.13+9edec1269e')
jij('net.fabricmc.fabric-api:fabric-lifecycle-events-v1:4.1.3+4575b05f9e')
jij('net.fabricmc.fabric-api:fabric-command-api-v2:3.1.0+00cb03469e')
jij('net.fabricmc.fabric-api:fabric-events-interaction-v0:5.2.6+8f57f7ee9e')
implementation('net.fabricmc.fabric-api:fabric-api-base:2.0.4+ece063239e')
implementation('net.fabricmc.fabric-api:fabric-registry-sync-v0:7.1.0+c7bd5b8e9e')
implementation('net.fabricmc.fabric-api:fabric-resource-loader-v1:2.0.13+9edec1269e')
implementation('net.fabricmc.fabric-api:fabric-lifecycle-events-v1:4.1.3+4575b05f9e')
implementation('net.fabricmc.fabric-api:fabric-command-api-v2:3.1.0+00cb03469e')
implementation('net.fabricmc.fabric-api:fabric-events-interaction-v0:5.2.6+8f57f7ee9e')
compileOnly('org.slf4j:slf4j-api:2.0.17')
compileOnly(libs.spigot) {
transitive = false
+3 -3
View File
@@ -28,9 +28,9 @@ plugins {
Properties rootProperties = new Properties()
file('../../gradle.properties').withInputStream { InputStream stream -> rootProperties.load(stream) }
String irisVersion = providers.gradleProperty('irisVersion').getOrElse(rootProperties.getProperty('irisVersion', '4.0.0-26.1'))
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse(rootProperties.getProperty('minecraftVersion', '26.1.2'))
String forgeVersion = providers.gradleProperty('forgeVersion').getOrElse(rootProperties.getProperty('forgeVersion', '26.1.2-64.0.9'))
String irisVersion = providers.gradleProperty('irisVersion').getOrElse(rootProperties.getProperty('irisVersion', '4.0.0-26.2'))
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse(rootProperties.getProperty('minecraftVersion', '26.2'))
String forgeVersion = providers.gradleProperty('forgeVersion').getOrElse(rootProperties.getProperty('forgeVersion', '26.2-65.0.0'))
Closure<String> loaderDisplayVersion = { String loaderVersion ->
String coordinatePrefix = "${minecraftVersion}-"
if (loaderVersion.startsWith(coordinatePrefix)) {
@@ -34,7 +34,7 @@ import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.PointedDripstoneBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DripstoneThickness;
import net.minecraft.world.level.block.state.properties.SpeleothemThickness;
import net.minecraft.world.level.block.state.properties.Property;
import java.util.Arrays;
@@ -434,7 +434,7 @@ public final class ModdedBlockResolution {
public static boolean isUpdatable(BlockState state) {
return isStorage(state)
|| (state.getBlock() instanceof PointedDripstoneBlock
&& state.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP);
&& state.getValue(PointedDripstoneBlock.THICKNESS) == SpeleothemThickness.TIP);
}
public static boolean isFoliage(BlockState state) {
@@ -67,6 +67,7 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
@@ -246,7 +247,11 @@ public final class IrisModdedCommands {
IntegerArgumentType.getInteger(context, "z"), false, ModdedPregenMode.ASYNC, false))
.then(pregenStartFlag("gui", true, true, ModdedPregenMode.ASYNC, false))
.then(pregenStartFlag("sync", true, false, ModdedPregenMode.SYNC, false))
.then(pregenStartFlag("cached", true, false, ModdedPregenMode.SYNC, true))))))
.then(pregenStartFlag("cached", true, false, ModdedPregenMode.SYNC, true))))
.then(Commands.argument("dimension", StringArgumentType.greedyString()).suggests(DIMENSION_NAMES)
.executes((CommandContext<CommandSourceStack> context) -> pregenStart(context.getSource(),
IntegerArgumentType.getInteger(context, "radius"), 0, 0, false, ModdedPregenMode.ASYNC, false,
StringArgumentType.getString(context, "dimension"))))))
.then(Commands.literal("stop")
.executes((CommandContext<CommandSourceStack> context) -> pregenStop(context.getSource())))
.then(Commands.literal("x")
@@ -335,7 +340,20 @@ public final class IrisModdedCommands {
}
private static int pregenStart(CommandSourceStack source, int radius, int centerX, int centerZ, boolean gui, ModdedPregenMode mode, boolean cached) {
ServerLevel level = source.getLevel();
return pregenStart(source, radius, centerX, centerZ, gui, mode, cached, null);
}
private static int pregenStart(CommandSourceStack source, int radius, int centerX, int centerZ, boolean gui, ModdedPregenMode mode, boolean cached, String dimension) {
ServerLevel level;
if (dimension == null || dimension.isBlank()) {
level = source.getLevel();
} else {
level = resolveIrisLevel(source.getServer(), dimension);
if (level == null) {
fail(source, "No loaded Iris dimension matches '" + dimension + "'. Use a bare name (irisworld) or full id (irisworldgen:irisworld); see /iris info for loaded dimensions.");
return 0;
}
}
Engine engine = engineFor(level);
if (engine == null) {
fail(source, "This dimension is not generated by Iris.");
@@ -825,6 +843,29 @@ public final class IrisModdedCommands {
return count;
}
private static ServerLevel resolveIrisLevel(MinecraftServer server, String raw) {
String target = raw.trim().toLowerCase(Locale.ROOT);
boolean qualified = target.indexOf(':') >= 0;
for (ServerLevel level : server.getAllLevels()) {
if (!(level.getChunkSource().getGenerator() instanceof IrisModdedChunkGenerator)) {
continue;
}
String fullId = level.dimension().identifier().toString();
if (qualified) {
if (fullId.equals(target)) {
return level;
}
continue;
}
int separator = fullId.indexOf(':');
String path = separator >= 0 ? fullId.substring(separator + 1) : fullId;
if (path.equals(target)) {
return level;
}
}
return null;
}
private static CompletableFuture<Suggestions> suggestBiomeKeys(CommandContext<CommandSourceStack> context, SuggestionsBuilder builder) {
ModdedCommandFeedback.tab(context.getSource());
try {
@@ -90,6 +90,7 @@ public final class ModdedStudioCommands {
private static final String STUDIO_NAMESPACE = "irisworldgen";
private static final String STUDIO_PREFIX = "studio_";
private static final String DEFAULT_TEMPLATE = "example";
private static final UUID CONSOLE_OWNER = new UUID(0L, 0L);
private static final Map<UUID, String> STUDIOS = new ConcurrentHashMap<>();
private static final SuggestionProvider<CommandSourceStack> GENERATOR_KEYS = (CommandContext<CommandSourceStack> context, SuggestionsBuilder builder) -> {
ModdedCommandFeedback.tab(context.getSource());
@@ -291,19 +292,19 @@ public final class ModdedStudioCommands {
return STUDIO_NAMESPACE + ":" + STUDIO_PREFIX + base;
}
private static String studioConsoleDimensionId() {
return STUDIO_NAMESPACE + ":" + STUDIO_PREFIX + "console";
}
private static int open(CommandSourceStack source, String pack, long seed) {
ServerPlayer player = source.getPlayer();
if (player == null) {
IrisModdedCommands.fail(source, "This command can only be used by players (a studio teleports you into the dimension).");
return 0;
}
if (pack == null || pack.isBlank()) {
IrisModdedCommands.fail(source, "Provide a dimension pack: /iris studio open <pack> [seed]");
return 0;
}
ServerPlayer player = source.getPlayer();
UUID owner = player == null ? CONSOLE_OWNER : player.getUUID();
String dimensionId = player == null ? studioConsoleDimensionId() : studioDimensionId(player);
MinecraftServer server = source.getServer();
UUID owner = player.getUUID();
String dimensionId = studioDimensionId(player);
IrisModdedCommands.ok(source, "Opening studio for '" + pack + "' (seed " + seed + ")...");
Thread thread = new Thread(() -> openAsync(source, server, owner, dimensionId, pack, seed), "Iris Studio Open");
thread.setDaemon(true);
@@ -329,13 +330,45 @@ public final class ModdedStudioCommands {
server.execute(() -> IrisModdedCommands.fail(source, "Pack '" + pack + "' has no dimensions/" + pack + ".json"));
return;
}
server.execute(() -> injectAndTeleport(source, server, owner, dimensionId, pack, seed));
server.execute(() -> {
if (owner.equals(CONSOLE_OWNER)) {
injectConsole(source, server, dimensionId, pack, seed);
} else {
injectAndTeleport(source, server, owner, dimensionId, pack, seed);
}
});
} catch (Throwable e) {
LOGGER.error("Iris studio open failed for {}", pack, e);
server.execute(() -> IrisModdedCommands.fail(source, "Studio open failed: " + e.getClass().getSimpleName() + (e.getMessage() == null ? "" : " - " + e.getMessage())));
}
}
private static void injectConsole(CommandSourceStack source, MinecraftServer server, String dimensionId, String pack, long seed) {
ModdedDimensionManager.Handle handle;
try {
handle = ModdedDimensionManager.create(server, dimensionId, pack, seed);
} catch (Throwable e) {
LOGGER.error("Iris console studio injection failed for {} ({})", dimensionId, pack, e);
IrisModdedCommands.fail(source, "Studio injection failed: " + e.getClass().getSimpleName() + (e.getMessage() == null ? "" : " - " + e.getMessage()));
return;
}
STUDIOS.put(CONSOLE_OWNER, dimensionId);
ServerLevel studio = handle.level();
int surface = studio.getMaxY();
try {
Engine engine = IrisModdedCommands.engineFor(studio);
if (engine != null) {
surface = engine.getMinHeight() + engine.getHeight(8, 8, false) + 2;
}
} catch (Throwable e) {
LOGGER.error("Iris console studio surface probe failed for {}", dimensionId, e);
}
IrisModdedCommands.ok(source, "Console studio open: " + dimensionId + " now runs '" + pack + "' seed " + seed + " (transient; not written to iris-dimensions.json and cleared on restart).");
IrisModdedCommands.ok(source, "Enter it with: /execute in " + dimensionId + " run tp @s 8.5 " + surface + " 8.5");
IrisModdedCommands.ok(source, "Pregen it with: /iris pregen start <radius> " + dimensionId);
IrisModdedCommands.ok(source, "Remove it with: /iris studio close");
}
private static void injectAndTeleport(CommandSourceStack source, MinecraftServer server, UUID owner, String dimensionId, String pack, long seed) {
ServerPlayer player = server.getPlayerList().getPlayer(owner);
if (player == null) {
@@ -366,12 +399,8 @@ public final class ModdedStudioCommands {
private static int close(CommandSourceStack source) {
ServerPlayer player = source.getPlayer();
if (player == null) {
IrisModdedCommands.fail(source, "This command can only be used by players.");
return 0;
}
MinecraftServer server = source.getServer();
UUID owner = player.getUUID();
UUID owner = player == null ? CONSOLE_OWNER : player.getUUID();
String dimensionId = STUDIOS.remove(owner);
if (dimensionId == null) {
IrisModdedCommands.fail(source, "You do not have an open studio. Use /iris studio open <pack> first.");
@@ -420,6 +449,9 @@ public final class ModdedStudioCommands {
}
private static String ownerName(MinecraftServer server, UUID owner) {
if (owner.equals(CONSOLE_OWNER)) {
return "console";
}
ServerPlayer player = server.getPlayerList().getPlayer(owner);
return player == null ? owner.toString() : player.getScoreboardName();
}
+3 -3
View File
@@ -28,9 +28,9 @@ plugins {
Properties rootProperties = new Properties()
file('../../gradle.properties').withInputStream { InputStream stream -> rootProperties.load(stream) }
String irisVersion = providers.gradleProperty('irisVersion').getOrElse(rootProperties.getProperty('irisVersion', '4.0.0-26.1'))
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse(rootProperties.getProperty('minecraftVersion', '26.1.2'))
String neoForgeVersion = providers.gradleProperty('neoForgeVersion').getOrElse(rootProperties.getProperty('neoForgeVersion', '26.1.2.75'))
String irisVersion = providers.gradleProperty('irisVersion').getOrElse(rootProperties.getProperty('irisVersion', '4.0.0-26.2'))
String minecraftVersion = providers.gradleProperty('minecraftVersion').getOrElse(rootProperties.getProperty('minecraftVersion', '26.2'))
String neoForgeVersion = providers.gradleProperty('neoForgeVersion').getOrElse(rootProperties.getProperty('neoForgeVersion', '26.2.0.6-beta'))
Closure<String> irisArtifactName = { String platform, String targetVersion ->
return "Iris v${project.version} [${platform}] ${targetVersion}.jar"
}