revert because it is slow

This commit is contained in:
creeper123123321 2019-01-07 16:03:57 -02:00
parent 7328db43b4
commit 2553caf3fd
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
4 changed files with 4 additions and 53 deletions

View File

@ -55,6 +55,8 @@ jar {
exclude 'us/myles/ViaVersion/SpongePlugin.class' exclude 'us/myles/ViaVersion/SpongePlugin.class'
exclude 'us/viaversion/libs/javassist/**' exclude 'us/viaversion/libs/javassist/**'
exclude 'mcmod.info' exclude 'mcmod.info'
exclude 'plugin.yml'
exclude 'bungee.yml'
} }
} }
} }

View File

@ -40,7 +40,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline; import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
@Mixin(targets = "net.minecraft.network.ClientConnection$1") @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) @Inject(method = "initChannel(Lio/netty/channel/Channel;)V", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) { private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) { if (channel instanceof SocketChannel) {

View File

@ -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 = "<init>", 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<Object> out, CallbackInfo ci) {
if (!out.isEmpty()) {
ctx.executor().execute(() -> ctx.channel().read());
}
}
}

View File

@ -5,7 +5,7 @@
"mixins": [ "mixins": [
], ],
"client": [ "client": [
"client.ClientConnectionChInit", "client.MixinClientConnectionChInit",
"client.MixinMultiplayerGui" "client.MixinMultiplayerGui"
], ],
"injectors": { "injectors": {