mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@51d28af8 [ci/skip] Typo in CartographyInventory (#12777) PaperMC/Paper@6ea679eb Allow listening to plugin messages during configuration phase (#12775) PaperMC/Paper@c3be00f0 Always call plugin message dispatch on PlayerConnection PaperMC/Paper@3fec37a9 Move the double call into the dispatch method PaperMC/Paper@108255cb Reduce PlayerLoginEvent alt behavior nag for now (#12782) PaperMC/Paper@2141ca52 Port plugins command to brigadier (#12632) PaperMC/Paper@0cadaefc Fix quitmessage nullability issues (#12783)
This commit is contained in:
@@ -2,7 +2,7 @@ group = org.purpurmc.purpur
|
||||
version = 1.21.7-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion = 1.21.7
|
||||
paperCommit = 5661fbbab951899b7d1d46f70a0c567c6a429549
|
||||
paperCommit = 0cadaefc094c1d25eb19332cfebc02f9b5885c4a
|
||||
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.caching = true
|
||||
|
||||
@@ -42,10 +42,10 @@ index 83eff33884bffddfafc85eeb4a2900104a396e2e..3c7159d0981c948e71a5612ba4083acc
|
||||
@Override
|
||||
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 982836b811289eee0f4f5481c7c8796a89a3ef74..a249567d9cd2dfb552748ab4112709c0c0d2009b 100644
|
||||
index ee8f785ec897950a3ac3026ee0a5093502a1ec75..b89ef2c981d48e40d1c278f90891e36f7fc9a5bc 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -795,6 +795,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -794,6 +794,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.trackEnteredOrExitedLavaOnVehicle();
|
||||
this.updatePlayerAttributes();
|
||||
this.advancements.flushDirty(this, true);
|
||||
@@ -62,7 +62,7 @@ index 982836b811289eee0f4f5481c7c8796a89a3ef74..a249567d9cd2dfb552748ab4112709c0
|
||||
|
||||
private void updatePlayerAttributes() {
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 5321bccd3d221bbe4e2554ab84ed662ff67b1f6a..34342b32b199de1be4b18a7288fb31ee458d8029 100644
|
||||
index b17c1eeb7d102d983fc9b4f234a4afffec36f8dc..4b3096d211032e799208cbb79f7ebdc3d8747148 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2842,6 +2842,8 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -177,7 +177,7 @@ index f0c452ddc4b299a930de261722cc41a89aa78eeb..8e8ddab59de508c84c4182e105a11554
|
||||
protected ParticleOptions getInkParticle() {
|
||||
return ParticleTypes.GLOW_SQUID_INK;
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 65cb0a0cfa3d75e4d1083b7e6b22ca1b2682dc49..310c18480dd5ff3d700f477a2466cbcc42690034 100644
|
||||
index 96e47e6145a4cce8c154a05f9b155c1ba74bfa6a..9342765509beb740aec2d6079c9a7a98bc66ba77 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -238,9 +238,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Minecart settings and WASD controls
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index a249567d9cd2dfb552748ab4112709c0c0d2009b..f047ba2070ffe733a97a944b02fdb5f62046f657 100644
|
||||
index b89ef2c981d48e40d1c278f90891e36f7fc9a5bc..ac4e3a66c5979bbd65618eec0c8e0b744f397603 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1204,6 +1204,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -1203,6 +1203,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
} else {
|
||||
// Purpur start - Add boat fall damage config
|
||||
if (damageSource.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -429,6 +_,10 @@
|
||||
@@ -429,6 +_,9 @@
|
||||
public boolean isRealPlayer; // Paper
|
||||
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||
+ public boolean purpurClient = false; // Purpur - Purpur client support
|
||||
+ private boolean tpsBar = false; // Purpur - Implement TPSBar
|
||||
+ private boolean compassBar = false; // Purpur - Add compass command
|
||||
+ private boolean ramBar = false; // Purpur - Implement rambar commands
|
||||
|
||||
@@ -13,15 +13,18 @@
|
||||
private volatile int latency; // Paper - improve keepalives - make volatile
|
||||
private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives
|
||||
private volatile boolean suspendFlushingOnServerThread = false;
|
||||
@@ -53,6 +_,7 @@
|
||||
@@ -53,6 +_,10 @@
|
||||
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
|
||||
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
|
||||
protected static final net.minecraft.resources.ResourceLocation MINECRAFT_BRAND = net.minecraft.resources.ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support
|
||||
+ protected static final net.minecraft.resources.ResourceLocation PURPUR_CLIENT = net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("purpur", "client"); // Purpur - Purpur client support
|
||||
public @Nullable String playerBrand; // Paper
|
||||
|
||||
public ServerCommonPacketListenerImpl(MinecraftServer server, Connection connection, CommonListenerCookie cookie) {
|
||||
@@ -94,6 +_,18 @@
|
||||
+ // Purpur start - Purpur client support
|
||||
+ protected static final net.minecraft.resources.ResourceLocation PURPUR_CLIENT = net.minecraft.resources.ResourceLocation.fromNamespaceAndPath("purpur", "client");
|
||||
+ public boolean purpurClient;
|
||||
+ // Purpur end - Purpur client support
|
||||
// Paper start - retain certain values
|
||||
public @Nullable String playerBrand;
|
||||
public final java.util.Set<String> pluginMessagerChannels;
|
||||
@@ -98,6 +_,18 @@
|
||||
// Paper start - improve keepalives
|
||||
long now = System.nanoTime();
|
||||
io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek();
|
||||
@@ -40,7 +43,20 @@
|
||||
if (pending != null && pending.challengeId() == packet.getId()) {
|
||||
this.keepAlive.pendingKeepAlives.remove(pending);
|
||||
|
||||
@@ -179,6 +_,23 @@
|
||||
@@ -172,6 +_,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+ // Purpur start - Purpur client support
|
||||
+ if (identifier.equals(PURPUR_CLIENT)) {
|
||||
+ this.purpurClient = true;
|
||||
+ }
|
||||
+ // Purpur end - Purpur client support
|
||||
+
|
||||
if (identifier.equals(MINECRAFT_BRAND)) {
|
||||
this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
|
||||
}
|
||||
@@ -251,6 +_,23 @@
|
||||
Profiler.get().push("keepAlive");
|
||||
long millis = Util.getMillis();
|
||||
// Paper start - improve keepalives
|
||||
|
||||
@@ -231,16 +231,3 @@
|
||||
LOGGER.warn(
|
||||
"Player {} tried to change game mode to {} without required permissions",
|
||||
this.player.getGameProfile().getName(),
|
||||
@@ -3747,6 +_,12 @@
|
||||
readChannelIdentifier(data, startIndex, data.length, registerChannel);
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ // Purpur start - Purpur client support
|
||||
+ if (identifier.equals(PURPUR_CLIENT)) {
|
||||
+ this.player.purpurClient = true;
|
||||
+ }
|
||||
+ // Purpur end - Purpur client support
|
||||
|
||||
if (identifier.equals(MINECRAFT_BRAND)) {
|
||||
this.player.connection.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
|
||||
|
||||
@@ -29,10 +29,10 @@ index edc1758f12b36555edb7eaba2ea3bd78118dda93..7a9e20699a8a5e95910ed15eb6cd1192
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index dc3f7eff78c5fd81dfffb48a3b978ffe91902469..7f5eca8f32ae1afe3e6d2544b76cf0bbe131109f 100644
|
||||
index 3fb2b52d0d5f4f6f8b86fec999081b961503e91e..218556fdaf4ea4993864e22530b4bad3335a535d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1397,6 +1397,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1384,6 +1384,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
// Paper start - Teleport passenger API
|
||||
// Don't allow teleporting between worlds while keeping passengers
|
||||
if (ignorePassengers && entity.isVehicle() && location.getWorld() != this.getWorld()) {
|
||||
@@ -40,7 +40,7 @@ index dc3f7eff78c5fd81dfffb48a3b978ffe91902469..7f5eca8f32ae1afe3e6d2544b76cf0bb
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1418,6 +1419,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1405,6 +1406,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
||||
}
|
||||
|
||||
if (entity.isVehicle() && !ignorePassengers) { // Paper - Teleport API
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
|
||||
+++ b/src/main/java/io/papermc/paper/command/PaperPluginsCommand.java
|
||||
@@ -70,10 +_,10 @@
|
||||
this.setAliases(List.of("pl"));
|
||||
@@ -74,10 +_,10 @@
|
||||
.build();
|
||||
}
|
||||
|
||||
- private static <T> List<Component> formatProviders(final TreeMap<String, PluginProvider<T>> plugins) {
|
||||
+ private static <T> List<Component> formatProviders(final TreeMap<String, PluginProvider<T>> plugins, CommandSender sender) { // Purpur - Improve output of plugins command
|
||||
+ private static <T> List<Component> formatProviders(final TreeMap<String, PluginProvider<T>> plugins, final CommandSender sender) { // Purpur - Improve output of plugins command
|
||||
final List<Component> components = new ArrayList<>(plugins.size());
|
||||
for (final PluginProvider<T> entry : plugins.values()) {
|
||||
- components.add(formatProvider(entry));
|
||||
@@ -13,7 +13,7 @@
|
||||
}
|
||||
|
||||
boolean isFirst = true;
|
||||
@@ -100,15 +_,49 @@
|
||||
@@ -104,15 +_,49 @@
|
||||
return formattedSubLists;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
builder.append(pluginName);
|
||||
|
||||
@@ -126,6 +_,23 @@
|
||||
@@ -130,6 +_,23 @@
|
||||
return componentHeader.append(Component.text(":")).build();
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
private static Component asPlainComponents(final String strings) {
|
||||
final net.kyori.adventure.text.TextComponent.Builder builder = Component.text();
|
||||
for (final String string : strings.split("\n")) {
|
||||
@@ -186,25 +_,25 @@
|
||||
@@ -188,25 +_,25 @@
|
||||
final int sizePaperPlugins = paperPlugins.size();
|
||||
final int sizeSpigotPlugins = spigotPlugins.size();
|
||||
final int sizePlugins = sizePaperPlugins + sizeSpigotPlugins;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -575,10 +_,15 @@
|
||||
@@ -562,10 +_,15 @@
|
||||
|
||||
@Override
|
||||
public void setPlayerListName(String name) {
|
||||
@@ -17,7 +17,7 @@
|
||||
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
|
||||
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
|
||||
if (player.getBukkitEntity().canSee(this)) {
|
||||
@@ -2676,6 +_,28 @@
|
||||
@@ -2655,6 +_,28 @@
|
||||
return this.getHandle().getAbilities().walkingSpeed * 2f;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
private void validateSpeed(float value) {
|
||||
Preconditions.checkArgument(value <= 1f && value >= -1f, "Speed value (%s) need to be between -1f and 1f", value);
|
||||
}
|
||||
@@ -3524,4 +_,76 @@
|
||||
@@ -3503,4 +_,76 @@
|
||||
public PlayerGameConnection getConnection() {
|
||||
return this.getHandle().connection.playerGameConnection;
|
||||
}
|
||||
@@ -54,7 +54,7 @@
|
||||
+ // Purpur start - Purpur client support
|
||||
+ @Override
|
||||
+ public boolean usesPurpurClient() {
|
||||
+ return getHandle().purpurClient;
|
||||
+ return getHandle().connection.purpurClient;
|
||||
+ }
|
||||
+ // Purpur end - Purpur client support
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user