Skip to content

Commit 614f2c2

Browse files
committed
Update to 26.1-snapshot-6
1 parent 501ed33 commit 614f2c2

18 files changed

Lines changed: 42 additions & 52 deletions

.github/workflows/build.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
1-
# Automatically build the project and run any configured tests for every push
2-
# and submitted pull request. This can help catch issues that only occur on
3-
# certain platforms or Java versions, and provides a first line of defence
4-
# against bad commits.
5-
61
name: build
72
on: [pull_request, push]
83

94
jobs:
105
build:
11-
strategy:
12-
matrix:
13-
# Use these Java versions
14-
java: [
15-
21, # Current Java LTS & minimum supported by Minecraft
16-
]
17-
runs-on: ubuntu-22.04
6+
runs-on: ubuntu-latest
187
steps:
198
- name: checkout repository
209
uses: actions/checkout@v4
2110
- name: validate gradle wrapper
2211
uses: gradle/wrapper-validation-action@v2
23-
- name: setup jdk ${{ matrix.java }}
12+
- name: setup jdk
2413
uses: actions/setup-java@v4
2514
with:
26-
java-version: ${{ matrix.java }}
15+
java-version: 25
2716
distribution: 'microsoft'
2817
- name: make gradle wrapper executable
2918
run: chmod +x ./gradlew
3019
- name: build
3120
run: ./gradlew build
3221
- name: capture build artifacts
33-
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
3422
uses: actions/upload-artifact@v4
3523
with:
3624
name: Artifacts

build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.13-SNAPSHOT'
2+
id 'net.fabricmc.fabric-loom' version '1.15.3'
33
id 'maven-publish'
44
}
55

@@ -34,11 +34,10 @@ loom {
3434
dependencies {
3535
// To change the versions see the gradle.properties file
3636
minecraft "com.mojang:minecraft:${project.minecraft_version}"
37-
mappings loom.officialMojangMappings()
38-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
37+
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
3938

4039
// Fabric API. This is technically optional, but you probably want it anyway.
41-
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
40+
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
4241

4342
}
4443

@@ -51,7 +50,7 @@ processResources {
5150
}
5251

5352
tasks.withType(JavaCompile).configureEach {
54-
it.options.release = 21
53+
it.options.release = 25
5554
}
5655

5756
java {
@@ -60,8 +59,8 @@ java {
6059
// If you remove this line, sources will not be generated.
6160
withSourcesJar()
6261

63-
sourceCompatibility = JavaVersion.VERSION_21
64-
targetCompatibility = JavaVersion.VERSION_21
62+
sourceCompatibility = JavaVersion.VERSION_25
63+
targetCompatibility = JavaVersion.VERSION_25
6564
}
6665

6766
jar {

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.11
8-
loader_version=0.18.1
7+
minecraft_version=26.1-snapshot-6
8+
loader_version=0.18.4
99

1010
# Mod Properties
11-
mod_version=2.4.0
11+
mod_version=2.5.0-beta1
1212
maven_group=io.github.misode
1313
archives_base_name=packtest
1414

1515
# Dependencies
16-
fabric_version=0.139.4+1.21.11
16+
fabric_version=0.143.2+26.1

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/io/github/misode/packtest/PackTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static void registerCommands(CommandDispatcher<CommandSourceStack> dispa
9797
}
9898

9999
public static void runHeadlessServer(LevelStorageSource.LevelStorageAccess storage, PackRepository packRepository) {
100-
GameTestServer.spin(thread -> GameTestServer.create(thread, storage, packRepository, Optional.empty(), false));
100+
GameTestServer.spin(thread -> GameTestServer.create(thread, storage, packRepository, Optional.empty(), false, 0));
101101
}
102102

103103
public static String wrapError(String message) {

src/main/java/io/github/misode/packtest/PackTestFunction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ private Optional<Vec3> getDummyPos(CommandSourceStack source) {
102102
}
103103
}
104104

105-
public TestData<Holder<TestEnvironmentDefinition>> getTestData(HolderGetter.Provider registries) {
105+
public TestData<Holder<TestEnvironmentDefinition<?>>> getTestData(HolderGetter.Provider registries) {
106106
var environments = registries.lookup(Registries.TEST_ENVIRONMENT).orElseThrow();
107107
Identifier environmentId = Optional.ofNullable(this.directives.get("environment")).map(Identifier::parse).orElse(GameTestEnvironments.DEFAULT_KEY.identifier());
108-
Holder<TestEnvironmentDefinition> environment = environments.getOrThrow(ResourceKey.create(Registries.TEST_ENVIRONMENT, environmentId));
108+
Holder<TestEnvironmentDefinition<?>> environment = environments.getOrThrow(ResourceKey.create(Registries.TEST_ENVIRONMENT, environmentId));
109109
Identifier structure = Optional.ofNullable(this.directives.get("template")).map(Identifier::parse).orElse(Identifier.withDefaultNamespace("empty"));
110110
int maxTicks = Optional.ofNullable(this.directives.get("timeout")).map(Integer::parseInt).orElse(100);
111111
boolean required = Optional.ofNullable(this.directives.get("optional")).map(s -> !Boolean.parseBoolean(s)).orElse(true);
112112
boolean skyAccess = Optional.ofNullable(this.directives.get("skyaccess")).map(Boolean::parseBoolean).orElse(false);
113-
return new TestData<>(environment, structure, maxTicks, 0, required, Rotation.NONE, false, 1, 1, skyAccess);
113+
return new TestData<>(environment, structure, maxTicks, 0, required, Rotation.NONE, false, 1, 1, skyAccess, 0);
114114
}
115115

116116
public record Step(String line, int lineNumber) {

src/main/java/io/github/misode/packtest/commands/DummyCommand.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,7 @@ private static int useEntity(CommandContext<CommandSourceStack> ctx, Vec3 pos) t
273273
pos = entity.position();
274274
}
275275
for (InteractionHand hand : InteractionHand.values()) {
276-
if (entity.interactAt(dummy, pos, hand).consumesAction()) {
277-
return 1;
278-
}
279-
if (dummy.interactOn(entity, hand).consumesAction()) {
276+
if (dummy.interactOn(entity, hand, pos).consumesAction()) {
280277
return 1;
281278
}
282279
}

src/main/java/io/github/misode/packtest/mixin/ForceLoadCommandMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private static boolean changeForceLoad(ServerLevel level, int x, int z, boolean
2121
return handleChange(level, x, z, toggle, original);
2222
}
2323

24-
@WrapOperation(method = "method_13377", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;setChunkForced(IIZ)Z"))
24+
@WrapOperation(method = "lambda$removeAll$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;setChunkForced(IIZ)Z"))
2525
private static boolean removeAll(ServerLevel level, int x, int z, boolean toggle, Operation<Boolean> original) {
2626
return handleChange(level, x, z, toggle, original);
2727
}

src/main/java/io/github/misode/packtest/mixin/GameTestRunner1Mixin.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@
1313
@Mixin(targets = "net.minecraft.gametest.framework.GameTestRunner$1")
1414
public class GameTestRunner1Mixin {
1515

16-
@WrapOperation(method = "method_56233", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;setChunkForced(IIZ)Z"))
16+
@WrapOperation(method = "lambda$testCompleted$1", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;setChunkForced(IIZ)Z"))
1717
private boolean testCompleted(ServerLevel level, int x, int z, boolean value, Operation<Boolean> original) {
1818
if (TemporaryForcedChunks.isTemporary(level, x, z)) {
1919
TemporaryForcedChunks.unmarkTemporary(level, x, z);
2020
return original.call(level, x, z, value);
2121
}
2222
return false;
2323
}
24+
25+
@WrapOperation(method = "lambda$testFailed$0", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;setChunkForced(IIZ)Z"))
26+
private boolean testFailed(ServerLevel level, int x, int z, boolean value, Operation<Boolean> original) {
27+
if (TemporaryForcedChunks.isTemporary(level, x, z)) {
28+
TemporaryForcedChunks.unmarkTemporary(level, x, z);
29+
return original.call(level, x, z, value);
30+
}
31+
return false;
32+
}
2433
}

src/main/java/io/github/misode/packtest/mixin/GameTestServerMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ private int onServerExit(int original) {
6060
@ModifyExpressionValue(method = "startTests", at = @At(value = "NEW", target = "(III)Lnet/minecraft/core/BlockPos;"))
6161
private BlockPos startTests(BlockPos original, ServerLevel level) {
6262
WorldBorder border = level.getWorldBorder();
63-
int x = level.random.nextIntBetweenInclusive((int) border.getMinX(), (int) border.getMaxX());
64-
int z = level.random.nextIntBetweenInclusive((int) border.getMinZ(), (int) border.getMaxZ());
63+
int x = level.getRandom().nextIntBetweenInclusive((int) border.getMinX(), (int) border.getMaxX());
64+
int z = level.getRandom().nextIntBetweenInclusive((int) border.getMinZ(), (int) border.getMaxZ());
6565
return new BlockPos(x, original.getY(), z);
6666
}
6767
}

0 commit comments

Comments
 (0)