3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-10-03 16:51:04 +02:00

Bump to 0.4.1, Fixes bungee issues :) (Some chunk stuff, me being an idiot)

Dieser Commit ist enthalten in:
Myles 2016-03-02 17:03:32 +00:00
Ursprung 6c96271925
Commit ccd6987f11
5 geänderte Dateien mit 5 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
# ViaVersion 0.4.0 # ViaVersion 0.4.1
**Allows the connection of 1.8 clients to 1.9** **Allows the connection of 1.8 clients to 1.9**
This plugin modifies netty to allow connection of 1.9 clients to 1.8, This plugin modifies netty to allow connection of 1.9 clients to 1.8,

Datei anzeigen

@ -6,7 +6,6 @@ import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline; import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.SocketChannel;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;

Datei anzeigen

@ -1,15 +1,12 @@
package us.myles.ViaVersion.handlers; package us.myles.ViaVersion.handlers;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.handler.codec.ByteToMessageDecoder;
import us.myles.ViaVersion.CancelException; import us.myles.ViaVersion.CancelException;
import us.myles.ViaVersion.ConnectionInfo; import us.myles.ViaVersion.ConnectionInfo;
import us.myles.ViaVersion.util.PacketUtil;
import us.myles.ViaVersion.transformers.IncomingTransformer; import us.myles.ViaVersion.transformers.IncomingTransformer;
import us.myles.ViaVersion.util.PacketUtil;
import java.util.List; import java.util.List;

Datei anzeigen

@ -26,11 +26,10 @@ public class ViaEncodeHandler extends MessageToByteEncoder {
@Override @Override
protected void encode(ChannelHandlerContext ctx, Object o, ByteBuf bytebuf) throws Exception { protected void encode(ChannelHandlerContext ctx, Object o, ByteBuf bytebuf) throws Exception {
// handle the packet type // handle the packet type
if (o == null) return;
if (!(o instanceof ByteBuf)) { if (!(o instanceof ByteBuf)) {
info.setLastPacket(o); info.setLastPacket(o);
/* This transformer is more for fixing issues which we find hard at packet level :) */ /* This transformer is more for fixing issues which we find hard at packet level :) */
if (o.getClass().getName().endsWith("PacketPlayOutMapChunkBulk")) { if (o.getClass().getName().endsWith("PacketPlayOutMapChunkBulk") && info.isActive()) {
int[] locX = ReflectionUtil.get(o, "a", int[].class); int[] locX = ReflectionUtil.get(o, "a", int[].class);
int[] locZ = ReflectionUtil.get(o, "b", int[].class); int[] locZ = ReflectionUtil.get(o, "b", int[].class);
@ -62,6 +61,7 @@ public class ViaEncodeHandler extends MessageToByteEncoder {
try { try {
outgoingTransformer.transform(id, oldPacket, bytebuf); outgoingTransformer.transform(id, oldPacket, bytebuf);
} catch (CancelException e) { } catch (CancelException e) {
bytebuf.clear();
return; return;
} finally { } finally {
oldPacket.release(); oldPacket.release();

Datei anzeigen

@ -1,6 +1,6 @@
name: ViaVersion name: ViaVersion
main: us.myles.ViaVersion.ViaVersionPlugin main: us.myles.ViaVersion.ViaVersionPlugin
author: _MylesC author: _MylesC
version: 0.4.0 version: 0.4.1
load: startup load: startup
loadbefore: [ProtocolLib, ProxyPipe] loadbefore: [ProtocolLib, ProxyPipe]