Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-10-08 03:00:06 +02:00
Merge branch 'master' into dev
Dieser Commit ist enthalten in:
Commit
d3662d226b
@ -227,7 +227,7 @@ public class BukkitViaConfig extends Config implements ViaVersionConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBlockConnectionMethod() {
|
public String getBlockConnectionMethod() {
|
||||||
return getString("blockconnection-method", "world");
|
return getString("blockconnection-method", "packet");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -129,8 +129,8 @@ change-1_14-hitbox: false
|
|||||||
#
|
#
|
||||||
# Enable serverside block-connections for 1.13+ clients
|
# Enable serverside block-connections for 1.13+ clients
|
||||||
serverside-blockconnections: false
|
serverside-blockconnections: false
|
||||||
# Sets the method for the block connections (world for world-level or packet for packet-level)
|
# Sets the method for the block connections (world for highly experimental (USE AT OWN RISK) world-level or packet for packet-level)
|
||||||
blockconnection-method: world
|
blockconnection-method: packet
|
||||||
# When activated, only the most important blocks are stored in the blockstorage. (fences, glass panes etc. won't connect to solid blocks)
|
# When activated, only the most important blocks are stored in the blockstorage. (fences, glass panes etc. won't connect to solid blocks)
|
||||||
reduce-blockstorage-memory: false
|
reduce-blockstorage-memory: false
|
||||||
# When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems
|
# When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems
|
||||||
|
@ -233,7 +233,7 @@ public class SpongeViaConfig extends Config implements ViaVersionConfig {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBlockConnectionMethod() {
|
public String getBlockConnectionMethod() {
|
||||||
return getString("blockconnection-method", "world");
|
return getString("blockconnection-method", "packet");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,6 +34,7 @@ public class VelocityServerHandler {
|
|||||||
private static Method getMinecraftConnection;
|
private static Method getMinecraftConnection;
|
||||||
private static Method getNextProtocolVersion;
|
private static Method getNextProtocolVersion;
|
||||||
private static Method getKnownChannels;
|
private static Method getKnownChannels;
|
||||||
|
private static Class<?> clientPlaySessionHandler;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
@ -45,7 +46,8 @@ public class VelocityServerHandler {
|
|||||||
.getDeclaredMethod("getMinecraftConnection");
|
.getDeclaredMethod("getMinecraftConnection");
|
||||||
getNextProtocolVersion = Class.forName("com.velocitypowered.proxy.connection.MinecraftConnection")
|
getNextProtocolVersion = Class.forName("com.velocitypowered.proxy.connection.MinecraftConnection")
|
||||||
.getDeclaredMethod("getNextProtocolVersion");
|
.getDeclaredMethod("getNextProtocolVersion");
|
||||||
getKnownChannels = Class.forName("com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler")
|
clientPlaySessionHandler = Class.forName("com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler");
|
||||||
|
getKnownChannels = clientPlaySessionHandler
|
||||||
.getDeclaredMethod("getKnownChannels");
|
.getDeclaredMethod("getKnownChannels");
|
||||||
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
} catch (NoSuchMethodException | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@ -144,12 +146,13 @@ public class VelocityServerHandler {
|
|||||||
pipeline.add(ProtocolRegistry.getBaseProtocol(protocolId));
|
pipeline.add(ProtocolRegistry.getBaseProtocol(protocolId));
|
||||||
|
|
||||||
// Workaround 1.13 server change
|
// Workaround 1.13 server change
|
||||||
Set<String> knownChannels = (Set<String>) getKnownChannels.invoke(
|
Object sessionHandler = ReflectionUtil.invoke(
|
||||||
ReflectionUtil.invoke(
|
|
||||||
getMinecraftConnection.invoke(e.getPlayer()),
|
getMinecraftConnection.invoke(e.getPlayer()),
|
||||||
"getSessionHandler"
|
"getSessionHandler"
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (clientPlaySessionHandler.isInstance(sessionHandler)) { // It may be InitialConnectSessionHandler on the first server connection
|
||||||
|
Set<String> knownChannels = (Set<String>) getKnownChannels.invoke(sessionHandler);
|
||||||
if (previousServerProtocol != -1) {
|
if (previousServerProtocol != -1) {
|
||||||
int id1_13 = ProtocolVersion.MINECRAFT_1_13.getProtocol();
|
int id1_13 = ProtocolVersion.MINECRAFT_1_13.getProtocol();
|
||||||
if (previousServerProtocol < id1_13 && protocolId >= id1_13) {
|
if (previousServerProtocol < id1_13 && protocolId >= id1_13) {
|
||||||
@ -174,6 +177,7 @@ public class VelocityServerHandler {
|
|||||||
knownChannels.addAll(newChannels);
|
knownChannels.addAll(newChannels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
user.put(info);
|
user.put(info);
|
||||||
user.put(storage);
|
user.put(storage);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren