diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientCommonPacketListenerImpl_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientCommonPacketListenerImpl_API.java new file mode 100644 index 00000000000..651061ce0fc --- /dev/null +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientCommonPacketListenerImpl_API.java @@ -0,0 +1,36 @@ +/* + * This file is part of Sponge, licensed under the MIT License (MIT). + * + * Copyright (c) SpongePowered + * 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 org.spongepowered.common.mixin.api.minecraft.client.multiplayer; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(ClientCommonPacketListenerImpl.class) +public abstract class ClientCommonPacketListenerImpl_API { + @Shadow @Final protected Minecraft minecraft; +} diff --git a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientPacketListenerMixin_API.java b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientPacketListenerMixin_API.java index 724fd5e1c71..b8f5ab880ee 100644 --- a/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientPacketListenerMixin_API.java +++ b/src/mixins/java/org/spongepowered/common/mixin/api/minecraft/client/multiplayer/ClientPacketListenerMixin_API.java @@ -24,20 +24,13 @@ */ package org.spongepowered.common.mixin.api.minecraft.client.multiplayer; -import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientPacketListener; import org.spongepowered.api.entity.living.player.client.LocalPlayer; import org.spongepowered.api.network.LocalPlayerConnection; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; @Mixin(ClientPacketListener.class) -public abstract class ClientPacketListenerMixin_API implements LocalPlayerConnection { - - // @formatter:off - @Shadow @Final private Minecraft minecraft; - // @formatter:on +public abstract class ClientPacketListenerMixin_API extends ClientCommonPacketListenerImpl_API implements LocalPlayerConnection { @Override public LocalPlayer player() { diff --git a/src/mixins/resources/mixins.sponge.api.json b/src/mixins/resources/mixins.sponge.api.json index c9b5c6a40c5..aec4b3d56dc 100644 --- a/src/mixins/resources/mixins.sponge.api.json +++ b/src/mixins/resources/mixins.sponge.api.json @@ -465,6 +465,7 @@ "minecraft.client.MinecraftMixin_API", "minecraft.client.multiplayer.ClientLevel_ClientLevelDataMixin_API", "minecraft.client.multiplayer.ClientLevelMixin_API", + "minecraft.client.multiplayer.ClientCommonPacketListenerImpl_API", "minecraft.client.multiplayer.ClientPacketListenerMixin_API", "minecraft.client.network.ClientNetHandlerMixin_API", "minecraft.client.player.AbstractClientPlayerMixin_API",