diff --git a/build.gradle b/build.gradle index c9e24d0..1f33a8a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ plugins { - id 'fabric-loom' version '0.8-SNAPSHOT' + id 'fabric-loom' version '0.10-SNAPSHOT' id 'maven-publish' id 'com.github.johnrengelman.shadow' version '7.0.0' } -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 @@ -39,11 +39,11 @@ dependencies { implementation(include("com.moandjiezana.toml:toml4j:0.7.2")) - modRuntime ("com.github.SuperCoder7979:databreaker:0.2.6") { + modRuntimeOnly("com.github.SuperCoder7979:databreaker:0.2.6") { exclude module: "fabric-loader" } - modRuntime("maven.modrinth:lithium:mc1.17.1-0.7.4") +// modRuntime("maven.modrinth:lithium:mc1.17.1-0.7.4") } processResources { @@ -62,7 +62,7 @@ tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" // Minecraft 1.17 (21w19a) upwards uses Java 16. - it.options.release = 16 + it.options.release = 17 } java { diff --git a/gradle.properties b/gradle.properties index 68c9ceb..dbb41cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.17.1 - yarn_mappings=1.17.1+build.9 - loader_version=0.11.6 + minecraft_version=1.18 + yarn_mappings=1.18+build.1 + loader_version=0.12.8 # Mod Properties - mod_version = 1.1.0 + mod_version = 1.1.1 maven_group = com.github.quiltservertools archives_base_name = ticktools # Dependencies -fabric_version=0.37.1+1.17 +fabric_version=0.44.0+1.18 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e5338d3..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.1-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/quiltservertools/ticktools/mixin/MixinServerPlayerEntity.java b/src/main/java/com/github/quiltservertools/ticktools/mixin/MixinServerPlayerEntity.java index 97af326..6184256 100644 --- a/src/main/java/com/github/quiltservertools/ticktools/mixin/MixinServerPlayerEntity.java +++ b/src/main/java/com/github/quiltservertools/ticktools/mixin/MixinServerPlayerEntity.java @@ -1,21 +1,29 @@ package com.github.quiltservertools.ticktools.mixin; -import com.github.quiltservertools.ticktools.TickToolsManager; + import net.minecraft.network.packet.s2c.play.ChunkLoadDistanceS2CPacket; +import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(ServerPlayerEntity.class) -public class MixinServerPlayerEntity { +@Mixin(ServerPlayerEntity.class) +public abstract class MixinServerPlayerEntity { + @Shadow + public ServerPlayNetworkHandler networkHandler; + @Inject(method = "worldChanged", at = @At("HEAD")) public void ticktools$syncRenderDistance(ServerWorld origin, CallbackInfo ci) { - ServerWorld world = ((ServerPlayerEntity) (Object) this).getServerWorld(); + ServerWorld world = this.getWorld(); int distance = ((MixinThreadedAnvilChunkStorage) world.getChunkManager().threadedAnvilChunkStorage).getWatchDistance(); - ((ServerPlayerEntity) (Object) this).networkHandler.sendPacket(new ChunkLoadDistanceS2CPacket(distance)); + networkHandler.sendPacket(new ChunkLoadDistanceS2CPacket(distance)); } + + @Shadow + public abstract ServerWorld getWorld(); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 10bf3c9..da8cf0e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ "depends": { "fabricloader": ">=0.11.3", "fabric": "*", - "minecraft": "1.17.x", + "minecraft": "1.18.x", "java": ">=16" } }