Add back more optimization patches
Dieser Commit ist enthalten in:
Ursprung
04dad71064
Commit
0008fa17e9
@ -1,48 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nassim Jahnke <nassim@njahnke.dev>
|
||||
Date: Fri, 14 Jun 2024 17:19:59 +0200
|
||||
Subject: [PATCH] stubs
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ecd975855d92ae5948ee926f42396cb004843aed..4a613d94f40cc73a9f50b8ef2d6949fc2bd34e53 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -110,6 +110,7 @@ import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
|
||||
import org.bukkit.BanEntry;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Bukkit;
|
||||
+import org.bukkit.Chunk;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
@@ -192,6 +193,7 @@ import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
||||
+import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
@DelegateDeserialization(CraftOfflinePlayer.class)
|
||||
public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -3481,6 +3483,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetIdleDuration() {
|
||||
this.getHandle().resetLastActionTime();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull @Unmodifiable Set<Long> getSentChunkKeys() {
|
||||
+ throw new UnsupportedOperationException("Not implemented yet");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull @Unmodifiable Set<Chunk> getSentChunks() {
|
||||
+ throw new UnsupportedOperationException("Not implemented yet");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isChunkSent(final long chunkKey) {
|
||||
+ throw new UnsupportedOperationException("Not implemented yet");
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
public Player.Spigot spigot()
|
@ -2009,10 +2009,10 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 019034eea40c1669ce3d774565ce71c078c78ba5..05bf2094d10f924401eb122cd3fe4540aafce497 100644
|
||||
index bac8deab8f703c2e0ecbc11bf218319bb52e0cd4..fb0db51493e343c781876b9db773fa3fc9a8d666 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -228,6 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
public final UUID uuid;
|
||||
public boolean hasPhysicsEvent = true; // Paper - BlockPhysicsEvent
|
||||
public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
|
||||
@ -2020,7 +2020,7 @@ index 019034eea40c1669ce3d774565ce71c078c78ba5..05bf2094d10f924401eb122cd3fe4540
|
||||
|
||||
public LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
|
||||
@@ -2560,6 +2561,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -2397,6 +2398,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
return crashreportsystemdetails;
|
||||
}
|
||||
|
||||
@ -2035,13 +2035,13 @@ index 019034eea40c1669ce3d774565ce71c078c78ba5..05bf2094d10f924401eb122cd3fe4540
|
||||
|
||||
EntityCallbacks() {}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 07281d73fcbca2ea5f8bce25f6bf961d258bf8a0..0a8eeebb2d702ebcefd9f26cc0f41d1eab497902 100644
|
||||
index 9f2fad2f4b1e4e7eda645d53eb76ed04fc0b3451..96ad3868a93964247790134fa5f4b18e5c07aea8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1881,4 +1881,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return ret;
|
||||
@@ -1570,4 +1570,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - notify observers even if grow failed
|
||||
+ // Paper start - optimize redstone (Alternate Current)
|
||||
+ public alternate.current.wire.WireHandler getWireHandler() {
|
||||
+ // This method is overridden in ServerLevel.
|
@ -6,13 +6,13 @@ Subject: [PATCH] Improve cancelling PreCreatureSpawnEvent with per player mob
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 56f855ed9dbbb9a7025bef6f9e98a8cdcf2ad4fc..4621c33ed73b0db64e78e7b9be7013a2ba7393c8 100644
|
||||
index 7bebf252887ecc7594b1ce21471fb6ba7aa2c051..df00ea382915480be1279a5347872cf7a1417341 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -309,8 +309,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -300,8 +300,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
++((ServerPlayer)backingSet[i]).mobCounts[index];
|
||||
}
|
||||
}
|
||||
|
||||
+ // Paper start - per player mob count backoff
|
||||
+ public void updateFailurePlayerMobTypeMap(int chunkX, int chunkZ, net.minecraft.world.entity.MobCategory mobCategory) {
|
||||
+ if (!this.level.paperConfig().entities.spawning.perPlayerMobSpawns) {
|
||||
@ -33,14 +33,14 @@ index 56f855ed9dbbb9a7025bef6f9e98a8cdcf2ad4fc..4621c33ed73b0db64e78e7b9be7013a2
|
||||
public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) {
|
||||
- return player.mobCounts[mobCategory.ordinal()];
|
||||
+ return player.mobCounts[mobCategory.ordinal()] + player.mobBackoffCounts[mobCategory.ordinal()]; // Paper - per player mob count backoff
|
||||
// Paper end - Optional per player mob spawns
|
||||
}
|
||||
// Paper end - Optional per player mob spawns
|
||||
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 41be61c8d239515975b5a73ecf448734710abd23..6b258a2bd85bb71b030d42b488e1a4742d1e147d 100644
|
||||
index f134b75b3665b53ef873404b3f4775657cfbcadb..7dc2ecd8a80b063cec922021bd978ba2c6f8c0fb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -522,7 +522,17 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -505,7 +505,17 @@ public class ServerChunkCache extends ChunkSource {
|
||||
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
|
||||
// re-set mob counts
|
||||
for (ServerPlayer player : this.level.players) {
|
||||
@ -60,10 +60,10 @@ index 41be61c8d239515975b5a73ecf448734710abd23..6b258a2bd85bb71b030d42b488e1a474
|
||||
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, null, true);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 2a7d050c785e6cba36ec3df3127c2fc3b7932db6..54023123e8f46671968f23f05590dd18ed5c2024 100644
|
||||
index c75812c195cc83dbe02eebc9ba67b2a9c29ca9a4..89ed20e9c629cf39a24c7a0ce5c4fee41fc64fd5 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -276,6 +276,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -279,6 +279,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
public static final int MOBCATEGORY_TOTAL_ENUMS = net.minecraft.world.entity.MobCategory.values().length;
|
||||
public final int[] mobCounts = new int[MOBCATEGORY_TOTAL_ENUMS]; // Paper
|
||||
// Paper end - Optional per player mob spawns
|
@ -5,12 +5,12 @@ Subject: [PATCH] Use Velocity compression and cipher natives
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 48b8db6d5fdf9b2f7155b9356418178f5594ddcb..4998aff0b7cb084dcda15c6a18bbe45e99b6000a 100644
|
||||
index b06f38b87765d084565bc11cf5da6076562b6be8..299b7b029384c58fed80d53cc0b77c420d62eed7 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -37,6 +37,11 @@ dependencies {
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.4.0")
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
+ // Paper start - Use Velocity cipher
|
||||
+ implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
|
||||
@ -275,10 +275,10 @@ index 34a80d2f34555663ab1b394972957089214cb337..ec30c291188ac3bba7f1c3bc397576d1
|
||||
return this.threshold;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434f8be6593 100644
|
||||
index 7dc7aeb1d94d26cf54bd4e4ab13972a3a60c1f98..90a2c61c42cba7e38f167eccdd7a951a947963c4 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -763,11 +763,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -792,11 +792,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
return networkmanager;
|
||||
}
|
||||
|
||||
@ -311,7 +311,7 @@ index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434
|
||||
|
||||
public boolean isEncrypted() {
|
||||
return this.encrypted;
|
||||
@@ -800,12 +817,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -829,12 +846,13 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
||||
public void setupCompression(int compressionThreshold, boolean rejectsBadPackets) {
|
||||
if (compressionThreshold >= 0) {
|
||||
@ -326,7 +326,7 @@ index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434
|
||||
} else {
|
||||
this.channel.pipeline().addAfter("splitter", "decompress", new CompressionDecoder(compressionThreshold, rejectsBadPackets));
|
||||
}
|
||||
@@ -816,7 +834,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -845,7 +863,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
||||
packetcompressor.setThreshold(compressionThreshold);
|
||||
} else {
|
||||
@ -336,7 +336,7 @@ index f94458d4270042062b9ae18931cc8179ef1fb420..63066dfde00569833546da01cd580434
|
||||
this.channel.pipeline().fireUserEventTriggered(io.papermc.paper.network.ConnectionEvent.COMPRESSION_THRESHOLD_SET); // Paper - Add Channel initialization listeners
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
|
||||
index a08d9aa6e420f691795df9b627a9cd5b5c0112c5..52f537b7bfbdeaad9d17c0e88a1ed1c8925a833f 100644
|
||||
index 2929d9a2efa9669781b6773161db7c5f968c2544..8aff5129f85ab5729b3da2e465871be62d15bdf2 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
|
||||
@@ -106,6 +106,11 @@ public class ServerConnectionListener {
|
||||
@ -352,10 +352,10 @@ index a08d9aa6e420f691795df9b627a9cd5b5c0112c5..52f537b7bfbdeaad9d17c0e88a1ed1c8
|
||||
protected void initChannel(Channel channel) {
|
||||
try {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index cb006ae0e5be2f1d31261bdd36964229ec44416d..b656741eb68adeb04bf995f1045902cb6bd5f2e7 100644
|
||||
index 0fc30ce511f449d2a3ddab28c86f7e388223ece1..b0f7a378f19b9837c060c891002cd5db756cdae1 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -280,12 +280,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -282,12 +282,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
}
|
||||
|
||||
SecretKey secretkey = packet.getSecretKey(privatekey);
|
@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 64ae2745c3144d43cad12dfe9baf1a291756d129..6d7224787d328540319c76f904e00cbe96d53565 100644
|
||||
index cd69971065b13353353eca55f6e145949390de11..7e32eecacf6f5e832dbfd0455e4bab1302a33d46 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1753,6 +1753,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1659,6 +1659,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
||||
@ -62,10 +62,10 @@ index 64ae2745c3144d43cad12dfe9baf1a291756d129..6d7224787d328540319c76f904e00cbe
|
||||
this.profiler.push(() -> {
|
||||
String s = String.valueOf(worldserver);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 3f6082b656ec8c9b96b40fbd1c926d5211ffe4c6..066feef97f92b3f788dd6d25d188f2cc36fc4c80 100644
|
||||
index 86197725f0f2ac1e650297ae7a79907578e0e8f1..312b57b4ef340935f4335989ce1d6a4b8b61532c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -801,10 +801,16 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -809,10 +809,16 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
|
||||
public ItemStack copy() {
|
||||
@ -85,7 +85,7 @@ index 3f6082b656ec8c9b96b40fbd1c926d5211ffe4c6..066feef97f92b3f788dd6d25d188f2cc
|
||||
itemstack.setPopTime(this.getPopTime());
|
||||
return itemstack;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
index 6207c6063cd11ccb1177fe7016c49c02a3416990..139cc0123921bf981d10334d9bd7378d19ec5f3b 100644
|
||||
index cd3b952a228c09077c2e74183a34ddb32811280b..c0563260277f9f4bd9ff08993b2efb4bca9a0c60 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -38,6 +38,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
||||
@ -96,7 +96,7 @@ index 6207c6063cd11ccb1177fe7016c49c02a3416990..139cc0123921bf981d10334d9bd7378d
|
||||
|
||||
public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
|
||||
// CraftBukkit start - data containers
|
||||
@@ -211,6 +212,7 @@ public abstract class BlockEntity {
|
||||
@@ -216,6 +217,7 @@ public abstract class BlockEntity {
|
||||
|
||||
public void setChanged() {
|
||||
if (this.level != null) {
|
@ -7,7 +7,7 @@ Inline bit operations and reduce instruction count to make these hot
|
||||
operations faster
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
index 4144c872fbd89d22827ad1f586e9a8d63a39ed46..665e88b2dedf9d5bb50914d5f3d377f2d19f40b0 100644
|
||||
index 12ff8886bb53ca15db745989c25b9bd2f45335e4..2767d6f97e8b314d23a8e62f22dfd396f5660d31 100644
|
||||
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
||||
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
||||
@@ -50,15 +50,16 @@ public class BlockPos extends Vec3i {
|
@ -10,10 +10,10 @@ when if this was fixed on the client, that wouldn't be needed.
|
||||
Mojira Issue: https://bugs.mojang.com/browse/MC-235045
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
index 3c0d2332207ba638faaaa4280bce18c334a01271..e6c7f62ed379a78645933670299e4fcda8540ed1 100644
|
||||
index 4017b82e72fefd6685e9250a936686fd8a0891f1..59d7e8a3d83d3ab7aa28606401bb129ccaeff240 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -462,4 +462,20 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
@@ -447,4 +447,20 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
return this.source.getBukkitSender(this);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -35,18 +35,18 @@ index 3c0d2332207ba638faaaa4280bce18c334a01271..e6c7f62ed379a78645933670299e4fcd
|
||||
+ // Paper end - tell clients to ask server for suggestions for EntityArguments
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index e1aa1e1f23512fc7d2267ff8e75358b67cb419a3..aa2fca6917fb67fe0e9ba067d11487c3a274f675 100644
|
||||
index d0a2581bc87df5335c064fa7854caf0bab512e91..eb488f598de412849ad6fd83161cfaebe043be14 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -517,6 +517,7 @@ public class Commands {
|
||||
private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) {
|
||||
@@ -535,6 +535,7 @@ public class Commands {
|
||||
resultNodes.keySet().removeIf((node) -> !org.spigotmc.SpigotConfig.sendNamespaced && node.getName().contains( ":" )); // Paper - Remove namedspaced from result nodes to prevent redirect trimming ~ see comment below
|
||||
Iterator iterator = tree.getChildren().iterator();
|
||||
|
||||
+ boolean registeredAskServerSuggestionsForTree = false; // Paper - tell clients to ask server for suggestions for EntityArguments
|
||||
while (iterator.hasNext()) {
|
||||
CommandNode<CommandSourceStack> commandnode2 = (CommandNode) iterator.next();
|
||||
// Paper start - Brigadier API
|
||||
@@ -543,6 +544,12 @@ public class Commands {
|
||||
@@ -597,6 +598,12 @@ public class Commands {
|
||||
|
||||
if (requiredargumentbuilder.getSuggestionsProvider() != null) {
|
||||
requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider()));
|
||||
@ -94,10 +94,10 @@ index 2043001c16b3530c2d3f52efda10bcad424881c0..7976885b902a6ce7d80f31e49448c994
|
||||
|
||||
SharedSuggestionProvider.suggest((Iterable) iterable, suggestionsbuilder1);
|
||||
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
index 3d897ec6920eff6176ddac9f0442a997b9ef14fd..abaf1ea340c69c8bee80e64567b44b5ce66d5fa3 100644
|
||||
index 6b6756625f3fb1f36f940c6e31e97b84f32a9990..32b39803380456f40bafdb790eaa27efab5f06a6 100644
|
||||
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
|
||||
@@ -113,12 +113,19 @@ public class EntitySelectorParser {
|
||||
@@ -115,12 +115,19 @@ public class EntitySelectorParser {
|
||||
private boolean hasScores;
|
||||
private boolean hasAdvancements;
|
||||
private boolean usesSelectors;
|
@ -9,7 +9,7 @@ creating too large of a packet to sed.
|
||||
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
index 05e29a703f022b5047262bae8caef33d9dfb9035..2501fbaf497d226051800c53d60a39bbc80db91c 100644
|
||||
index 1e75cd33c32f0e2923681da64b9b73b279933c1b..0a8d07bf68b0ceabd13c70196d357fce79dcc2c3 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
|
||||
@@ -27,6 +27,14 @@ public class ClientboundLevelChunkPacketData {
|
@ -4,11 +4,11 @@ Date: Mon, 8 Apr 2024 16:43:16 +0200
|
||||
Subject: [PATCH] API for checking sent chunks
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
|
||||
index ee58c67cb2bd78159cce19ec75f13dc6168a0e7a..149cfb0587299f72fcfddf395fb71b70438986c1 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
|
||||
@@ -1048,6 +1048,11 @@ public class RegionizedPlayerChunkLoader {
|
||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
|
||||
index dba09cb32844533c383635e7623f5180a468f636..a88c7113652b268c0fdc355710b00f452f9b5431 100644
|
||||
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
|
||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/player/RegionizedPlayerChunkLoader.java
|
||||
@@ -1055,5 +1055,10 @@ public final class RegionizedPlayerChunkLoader {
|
||||
|
||||
// now all tickets should be removed, which is all of our external state
|
||||
}
|
||||
@ -18,13 +18,12 @@ index ee58c67cb2bd78159cce19ec75f13dc6168a0e7a..149cfb0587299f72fcfddf395fb71b70
|
||||
+ return this.sentChunks;
|
||||
+ }
|
||||
}
|
||||
|
||||
// TODO rebase into util patch
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 9aec6efef4094bbdb920101df1a7a5a2a6070dde..815bcfd90218b932ca004c0f18db8b4de5d35c19 100644
|
||||
index ecd975855d92ae5948ee926f42396cb004843aed..c868abef790aa80863721490f69087343aba13e7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3455,6 +3455,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -3483,6 +3483,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@ -33,18 +32,18 @@ index 9aec6efef4094bbdb920101df1a7a5a2a6070dde..815bcfd90218b932ca004c0f18db8b4d
|
||||
+ public Set<java.lang.Long> getSentChunkKeys() {
|
||||
+ org.spigotmc.AsyncCatcher.catchOp("accessing sent chunks");
|
||||
+ return it.unimi.dsi.fastutil.longs.LongSets.unmodifiable(
|
||||
+ this.getHandle().chunkLoader.getSentChunksRaw().clone()
|
||||
+ this.getHandle().moonrise$getChunkLoader().getSentChunksRaw().clone()
|
||||
+ );
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Set<org.bukkit.Chunk> getSentChunks() {
|
||||
+ org.spigotmc.AsyncCatcher.catchOp("accessing sent chunks");
|
||||
+ final it.unimi.dsi.fastutil.longs.LongOpenHashSet rawChunkKeys = this.getHandle().chunkLoader.getSentChunksRaw();
|
||||
+ final it.unimi.dsi.fastutil.longs.LongOpenHashSet rawChunkKeys = this.getHandle().moonrise$getChunkLoader().getSentChunksRaw();
|
||||
+ final it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<org.bukkit.Chunk> chunks = new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(rawChunkKeys.size());
|
||||
+ final org.bukkit.World world = this.getWorld();
|
||||
+
|
||||
+ final it.unimi.dsi.fastutil.longs.LongIterator iter = this.getHandle().chunkLoader.getSentChunksRaw().longIterator();
|
||||
+ final it.unimi.dsi.fastutil.longs.LongIterator iter = this.getHandle().moonrise$getChunkLoader().getSentChunksRaw().longIterator();
|
||||
+ while (iter.hasNext()) chunks.add(world.getChunkAt(iter.nextLong(), false));
|
||||
+
|
||||
+ return it.unimi.dsi.fastutil.objects.ObjectSets.unmodifiable(chunks);
|
||||
@ -53,7 +52,7 @@ index 9aec6efef4094bbdb920101df1a7a5a2a6070dde..815bcfd90218b932ca004c0f18db8b4d
|
||||
+ @Override
|
||||
+ public boolean isChunkSent(final long chunkKey) {
|
||||
+ org.spigotmc.AsyncCatcher.catchOp("accessing sent chunks");
|
||||
+ return this.getHandle().chunkLoader.getSentChunksRaw().contains(chunkKey);
|
||||
+ return this.getHandle().moonrise$getChunkLoader().getSentChunksRaw().contains(chunkKey);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
In neuem Issue referenzieren
Einen Benutzer sperren