Skip to content

Error in mixins Shadow that works #367

@X-com

Description

@X-com

I have this issue where this line of code gives an error, however it works when running the code.

@Shadow(aliases="val$networkmanager")

full code

import io.netty.channel.*;
import io.netty.handler.timeout.ReadTimeoutHandler;
import net.minecraft.network.*;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(targets="net.minecraft.network.NetworkManager$5")
public class MixinNetworkManager$5 {

    @Shadow(aliases="val$networkmanager") private @Final NetworkManager field_179248_a;

    @Overwrite
    protected void initChannel(Channel p_initChannel_1_) throws Exception {
        try
        {
            p_initChannel_1_.config().setOption(ChannelOption.TCP_NODELAY, Boolean.valueOf(true));
        }
        catch (ChannelException var3)
        {
            ;
        }

        p_initChannel_1_.pipeline().addLast("timeout", new ReadTimeoutHandler(0))
                .addLast("splitter", new NettyVarint21FrameDecoder())
                .addLast("decoder", new NettyPacketDecoder(EnumPacketDirection.CLIENTBOUND))
                .addLast("prepender", new NettyVarint21FrameEncoder())
                .addLast("encoder", new NettyPacketEncoder(EnumPacketDirection.SERVERBOUND))
                .addLast("packet_handler", field_179248_a);
    }
}

My specs:
Target platform: mixin (in liteloader)
IDE: Intellij 2017.2.6
OS: Windows 7

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions