Skip to content

Commit

Permalink
Updated Upstream (BungeeCord)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

BungeeCord Changes:
5a1e342e Minecraft 1.20.2 support
d9bbdc32 Add Java 21 compilation support
cfe00fa4 #3490: Add ComponentBuilder#build() and ComponentSerializer#deserialize()
d68ebd1e Minecraft 1.20.2-rc1 support
a7cd79eb #3516: Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0
9e83ee6f #3508: Use same compression threshold checks as Vanilla
7c81d917 #3513: Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.4.0 to 3.4.1
5b126b7f Fix javadoc plugin version in non-dist builds
9fe7d21f #3510: Bump actions/checkout from 3 to 4
94ea0271 #3505: Bump io.netty:netty-bom from 4.1.96.Final to 4.1.97.Final
3af672d2 #3504: Bump org.apache.maven.plugins:maven-enforcer-plugin from 3.3.0 to 3.4.0
0dd7b984 Bump version to 1.20-R0.2-SNAPSHOT
a793692a Release 1.20-R0.1
23fb8382 #3493: Bump io.netty:netty-bom from 4.1.95.Final to 4.1.96.Final
2d6d89d6 #3492: Bump io.netty:netty-bom from 4.1.94.Final to 4.1.95.Final
0199cb90 #3489: Add command string length limit when decoding ClientCommand
958cef50 #3488: Bump scriptus from 0.4.1 to 0.5.0
9f5ace90 #3418: Add tab completion for bungee command names in pre-1.13 versions
3a6e2631 #3479: Bump netty-bom from 4.1.93.Final to 4.1.94.Final
c7adcf9f Disable maven enforcer for now
da3616e6 SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
b371fe67 #3478: Bump maven-shade-plugin from 3.4.1 to 3.5.0
6324c7d5 #3401: Only synchronize necessary parts of the BungeeServerInfo#sendData method
6263fe28 #3426: Made find command output hover and clickable
9a7617f9 #3475: Add KickPlayerRaw channel
9a71358d #3439: Add GetPlayerServer bungee plugin message subchannel
a96a2e80 #3437: Remove unused enum in ServerConnector and add color to exception message
  • Loading branch information
electronicboy committed Sep 21, 2023
1 parent 7800e6f commit 77a8bd1
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 213 deletions.
2 changes: 1 addition & 1 deletion BungeeCord
6 changes: 3 additions & 3 deletions BungeeCord-Patches/0007-Fixup-ProtocolConstants.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From adedd18803ccda77f946628374b537f459b16010 Mon Sep 17 00:00:00 2001
From d86bb6401198008a6cc41ab73ebd1f253322ff7c Mon Sep 17 00:00:00 2001
From: Troy Frew <fuzzy_bot@arenaga.me>
Date: Tue, 15 Nov 2016 09:07:51 -0500
Subject: [PATCH] Fixup ProtocolConstants


diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
index 46311941..3800141e 100644
index 7d5e2635..a0dd9be6 100644
--- a/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/ProtocolConstants.java
@@ -113,6 +113,16 @@ public class ProtocolConstants
@@ -114,6 +114,16 @@ public class ProtocolConstants
SUPPORTED_VERSION_IDS = supportedVersionIds.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 88fb3abe3ca17082bc542226a1f52df63517cf67 Mon Sep 17 00:00:00 2001
From f2b7723b3a39d08901799d3205d6aa93e70f89b3 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@techcable.net>
Date: Thu, 19 May 2016 17:09:22 -0600
Subject: [PATCH] Allow invalid packet ids for forge servers
Expand Down Expand Up @@ -92,18 +92,6 @@ index 7c3e9a29..56e500a1 100644
bungee.getPluginManager().callEvent( event );

ch.write( BungeeCord.getInstance().registerChannels( user.getPendingConnection().getVersion() ) );
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 65e942cd..e37d502b 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -74,6 +74,7 @@ public final class UserConnection implements ProxiedPlayer
private final ProxyServer bungee;
@Getter
@NonNull
+ @Getter
private final ChannelWrapper ch;
@Getter
@NonNull
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 30cc36a4..c033118f 100644
--- a/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap.java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b624f9224f0de6b440be2830fcf51b2e8cb21c30 Mon Sep 17 00:00:00 2001
From 964bf7b3cf1b45a82b8ab24689bed4cbd549b968 Mon Sep 17 00:00:00 2001
From: Ichbinjoe <joe@ibj.io>
Date: Sat, 16 Jul 2016 20:44:01 -0400
Subject: [PATCH] Add timeout variant to connect methods
Expand Down Expand Up @@ -75,10 +75,10 @@ index c3848b3c..a441a424 100644
* Connects / transfers this user to the specified connection, gracefully
* closing the current one. Depending on the implementation, this method
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index e37d502b..07cfe1d5 100644
index 65e942cd..87eb9199 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -259,9 +259,20 @@ public final class UserConnection implements ProxiedPlayer
@@ -258,9 +258,20 @@ public final class UserConnection implements ProxiedPlayer

public void connect(ServerInfo info, final Callback<Boolean> callback, final boolean retry, ServerConnectEvent.Reason reason)
{
Expand All @@ -99,7 +99,7 @@ index e37d502b..07cfe1d5 100644
if ( callback != null )
{
// Convert the Callback<Boolean> to be compatible with Callback<Result> from ServerConnectRequest.
@@ -355,7 +366,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -354,7 +365,7 @@ public final class UserConnection implements ProxiedPlayer
if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) )
{
sendMessage( bungee.getTranslation( "fallback_lobby" ) );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ce79efbdf45d665fd0f018cae81294db0245c262 Mon Sep 17 00:00:00 2001
From 42716f7bfd1552c1a7207293614d27d8105833d1 Mon Sep 17 00:00:00 2001
From: Aaron Hill <aa1ronham@gmail.com>
Date: Thu, 15 Sep 2016 22:38:37 +0200
Subject: [PATCH] Fix potion race condition on Forge 1.8.9
Expand Down Expand Up @@ -117,7 +117,7 @@ index 00000000..7ed2dc3a
+ }
+}
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 07cfe1d5..c74e44b5 100644
index 87eb9199..a129dc42 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -1,7 +1,9 @@
Expand All @@ -130,8 +130,19 @@ index 07cfe1d5..c74e44b5 100644
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
@@ -125,6 +127,10 @@ public final class UserConnection implements ProxiedPlayer
private final Scoreboard serverSentScoreboard = new Scoreboard();
@Getter
private final Collection<UUID> sentBossBars = new HashSet<>();
+ // Waterfall start
+ @Getter
+ private final Multimap<Integer, Integer> potions = HashMultimap.create();
+ // Waterfall end
@Getter
@Setter
private String lastCommandTabbed;
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
index 30fbb0b1..102eb1a8 100644
index 30fbb0b1..c412bbab 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
@@ -737,6 +737,32 @@ public class DownstreamBridge extends PacketHandler
Expand All @@ -140,7 +151,7 @@ index 30fbb0b1..102eb1a8 100644

+ // Waterfall start
+ @Override
+ public void handle(EntityEffect entityEffect) throws Exception
+ public void handle(net.md_5.bungee.protocol.packet.EntityEffect entityEffect) throws Exception
+ {
+ // Don't send any potions when switching between servers (which involves a handshake), which can trigger a race
+ // condition on the client.
Expand All @@ -151,7 +162,7 @@ index 30fbb0b1..102eb1a8 100644
+ }
+
+ @Override
+ public void handle(EntityRemoveEffect removeEffect) throws Exception
+ public void handle(net.md_5.bungee.protocol.packet.EntityRemoveEffect removeEffect) throws Exception
+ {
+ con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId());
+ }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From f0bc70621c1957e310e814708854a5674129f7aa Mon Sep 17 00:00:00 2001
From ceefeced5e361ab808abd4831ce7ff9d45026855 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Fri, 22 Sep 2017 12:46:47 +0200
Subject: [PATCH] Use Log4j2 for logging and TerminalConsoleAppender for
Expand Down Expand Up @@ -39,7 +39,7 @@ index 07d49112..672a813d 100644
</build>
diff --git a/log4j/pom.xml b/log4j/pom.xml
new file mode 100644
index 00000000..1cc7936e
index 00000000..f9a169cc
--- /dev/null
+++ b/log4j/pom.xml
@@ -0,0 +1,48 @@
Expand All @@ -50,13 +50,13 @@ index 00000000..1cc7936e
+ <parent>
+ <groupId>io.github.waterfallmc</groupId>
+ <artifactId>waterfall-parent</artifactId>
+ <version>1.20-R0.1-SNAPSHOT</version>
+ <version>1.20-R0.2-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>io.github.waterfallmc</groupId>
+ <artifactId>waterfall-log4j</artifactId>
+ <version>1.20-R0.1-SNAPSHOT</version>
+ <version>1.20-R0.2-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>Waterfall-Log4J</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 3be2c70b1860141a74772aa85bdbfb6c91b7d1f2 Mon Sep 17 00:00:00 2001
From 8525fdb1e67b91ffd9d11342c505ecf351a29619 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 14 Jan 2019 03:35:21 +0000
Subject: [PATCH] Provide an option to disable entity metadata rewriting
Expand Down Expand Up @@ -57,7 +57,7 @@ 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 2624dd37..c3268cbe 100644
index 2624dd37..55218447 100644
--- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
+++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java
@@ -255,7 +255,7 @@ public class ServerConnector extends PacketHandler
Expand Down Expand Up @@ -85,7 +85,7 @@ index 2624dd37..c3268cbe 100644
serverScoreboard.clear();

for ( UUID bossbar : user.getSentBossBars() )
@@ -340,13 +342,33 @@ public class ServerConnector extends PacketHandler
@@ -340,13 +342,34 @@ public class ServerConnector extends PacketHandler
}

user.setDimensionChange( true );
Expand All @@ -105,26 +105,27 @@ index 2624dd37..c3268cbe 100644
+ // Only send if we are not in the same dimension
+ if ( login.getDimension() != user.getDimension() ) // Waterfall - defer
+ {
+ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), login.getPortalCooldown() ) );
+ user.unsafe().sendPacket( new Respawn( (Integer) user.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), (byte) 0, login.getDeathLocation(), login.getPortalCooldown() ) );
+ }
+ Login modLogin = new Login( login.getEntityId(), login.isHardcore(), login.getGameMode(), login.getPreviousGameMode(), login.getWorldNames(), login.getDimensions(), login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(),
+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isDebug(), login.isFlat(), login.getDeathLocation(), login.getPortalCooldown() );
+ (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType(), login.getViewDistance(), login.getSimulationDistance(), login.isReducedDebugInfo(), login.isNormalRespawn(), login.isLimitedCrafting(), login.isDebug(), login.isFlat(), login.getDeathLocation(),
+ login.getPortalCooldown() );
+ user.unsafe().sendPacket(modLogin);
+ // Only send if we're in the same dimension
+ if ( login.getDimension() == user.getDimension() ) // Waterfall - defer
+ {
+ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false, login.getDeathLocation(), login.getPortalCooldown() ) );
+ user.unsafe().sendPacket( new Respawn( (Integer) login.getDimension() >= 0 ? -1 : 0, login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), (byte) 0, login.getDeathLocation(), login.getPortalCooldown() ) );
+ }
+ }
+ // Waterfall end
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getWorldName(), login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(),
(byte) 0, login.getDeathLocation(), login.getPortalCooldown() ) );
if ( user.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_14 )
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index c74e44b5..9e933b1d 100644
index a129dc42..fe6eab9b 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -775,4 +775,10 @@ public final class UserConnection implements ProxiedPlayer
@@ -778,4 +778,10 @@ public final class UserConnection implements ProxiedPlayer
{
return serverSentScoreboard;
}
Expand All @@ -136,20 +137,20 @@ index c74e44b5..9e933b1d 100644
+ // Waterfall end
}
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
index 102eb1a8..a2995c60 100644
index c412bbab..5966469b 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java
@@ -741,6 +741,7 @@ public class DownstreamBridge extends PacketHandler
@Override
public void handle(EntityEffect entityEffect) throws Exception
public void handle(net.md_5.bungee.protocol.packet.EntityEffect entityEffect) throws Exception
{
+ if (con.isDisableEntityMetadataRewrite()) return; // Waterfall
// Don't send any potions when switching between servers (which involves a handshake), which can trigger a race
// condition on the client.
if (this.con.getForgeClientHandler().isForgeUser() && !this.con.getForgeClientHandler().isHandshakeComplete()) {
@@ -752,6 +753,7 @@ public class DownstreamBridge extends PacketHandler
@Override
public void handle(EntityRemoveEffect removeEffect) throws Exception
public void handle(net.md_5.bungee.protocol.packet.EntityRemoveEffect removeEffect) throws Exception
{
+ if (con.isDisableEntityMetadataRewrite()) return; // Waterfall
con.getPotions().remove(rewriteEntityId(removeEffect.getEntityId()), removeEffect.getEffectId());
Expand Down
12 changes: 6 additions & 6 deletions BungeeCord-Patches/0058-ServerConnectRequest-sendFeedback.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From f5ddca96ef3353bc21ba8b63b1be12437c0e8424 Mon Sep 17 00:00:00 2001
From cf604e1b03d62a3c0914712ed056c9fb538c3de0 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Fri, 16 Apr 2021 06:29:28 +0100
Subject: [PATCH] ServerConnectRequest#sendFeedback
Expand Down Expand Up @@ -31,10 +31,10 @@ index c81b0a4e..d21370be 100644
}
}
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 9e933b1d..1a7fa00e 100644
index fe6eab9b..fc8df2b8 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -268,12 +268,16 @@ public final class UserConnection implements ProxiedPlayer
@@ -271,12 +271,16 @@ public final class UserConnection implements ProxiedPlayer
connect(info, callback, retry, ServerConnectEvent.Reason.PLUGIN, timeout);
}

Expand All @@ -53,7 +53,7 @@ index 9e933b1d..1a7fa00e 100644
builder.connectTimeout(timeout); // Waterfall
if ( callback != null )
{
@@ -321,7 +325,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -324,7 +328,7 @@ public final class UserConnection implements ProxiedPlayer
callback.done( ServerConnectRequest.Result.ALREADY_CONNECTED, null );
}

Expand All @@ -62,7 +62,7 @@ index 9e933b1d..1a7fa00e 100644
return;
}
if ( pendingConnects.contains( target ) )
@@ -331,7 +335,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -334,7 +338,7 @@ public final class UserConnection implements ProxiedPlayer
callback.done( ServerConnectRequest.Result.ALREADY_CONNECTING, null );
}

Expand All @@ -71,7 +71,7 @@ index 9e933b1d..1a7fa00e 100644
return;
}

@@ -367,14 +371,14 @@ public final class UserConnection implements ProxiedPlayer
@@ -370,14 +374,14 @@ public final class UserConnection implements ProxiedPlayer
ServerInfo def = updateAndGetNextServer( target );
if ( request.isRetry() && def != null && ( getServer() == null || def != getServer().getInfo() ) )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 49d8d065ef2a1f7a7b885b204ba6676a8f2c826e Mon Sep 17 00:00:00 2001
From e1c30dc6d176143f1f51a9e48636125f45ecb957 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 22 Mar 2022 14:56:44 +0000
Subject: [PATCH] Don't send exceptions to the client during kicks, etc
Expand All @@ -13,10 +13,10 @@ allows for retaining much of the overall context here, i.e. who
was this exception assocated with?

diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 1a7fa00e..5c4d7e54 100644
index fc8df2b8..fb08c080 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -399,7 +399,8 @@ public final class UserConnection implements ProxiedPlayer
@@ -402,7 +402,8 @@ public final class UserConnection implements ProxiedPlayer

private String connectionFailMessage(Throwable cause)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 30382255e40088804060b9e07047a89d149ef381 Mon Sep 17 00:00:00 2001
From 1dc384718469865083289a3c4239082c5a68f9ce Mon Sep 17 00:00:00 2001
From: Janmm14 <gitconfig1@janmm14.de>
Date: Mon, 21 Jun 2021 23:43:39 +0200
Subject: [PATCH] Replace reflection inside netty with ChannelFactory.
Expand Down Expand Up @@ -32,10 +32,10 @@ index 377df7ec..8f531f85 100644
.handler( PipelineUtils.BASE_SERVERSIDE )
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, BungeeCord.getInstance().getConfig().getRemotePingTimeout() )
diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
index 5c4d7e54..7d3f079f 100644
index fb08c080..96f4d017 100644
--- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java
+++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java
@@ -384,7 +384,7 @@ public final class UserConnection implements ProxiedPlayer
@@ -387,7 +387,7 @@ public final class UserConnection implements ProxiedPlayer
}
};
Bootstrap b = new Bootstrap()
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 77a8bd1

Please sign in to comment.