Update Paper

This commit is contained in:
Spottedleaf 2024-08-24 13:13:45 -07:00
parent 9203a7a887
commit bfa3106e76
6 changed files with 91 additions and 91 deletions

View File

@ -2,7 +2,7 @@ group=dev.folia
version=1.21.1-R0.1-SNAPSHOT
mcVersion=1.21.1
paperRef=4829fbf6bd51e2dc86e2f190971c081aac76a201
paperRef=fcedb49fea3df3bbb1dfe1281060bafa49d9cbe5
org.gradle.caching=true
org.gradle.parallel=true

View File

@ -11,10 +11,10 @@ the schedulers depending on the result of the ownership
check.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 4705c1d91e39fcc3c608b1f1a38a30d063ccf06e..886920b33b37bdefc301f898ad0003e40eff6443 100644
index 419c056faf0d49d9b0435feb01252e87e227b9a9..63eb35aebc4551355ea1ea5cd1305d93502f0dbc 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2905,6 +2905,14 @@ public final class Bukkit {
@@ -2916,6 +2916,14 @@ public final class Bukkit {
return server.isOwnedByCurrentRegion(entity);
}
// Paper end - Folia region threading API
@ -30,10 +30,10 @@ index 4705c1d91e39fcc3c608b1f1a38a30d063ccf06e..886920b33b37bdefc301f898ad0003e4
@NotNull
public static Server.Spigot spigot() {
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c043d239c449bf4bb13a24467f2f6c67b4d28d2d..d6f72cb1e2380bd1a18d695c7d26ae3834f6eb52 100644
index 5aa64ea39ebd92e5067c53cea49a8685c0b9eee4..8a7ba7d14f20b8169854daaf26e8f4da4563f166 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2543,4 +2543,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2554,4 +2554,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean isOwnedByCurrentRegion(@NotNull Entity entity);
// Paper end - Folia region threading API

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..f0a90d13a17160cd363d54d494add4f6433b4758 100644
index 3588770a9ea6ee0a9508b218758650f43d994715..a663cfec76f4deddb7cf8d2f134bedfa1a3cde66 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {

View File

@ -1120,10 +1120,10 @@ index bd68139ae635f2ad7ec8e7a21e0056a139c4c62e..48a43341b17247355a531164019d5cc9
}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 214ea75502d4abf9ebbc99a3811e4d2f8465227e..eae1bb367483eb6343a8644f6bac56215298bb43 100644
index 690086adcb1f87adc0b3ab664fde735ad3e1093a..155ea12a82c94e513fbb6090b209b14a8df5ef97 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -356,4 +356,18 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -357,4 +357,18 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean disableChorusPlantUpdates = false;
public boolean disableMushroomBlockUpdates = false;
}
@ -1143,10 +1143,10 @@ index 214ea75502d4abf9ebbc99a3811e4d2f8465227e..eae1bb367483eb6343a8644f6bac5621
+ // Folia end - threaded regions
}
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index 4bcf27f98765abf693e535cfc1756c27a10cb316..ce07b808067627b85e11ce9836ed91c175f11d93 100644
index 95e96fe8aa93efbbb2e0a7dd98377fdc4fe0e6dd..eddbaa14fff6328397fbe9dd353179f6659f5b09 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -475,6 +475,14 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -482,6 +482,14 @@ public class WorldConfiguration extends ConfigurationPart {
public Chunks chunks;
public class Chunks extends ConfigurationPart {
@ -12707,7 +12707,7 @@ index 8aff5129f85ab5729b3da2e465871be62d15bdf2..8044271ff01dfc6808f5a3b60be74f6d
Collections.shuffle( this.connections );
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765ee482079 100644
index b13057c0792067cc6b0abdf0d64a9be2cc9389a4..8a6e2ec591815eb41c4fd04c51acb3681972e928 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -300,7 +300,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -12872,7 +12872,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
} 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);
@@ -1192,11 +1227,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1196,11 +1231,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper end - Book size limits
// CraftBukkit start
@ -12886,7 +12886,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
// CraftBukkit end
int i = packet.slot();
@@ -1216,7 +1251,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1220,7 +1255,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.updateBookContents(list1, i);
};
@ -12907,7 +12907,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
}
}
@@ -1364,9 +1411,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1368,9 +1415,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int i = this.receivedMovePacketCount - this.knownMovePacketCount;
// CraftBukkit start - handle custom speeds and skipped ticks
@ -12920,7 +12920,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
if (i > Math.max(this.allowedPlayerTicks, 5)) {
ServerGamePacketListenerImpl.LOGGER.debug("{} is sending move packets too frequently ({} packets since last tick)", this.player.getName().getString(), i);
@@ -1558,7 +1606,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1562,7 +1610,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// If the event is cancelled we move the player back to their old location.
if (event.isCancelled()) {
@ -12929,7 +12929,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
return;
}
@@ -1566,7 +1614,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1570,7 +1618,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// 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()) {
@ -12938,7 +12938,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
return;
}
@@ -1810,9 +1858,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1814,9 +1862,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
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.
@ -12950,7 +12950,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
} else {
// Else we increment the drop count and check the amount.
this.dropCount++;
@@ -1840,7 +1888,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1844,7 +1892,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
// Paper start - Don't allow digging into unloaded chunks
@ -12959,7 +12959,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
this.player.connection.ackBlockChangesUpTo(packet.getSequence());
return;
}
@@ -1923,7 +1971,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1927,7 +1975,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper end - improve distance check
BlockPos blockposition = movingobjectpositionblock.getBlockPos();
@ -12968,7 +12968,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition));
double d0 = 1.0000001D;
@@ -2045,7 +2093,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2049,7 +2097,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Entity entity = packet.getEntity(worldserver);
if (entity != null) {
@ -12977,7 +12977,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
return;
}
}
@@ -2080,7 +2128,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2084,7 +2132,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), info.reason().getString());
@ -12986,7 +12986,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
super.onDisconnect(info, quitMessage); // Paper - Fix kick event leave message not being sent
}
@@ -2089,6 +2137,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2093,6 +2141,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.removePlayerFromWorld(null);
}
@ -12995,7 +12995,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
private void removePlayerFromWorld(@Nullable net.kyori.adventure.text.Component quitMessage) {
// Paper end - Fix kick event leave message not being sent
this.chatMessageChain.close();
@@ -2101,6 +2151,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2105,6 +2155,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
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
@ -13004,7 +13004,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) {
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end
@@ -2349,7 +2401,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2353,7 +2405,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime();
// CraftBukkit start
if (sync) {
@ -13013,7 +13013,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
} else {
runnable.run();
}
@@ -2407,7 +2459,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2411,7 +2463,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
String originalFormat = event.getFormat(), originalMessage = event.getMessage();
this.cserver.getPluginManager().callEvent(event);
@ -13022,7 +13022,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
// Evil plugins still listening to deprecated event
final PlayerChatEvent queueEvent = new PlayerChatEvent(player, event.getMessage(), event.getFormat(), event.getRecipients());
queueEvent.setCancelled(event.isCancelled());
@@ -2505,6 +2557,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2509,6 +2561,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (s.isEmpty()) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send an empty message");
} else if (this.getCraftPlayer().isConversing()) {
@ -13030,7 +13030,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
final String conversationInput = s;
this.server.processQueue.add(new Runnable() {
@Override
@@ -2736,8 +2789,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2740,8 +2793,25 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot End
public void switchToConfig() {
@ -13057,7 +13057,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
this.send(ClientboundStartConfigurationPacket.INSTANCE);
this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
}
@@ -2763,7 +2833,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2767,7 +2837,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime();
this.player.setShiftKeyDown(packet.isUsingSecondaryAction());
@ -13066,7 +13066,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
if (!worldserver.getWorldBorder().isWithinBounds(entity.blockPosition())) {
return;
}
@@ -2907,6 +2977,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2911,6 +2981,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
switch (packetplayinclientcommand_enumclientcommand) {
case PERFORM_RESPAWN:
if (this.player.wonGame) {
@ -13079,7 +13079,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
this.player.wonGame = false;
this.player = this.server.getPlayerList().respawn(this.player, true, Entity.RemovalReason.CHANGED_DIMENSION, RespawnReason.END_PORTAL); // CraftBukkit
CriteriaTriggers.CHANGED_DIMENSION.trigger(this.player, Level.END, Level.OVERWORLD);
@@ -2915,6 +2991,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2919,6 +2995,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
return;
}
@ -13097,7 +13097,7 @@ index 750f216400a473ed6895273c99ff89960bb56833..3bc578038655a8ac36618e8ad6083765
this.player = this.server.getPlayerList().respawn(this.player, false, Entity.RemovalReason.KILLED, RespawnReason.DEATH); // CraftBukkit
if (this.server.isHardcore()) {
this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper - Expand PlayerGameModeChangeEvent
@@ -3448,7 +3535,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3471,7 +3558,18 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.filterTextPacket(list).thenAcceptAsync((list1) -> {
this.updateSignText(packet, list1);
@ -14958,7 +14958,7 @@ index ccd9dff20a60f019e0c320acfb526b8bf3e5f806..6e2ce383bb4d52702dfcb8823ce0c5dc
while (!flag2 && blockposition.getY() > world.getMinBuildHeight()) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index bd7c6ce15698aed70376c109ba36f52d6794a2f8..741ba5f0834ab5f0b0ffdeb91a9ff8cfaf922792 100644
index f36a814bfd90af6457171512c131601b19905737..a4ddf384bc1f58ceac5f49721aca652276ad62eb 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -148,6 +148,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@ -15006,7 +15006,7 @@ index bd7c6ce15698aed70376c109ba36f52d6794a2f8..741ba5f0834ab5f0b0ffdeb91a9ff8cf
if (fireEvent) {
if (reason == EntityTargetEvent.TargetReason.UNKNOWN && this.getTarget() != null && entityliving == null) {
reason = this.getTarget().isAlive() ? EntityTargetEvent.TargetReason.FORGOT_TARGET : EntityTargetEvent.TargetReason.TARGET_DIED;
@@ -1784,16 +1804,22 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@@ -1791,16 +1811,22 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
this.goalSelector.removeAllGoals(predicate);
}
@ -19336,7 +19336,7 @@ index 7a69564572357a7acc043e35b9c113beeb738951..ea161048b68de3c8cdcba5f4cb66eb15
LevelChunkTicks<T> levelChunkTicks = this.allContainers.get(l);
if (levelChunkTicks == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f6de1c6e8fd9086b7bd725f75ee2606583591d6a..1f3d3b59236f45d0e7040968c9c1017eebf362c2 100644
index 1b36e94617d4e777c419660936460d5cf8a4b3e8..454cac11619fc1e8317db0b95a174f6747af6e60 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -312,7 +312,7 @@ public final class CraftServer implements Server {
@ -19428,7 +19428,7 @@ index f6de1c6e8fd9086b7bd725f75ee2606583591d6a..1f3d3b59236f45d0e7040968c9c1017e
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36912165cf 100644
index ffd284f0e25c6f20672f7225aafd37e6c87ccf03..6b535d154e33947a85a2fe5b40a241a9d172db84 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -192,7 +192,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@ -19440,7 +19440,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
}
@Override
@@ -262,7 +262,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -257,7 +257,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper start - per world spawn limits
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
@ -19449,7 +19449,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
}
}
// Paper end - per world spawn limits
@@ -326,6 +326,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -321,6 +321,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public Chunk getChunkAt(int x, int z) {
@ -19457,7 +19457,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
warnUnsafeChunk("getting a faraway chunk", x, z); // Paper
// Paper start - add ticket to hold chunk for a little while longer if plugin accesses it
net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkSource().getChunkAtIfLoadedImmediately(x, z);
@@ -349,7 +350,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -344,7 +345,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper start
private void addTicket(int x, int z) {
@ -19466,7 +19466,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
}
// Paper end
@@ -368,10 +369,10 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -363,10 +364,10 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean isChunkGenerated(int x, int z) {
// Paper start - Fix this method
@ -19479,7 +19479,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
}
ChunkAccess chunk = world.getChunkSource().getChunkAtImmediately(x, z);
if (chunk != null) {
@@ -428,7 +429,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -423,7 +424,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
private boolean unloadChunk0(int x, int z, boolean save) {
@ -19488,7 +19488,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
if (!this.isChunkLoaded(x, z)) {
return true;
}
@@ -443,7 +444,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -438,7 +439,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean regenerateChunk(int x, int z) {
@ -19497,7 +19497,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
throw new UnsupportedOperationException("Not supported in this Minecraft version! Unless you can fix it, this is not a bug :)");
/*
if (!unloadChunk0(x, z, false)) {
@@ -470,6 +471,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -465,6 +466,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean refreshChunk(int x, int z) {
@ -19505,7 +19505,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
if (playerChunk == null) return false;
@@ -530,7 +532,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -525,7 +527,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean loadChunk(int x, int z, boolean generate) {
@ -19514,7 +19514,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
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
@@ -571,7 +573,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -566,7 +568,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
DistanceManager chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
if (chunkDistanceManager.addRegionTicketAtDistance(TicketType.PLUGIN_TICKET, new ChunkPos(x, z), 2, plugin)) { // keep in-line with force loading, add at level 31
@ -19523,7 +19523,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
return true;
}
@@ -782,13 +784,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -777,13 +779,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
@ -19544,7 +19544,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
BlockPos position = ((CraftBlockState) blockstate).getPosition();
net.minecraft.world.level.block.state.BlockState oldBlock = this.world.getBlockState(position);
int flag = ((CraftBlockState) blockstate).getFlag();
@@ -796,10 +800,10 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -791,10 +795,10 @@ public class CraftWorld extends CraftRegionAccessor implements World {
net.minecraft.world.level.block.state.BlockState newBlock = this.world.getBlockState(position);
this.world.notifyAndUpdatePhysics(position, null, oldBlock, newBlock, newBlock, flag, 512);
}
@ -19557,7 +19557,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
return false;
}
}
@@ -833,6 +837,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -828,6 +832,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setTime(long time) {
@ -19565,7 +19565,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
long margin = (time - this.getFullTime()) % 24000;
if (margin < 0) margin += 24000;
this.setFullTime(this.getFullTime() + margin);
@@ -845,6 +850,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -840,6 +845,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setFullTime(long time) {
@ -19573,7 +19573,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
// Notify anyone who's listening
TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - this.world.getDayTime());
this.server.getPluginManager().callEvent(event);
@@ -872,7 +878,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -867,7 +873,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public long getGameTime() {
@ -19582,7 +19582,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
}
@Override
@@ -901,11 +907,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -896,11 +902,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
explosionType = net.minecraft.world.level.Level.ExplosionInteraction.MOB; // Respect mobGriefing gamerule
}
@ -19596,7 +19596,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
return !world.explode(source != null ? ((org.bukkit.craftbukkit.entity.CraftEntity) source).getHandle() : null, loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks ? net.minecraft.world.level.Level.ExplosionInteraction.MOB : net.minecraft.world.level.Level.ExplosionInteraction.NONE).wasCanceled;
}
// Paper end
@@ -982,6 +990,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -977,6 +985,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) {
@ -19604,7 +19604,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
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);
@@ -1012,6 +1021,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1007,6 +1016,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@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);
@ -19612,7 +19612,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
if (this.world.hasChunkAt(pos)) {
net.minecraft.world.level.chunk.LevelChunk chunk = this.world.getChunkAt(pos);
@@ -1322,6 +1332,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1317,6 +1327,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setStorm(boolean hasStorm) {
@ -19620,7 +19620,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
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)
@@ -1334,6 +1345,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1329,6 +1340,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setWeatherDuration(int duration) {
@ -19628,7 +19628,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.world.serverLevelData.setRainTime(duration);
}
@@ -1344,6 +1356,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1339,6 +1351,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setThundering(boolean thundering) {
@ -19636,7 +19636,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
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)
@@ -1356,6 +1369,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1351,6 +1364,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setThunderDuration(int duration) {
@ -19644,7 +19644,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.world.serverLevelData.setThunderTime(duration);
}
@@ -1366,6 +1380,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1361,6 +1375,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setClearWeatherDuration(int duration) {
@ -19652,7 +19652,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.world.serverLevelData.setClearWeatherTime(duration);
}
@@ -1560,6 +1575,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1555,6 +1570,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setKeepSpawnInMemory(boolean keepLoaded) {
@ -19660,7 +19660,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
if (keepLoaded) {
this.setGameRule(GameRule.SPAWN_CHUNK_RADIUS, this.getGameRuleDefault(GameRule.SPAWN_CHUNK_RADIUS));
} else {
@@ -1628,6 +1644,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1623,6 +1639,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setHardcore(boolean hardcore) {
@ -19668,7 +19668,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.world.serverLevelData.settings.hardcore = hardcore;
}
@@ -1640,6 +1657,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1635,6 +1652,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) {
@ -19676,7 +19676,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setTicksPerSpawns(SpawnCategory.ANIMAL, ticksPerAnimalSpawns);
}
@@ -1652,6 +1670,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1647,6 +1665,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) {
@ -19684,7 +19684,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setTicksPerSpawns(SpawnCategory.MONSTER, ticksPerMonsterSpawns);
}
@@ -1664,6 +1683,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1659,6 +1678,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setTicksPerWaterSpawns(int ticksPerWaterSpawns) {
@ -19692,7 +19692,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setTicksPerSpawns(SpawnCategory.WATER_ANIMAL, ticksPerWaterSpawns);
}
@@ -1676,6 +1696,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1671,6 +1691,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) {
@ -19700,7 +19700,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setTicksPerSpawns(SpawnCategory.WATER_AMBIENT, ticksPerWaterAmbientSpawns);
}
@@ -1688,6 +1709,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1683,6 +1704,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) {
@ -19708,7 +19708,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setTicksPerSpawns(SpawnCategory.WATER_UNDERGROUND_CREATURE, ticksPerWaterUndergroundCreatureSpawns);
}
@@ -1700,11 +1722,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1695,11 +1717,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns) {
@ -19722,7 +19722,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
@@ -1721,21 +1745,25 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1716,21 +1740,25 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
@ -19748,7 +19748,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.server.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin);
}
@@ -1748,6 +1776,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1743,6 +1771,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setMonsterSpawnLimit(int limit) {
@ -19756,7 +19756,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setSpawnLimit(SpawnCategory.MONSTER, limit);
}
@@ -1760,6 +1789,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1755,6 +1784,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setAnimalSpawnLimit(int limit) {
@ -19764,7 +19764,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setSpawnLimit(SpawnCategory.ANIMAL, limit);
}
@@ -1772,6 +1802,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1767,6 +1797,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setWaterAnimalSpawnLimit(int limit) {
@ -19772,7 +19772,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setSpawnLimit(SpawnCategory.WATER_ANIMAL, limit);
}
@@ -1784,6 +1815,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1779,6 +1810,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setWaterAmbientSpawnLimit(int limit) {
@ -19780,7 +19780,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setSpawnLimit(SpawnCategory.WATER_AMBIENT, limit);
}
@@ -1796,6 +1828,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1791,6 +1823,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setWaterUndergroundCreatureSpawnLimit(int limit) {
@ -19788,7 +19788,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setSpawnLimit(SpawnCategory.WATER_UNDERGROUND_CREATURE, limit);
}
@@ -1808,6 +1841,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1803,6 +1836,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
@Deprecated
public void setAmbientSpawnLimit(int limit) {
@ -19796,7 +19796,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
this.setSpawnLimit(SpawnCategory.AMBIENT, limit);
}
@@ -1830,6 +1864,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1825,6 +1859,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setSpawnLimit(SpawnCategory spawnCategory, int limit) {
@ -19804,7 +19804,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
@@ -1912,7 +1947,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1907,7 +1942,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
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);
@ -19813,7 +19813,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
if (entityTracker != null) {
entityTracker.broadcastAndSend(packet);
}
@@ -1924,7 +1959,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1919,7 +1954,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
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);
@ -19822,7 +19822,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
if (entityTracker != null) {
entityTracker.broadcastAndSend(packet);
}
@@ -2013,6 +2048,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2008,6 +2043,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean setGameRuleValue(String rule, String value) {
@ -19830,7 +19830,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
// No null values allowed
if (rule == null || value == null) return false;
@@ -2055,6 +2091,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2050,6 +2086,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public <T> boolean setGameRule(GameRule<T> rule, T newValue) {
@ -19838,7 +19838,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
Preconditions.checkArgument(rule != null, "GameRule cannot be null");
Preconditions.checkArgument(newValue != null, "GameRule value cannot be null");
@@ -2281,6 +2318,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2276,6 +2313,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void sendGameEvent(Entity sourceEntity, org.bukkit.GameEvent gameEvent, Vector position) {
@ -19851,7 +19851,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
getHandle().gameEvent(sourceEntity != null ? ((CraftEntity) sourceEntity).getHandle(): null, net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.getHolder(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(gameEvent.getKey())).orElseThrow(), org.bukkit.craftbukkit.util.CraftVector.toBlockPos(position));
}
// Paper end
@@ -2409,7 +2452,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2404,7 +2447,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper start
public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) {
warnUnsafeChunk("getting a faraway chunk async", x, z); // Paper
@ -19860,7 +19860,7 @@ index 362ca138a5cd5ad19f1300015c2571794adc3649..a33a874a845967b78877b7bb4d072c36
net.minecraft.world.level.chunk.LevelChunk immediate = this.world.getChunkSource().getChunkAtIfLoadedImmediately(x, z);
if (immediate != null) {
return java.util.concurrent.CompletableFuture.completedFuture(new CraftChunk(immediate));
@@ -2426,7 +2469,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2421,7 +2464,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
java.util.concurrent.CompletableFuture<Chunk> ret = new java.util.concurrent.CompletableFuture<>();
ca.spottedleaf.moonrise.common.util.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
@ -20290,10 +20290,10 @@ index a0d5082590ee03060f0dbb4770d196efc316c328..0e3eed03f307a414effdd30414b8d017
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..fced5379b855d100c46fa303cfab3a19f862f525 100644
index 77ef27f9254235180a8596c6c8c4af750dc759d1..f2a3cb4be886bd81d795b57b97536306534c5973 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -951,7 +951,7 @@ public class CraftEventFactory {
@@ -953,7 +953,7 @@ public class CraftEventFactory {
return CraftEventFactory.handleBlockSpreadEvent(world, source, target, block, 2);
}
@ -20302,7 +20302,7 @@ index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..fced5379b855d100c46fa303cfab3a19
public static boolean handleBlockSpreadEvent(LevelAccessor world, BlockPos source, BlockPos target, net.minecraft.world.level.block.state.BlockState block, int flag) {
// Suppress during worldgen
@@ -963,7 +963,7 @@ public class CraftEventFactory {
@@ -965,7 +965,7 @@ public class CraftEventFactory {
CraftBlockState state = CraftBlockStates.getBlockState(world, target, flag);
state.setData(block);
@ -20311,7 +20311,7 @@ index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..fced5379b855d100c46fa303cfab3a19
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@@ -2209,7 +2209,7 @@ public class CraftEventFactory {
@@ -2225,7 +2225,7 @@ public class CraftEventFactory {
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemStack.copyWithCount(1));
org.bukkit.event.block.BlockDispenseEvent event = new org.bukkit.event.block.BlockDispenseEvent(bukkitBlock, craftItem.clone(), CraftVector.toBukkit(to));

View File

@ -455,10 +455,10 @@ index dd91de8f24c27b9318c2a898a49991d74c100bff..b951571eda47da97ee73ba7d9b71b4f6
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
index e33b1b6fd50a4eea57500cc00dba20d6edcab75d..74d1f88ae81b01e7c00ec43fcbe5b9b159d89956 100644
index 01a9660de65688b7c1a4f9dafcb650774ce1853b..869524adfe5cb14b3cbd71a76f340bc9343b9e24 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -102,8 +102,16 @@ public class CraftBoat extends CraftVehicle implements Boat {
@@ -102,8 +102,16 @@ public class CraftBoat extends CraftVehicle implements Boat, io.papermc.paper.en
return CraftBoat.boatStatusFromNms(this.getHandle().status);
}
@ -1677,7 +1677,7 @@ index e9f471e60af0725ec34e2985d63ae9ea9f88590a..cd824fc65ac2b1fe55710da4700f7c31
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index d2bb0831394c03b620b2cbd8306cb82b621f34f7..3015910083bae42f200b977f74ed53db46a93342 100644
index beb6ad312028adb14053e3f019a4fcf6c9149373..90939123cd749321d3846f0970aa75417c1a0f52 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -477,6 +477,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@ -1914,10 +1914,10 @@ index 79b608e89d4d1f76a58868c585bb87c82e2689b1..7884de5348f325ee12db41a521a042be
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
index deb66c04abefb4a88521483db1612e494bd27164..4f5083171f67decff5021e0bb638fbb16a147adc 100644
index 5f9f7e325e3e0276f7a475c4a4725cc0e1b54afd..b6721b3388a5c921e9e621798329f17434683a87 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java
@@ -54,8 +54,16 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
@@ -54,8 +54,16 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob, io.pape
return (sound != null) ? CraftSound.minecraftToBukkit(sound) : null;
}
@ -1934,7 +1934,7 @@ index deb66c04abefb4a88521483db1612e494bd27164..4f5083171f67decff5021e0bb638fbb1
return (net.minecraft.world.entity.Mob) this.entity;
}
@@ -63,7 +71,7 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob {
@@ -63,7 +71,7 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob, io.pape
@Override
public void setHandle(net.minecraft.world.entity.Entity entity) {
super.setHandle(entity);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Throw UnsupportedOperationException() for broken APIs
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1f3d3b59236f45d0e7040968c9c1017eebf362c2..6bce7ef8067c4ca6a488673ecbfdf3625e596565 100644
index 454cac11619fc1e8317db0b95a174f6747af6e60..39e4493ef5c7d4bfd903da18b76e14235a535ab5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1310,6 +1310,7 @@ public final class CraftServer implements Server {