Update Paper

This commit is contained in:
Spottedleaf 2025-01-28 14:02:07 -08:00
parent e7e959208c
commit 81b9f70be9
6 changed files with 104 additions and 76 deletions

View File

@ -134,7 +134,7 @@
return;
}
@@ -817,7 +_,7 @@
@@ -824,7 +_,7 @@
}
// This needs to be on main
@ -143,7 +143,7 @@
} else if (!completions.isEmpty()) {
final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packet.getCommand(), stringReader.getTotalLength());
final com.mojang.brigadier.suggestion.SuggestionsBuilder builder = builder0.createOffset(builder0.getInput().lastIndexOf(' ') + 1);
@@ -1200,11 +_,11 @@
@@ -1207,11 +_,11 @@
}
// Paper end - Book size limits
// CraftBukkit start
@ -157,7 +157,7 @@
// CraftBukkit end
int slot = packet.slot();
if (Inventory.isHotbarSlot(slot) || slot == 40) {
@@ -1215,7 +_,22 @@
@@ -1222,7 +_,22 @@
Consumer<List<FilteredText>> consumer = optional.isPresent()
? texts -> this.signBook(texts.get(0), texts.subList(1, texts.size()), slot)
: texts -> this.updateBookContents(texts, slot);
@ -181,7 +181,7 @@
}
}
@@ -1341,9 +_,10 @@
@@ -1348,9 +_,10 @@
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
// CraftBukkit start - handle custom speeds and skipped ticks
@ -194,7 +194,7 @@
if (i > Math.max(this.allowedPlayerTicks, 5)) {
LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getName().getString(), i);
@@ -1532,7 +_,7 @@
@@ -1539,7 +_,7 @@
// If the event is cancelled we move the player back to their old location.
if (event.isCancelled()) {
@ -203,7 +203,7 @@
return;
}
@@ -1540,7 +_,7 @@
@@ -1547,7 +_,7 @@
// there to avoid any 'Moved wrongly' or 'Moved too quickly' errors.
// We only do this if the Event was not cancelled.
if (!oldTo.equals(event.getTo()) && !event.isCancelled()) {
@ -212,7 +212,7 @@
return;
}
@@ -1799,9 +_,9 @@
@@ -1806,9 +_,9 @@
if (!this.player.isSpectator()) {
// limit how quickly items can be dropped
// If the ticks aren't the same then the count starts from 0 and we update the lastDropTick.
@ -224,7 +224,7 @@
} else {
// Else we increment the drop count and check the amount.
this.dropCount++;
@@ -1829,7 +_,7 @@
@@ -1836,7 +_,7 @@
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
// Paper start - Don't allow digging into unloaded chunks
@ -233,7 +233,7 @@
this.player.connection.ackBlockChangesUpTo(packet.getSequence());
return;
}
@@ -1911,7 +_,7 @@
@@ -1918,7 +_,7 @@
}
// Paper end - improve distance check
BlockPos blockPos = hitResult.getBlockPos();
@ -242,7 +242,7 @@
Vec3 vec3 = location.subtract(Vec3.atCenterOf(blockPos));
double d = 1.0000001;
if (Math.abs(vec3.x()) < 1.0000001 && Math.abs(vec3.y()) < 1.0000001 && Math.abs(vec3.z()) < 1.0000001) {
@@ -2032,7 +_,7 @@
@@ -2039,7 +_,7 @@
for (ServerLevel serverLevel : this.server.getAllLevels()) {
Entity entity = packet.getEntity(serverLevel);
if (entity != null) {
@ -251,7 +251,7 @@
return;
}
}
@@ -2064,7 +_,7 @@
@@ -2071,7 +_,7 @@
}
// CraftBukkit end
LOGGER.info("{} lost connection: {}", this.player.getName().getString(), details.reason().getString());
@ -260,7 +260,7 @@
super.onDisconnect(details, quitMessage); // Paper - Fix kick event leave message not being sent
}
@@ -2073,6 +_,8 @@
@@ -2080,6 +_,8 @@
this.removePlayerFromWorld(null);
}
@ -269,7 +269,7 @@
private void removePlayerFromWorld(@Nullable net.kyori.adventure.text.Component quitMessage) {
// Paper end - Fix kick event leave message not being sent
this.chatMessageChain.close();
@@ -2086,6 +_,8 @@
@@ -2093,6 +_,8 @@
this.player.disconnect();
// Paper start - Adventure
quitMessage = quitMessage == null ? this.server.getPlayerList().remove(this.player) : this.server.getPlayerList().remove(this.player, quitMessage); // Paper - pass in quitMessage to fix kick message not being used
@ -278,7 +278,7 @@
if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) {
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end - Adventure
@@ -2324,7 +_,7 @@
@@ -2331,7 +_,7 @@
this.player.resetLastActionTime();
// CraftBukkit start
if (sync) {
@ -287,7 +287,7 @@
} else {
handler.run();
}
@@ -2379,7 +_,7 @@
@@ -2386,7 +_,7 @@
String originalFormat = event.getFormat(), originalMessage = event.getMessage();
this.cserver.getPluginManager().callEvent(event);
@ -296,7 +296,7 @@
// Evil plugins still listening to deprecated event
final PlayerChatEvent queueEvent = new PlayerChatEvent(player, event.getMessage(), event.getFormat(), event.getRecipients());
queueEvent.setCancelled(event.isCancelled());
@@ -2476,6 +_,7 @@
@@ -2483,6 +_,7 @@
if (rawMessage.isEmpty()) {
LOGGER.warn("{} tried to send an empty message", this.player.getScoreboardName());
} else if (this.getCraftPlayer().isConversing()) {
@ -304,7 +304,7 @@
final String conversationInput = rawMessage;
this.server.processQueue.add(() -> ServerGamePacketListenerImpl.this.getCraftPlayer().acceptConversationInput(conversationInput));
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check
@@ -2701,8 +_,25 @@
@@ -2708,8 +_,25 @@
// Spigot end
public void switchToConfig() {
@ -331,7 +331,7 @@
this.send(ClientboundStartConfigurationPacket.INSTANCE);
this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
}
@@ -2727,7 +_,7 @@
@@ -2734,7 +_,7 @@
// Spigot end
this.player.resetLastActionTime();
this.player.setShiftKeyDown(packet.isUsingSecondaryAction());
@ -340,7 +340,7 @@
if (!serverLevel.getWorldBorder().isWithinBounds(target.blockPosition())) {
return;
}
@@ -2859,6 +_,12 @@
@@ -2866,6 +_,12 @@
switch (action) {
case PERFORM_RESPAWN:
if (this.player.wonGame) {
@ -353,7 +353,7 @@
this.player.wonGame = false;
this.player = this.server.getPlayerList().respawn(this.player, true, Entity.RemovalReason.CHANGED_DIMENSION, RespawnReason.END_PORTAL); // CraftBukkit
this.resetPosition();
@@ -2868,6 +_,17 @@
@@ -2875,6 +_,17 @@
return;
}
@ -371,7 +371,7 @@
this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit
this.resetPosition();
if (this.server.isHardcore()) {
@@ -3441,7 +_,21 @@
@@ -3448,7 +_,21 @@
}
List<String> list = Stream.of(lines).map(ChatFormatting::stripFormatting).collect(Collectors.toList());
// Paper end - Limit client sign length

View File

@ -7,10 +7,10 @@ When regions take too long, having the server print the stacktrace
of the ticking region should help debug the cause.
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index a9339f59f81dff307317ae4afdff0dc296febcc9..75b698c2bcbbf487200b29083671332a6cc222ed 100644
index dced8899be0bb8d562093dc3a7673ed8185b85a6..8228752184aaf91288092c1c60e8a431723ded41 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -159,7 +159,7 @@ public class WatchdogThread extends Thread {
@@ -159,7 +159,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
}
}

View File

@ -12,7 +12,35 @@
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ChunkPos;
@@ -119,50 +_,157 @@
@@ -15,8 +_,26 @@
private static final Logger LOGGER = LoggerFactory.getLogger(TickThread.class);
+ private static String getRegionInfo(final ThreadedRegionizer.ThreadedRegion<TickRegions.TickRegionData, TickRegions.TickRegionSectionData> region) {
+ if (region == null) {
+ return "{null}";
+ }
+
+ final ChunkPos center = region.getCenterChunk();
+ final net.minecraft.server.level.ServerLevel world = region.regioniser.world;
+
+ return "{center=" + center + ",world=" + (world == null ? "null" : WorldUtil.getWorldName(world)) + "}";
+ }
+
private static String getThreadContext() {
- return "thread=" + Thread.currentThread().getName();
+ final Thread thread = Thread.currentThread();
+
+ if (!(thread instanceof TickThread)) {
+ return "[thread=" + thread + ",class=" + thread.getClass().getName() + "]";
+ }
+
+ return "[thread=" + thread.getName() + ",class=" + thread.getClass().getName() + ",region=" + getRegionInfo(TickRegionScheduler.getCurrentRegion()) + "]";
+
}
/**
@@ -123,50 +_,157 @@
}
public static boolean isShutdownThread() {

View File

@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -230,7 +_,7 @@
@@ -233,7 +_,7 @@
@Override
public int getTickableTileEntityCount() {
@ -9,7 +9,7 @@
}
@Override
@@ -297,7 +_,7 @@
@@ -300,7 +_,7 @@
// Paper start - per world spawn limits
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
@ -18,7 +18,7 @@
}
}
// Paper end - per world spawn limits
@@ -367,6 +_,7 @@
@@ -370,6 +_,7 @@
@Override
public Chunk getChunkAt(int x, int z) {
@ -26,7 +26,7 @@
warnUnsafeChunk("getting a faraway chunk", x, z); // Paper
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) this.world.getChunk(x, z, ChunkStatus.FULL, true);
return new CraftChunk(chunk);
@@ -397,10 +_,10 @@
@@ -400,10 +_,10 @@
@Override
public boolean isChunkGenerated(int x, int z) {
// Paper start - Fix this method
@ -39,7 +39,7 @@
}
ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z);
if (chunk != null) {
@@ -457,7 +_,7 @@
@@ -460,7 +_,7 @@
}
private boolean unloadChunk0(int x, int z, boolean save) {
@ -48,7 +48,7 @@
if (!this.isChunkLoaded(x, z)) {
return true;
}
@@ -474,7 +_,7 @@
@@ -477,7 +_,7 @@
@Override
public boolean regenerateChunk(int x, int z) {
@ -57,7 +57,7 @@
throw new UnsupportedOperationException("Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)");
/*
if (!unloadChunk0(x, z, false)) {
@@ -501,6 +_,7 @@
@@ -504,6 +_,7 @@
@Override
public boolean refreshChunk(int x, int z) {
@ -65,7 +65,7 @@
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
if (playerChunk == null) return false;
@@ -551,7 +_,7 @@
@@ -554,7 +_,7 @@
@Override
public boolean loadChunk(int x, int z, boolean generate) {
@ -74,7 +74,7 @@
warnUnsafeChunk("loading a faraway chunk", x, z); // Paper
ChunkAccess chunk = this.world.getChunkSource().getChunk(x, z, generate || isChunkGenerated(x, z) ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); // Paper
@@ -591,7 +_,7 @@
@@ -594,7 +_,7 @@
final DistanceManager distanceManager = this.world.getChunkSource().chunkMap.distanceManager;
if (distanceManager.addPluginRegionTicket(new ChunkPos(x, z), plugin)) {
@ -83,7 +83,7 @@
return true;
}
@@ -779,13 +_,15 @@
@@ -782,13 +_,15 @@
@Override
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
@ -104,7 +104,7 @@
BlockPos position = ((CraftBlockState) blockstate).getPosition();
net.minecraft.world.level.block.state.BlockState oldBlock = this.world.getBlockState(position);
int flag = ((CraftBlockState) blockstate).getFlag();
@@ -793,10 +_,10 @@
@@ -796,10 +_,10 @@
net.minecraft.world.level.block.state.BlockState newBlock = this.world.getBlockState(position);
this.world.notifyAndUpdatePhysics(position, null, oldBlock, newBlock, newBlock, flag, 512);
}
@ -117,7 +117,7 @@
return false;
}
}
@@ -830,6 +_,7 @@
@@ -833,6 +_,7 @@
@Override
public void setTime(long time) {
@ -125,7 +125,7 @@
long margin = (time - this.getFullTime()) % 24000;
if (margin < 0) margin += 24000;
this.setFullTime(this.getFullTime() + margin);
@@ -842,6 +_,7 @@
@@ -845,6 +_,7 @@
@Override
public void setFullTime(long time) {
@ -133,7 +133,7 @@
// Notify anyone who's listening
TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - this.world.getDayTime());
this.server.getPluginManager().callEvent(event);
@@ -869,7 +_,7 @@
@@ -872,7 +_,7 @@
@Override
public long getGameTime() {
@ -142,7 +142,7 @@
}
@Override
@@ -894,6 +_,7 @@
@@ -897,6 +_,7 @@
}
public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source, Consumer<net.minecraft.world.level.ServerExplosion> configurator) {
// Paper end - expand explosion API
@ -150,7 +150,7 @@
net.minecraft.world.level.Level.ExplosionInteraction explosionType;
if (!breakBlocks) {
explosionType = net.minecraft.world.level.Level.ExplosionInteraction.NONE; // Don't break blocks
@@ -903,6 +_,7 @@
@@ -906,6 +_,7 @@
explosionType = net.minecraft.world.level.Level.ExplosionInteraction.MOB; // Respect mobGriefing gamerule
}
@ -158,7 +158,7 @@
net.minecraft.world.entity.Entity entity = (source == null) ? null : ((CraftEntity) source).getHandle();
return !this.world.explode0(entity, Explosion.getDefaultDamageSource(this.world, entity), null, x, y, z, power, setFire, explosionType, ParticleTypes.EXPLOSION, ParticleTypes.EXPLOSION_EMITTER, SoundEvents.GENERIC_EXPLODE, configurator).wasCanceled; // Paper - expand explosion API
}
@@ -985,6 +_,7 @@
@@ -988,6 +_,7 @@
@Override
public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) {
@ -166,7 +166,7 @@
warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper
// Transient load for this tick
return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z);
@@ -1015,6 +_,7 @@
@@ -1018,6 +_,7 @@
@Override
public void setBiome(int x, int y, int z, Holder<net.minecraft.world.level.biome.Biome> bb) {
BlockPos pos = new BlockPos(x, 0, z);
@ -174,7 +174,7 @@
if (this.world.hasChunkAt(pos)) {
net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos);
@@ -1325,6 +_,7 @@
@@ -1348,6 +_,7 @@
@Override
public void setStorm(boolean hasStorm) {
@ -182,7 +182,7 @@
this.world.serverLevelData.setRaining(hasStorm, org.bukkit.event.weather.WeatherChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents
this.setWeatherDuration(0); // Reset weather duration (legacy behaviour)
this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
@@ -1337,6 +_,7 @@
@@ -1360,6 +_,7 @@
@Override
public void setWeatherDuration(int duration) {
@ -190,7 +190,7 @@
this.world.serverLevelData.setRainTime(duration);
}
@@ -1347,6 +_,7 @@
@@ -1370,6 +_,7 @@
@Override
public void setThundering(boolean thundering) {
@ -198,7 +198,7 @@
this.world.serverLevelData.setThundering(thundering, org.bukkit.event.weather.ThunderChangeEvent.Cause.PLUGIN); // Paper - Add cause to Weather/ThunderChangeEvents
this.setThunderDuration(0); // Reset weather duration (legacy behaviour)
this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
@@ -1359,6 +_,7 @@
@@ -1382,6 +_,7 @@
@Override
public void setThunderDuration(int duration) {
@ -206,7 +206,7 @@
this.world.serverLevelData.setThunderTime(duration);
}
@@ -1369,6 +_,7 @@
@@ -1392,6 +_,7 @@
@Override
public void setClearWeatherDuration(int duration) {
@ -214,7 +214,7 @@
this.world.serverLevelData.setClearWeatherTime(duration);
}
@@ -1567,6 +_,7 @@
@@ -1590,6 +_,7 @@
@Override
public void setKeepSpawnInMemory(boolean keepLoaded) {
@ -222,7 +222,7 @@
if (keepLoaded) {
this.setGameRule(GameRule.SPAWN_CHUNK_RADIUS, this.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS));
} else {
@@ -1635,6 +_,7 @@
@@ -1658,6 +_,7 @@
@Override
public void setHardcore(boolean hardcore) {
@ -230,7 +230,7 @@
this.world.serverLevelData.settings.hardcore = hardcore;
}
@@ -1647,6 +_,7 @@
@@ -1670,6 +_,7 @@
@Override
@Deprecated
public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) {
@ -238,7 +238,7 @@
this.setTicksPerSpawns(SpawnCategory.ANIMAL, ticksPerAnimalSpawns);
}
@@ -1659,6 +_,7 @@
@@ -1682,6 +_,7 @@
@Override
@Deprecated
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) {
@ -246,7 +246,7 @@
this.setTicksPerSpawns(SpawnCategory.MONSTER, ticksPerMonsterSpawns);
}
@@ -1671,6 +_,7 @@
@@ -1694,6 +_,7 @@
@Override
@Deprecated
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) {
@ -254,7 +254,7 @@
this.setTicksPerSpawns(SpawnCategory.WATER_ANIMAL, ticksPerWaterSpawns);
}
@@ -1683,6 +_,7 @@
@@ -1706,6 +_,7 @@
@Override
@Deprecated
public void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) {
@ -262,7 +262,7 @@
this.setTicksPerSpawns(SpawnCategory.WATER_AMBIENT, ticksPerWaterAmbientSpawns);
}
@@ -1695,6 +_,7 @@
@@ -1718,6 +_,7 @@
@Override
@Deprecated
public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) {
@ -270,7 +270,7 @@
this.setTicksPerSpawns(SpawnCategory.WATER_UNDERGROUND_CREATURE, ticksPerWaterUndergroundCreatureSpawns);
}
@@ -1707,11 +_,13 @@
@@ -1730,11 +_,13 @@
@Override
@Deprecated
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) {
@ -284,7 +284,7 @@
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
@@ -1728,21 +_,25 @@
@@ -1751,21 +_,25 @@
@Override
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
@ -310,7 +310,7 @@
this.server.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin);
}
@@ -1755,6 +_,7 @@
@@ -1778,6 +_,7 @@
@Override
@Deprecated
public void setMonsterSpawnLimit(int limit) {
@ -318,7 +318,7 @@
this.setSpawnLimit(SpawnCategory.MONSTER, limit);
}
@@ -1767,6 +_,7 @@
@@ -1790,6 +_,7 @@
@Override
@Deprecated
public void setAnimalSpawnLimit(int limit) {
@ -326,7 +326,7 @@
this.setSpawnLimit(SpawnCategory.ANIMAL, limit);
}
@@ -1779,6 +_,7 @@
@@ -1802,6 +_,7 @@
@Override
@Deprecated
public void setWaterAnimalSpawnLimit(int limit) {
@ -334,7 +334,7 @@
this.setSpawnLimit(SpawnCategory.WATER_ANIMAL, limit);
}
@@ -1791,6 +_,7 @@
@@ -1814,6 +_,7 @@
@Override
@Deprecated
public void setWaterAmbientSpawnLimit(int limit) {
@ -342,7 +342,7 @@
this.setSpawnLimit(SpawnCategory.WATER_AMBIENT, limit);
}
@@ -1803,6 +_,7 @@
@@ -1826,6 +_,7 @@
@Override
@Deprecated
public void setWaterUndergroundCreatureSpawnLimit(int limit) {
@ -350,7 +350,7 @@
this.setSpawnLimit(SpawnCategory.WATER_UNDERGROUND_CREATURE, limit);
}
@@ -1815,6 +_,7 @@
@@ -1838,6 +_,7 @@
@Override
@Deprecated
public void setAmbientSpawnLimit(int limit) {
@ -358,7 +358,7 @@
this.setSpawnLimit(SpawnCategory.AMBIENT, limit);
}
@@ -1837,6 +_,7 @@
@@ -1860,6 +_,7 @@
@Override
public void setSpawnLimit(SpawnCategory spawnCategory, int limit) {
@ -366,7 +366,7 @@
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
@@ -1919,7 +_,7 @@
@@ -1942,7 +_,7 @@
if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return;
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(CraftSound.bukkitToMinecraftHolder(sound), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
@ -375,7 +375,7 @@
if (entityTracker != null) {
entityTracker.broadcastAndSend(packet);
}
@@ -1940,7 +_,7 @@
@@ -1963,7 +_,7 @@
if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return;
ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(ResourceLocation.parse(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed);
@ -384,7 +384,7 @@
if (entityTracker != null) {
entityTracker.broadcastAndSend(packet);
}
@@ -2023,6 +_,7 @@
@@ -2046,6 +_,7 @@
@Override
public boolean setGameRuleValue(String rule, String value) {
@ -392,7 +392,7 @@
// No null values allowed
if (rule == null || value == null) return false;
@@ -2065,6 +_,7 @@
@@ -2088,6 +_,7 @@
@Override
public <T> boolean setGameRule(GameRule<T> rule, T newValue) {
@ -400,7 +400,7 @@
Preconditions.checkArgument(rule != null, "GameRule cannot be null");
Preconditions.checkArgument(newValue != null, "GameRule value cannot be null");
@@ -2292,6 +_,12 @@
@@ -2315,6 +_,12 @@
@Override
public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) {

View File

@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -667,7 +_,7 @@
@@ -672,7 +_,7 @@
@Override
public void kickPlayer(String message) {
@ -9,7 +9,7 @@
this.getHandle().transferCookieConnection.kickPlayer(CraftChatMessage.fromStringOrEmpty(message, true), org.bukkit.event.player.PlayerKickEvent.Cause.PLUGIN); // Paper - kick event cause
}
@@ -685,7 +_,7 @@
@@ -690,7 +_,7 @@
@Override
public void kick(net.kyori.adventure.text.Component message, org.bukkit.event.player.PlayerKickEvent.Cause cause) {
@ -18,7 +18,7 @@
final ServerGamePacketListenerImpl connection = this.getHandle().connection;
if (connection != null) {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message, cause);
@@ -1405,6 +_,11 @@
@@ -1410,6 +_,11 @@
@Override
public boolean teleport(Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) {
@ -30,7 +30,7 @@
Set<io.papermc.paper.entity.TeleportFlag.Relative> relativeArguments;
Set<io.papermc.paper.entity.TeleportFlag> allFlags;
if (flags.length == 0) {
@@ -2069,7 +_,7 @@
@@ -2074,7 +_,7 @@
private void unregisterEntity(Entity other) {
// Paper end
ChunkMap tracker = ((ServerLevel) this.getHandle().level()).getChunkSource().chunkMap;
@ -39,7 +39,7 @@
if (entry != null) {
entry.removePlayer(this.getHandle());
}
@@ -2166,7 +_,7 @@
@@ -2171,7 +_,7 @@
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
}
@ -48,7 +48,7 @@
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
entry.updatePlayer(this.getHandle());
}
@@ -2315,9 +_,16 @@
@@ -2320,9 +_,16 @@
return this;
}
@ -66,7 +66,7 @@
}
public void setHandle(final ServerPlayer entity) {
@@ -3349,7 +_,7 @@
@@ -3354,7 +_,7 @@
{
if ( CraftPlayer.this.getHealth() <= 0 && CraftPlayer.this.isOnline() )
{

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.21.4-R0.1-SNAPSHOT
mcVersion=1.21.4
paperRef=336ea9dfeb23d9eae0711db974a3465dfe72746f
paperRef=1004374a83efcc730876d41b80288359c993ae0e
org.gradle.configuration-cache=true
org.gradle.caching=true