Cover image
Try Now
2023-05-18

Client-Side-Versionsveränderer für MCP mit Viaversion, ViaBackwards und Viarewind

3 years

Works with Finder

13

Github Watches

10

Github Forks

111

Github Stars

ViaMCP Reborn

This repository is outdated, click here to get to the new one

Client-side version changer for MCP (Originally from https://github.com/LaVache-FR/ViaMCP)

ViaForge Mod: https://github.com/RejectedVia/ViaForge

(CHANGED!) Discord Link - Moved

Exporting without needing ViaMCP in JSON

Optional 1.8.x Block Sound Fixes

1.7.x Protocols

Yes, i know they are not working right now, do not make a pull request to remove them, as i am not going to remove them.

Selecting Version

Choose the version folder that corresponds with your client version

Installation

Firstly, you will need to add the listed libraries into your dependencies in IntelliJ or Eclipse

Dependencies (Included inside libraries folder)

ViaVersion-[ver].jar > ViaVersion > https://github.com/ViaVersion/ViaVersion
ViaBackwards-[ver].jar > ViaBackwards > https://github.com/ViaVersion/ViaBackwards
ViaRewind-[ver].jar > ViaRewind > https://github.com/ViaVersion/ViaRewind
ViaSnakeYaml-[ver].jar > SnakeYaml > https://bitbucket.org/snakeyaml/snakeyaml

Secondly, you need to add code that allows you to actually use ViaMCP

Main Class

Add this to the main class of your client (aka injection function)

try
{
  ViaMCP.getInstance().start();
  
  // Only use one of the following
  ViaMCP.getInstance().initAsyncSlider(); // For top left aligned slider
  ViaMCP.getInstance().initAsyncSlider(x, y, width (min. 110), height (recommended 20)); // For custom position and size slider
}
catch (Exception e)
{
  e.printStackTrace();
}

NetworkManager

You will need to change 2 functions in NetworkManager.java

1: Name may vary, but should be func_181124_a, createNetworkManagerAndConnect or contain (Bootstrap)((Bootstrap)((Bootstrap)(new Bootstrap()).group((EventLoopGroup)lazyloadbase.getValue())

After:

(1.8.x)

p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.CLIENTBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"packet_handler", (ChannelHandler)networkmanager);

(1.12.x)

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

Add:

if (p_initChannel_1_ instanceof SocketChannel && ViaMCP.getInstance().getVersion() != ViaMCP.PROTOCOL_VERSION)
{
    UserConnection user = new UserConnectionImpl(p_initChannel_1_, true);
    new ProtocolPipelineImpl(user);
    p_initChannel_1_.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new MCPEncodeHandler(user)).addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new MCPDecodeHandler(user));
}

Which should look like this afterwards (1.8.x for example):

p_initChannel_1_.pipeline().addLast((String)"timeout", (ChannelHandler)(new ReadTimeoutHandler(30))).addLast((String)"splitter", (ChannelHandler)(new MessageDeserializer2())).addLast((String)"decoder", (ChannelHandler)(new MessageDeserializer(EnumPacketDirection.CLIENTBOUND))).addLast((String)"prepender", (ChannelHandler)(new MessageSerializer2())).addLast((String)"encoder", (ChannelHandler)(new MessageSerializer(EnumPacketDirection.SERVERBOUND))).addLast((String)"packet_handler", (ChannelHandler)networkmanager);

if (p_initChannel_1_ instanceof SocketChannel && ViaMCP.getInstance().getVersion() != ViaMCP.PROTOCOL_VERSION)
{
    UserConnection user = new UserConnectionImpl(p_initChannel_1_, true);
    new ProtocolPipelineImpl(user);
    p_initChannel_1_.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new MCPEncodeHandler(user)).addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new MCPDecodeHandler(user));
}

2: setCompressionTreshold (Yes, minecraft devs cannot spell 'Threshold')

Decoder Switch

Comment out this.channel.pipeline().addBefore("decoder", "decompress", new NettyCompressionDecoder(treshold)); and paste in:

NettyUtil.decodeEncodePlacement(channel.pipeline(), "decoder", "decompress", new NettyCompressionDecoder(treshold));

Encoder Switch

Comment out this.channel.pipeline().addBefore("encoder", "compress", new NettyCompressionEncoder(treshold)) and paste in:

NettyUtil.decodeEncodePlacement(channel.pipeline(), "encoder", "compress", new NettyCompressionEncoder(treshold));

Version Control

You will need to add a button to access the protocol switcher (or alternatively use the version slider under this section)

In addSingleplayerMultiplayerButtons() function add (if in GuiMainMenu):

this.buttonList.add(new GuiButton(69, 5, 5, 90, 20, "Version"));

In actionPerformed() function add:

if (button.id == 69)
{
  this.mc.displayGuiScreen(new GuiProtocolSelector(this));
}

Version Slider

You can also use a version slider to control ViaMCP versions

this.buttonList.add(ViaMCP.getInstance().asyncSlider);

Attack Order Fixes

Class: Minecraft.java

Function: clickMouse()

1.8.x

Replace this.thePlayer.swingItem(); on the 1st line in the if-clause with:

AttackOrder.sendConditionalSwing(this.objectMouseOver);

Replace this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); in the switch in case ENTITY with:

AttackOrder.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit);

1.12.2

Replace this.player.swingArm(EnumHand.MAIN_HAND); at the last line in the else if-clause with:

AttackOrder.sendConditionalSwing(this.objectMouseOver, EnumHand.MAIN_HAND);

Replace this.playerController.attackEntity(this.player, this.objectMouseOver.entityHit); in the switch in case ENTITY with:

AttackOrder.sendFixedAttack(this.thePlayer, this.objectMouseOver.entityHit, EnumHand.MAIN_HAND);

Block Sound Fixes

Block Placement

Replace all code in onItemUse function in the ItemBlock class with:

return FixedSoundEngine.onItemUse(this, stack, playerIn, worldIn, pos, side, hitX, hitY, hitZ);

Block Breaking

Replace all code in destroyBlock function in the World class with:

return FixedSoundEngine.destroyBlock(this, pos, dropBlock);

Exporting Without JAR Files

  • This should fix most peoples issues with dependencies (usually NoClassDefFoundError or ClassNotFoundException)

1: First export your client normally

2: Open your client .jar file with an archive program (winrar or 7zip for example)

3: Also open all libraries with the selected archive program (ViaBackwards, ViaRewind, ViaSnakeYml and ViaVersion)

4: From ViaBackwards drag and drop assets and com folders to your client .jar

5: From ViaRewind drag and drop assets and de folders to your client .jar

6: From ViaSnakeYaml drag and drop org folder to your client .jar

7: From ViaVersion drag and drop assets, com and us folders to your client .jar

8: Then save and close, now your client should be working correctly ;)

Credits: mordolpl (Discord)

Finishing

You should now be able to use ViaMCP

If you have any problems, DM Hideri#9003 on discord!

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • pontusab
  • Die Cursor & Windsurf -Community finden Regeln und MCPs

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

  • 1Panel-dev
  • 🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.

  • GeyserMC
  • Eine Bibliothek für Kommunikation mit einem Minecraft -Client/Server.

  • Mintplex-Labs
  • Die All-in-One-Desktop & Docker-AI-Anwendung mit integriertem Lappen, AI-Agenten, No-Code-Agent Builder, MCP-Kompatibilität und vielem mehr.

  • awslabs
  • AWS MCP -Server - Spezielle MCP -Server, die AWS -Best Practices direkt in Ihren Entwicklungsworkflow bringen

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.

    Reviews

    3 (1)
    Avatar
    user_hDV9RZ6p
    2025-04-17

    ViaMCP-Reborn is an amazing tool for anyone interested in maintaining backward compatibility in Minecraft. The ease of use and seamless integration make it indispensable. Highly recommend checking it out on GitHub for a better Minecraft experience!