Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Update version to 0.3, also fix issue with teams haha
Dieser Commit ist enthalten in:
Ursprung
e2de17e221
Commit
e885a1cec2
@ -1,9 +1,9 @@
|
|||||||
# ViaVersion 0.2
|
# ViaVersion 0.3
|
||||||
**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,
|
||||||
|
|
||||||
**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:**
|
**As of this point it doesn't have everything, I need to fix:**
|
||||||
|
|
||||||
|
@ -24,7 +24,10 @@ public class Core extends JavaPlugin {
|
|||||||
try {
|
try {
|
||||||
injectPacketHandler();
|
injectPacketHandler();
|
||||||
} catch (Exception e) {
|
} 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();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,10 @@ public enum MetaIndex {
|
|||||||
|
|
||||||
public static MetaIndex getIndex(EntityType type, int index) {
|
public static MetaIndex getIndex(EntityType type, int index) {
|
||||||
Class<? extends org.bukkit.entity.Entity> entityClass = type.getEntityClass();
|
Class<? extends org.bukkit.entity.Entity> entityClass = type.getEntityClass();
|
||||||
|
if(entityClass == null){
|
||||||
|
System.out.println("Could not get entity class for " + type);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
for (MetaIndex mi : MetaIndex.values()) {
|
for (MetaIndex mi : MetaIndex.values()) {
|
||||||
if (mi.getIndex() == index) {
|
if (mi.getIndex() == index) {
|
||||||
if (mi.getApplicableClass().isAssignableFrom(entityClass) ||
|
if (mi.getApplicableClass().isAssignableFrom(entityClass) ||
|
||||||
|
@ -19,6 +19,7 @@ import us.myles.ViaVersion.packets.State;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class OutgoingTransformer {
|
public class OutgoingTransformer {
|
||||||
@ -45,7 +46,7 @@ public class OutgoingTransformer {
|
|||||||
if (packet == null) {
|
if (packet == null) {
|
||||||
throw new RuntimeException("Outgoing Packet not found? " + packetID + " State: " + info.getState() + " Version: " + info.getProtocol());
|
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());
|
// System.out.println("Packet Type: " + packet + " Original ID: " + packetID + " State:" + info.getState());
|
||||||
if (packet.getPacketID() != -1) {
|
if (packet.getPacketID() != -1) {
|
||||||
packetID = packet.getNewPacketID();
|
packetID = packet.getNewPacketID();
|
||||||
@ -334,7 +335,7 @@ public class OutgoingTransformer {
|
|||||||
output.writeByte(input.readByte());
|
output.writeByte(input.readByte());
|
||||||
PacketUtil.writeString(PacketUtil.readString(input), output);
|
PacketUtil.writeString(PacketUtil.readString(input), output);
|
||||||
|
|
||||||
PacketUtil.readString(input); // collission rule :)
|
PacketUtil.writeString("", output); // collission rule :)
|
||||||
}
|
}
|
||||||
output.writeBytes(input);
|
output.writeBytes(input);
|
||||||
return;
|
return;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name: ViaVersion
|
name: ViaVersion
|
||||||
main: us.myles.ViaVersion.Core
|
main: us.myles.ViaVersion.Core
|
||||||
author: _MylesC
|
author: _MylesC
|
||||||
version: 0.2
|
version: 0.3
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren