-
-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hotfix settings not being sent to the server on switch with rewriting…
… disabled
- Loading branch information
1 parent
adf2ad0
commit 4a98fac
Showing
1 changed file
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 4daf7cef8acb15511f300aa4507d6f4fb5c7c6d6 Mon Sep 17 00:00:00 2001 | ||
From 3a73a93ff02dde8334169942cdb6a220ab975c21 Mon Sep 17 00:00:00 2001 | ||
From: Shane Freeder <[email protected]> | ||
Date: Mon, 14 Jan 2019 03:35:21 +0000 | ||
Subject: [PATCH] Provide an option to disable entity metadata rewriting | ||
|
@@ -57,35 +57,61 @@ index 4ff8da6d..e860214f 100644 | |
+ } | ||
} | ||
diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java | ||
index f981313e..57136c2d 100644 | ||
index f981313e..f8de9716 100644 | ||
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java | ||
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java | ||
@@ -254,7 +254,7 @@ public class ServerConnector extends PacketHandler | ||
@@ -40,23 +40,7 @@ import net.md_5.bungee.protocol.MinecraftDecoder; | ||
import net.md_5.bungee.protocol.PacketWrapper; | ||
import net.md_5.bungee.protocol.Protocol; | ||
import net.md_5.bungee.protocol.ProtocolConstants; | ||
-import net.md_5.bungee.protocol.packet.EncryptionRequest; | ||
-import net.md_5.bungee.protocol.packet.EntityStatus; | ||
-import net.md_5.bungee.protocol.packet.GameState; | ||
-import net.md_5.bungee.protocol.packet.Handshake; | ||
-import net.md_5.bungee.protocol.packet.Kick; | ||
-import net.md_5.bungee.protocol.packet.Login; | ||
-import net.md_5.bungee.protocol.packet.LoginPayloadRequest; | ||
-import net.md_5.bungee.protocol.packet.LoginPayloadResponse; | ||
-import net.md_5.bungee.protocol.packet.LoginRequest; | ||
-import net.md_5.bungee.protocol.packet.LoginSuccess; | ||
-import net.md_5.bungee.protocol.packet.PluginMessage; | ||
-import net.md_5.bungee.protocol.packet.Respawn; | ||
-import net.md_5.bungee.protocol.packet.ScoreboardObjective; | ||
-import net.md_5.bungee.protocol.packet.ScoreboardScore; | ||
-import net.md_5.bungee.protocol.packet.SetCompression; | ||
-import net.md_5.bungee.protocol.packet.StartConfiguration; | ||
-import net.md_5.bungee.protocol.packet.ViewDistance; | ||
+import net.md_5.bungee.protocol.packet.*; | ||
import net.md_5.bungee.util.AddressUtil; | ||
import net.md_5.bungee.util.BufUtil; | ||
import net.md_5.bungee.util.QuietException; | ||
@@ -254,7 +238,8 @@ public class ServerConnector extends PacketHandler | ||
ch.write( new PluginMessage( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_13 ? "minecraft:register" : "REGISTER", Joiner.on( "\0" ).join( registeredChannels ).getBytes( StandardCharsets.UTF_8 ), false ) ); | ||
} | ||
|
||
- if ( user.getSettings() != null ) | ||
+ if (!user.isDisableEntityMetadataRewrite() && user.getSettings() != null ) | ||
+ // Something deeper is going wrong here, but, as it stands, this project is EOL, so, we'll just shove this through. | ||
+ if (user.getSettings() != null && (!user.isDisableEntityMetadataRewrite() || user.getPendingConnection().getVersion() <= ProtocolConstants.MINECRAFT_1_20_2)) | ||
{ | ||
ch.write( user.getSettings() ); | ||
} | ||
@@ -309,6 +309,7 @@ public class ServerConnector extends PacketHandler | ||
@@ -309,6 +294,7 @@ public class ServerConnector extends PacketHandler | ||
user.getTabListHandler().onServerChange(); | ||
|
||
Scoreboard serverScoreboard = user.getServerSentScoreboard(); | ||
+ if ( !user.isDisableEntityMetadataRewrite() ) { // Waterfall | ||
for ( Objective objective : serverScoreboard.getObjectives() ) | ||
{ | ||
user.unsafe().sendPacket( new ScoreboardObjective( objective.getName(), objective.getValue(), ScoreboardObjective.HealthDisplay.fromString( objective.getType() ), (byte) 1 ) ); | ||
@@ -321,6 +322,7 @@ public class ServerConnector extends PacketHandler | ||
@@ -321,6 +307,7 @@ public class ServerConnector extends PacketHandler | ||
{ | ||
user.unsafe().sendPacket( new net.md_5.bungee.protocol.packet.Team( team.getName() ) ); | ||
} | ||
+ } // Waterfall | ||
serverScoreboard.clear(); | ||
|
||
for ( UUID bossbar : user.getSentBossBars() ) | ||
@@ -339,13 +341,34 @@ public class ServerConnector extends PacketHandler | ||
@@ -339,13 +326,34 @@ public class ServerConnector extends PacketHandler | ||
} | ||
|
||
user.setDimensionChange( true ); | ||
|
@@ -156,6 +182,18 @@ index c412bbab..5966469b 100644 | |
con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId()); | ||
} | ||
|
||
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java | ||
index b9d250d9..d7c3b871 100644 | ||
--- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java | ||
+++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java | ||
@@ -308,7 +308,6 @@ public class UpstreamBridge extends PacketHandler | ||
public void handle(ClientSettings settings) throws Exception | ||
{ | ||
con.setSettings( settings ); | ||
- | ||
SettingsChangedEvent settingsEvent = new SettingsChangedEvent( con ); | ||
bungee.getPluginManager().callEvent( settingsEvent ); | ||
} | ||
diff --git a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java b/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java | ||
index c033118f..69accd42 100644 | ||
--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java | ||
|
@@ -225,5 +263,5 @@ index 00000000..cb81d1dd | |
+// Waterfall end | ||
\ No newline at end of file | ||
-- | ||
2.42.0 | ||
2.39.3 (Apple Git-145) | ||
|