mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-10-31 23:59:33 +01:00
parent
2e59a51734
commit
e298a7efac
@ -237,6 +237,6 @@ public abstract class Type<T> implements ByteBufReader<T>, ByteBufWriter<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Type|" + typeName;
|
return typeName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
|||||||
|
|
||||||
public class BukkitViaInjector extends LegacyViaInjector {
|
public class BukkitViaInjector extends LegacyViaInjector {
|
||||||
|
|
||||||
private static final boolean HAS_SHARED_CONSTANTS = PaperViaInjector.hasClass("net.minecraft.SharedConstants") && PaperViaInjector.hasClass("net.minecraft.WorldVersion");
|
private static final boolean HAS_WORLD_VERSION_PROTOCOL_VERSION = PaperViaInjector.hasClass("net.minecraft.SharedConstants")
|
||||||
|
&& PaperViaInjector.hasClass("net.minecraft.WorldVersion")
|
||||||
|
&& !PaperViaInjector.hasClass("com.mojang.bridge.game.GameVersion");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void inject() throws ReflectiveOperationException {
|
public void inject() throws ReflectiveOperationException {
|
||||||
@ -65,7 +67,7 @@ public class BukkitViaInjector extends LegacyViaInjector {
|
|||||||
return Bukkit.getUnsafe().getProtocolVersion();
|
return Bukkit.getUnsafe().getProtocolVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
return HAS_SHARED_CONSTANTS ? cursedProtocolDetection() : veryCursedProtocolDetection();
|
return HAS_WORLD_VERSION_PROTOCOL_VERSION ? cursedProtocolDetection() : veryCursedProtocolDetection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int cursedProtocolDetection() throws ReflectiveOperationException {
|
private int cursedProtocolDetection() throws ReflectiveOperationException {
|
||||||
@ -187,7 +189,7 @@ public class BukkitViaInjector extends LegacyViaInjector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean lateProtocolVersionSetting() {
|
public boolean lateProtocolVersionSetting() {
|
||||||
return !(PaperViaInjector.PAPER_PROTOCOL_METHOD || HAS_SHARED_CONSTANTS);
|
return !(PaperViaInjector.PAPER_PROTOCOL_METHOD || HAS_WORLD_VERSION_PROTOCOL_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBinded() {
|
public boolean isBinded() {
|
||||||
|
@ -509,10 +509,10 @@ public class PacketWrapperImpl implements PacketWrapper {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "PacketWrapper{" +
|
return "PacketWrapper{" +
|
||||||
"packetType=" + packetType +
|
"type=" + packetType +
|
||||||
", id=" + id +
|
", id=" + id +
|
||||||
", packetValues=" + packetValues +
|
", values=" + packetValues +
|
||||||
", readableObjects=" + readableObjects +
|
", readable=" + readableObjects +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,10 +555,7 @@ public class PacketWrapperImpl implements PacketWrapper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "{"
|
return "{" + type + ": " + value + "}";
|
||||||
+ type +
|
|
||||||
", " + value +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user