mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-07-16 11:53:42 +00:00
ff
This commit is contained in:
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class INMS {
|
||||
private static final Version CURRENT = new Version(26, 1, 2, "v26_1_R1");
|
||||
private static final Version CURRENT = new Version(26, 2, 0, "v26_2_R1");
|
||||
|
||||
private static final List<Version> REVISION = List.of(
|
||||
CURRENT
|
||||
@@ -85,7 +85,7 @@ public class INMS {
|
||||
|
||||
MinecraftVersion detectedVersion = getMinecraftVersion();
|
||||
String serverVersion = detectedVersion == null ? Bukkit.getServer().getVersion() : detectedVersion.value();
|
||||
throw new IllegalStateException("Iris requires Minecraft 26.1.2. Detected server version: " + serverVersion);
|
||||
throw new IllegalStateException("Iris requires Minecraft 26.2. Detected server version: " + serverVersion);
|
||||
}
|
||||
|
||||
private static String getTag(List<Version> versions, String def) {
|
||||
|
||||
@@ -37,7 +37,11 @@ import art.arcane.volmlib.util.math.Vector3d;
|
||||
import art.arcane.volmlib.util.nbt.mca.palette.MCABiomeContainer;
|
||||
import art.arcane.volmlib.util.nbt.mca.palette.MCAPaletteAccess;
|
||||
import art.arcane.volmlib.util.nbt.tag.CompoundTag;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@@ -197,7 +201,7 @@ public interface INMSBinding {
|
||||
Color getBiomeColor(Location location, BiomeColor type);
|
||||
|
||||
default DataVersion getDataVersion() {
|
||||
return DataVersion.V26_1_2;
|
||||
return DataVersion.V26_2;
|
||||
}
|
||||
|
||||
default int getSpawnChunkCount(World world) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.function.Supplier;
|
||||
@Getter
|
||||
public enum DataVersion {
|
||||
UNSUPPORTED("0.0.0", 0, () -> null),
|
||||
V26_1_2("26.1.2", 101, DataFixerV1217::new);
|
||||
V26_2("26.2", 107, DataFixerV1217::new);
|
||||
private static final KMap<DataVersion, IDataFixer> cache = new KMap<>();
|
||||
@Getter(AccessLevel.NONE)
|
||||
private final Supplier<IDataFixer> constructor;
|
||||
|
||||
@@ -94,7 +94,7 @@ public final class Tasks {
|
||||
} else if (parts.length >= 2) {
|
||||
supportedVersions = parts[1];
|
||||
} else {
|
||||
supportedVersions = "26.1.2";
|
||||
supportedVersions = "26.2";
|
||||
}
|
||||
|
||||
if (!(INMS.get() instanceof NMSBinding1X)) {
|
||||
|
||||
@@ -114,7 +114,11 @@ public final class EngineBukkitOps {
|
||||
try {
|
||||
Runnable tileTask = () -> {
|
||||
chunk.iterate(TileWrapper.class, (x, y, z, v) -> {
|
||||
Block block = c.getBlock(x & 15, y + engine.getWorld().minHeight(), z & 15);
|
||||
int worldY = y + engine.getWorld().minHeight();
|
||||
if (worldY < c.getWorld().getMinHeight() || worldY >= c.getWorld().getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
Block block = c.getBlock(x & 15, worldY, z & 15);
|
||||
if (!TileData.setTileState(block, v.getData())) {
|
||||
NamespacedKey blockTypeKey = KeyedType.getKey(block.getType());
|
||||
NamespacedKey tileTypeKey = KeyedType.getKey(v.getData().getMaterial());
|
||||
@@ -127,7 +131,11 @@ public final class EngineBukkitOps {
|
||||
|
||||
Runnable customTask = () -> {
|
||||
chunk.iterate(Identifier.class, (x, y, z, v) -> {
|
||||
IrisServices.get(ExternalDataSVC.class).processUpdate(engine, c.getBlock(x & 15, y + engine.getWorld().minHeight(), z & 15), v);
|
||||
int worldY = y + engine.getWorld().minHeight();
|
||||
if (worldY < c.getWorld().getMinHeight() || worldY >= c.getWorld().getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
IrisServices.get(ExternalDataSVC.class).processUpdate(engine, c.getBlock(x & 15, worldY, z & 15), v);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -246,6 +254,10 @@ public final class EngineBukkitOps {
|
||||
}
|
||||
|
||||
public static void update(Engine engine, int x, int y, int z, Chunk c, MantleChunk<Matter> mc, RNG rf) {
|
||||
World world = c.getWorld();
|
||||
if (y < world.getMinHeight() || y >= world.getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
Block block = c.getBlock(x, y, z);
|
||||
BlockData data = block.getBlockData();
|
||||
engine.blockUpdatedMetric();
|
||||
|
||||
@@ -22,7 +22,7 @@ import static org.mockito.Mockito.mockingDetails;
|
||||
public class IrisRuntimeSchedulerModeRoutingTest {
|
||||
@Test
|
||||
public void autoResolvesToPaperLikeOnPurpurBranding() {
|
||||
installServer("Purpur", "git-Purpur-2562 (MC: 26.1.2)");
|
||||
installServer("Purpur", "git-Purpur-2562 (MC: 26.2)");
|
||||
IrisSettings.IrisSettingsPregen pregen = new IrisSettings.IrisSettingsPregen();
|
||||
pregen.runtimeSchedulerMode = IrisRuntimeSchedulerMode.AUTO;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class IrisRuntimeSchedulerModeRoutingTest {
|
||||
|
||||
@Test
|
||||
public void autoResolvesToFoliaWhenBrandingContainsFolia() {
|
||||
installServer("Folia", "git-Folia-123 (MC: 26.1.2)");
|
||||
installServer("Folia", "git-Folia-123 (MC: 26.2)");
|
||||
IrisSettings.IrisSettingsPregen pregen = new IrisSettings.IrisSettingsPregen();
|
||||
pregen.runtimeSchedulerMode = IrisRuntimeSchedulerMode.AUTO;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class IrisRuntimeSchedulerModeRoutingTest {
|
||||
|
||||
@Test
|
||||
public void autoResolvesToPaperLikeOnCanvasBranding() {
|
||||
installServer("Canvas", "git-Canvas-101 (MC: 26.1.2)");
|
||||
installServer("Canvas", "git-Canvas-101 (MC: 26.2)");
|
||||
IrisSettings.IrisSettingsPregen pregen = new IrisSettings.IrisSettingsPregen();
|
||||
pregen.runtimeSchedulerMode = IrisRuntimeSchedulerMode.AUTO;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class IrisRuntimeSchedulerModeRoutingTest {
|
||||
|
||||
@Test
|
||||
public void explicitModeBypassesAutoDetection() {
|
||||
installServer("Purpur", "git-Purpur-2562 (MC: 26.1.2)");
|
||||
installServer("Purpur", "git-Purpur-2562 (MC: 26.2)");
|
||||
IrisSettings.IrisSettingsPregen pregen = new IrisSettings.IrisSettingsPregen();
|
||||
|
||||
pregen.runtimeSchedulerMode = IrisRuntimeSchedulerMode.FOLIA;
|
||||
|
||||
@@ -8,8 +8,8 @@ import static org.junit.Assert.assertTrue;
|
||||
public class PaperLibBootstrapTest {
|
||||
@Test
|
||||
public void isModernVersionSchemeAcceptsMajorVersionAboveOne() {
|
||||
assertTrue(PaperLibBootstrap.isModernVersionScheme("26.1.2-R0.1-SNAPSHOT"));
|
||||
assertTrue(PaperLibBootstrap.isModernVersionScheme("26.1.2"));
|
||||
assertTrue(PaperLibBootstrap.isModernVersionScheme("26.2-R0.1-SNAPSHOT"));
|
||||
assertTrue(PaperLibBootstrap.isModernVersionScheme("26.2"));
|
||||
assertTrue(PaperLibBootstrap.isModernVersionScheme("27.0.0-R0.1-SNAPSHOT"));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,22 +10,22 @@ import static org.junit.Assert.assertTrue;
|
||||
public class INMSBindingProbeCodesTest {
|
||||
@Test
|
||||
public void skipsSyntheticBukkitBindingWhenNmsIsEnabled() {
|
||||
List<String> probeCodes = NmsBindingProbeSupport.getBindingProbeCodes("BUKKIT", false, List.of("v26_1_R1"));
|
||||
List<String> probeCodes = NmsBindingProbeSupport.getBindingProbeCodes("BUKKIT", false, List.of("v26_2_R1"));
|
||||
|
||||
assertEquals(List.of("v26_1_R1"), probeCodes);
|
||||
assertEquals(List.of("v26_2_R1"), probeCodes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void leavesBukkitFallbackEmptyWhenNmsIsDisabled() {
|
||||
List<String> probeCodes = NmsBindingProbeSupport.getBindingProbeCodes("BUKKIT", true, List.of("v26_1_R1"));
|
||||
List<String> probeCodes = NmsBindingProbeSupport.getBindingProbeCodes("BUKKIT", true, List.of("v26_2_R1"));
|
||||
|
||||
assertTrue(probeCodes.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void keepsConcreteBindingCodesAsPrimaryProbe() {
|
||||
List<String> probeCodes = NmsBindingProbeSupport.getBindingProbeCodes("v26_1_R1", false, List.of("v26_1_R1"));
|
||||
List<String> probeCodes = NmsBindingProbeSupport.getBindingProbeCodes("v26_2_R1", false, List.of("v26_2_R1"));
|
||||
|
||||
assertEquals(List.of("v26_1_R1"), probeCodes);
|
||||
assertEquals(List.of("v26_2_R1"), probeCodes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,50 +18,50 @@ public class MinecraftVersionTest {
|
||||
@Test
|
||||
public void detectsMinecraftVersionFromPurpurDecoratedVersion() {
|
||||
Server server = mock(Server.class);
|
||||
doReturn("git-Purpur-2570 (MC: 26.1.2)").when(server).getVersion();
|
||||
doReturn("26.1.2.build.2570-experimental").when(server).getBukkitVersion();
|
||||
doReturn("git-Purpur-2570 (MC: 26.2)").when(server).getVersion();
|
||||
doReturn("26.2.build.2570-experimental").when(server).getBukkitVersion();
|
||||
|
||||
MinecraftVersion version = MinecraftVersion.detect(server);
|
||||
assertEquals("26.1.2", version.value());
|
||||
assertEquals("26.2", version.value());
|
||||
assertEquals(26, version.major());
|
||||
assertEquals(1, version.minor());
|
||||
assertEquals(2, version.patch());
|
||||
assertEquals(2, version.minor());
|
||||
assertEquals(0, version.patch());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void prefersRuntimeMinecraftVersionMethodWhenPresent() {
|
||||
PaperLikeServer server = mock(PaperLikeServer.class);
|
||||
doReturn("26.1.2").when(server).getMinecraftVersion();
|
||||
doReturn("26.1.2-2570-e64b1b2 (MC: 26.1.2)").when(server).getVersion();
|
||||
doReturn("26.1.2.build.2570-experimental").when(server).getBukkitVersion();
|
||||
doReturn("26.2").when(server).getMinecraftVersion();
|
||||
doReturn("26.2-2570-e64b1b2 (MC: 26.2)").when(server).getVersion();
|
||||
doReturn("26.2.build.2570-experimental").when(server).getBukkitVersion();
|
||||
|
||||
MinecraftVersion version = MinecraftVersion.detect(server);
|
||||
assertEquals("26.1.2", version.value());
|
||||
assertEquals("26.2", version.value());
|
||||
assertEquals(26, version.major());
|
||||
assertEquals(1, version.minor());
|
||||
assertEquals(2, version.patch());
|
||||
assertEquals(2, version.minor());
|
||||
assertEquals(0, version.patch());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rejectsPurpurApiBuildNumbersAsMinecraftVersion() {
|
||||
MinecraftVersion version = MinecraftVersion.fromBukkitVersion("26.1.2.build.2570-experimental");
|
||||
MinecraftVersion version = MinecraftVersion.fromBukkitVersion("26.2.build.2570-experimental");
|
||||
assertNull(version);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parsesStandardBukkitSnapshotVersion() {
|
||||
MinecraftVersion version = MinecraftVersion.fromBukkitVersion("26.1.2-R0.1-SNAPSHOT");
|
||||
assertEquals("26.1.2", version.value());
|
||||
MinecraftVersion version = MinecraftVersion.fromBukkitVersion("26.2-R0.1-SNAPSHOT");
|
||||
assertEquals("26.2", version.value());
|
||||
assertEquals(26, version.major());
|
||||
assertEquals(1, version.minor());
|
||||
assertEquals(2, version.patch());
|
||||
assertEquals(2, version.minor());
|
||||
assertEquals(0, version.patch());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void comparesMajorBeforeMinor() {
|
||||
MinecraftVersion version = MinecraftVersion.fromBukkitVersion("26.1.2-R0.1-SNAPSHOT");
|
||||
assertFalse(version.isAtLeast(26, 1, 3));
|
||||
assertTrue(version.isAtLeast(26, 1, 2));
|
||||
assertTrue(version.isSameRelease(26, 1, 2));
|
||||
MinecraftVersion version = MinecraftVersion.fromBukkitVersion("26.2-R0.1-SNAPSHOT");
|
||||
assertFalse(version.isAtLeast(26, 2, 1));
|
||||
assertTrue(version.isAtLeast(26, 2, 0));
|
||||
assertTrue(version.isSameRelease(26, 2, 0));
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,28 +1,28 @@
|
||||
Paper 26.1.2
|
||||
Paper 26.2
|
||||
/iris create matrix-paper overworld
|
||||
/iris std o overworld
|
||||
close Studio world
|
||||
benchmark create/unload
|
||||
|
||||
Purpur 26.1.2
|
||||
Purpur 26.2
|
||||
/iris create matrix-purpur overworld
|
||||
/iris std o overworld
|
||||
close Studio world
|
||||
benchmark create/unload
|
||||
|
||||
Canvas 26.1.2
|
||||
Canvas 26.2
|
||||
/iris create matrix-canvas overworld
|
||||
/iris std o overworld
|
||||
close Studio world
|
||||
benchmark create/unload
|
||||
|
||||
Folia 26.1.2
|
||||
Folia 26.2
|
||||
/iris create matrix-folia overworld
|
||||
/iris std o overworld
|
||||
close Studio world
|
||||
benchmark create/unload
|
||||
|
||||
Spigot 26.1.2
|
||||
Spigot 26.2
|
||||
/iris create matrix-spigot overworld
|
||||
/iris std o overworld
|
||||
close Studio world
|
||||
|
||||
Reference in New Issue
Block a user