From e885a1cec2a3c1cd4a5d6c8995ff8f40dabf1e7d Mon Sep 17 00:00:00 2001 From: Myles Date: Mon, 29 Feb 2016 20:35:50 +0000 Subject: [PATCH] Update version to 0.3, also fix issue with teams haha --- README.md | 4 ++-- src/main/java/us/myles/ViaVersion/Core.java | 5 ++++- src/main/java/us/myles/ViaVersion/metadata/MetaIndex.java | 5 ++++- .../myles/ViaVersion/transformers/OutgoingTransformer.java | 5 +++-- src/main/resources/plugin.yml | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 72438141b..232b5ff51 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# ViaVersion 0.2 +# ViaVersion 0.3 **Allows the connection of 1.8 clients to 1.9** This plugin modifies netty to allow connection of 1.9 clients to 1.8, -**Don't use late bind** +**Don't use late bind nor ProtocolLib** **As of this point it doesn't have everything, I need to fix:** diff --git a/src/main/java/us/myles/ViaVersion/Core.java b/src/main/java/us/myles/ViaVersion/Core.java index 64471f032..cff6755f8 100644 --- a/src/main/java/us/myles/ViaVersion/Core.java +++ b/src/main/java/us/myles/ViaVersion/Core.java @@ -24,7 +24,10 @@ public class Core extends JavaPlugin { try { injectPacketHandler(); } catch (Exception e) { - System.out.println("Unable to inject handlers, are you on 1.8?"); + if(Bukkit.getPluginManager().getPlugin("ProtocolLib") != null){ + System.out.println("This plugin is not compatible with protocol lib."); + } + System.out.println("Unable to inject handlers, are you on 1.8? "); e.printStackTrace(); } } diff --git a/src/main/java/us/myles/ViaVersion/metadata/MetaIndex.java b/src/main/java/us/myles/ViaVersion/metadata/MetaIndex.java index 90b5e5ff7..1655bc30d 100644 --- a/src/main/java/us/myles/ViaVersion/metadata/MetaIndex.java +++ b/src/main/java/us/myles/ViaVersion/metadata/MetaIndex.java @@ -171,7 +171,10 @@ public enum MetaIndex { public static MetaIndex getIndex(EntityType type, int index) { Class entityClass = type.getEntityClass(); - + if(entityClass == null){ + System.out.println("Could not get entity class for " + type); + return null; + } for (MetaIndex mi : MetaIndex.values()) { if (mi.getIndex() == index) { if (mi.getApplicableClass().isAssignableFrom(entityClass) || diff --git a/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java b/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java index c18dac629..1bf321845 100644 --- a/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java +++ b/src/main/java/us/myles/ViaVersion/transformers/OutgoingTransformer.java @@ -19,6 +19,7 @@ import us.myles.ViaVersion.packets.State; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.nio.charset.Charset; import java.util.*; public class OutgoingTransformer { @@ -45,7 +46,7 @@ public class OutgoingTransformer { if (packet == null) { throw new RuntimeException("Outgoing Packet not found? " + packetID + " State: " + info.getState() + " Version: " + info.getProtocol()); } -// if (packet != PacketType.PLAY_CHUNK_DATA && packet != PacketType.PLAY_KEEP_ALIVE && packet != PacketType.PLAY_TIME_UPDATE && !packet.name().toLowerCase().contains("entity")) +// if (packet != PacketType.PLAY_CHUNK_DATA && packet != PacketType.PLAY_KEEP_ALIVE && packet != PacketType.PLAY_TIME_UPDATE && (!packet.name().toLowerCase().contains("move") && !packet.name().contains("look"))) // System.out.println("Packet Type: " + packet + " Original ID: " + packetID + " State:" + info.getState()); if (packet.getPacketID() != -1) { packetID = packet.getNewPacketID(); @@ -334,7 +335,7 @@ public class OutgoingTransformer { output.writeByte(input.readByte()); PacketUtil.writeString(PacketUtil.readString(input), output); - PacketUtil.readString(input); // collission rule :) + PacketUtil.writeString("", output); // collission rule :) } output.writeBytes(input); return; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 2eca2012b..a4da788dc 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,4 +1,4 @@ name: ViaVersion main: us.myles.ViaVersion.Core author: _MylesC -version: 0.2 \ No newline at end of file +version: 0.3 \ No newline at end of file