diff --git a/fabric/build.gradle b/fabric/build.gradle index 4b51f2bd6..7c6cda7b4 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -14,9 +14,9 @@ repositories { dependencies { // https://modmuss50.me/fabric.html - minecraft 'com.mojang:minecraft:1.17.1' - mappings 'net.fabricmc:yarn:1.17.1+build.39:v2' - modImplementation 'net.fabricmc:fabric-loader:0.11.6' + minecraft 'com.mojang:minecraft:1.18' + mappings 'net.fabricmc:yarn:1.18+build.1:v2' + modImplementation 'net.fabricmc:fabric-loader:0.12.6' Set apiModules = [ 'fabric-api-base', @@ -26,7 +26,7 @@ dependencies { ] apiModules.forEach { - modImplementation(fabricApi.module(it, '0.38.0+1.17')) + modImplementation(fabricApi.module(it, '0.43.1+1.18')) } include(modImplementation('me.lucko:fabric-permissions-api:0.1-SNAPSHOT')) diff --git a/fabric/src/main/java/me/lucko/luckperms/fabric/context/FabricPlayerCalculator.java b/fabric/src/main/java/me/lucko/luckperms/fabric/context/FabricPlayerCalculator.java index 193e73e3c..e964e9e7a 100644 --- a/fabric/src/main/java/me/lucko/luckperms/fabric/context/FabricPlayerCalculator.java +++ b/fabric/src/main/java/me/lucko/luckperms/fabric/context/FabricPlayerCalculator.java @@ -81,7 +81,7 @@ public class FabricPlayerCalculator implements ContextCalculator - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.lucko.luckperms.fabric.mixin; - -import net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(ClientSettingsC2SPacket.class) -public interface ClientSettingsC2SPacketAccessor { - - @Accessor("language") - String getLanguage(); - -} diff --git a/fabric/src/main/java/me/lucko/luckperms/fabric/mixin/ServerPlayerEntityMixin.java b/fabric/src/main/java/me/lucko/luckperms/fabric/mixin/ServerPlayerEntityMixin.java index cc30d1e9c..3232599ee 100644 --- a/fabric/src/main/java/me/lucko/luckperms/fabric/mixin/ServerPlayerEntityMixin.java +++ b/fabric/src/main/java/me/lucko/luckperms/fabric/mixin/ServerPlayerEntityMixin.java @@ -70,7 +70,7 @@ public abstract class ServerPlayerEntityMixin implements MixinUser { private Locale luckperms$locale; // Used by PlayerChangeWorldCallback hook below. - @Shadow public abstract ServerWorld getServerWorld(); + @Shadow public abstract ServerWorld getWorld(); @Override public User getLuckPermsUser() { @@ -148,12 +148,12 @@ public abstract class ServerPlayerEntityMixin implements MixinUser { @Inject(at = @At("HEAD"), method = "setClientSettings") private void luckperms_setClientSettings(ClientSettingsC2SPacket information, CallbackInfo ci) { - String language = ((ClientSettingsC2SPacketAccessor) information).getLanguage(); + String language = information.language(); this.luckperms$locale = TranslationManager.parseLocale(language); } @Inject(at = @At("TAIL"), method = "worldChanged") private void luckperms_onChangeDimension(ServerWorld targetWorld, CallbackInfo ci) { - PlayerChangeWorldCallback.EVENT.invoker().onChangeWorld(this.getServerWorld(), targetWorld, (ServerPlayerEntity) (Object) this); + PlayerChangeWorldCallback.EVENT.invoker().onChangeWorld(this.getWorld(), targetWorld, (ServerPlayerEntity) (Object) this); } } diff --git a/fabric/src/main/resources/luckperms.mixins.json b/fabric/src/main/resources/luckperms.mixins.json index 392d4dac7..24634c967 100644 --- a/fabric/src/main/resources/luckperms.mixins.json +++ b/fabric/src/main/resources/luckperms.mixins.json @@ -3,10 +3,9 @@ "package": "me.lucko.luckperms.fabric.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ - "ClientSettingsC2SPacketAccessor", + "CommandManagerMixin", "ServerLoginNetworkHandlerAccessor", - "ServerPlayerEntityMixin", - "CommandManagerMixin" + "ServerPlayerEntityMixin" ], "client": [ ],