diff --git a/build.gradle b/build.gradle index 0ef6fcb..79ccafa 100644 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,8 @@ jar { exclude 'us/myles/ViaVersion/SpongePlugin.class' exclude 'us/viaversion/libs/javassist/**' exclude 'mcmod.info' + exclude 'plugin.yml' + exclude 'bungee.yml' } } } diff --git a/src/main/java/com/github/creeper123123321/viafabric/mixin/client/ClientConnectionChInit.java b/src/main/java/com/github/creeper123123321/viafabric/mixin/client/MixinClientConnectionChInit.java similarity index 98% rename from src/main/java/com/github/creeper123123321/viafabric/mixin/client/ClientConnectionChInit.java rename to src/main/java/com/github/creeper123123321/viafabric/mixin/client/MixinClientConnectionChInit.java index 8c60ce7..a7e5941 100644 --- a/src/main/java/com/github/creeper123123321/viafabric/mixin/client/ClientConnectionChInit.java +++ b/src/main/java/com/github/creeper123123321/viafabric/mixin/client/MixinClientConnectionChInit.java @@ -40,7 +40,7 @@ import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.protocol.ProtocolPipeline; @Mixin(targets = "net.minecraft.network.ClientConnection$1") -public class ClientConnectionChInit { +public class MixinClientConnectionChInit { @Inject(method = "initChannel(Lio/netty/channel/Channel;)V", at = @At(value = "TAIL"), remap = false) private void onInitChannel(Channel channel, CallbackInfo ci) { if (channel instanceof SocketChannel) { diff --git a/src/main/java/com/github/creeper123123321/viafabric/mixin/client/MixinSplitterHandler.java b/src/main/java/com/github/creeper123123321/viafabric/mixin/client/MixinSplitterHandler.java deleted file mode 100644 index 079990d..0000000 --- a/src/main/java/com/github/creeper123123321/viafabric/mixin/client/MixinSplitterHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2018 creeper123123321 and 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 com.github.creeper123123321.viafabric.mixin.client; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.ByteToMessageDecoder; -import net.minecraft.network.SplitterHandler; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.util.List; - -@Mixin(SplitterHandler.class) -public abstract class MixinSplitterHandler extends ByteToMessageDecoder { - @Inject(method = "", at = @At("TAIL")) - private void onInit(CallbackInfo ci) { - setSingleDecode(true); - } - - @Inject(method = "decode", at = @At("RETURN"), remap = false) - protected void onDecode(ChannelHandlerContext ctx, ByteBuf in, List out, CallbackInfo ci) { - if (!out.isEmpty()) { - ctx.executor().execute(() -> ctx.channel().read()); - } - } -} diff --git a/src/main/resources/mixins.viafabric.main.json b/src/main/resources/mixins.viafabric.main.json index ce62e37..64742d7 100644 --- a/src/main/resources/mixins.viafabric.main.json +++ b/src/main/resources/mixins.viafabric.main.json @@ -5,7 +5,7 @@ "mixins": [ ], "client": [ - "client.ClientConnectionChInit", + "client.MixinClientConnectionChInit", "client.MixinMultiplayerGui" ], "injectors": {