From 7e9e8c3dc7b56124027904d096afa17020996fab Mon Sep 17 00:00:00 2001 From: PotatoPresident <51728317+PotatoPresident@users.noreply.github.com> Date: Sat, 27 Nov 2021 13:32:28 -0800 Subject: [PATCH] Update to 1.18 --- .github/workflows/main.yml | 4 ++-- build.gradle | 6 +++--- gradle.properties | 12 ++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- .../github/fabricservertools/htm/HTMRegistry.java | 3 +-- .../htm/interactions/InfoAction.java | 2 +- .../htm/interactions/InteractionManager.java | 2 +- .../htm/mixin/LockableContainerMixin.java | 4 ++-- src/main/resources/fabric.mod.json | 4 ++-- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b98dd2..de61ec1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,10 +18,10 @@ jobs: uses: actions/checkout@v2 - name: validate gradle wrapper uses: gradle/wrapper-validation-action@v1 - - name: setup jdk 16 + - name: setup jdk 17 uses: actions/setup-java@v1 with: - java-version: 16 + java-version: 17 - name: make gradle wrapper executable if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew diff --git a/build.gradle b/build.gradle index 4062718..586a294 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.8-SNAPSHOT' + id 'fabric-loom' version '0.10.+' id 'maven-publish' } @@ -8,8 +8,8 @@ repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } } -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version diff --git a/gradle.properties b/gradle.properties index 39628cf..03f1c48 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,14 +2,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.17.1 -yarn_mappings=1.17.1+build.14 -loader_version=0.11.6 +minecraft_version=1.18-rc3 +yarn_mappings=1.18-rc3+build.1 +loader_version=0.12.5 # Mod Properties -mod_version=1.1.3 +mod_version=1.1.4 maven_group=us.potatoboy archives_base_name=htm # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.37.0+1.17 -translation_version=1.4.3+1.17 +fabric_version=0.43.1+1.18 +translation_version=1.4.8+1.18-pre1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f80bbf..e750102 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/github/fabricservertools/htm/HTMRegistry.java b/src/main/java/com/github/fabricservertools/htm/HTMRegistry.java index 5099aa5..e793b15 100644 --- a/src/main/java/com/github/fabricservertools/htm/HTMRegistry.java +++ b/src/main/java/com/github/fabricservertools/htm/HTMRegistry.java @@ -4,7 +4,6 @@ import com.github.fabricservertools.htm.api.LockType; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import org.jetbrains.annotations.Nullable; import java.util.HashSet; import java.util.Optional; @@ -35,7 +34,7 @@ public static String getLockId(LockType lockType) { return id == null ? "ERROR" : id; } - public static @Nullable Optional getLock(String name) { + public static Optional getLock(String name) { LockType lockType = lockTypes.get(name); return Optional.ofNullable(lockType.build()); } diff --git a/src/main/java/com/github/fabricservertools/htm/interactions/InfoAction.java b/src/main/java/com/github/fabricservertools/htm/interactions/InfoAction.java index 7395809..6fdae14 100644 --- a/src/main/java/com/github/fabricservertools/htm/interactions/InfoAction.java +++ b/src/main/java/com/github/fabricservertools/htm/interactions/InfoAction.java @@ -22,7 +22,7 @@ public void execute(ServerPlayerEntity player, World world, BlockPos pos, HTMCon return; } - Optional owner = player.getServerWorld().getServer().getUserCache().getByUuid(lock.getOwner()); + Optional owner = player.server.getUserCache().getByUuid(lock.getOwner()); if (owner.isEmpty()) { HTM.LOGGER.error("Can't find lock owner: " + lock.getOwner()); diff --git a/src/main/java/com/github/fabricservertools/htm/interactions/InteractionManager.java b/src/main/java/com/github/fabricservertools/htm/interactions/InteractionManager.java index e05c2e1..dcf95bb 100644 --- a/src/main/java/com/github/fabricservertools/htm/interactions/InteractionManager.java +++ b/src/main/java/com/github/fabricservertools/htm/interactions/InteractionManager.java @@ -35,7 +35,7 @@ public static void execute(ServerPlayerEntity player, World world, BlockPos pos) } public static HTMContainerLock getLock(ServerPlayerEntity player, BlockPos pos) { - HTMContainerLock lock = getLock(player.getServerWorld(), pos); + HTMContainerLock lock = getLock(player.getWorld(), pos); if (lock == null) { player.sendMessage(new TranslatableText("text.htm.error.unlockable"), false); } diff --git a/src/main/java/com/github/fabricservertools/htm/mixin/LockableContainerMixin.java b/src/main/java/com/github/fabricservertools/htm/mixin/LockableContainerMixin.java index 1a466f0..fedd92f 100644 --- a/src/main/java/com/github/fabricservertools/htm/mixin/LockableContainerMixin.java +++ b/src/main/java/com/github/fabricservertools/htm/mixin/LockableContainerMixin.java @@ -25,8 +25,8 @@ private void init(BlockEntityType blockEntityType, BlockPos blockPos, BlockSt } @Inject(method = "writeNbt", at = @At("HEAD")) - private void toTag(NbtCompound tag, CallbackInfoReturnable cir) { - htmContainerLock.toTag(tag); + private void toTag(NbtCompound nbt, CallbackInfo ci) { + htmContainerLock.toTag(nbt); } @Inject(method = "readNbt", at = @At("HEAD")) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1e87c3a..3d867a1 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -23,8 +23,8 @@ "htm.mixins.json" ], "depends": { - "fabricloader": ">=0.10.8", + "fabricloader": ">=0.12.3", "fabric": "*", - "minecraft": "1.17.x" + "minecraft": "1.18.x" } }