Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@1a332f7e move age locked related methods to Ageable and normalize setBaby/Adult setters
PaperMC/Paper@8b644429 fix chorus plant not growing properly
PaperMC/Paper@d45004bd deprecate group methods for some recipes
PaperMC/Paper@006f9d1b use the right var in ItemStack#useOn
PaperMC/Paper@f66c5901 remove redundant setBlock for cauldrons
PaperMC/Paper@c2631139 simplify cauldron events
PaperMC/Paper@33a9258c merge PlayerInteractAtEntityEvent and PlayerInteractEntityEvent
PaperMC/Paper@2d6e82ec Change world storage layout to be closer to vanilla & implement migration (#13736)
PaperMC/Paper@16e0088d Update Moonrise and DC
PaperMC/Paper@c7532535 Delete rej patches for applied files
PaperMC/Paper@e0497a6e Fix Moonrise compile
This commit is contained in:
granny
2026-04-07 16:06:21 -07:00
parent d8f2ab289c
commit 1d744fe85e
32 changed files with 128 additions and 128 deletions

View File

@@ -3,7 +3,7 @@ version=26.1-R0.1-SNAPSHOT
mcVersion = 26.1 mcVersion = 26.1
apiVersion = 26.1 apiVersion = 26.1
paperCommit = 8ad1ef1dc6aa692f639607a2829068bd6eecc813 paperCommit = e0497a6e3015e1e150c6d082ead4adea7fd03c31
org.gradle.configuration-cache = true org.gradle.configuration-cache = true
org.gradle.caching = true org.gradle.caching = true

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Purpur config files
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index bd8123503132b742d873c18486c3d19024fb9898..a17790d2da3008927b79814629e073b2091ce421 100644 index 413ad0c65fad59562413014c3db3f14af5da24a3..09a6042ba0ad63d7479ef48f0a8ddeeb3d9963bb 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -2425,6 +2425,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -2440,6 +2440,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
} }
// Paper end // Paper end

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -2761,4 +_,125 @@ @@ -2776,4 +_,125 @@
*/ */
void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value); void allowPausing(@NotNull org.bukkit.plugin.Plugin plugin, boolean value);
// Paper end - API to check if the server is sleeping // Paper end - API to check if the server is sleeping

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/entity/Villager.java --- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -406,4 +_,13 @@ @@ -402,4 +_,13 @@
* Demand is still updated even if all events are canceled. * Demand is still updated even if all events are canceled.
*/ */
public void restock(); public void restock();

View File

@@ -27,7 +27,7 @@
+ // Purpur end - Rebrand + // Purpur end - Rebrand
+ +
+ /*updatingMinecraft { // Purpur start - TODO - snapshot - we don't need this + /*updatingMinecraft { // Purpur start - TODO - snapshot - we don't need this
oldPaperCommit = "7e80cef5198561d0db53406127e5b8bc7af51577" // oldPaperCommit = "7e80cef5198561d0db53406127e5b8bc7af51577"
- } - }
+ }*/ // Purpur end - TODO - snapshot - we don't need this + }*/ // Purpur end - TODO - snapshot - we don't need this
} }
@@ -62,7 +62,7 @@
dependencies { dependencies {
- implementation(project(":paper-api")) - implementation(project(":paper-api"))
+ implementation(project(":purpur-api")) // Purpur + implementation(project(":purpur-api")) // Purpur
implementation("ca.spottedleaf:concurrentutil:0.0.8") implementation("ca.spottedleaf:concurrentutil:0.0.10")
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+ implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21 implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
@@ -135,6 +_,10 @@ @@ -135,6 +_,10 @@

View File

@@ -18,10 +18,10 @@ index 64a82b414afd093c010878c150592c681665b735..1db70e2397137158c3df9603ea90743e
public boolean isClientAuthoritative() { public boolean isClientAuthoritative() {
return false; return false;
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index e9b3c2a767dc6ecc5044e45c51e3231c68768316..50ac39c620aae79d9111089eb55d979d0ae3b5db 100644 index ebe24732d0d5e1d8e3fd7fa610202e5929ca82fd..62236ea8eaf52b5cc47e60d0064a3539bb6b8376 100644
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -1716,6 +1716,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1841,6 +1841,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
for (ServerLevel level : this.getAllLevels()) { for (ServerLevel level : this.getAllLevels()) {
level.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent level.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
level.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent level.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
@@ -30,7 +30,7 @@ index e9b3c2a767dc6ecc5044e45c51e3231c68768316..50ac39c620aae79d9111089eb55d979d
profiler.push(() -> level + " " + level.dimension().identifier()); profiler.push(() -> level + " " + level.dimension().identifier());
profiler.push("tick"); profiler.push("tick");
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 53617e830a1d16cb54b7385b0993b9121062a741..af825adf9d92ed36b430e48505944a2533f2692c 100644 index f3bd861bf442de944b403bb4f46ec916f21f0768..27112abea11a784d97c92633e8dc2b3d1040fce0 100644
--- a/net/minecraft/server/level/ServerLevel.java --- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java
@@ -235,6 +235,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet @@ -235,6 +235,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
@@ -42,10 +42,10 @@ index 53617e830a1d16cb54b7385b0993b9121062a741..af825adf9d92ed36b430e48505944a25
@Override @Override
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) { public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index f171cafaa24367c16057f33c2fedff659de47187..6b86ec9a15357ab48a36f6d42c09ee2715c95430 100644 index 722d4f8bad8aceaf07cf5070bab0e2813f8e719d..3a3d8f96406dfcc91b62345c427725be2ffe7912 100644
--- a/net/minecraft/server/level/ServerPlayer.java --- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java
@@ -759,6 +759,15 @@ public class ServerPlayer extends Player { @@ -789,6 +789,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.trackEnteredOrExitedLavaOnVehicle(); this.trackEnteredOrExitedLavaOnVehicle();
this.updatePlayerAttributes(); this.updatePlayerAttributes();
this.advancements.flushDirty(this, true); this.advancements.flushDirty(this, true);
@@ -75,10 +75,10 @@ index a81b553a209834883a99ae971fed18d3a6d2ff32..2162dc6a29d89193030d263c9f810420
if (itemType == Items.WATER_BUCKET && target instanceof net.minecraft.world.entity.animal.Bucketable && target instanceof LivingEntity && resendData) { if (itemType == Items.WATER_BUCKET && target instanceof net.minecraft.world.entity.animal.Bucketable && target instanceof LivingEntity && resendData) {
target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it target.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 8b15ca2c245acc3241ba1847f8a79629f8fcd9ef..036512b44ffe707eb9a0ac013672aaacf810a7c1 100644 index 785c20acd7feca4d0b52f2cf5dc83393d883a5ab..a812442edc8ef3f53b8e9a071a7e3e864314ae6d 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -3159,6 +3159,13 @@ public abstract class Entity @@ -3396,6 +3396,13 @@ public abstract class Entity
this.passengers = ImmutableList.copyOf(newPassengers); this.passengers = ImmutableList.copyOf(newPassengers);
} }
@@ -92,7 +92,7 @@ index 8b15ca2c245acc3241ba1847f8a79629f8fcd9ef..036512b44ffe707eb9a0ac013672aaac
} }
} }
@@ -3200,6 +3207,14 @@ public abstract class Entity @@ -3437,6 +3444,14 @@ public abstract class Entity
return false; return false;
} }
// CraftBukkit end // CraftBukkit end
@@ -107,7 +107,7 @@ index 8b15ca2c245acc3241ba1847f8a79629f8fcd9ef..036512b44ffe707eb9a0ac013672aaac
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) { if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
this.passengers = ImmutableList.of(); this.passengers = ImmutableList.of();
} else { } else {
@@ -5159,4 +5174,44 @@ public abstract class Entity @@ -5413,4 +5428,44 @@ public abstract class Entity
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition()); return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
} }
// Paper end - Expose entity id counter // Paper end - Expose entity id counter
@@ -3856,7 +3856,7 @@ index ffcf170d94c1747669b50747ac6f4432381b5553..6de264683da8b502a8b73208a53ff79c
this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.0); this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.0);
} else { } else {
diff --git a/net/minecraft/world/entity/monster/Shulker.java b/net/minecraft/world/entity/monster/Shulker.java diff --git a/net/minecraft/world/entity/monster/Shulker.java b/net/minecraft/world/entity/monster/Shulker.java
index 7d4abd0c806d41a631c9ff1b99df9e50fd55d933..eed74304cff4f121e8376236f53bf786e3be5759 100644 index e7d9e7c7c41ba6a6bf7bcd50a911a1fc0cbd6066..57f658dd219e88a190c9a98d3ae2a75bf9b561c9 100644
--- a/net/minecraft/world/entity/monster/Shulker.java --- a/net/minecraft/world/entity/monster/Shulker.java
+++ b/net/minecraft/world/entity/monster/Shulker.java +++ b/net/minecraft/world/entity/monster/Shulker.java
@@ -110,12 +110,31 @@ public class Shulker extends AbstractGolem implements Enemy { @@ -110,12 +110,31 @@ public class Shulker extends AbstractGolem implements Enemy {
@@ -4807,7 +4807,7 @@ index fe82f97689305de64caa52ef648308431f4aebb1..59265f8286a32a1fe7de1986df78b441
public boolean doHurtTarget(final ServerLevel level, final Entity target) { public boolean doHurtTarget(final ServerLevel level, final Entity target) {
if (super.doHurtTarget(level, target)) { if (super.doHurtTarget(level, target)) {
diff --git a/net/minecraft/world/entity/monster/spider/Spider.java b/net/minecraft/world/entity/monster/spider/Spider.java diff --git a/net/minecraft/world/entity/monster/spider/Spider.java b/net/minecraft/world/entity/monster/spider/Spider.java
index c1280f4a7d49f46068c2bb514a662991114709ea..ce03474ce732b46826eb3adb628addaddb1b2851 100644 index f80bceac44eaee98cf1a0fd3fd93810d803866cd..8d70cb4a79bb64df53e6ca9f7adb79ecfe33fe2f 100644
--- a/net/minecraft/world/entity/monster/spider/Spider.java --- a/net/minecraft/world/entity/monster/spider/Spider.java
+++ b/net/minecraft/world/entity/monster/spider/Spider.java +++ b/net/minecraft/world/entity/monster/spider/Spider.java
@@ -52,15 +52,34 @@ public class Spider extends Monster { @@ -52,15 +52,34 @@ public class Spider extends Monster {
@@ -5082,7 +5082,7 @@ index 2d294595b2d9e4daaf221482514329126d59f077..eb3ec4314603f61a041740d5b5e52165
protected void addBehaviourGoals() { protected void addBehaviourGoals() {
this.goalSelector.addGoal(1, new SpearUseGoal<>(this, 1.0, 1.0, 10.0F, 2.0F)); this.goalSelector.addGoal(1, new SpearUseGoal<>(this, 1.0, 1.0, 10.0F, 2.0F));
diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java diff --git a/net/minecraft/world/entity/npc/villager/Villager.java b/net/minecraft/world/entity/npc/villager/Villager.java
index 0f313abe1f7b2e9862d8231d71ce531c9f89a4cc..82813c07433f27b1186800e70df380a6b90644ec 100644 index 2dfcda843aae7dbefce7fc232889f2713a2dac05..af194ac19c110b9a69967631ca189494a166b55b 100644
--- a/net/minecraft/world/entity/npc/villager/Villager.java --- a/net/minecraft/world/entity/npc/villager/Villager.java
+++ b/net/minecraft/world/entity/npc/villager/Villager.java +++ b/net/minecraft/world/entity/npc/villager/Villager.java
@@ -252,6 +252,28 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re @@ -252,6 +252,28 @@ public class Villager extends AbstractVillager implements VillagerDataHolder, Re

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Minecart settings and WASD controls
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index e5d9c8e6999f3b7a40269fc5b06da4878a114046..b8ebcaca72ed6c92802fe289f8db1e0223d7470d 100644 index 3a3d8f96406dfcc91b62345c427725be2ffe7912..52c427634f143c596ea6f370bb6170c0dff2a1d2 100644
--- a/net/minecraft/server/level/ServerPlayer.java --- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1296,6 +1296,11 @@ public class ServerPlayer extends Player { @@ -1326,6 +1326,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
} else { } else {
// Purpur start - Add boat fall damage config // Purpur start - Add boat fall damage config
if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) { if (source.is(net.minecraft.tags.DamageTypeTags.IS_FALL)) {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Implement elytra settings
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 7119a83b5b9811ab3ef2622f91c966741818e48f..2e7e5c4c42bcdb6135a088ffe0a7a8f4558dc12c 100644 index 8af06875ea2fcb8e9bc08d370ff225c702e51031..9b7b285251aff741d8f2c19b3b558f81e77c0aaa 100644
--- a/net/minecraft/world/entity/LivingEntity.java --- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java
@@ -3945,7 +3945,16 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin @@ -3945,7 +3945,16 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
@@ -49,10 +49,10 @@ index c17607cb1fd5403f17a64b4218571e669b840a2e..6545145e1f83b333fd1d05ab714c9869
itemStack.shrink(1); // Moved up from below itemStack.shrink(1); // Moved up from below
} else { } else {
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
index 842bc5b3b7a31a8cc3b5651fb69092402d83606c..70a45aab9ac93973a3dde08140a4acf4813987f3 100644 index 87cdc33a42d94316990b934b2153e53117c88522..8c3d8ec4423d07ea3db3e0cbd5c79e1a468541ef 100644
--- a/net/minecraft/world/item/ItemStack.java --- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java
@@ -695,6 +695,14 @@ public final class ItemStack implements DataComponentHolder, ItemInstance { @@ -694,6 +694,14 @@ public final class ItemStack implements DataComponentHolder, ItemInstance {
org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent
} }
// CraftBukkit end // CraftBukkit end

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
Co-authored by: Encode42 <me@encode42.dev> Co-authored by: Encode42 <me@encode42.dev>
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 036512b44ffe707eb9a0ac013672aaacf810a7c1..461d02c149b1864fdec12667abaff9080d5efe5a 100644 index a812442edc8ef3f53b8e9a071a7e3e864314ae6d..e9fae59a2fffdd4b72e086d846beccf0a5265127 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -452,6 +452,21 @@ public abstract class Entity @@ -558,6 +558,21 @@ public abstract class Entity
} }
// Purpur end - Add canSaveToDisk to Entity // Purpur end - Add canSaveToDisk to Entity

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Setting to reintroduce end void rings
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 50ac39c620aae79d9111089eb55d979d0ae3b5db..e19b4e449abd213fce902feecec3c697114f573a 100644 index 62236ea8eaf52b5cc47e60d0064a3539bb6b8376..4bdb44ec660ae183735ccb43cf5fe4093d50b696 100644
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -1225,6 +1225,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1342,6 +1342,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
// Purpur end - config for startup commands // Purpur end - config for startup commands
@@ -25,7 +25,7 @@ index 50ac39c620aae79d9111089eb55d979d0ae3b5db..e19b4e449abd213fce902feecec3c697
while (this.running) { while (this.running) {
final long tickStart = System.nanoTime(); // Paper - improve tick loop final long tickStart = System.nanoTime(); // Paper - improve tick loop
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
index f27135d85936cae01823d8ae00134c4f8c6230d6..67a4038be124192eb70122e657d090bba7ec5bba 100644 index 95969baa7efa40e582e3eeb8c895b24f743badaf..d4c88cc35140cec61c2e9fd66e5126e80b083f3b 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java --- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java +++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -279,6 +279,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -279,6 +279,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java --- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java
@@ -319,6 +_,7 @@ @@ -320,6 +_,7 @@
public joptsimple.OptionSet options; public joptsimple.OptionSet options;
public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.ConsoleCommandSender console;
public static int currentTick; // Paper - improve tick loop public static int currentTick; // Paper - improve tick loop
@@ -8,7 +8,7 @@
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
// Paper - don't store the vanilla dispatcher // Paper - don't store the vanilla dispatcher
@@ -335,6 +_,8 @@ @@ -336,6 +_,8 @@
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
@@ -17,7 +17,7 @@
// Paper start - improve tick loop // Paper start - improve tick loop
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)); public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L));
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L)); public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
@@ -419,6 +_,7 @@ @@ -420,6 +_,7 @@
public double[] computeTPS() { public double[] computeTPS() {
final long interval = this.tickRateManager().nanosecondsPerTick(); final long interval = this.tickRateManager().nanosecondsPerTick();
return new double[] { return new double[] {
@@ -25,7 +25,7 @@
getTPS(this.tickTimes1m, interval), getTPS(this.tickTimes1m, interval),
getTPS(this.tickTimes5m, interval), getTPS(this.tickTimes5m, interval),
getTPS(this.tickTimes15m, interval) getTPS(this.tickTimes15m, interval)
@@ -941,6 +_,15 @@ @@ -1038,6 +_,15 @@
LOGGER.info("Stopping server"); LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -41,7 +41,7 @@
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.spark.disable(); // Paper - spark this.server.spark.disable(); // Paper - spark
@@ -1030,6 +_,8 @@ @@ -1132,6 +_,8 @@
this.safeShutdown(wait, false); this.safeShutdown(wait, false);
} }
public void safeShutdown(final boolean wait, final boolean isRestarting) { public void safeShutdown(final boolean wait, final boolean isRestarting) {
@@ -50,7 +50,7 @@
this.isRestarting = isRestarting; this.isRestarting = isRestarting;
this.hasLoggedStop = true; // Paper - Debugging this.hasLoggedStop = true; // Paper - Debugging
if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging if (this.isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
@@ -1196,11 +_,21 @@ @@ -1313,11 +_,21 @@
} }
// Paper end - Add onboarding message for initial server start // Paper end - Add onboarding message for initial server start
// Paper start - Improve outdated version checking // Paper start - Improve outdated version checking
@@ -73,7 +73,7 @@
while (this.running) { while (this.running) {
final long tickStart = System.nanoTime(); // Paper - improve tick loop final long tickStart = System.nanoTime(); // Paper - improve tick loop
long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval long thisTickNanos; // Paper - improve tick loop - diff on change, expect this to be tick interval
@@ -1214,9 +_,11 @@ @@ -1331,9 +_,11 @@
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart)); final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(thisTickNanos, tickStart));
final long catchup = (long)Math.max( final long catchup = (long)Math.max(
1, 1,
@@ -86,7 +86,7 @@
// adjust ticksBehind so that it is not greater-than catchup // adjust ticksBehind so that it is not greater-than catchup
if (ticksBehind - catchup > 0L) { if (ticksBehind - catchup > 0L) {
final long difference = ticksBehind - catchup; final long difference = ticksBehind - catchup;
@@ -1818,7 +_,7 @@ @@ -1943,7 +_,7 @@
} }
public String getServerModName() { public String getServerModName() {

View File

@@ -9,7 +9,7 @@
private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this); private final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
// CraftBukkit start // CraftBukkit start
@@ -380,8 +_,25 @@ @@ -642,8 +_,25 @@
// CraftBukkit end // CraftBukkit end
this.tickTime = tickTime; this.tickTime = tickTime;
this.server = server; this.server = server;
@@ -35,16 +35,16 @@
+ // Purpur end - Allow toggling special MobSpawners per world + // Purpur end - Allow toggling special MobSpawners per world
ChunkGenerator generator = levelStem.generator(); ChunkGenerator generator = levelStem.generator();
// CraftBukkit start // CraftBukkit start
this.serverLevelData.setWorld(this); if (loadedWorldData.pdc() != null) {
@@ -465,6 +_,7 @@ @@ -731,6 +_,7 @@
this.environmentAttributes = EnvironmentAttributeSystem.builder().addDefaultLayers(this).build(); this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
this.updateSkyBrightness(); // Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
+ this.preciseTime = this.serverLevelData.getGameTime(); // Purpur - Configurable daylight cycle + this.preciseTime = this.serverLevelData.getGameTime(); // Purpur - Configurable daylight cycle
} }
// Paper start // Paper start
@@ -521,7 +_,7 @@ @@ -787,7 +_,7 @@
} }
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE); int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
@@ -53,7 +53,7 @@
Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock(); Optional<Holder<WorldClock>> defaultClock = this.dimensionType().defaultClock();
org.bukkit.event.world.TimeSkipEvent event = null; // Paper - time skip event org.bukkit.event.world.TimeSkipEvent event = null; // Paper - time skip event
if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) { if (this.getGameRules().get(GameRules.ADVANCE_TIME) && defaultClock.isPresent()) {
@@ -729,9 +_,18 @@ @@ -1026,9 +_,18 @@
&& this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses && this.random.nextDouble() < difficulty.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
&& !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS); && !this.getBlockState(pos.below()).is(BlockTags.LIGHTNING_RODS);
if (isTrap) { if (isTrap) {
@@ -73,7 +73,7 @@
horse.setAge(0); horse.setAge(0);
horse.setPos(pos.getX(), pos.getY(), pos.getZ()); horse.setPos(pos.getX(), pos.getY(), pos.getZ());
this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit this.addFreshEntity(horse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
@@ -766,9 +_,35 @@ @@ -1063,9 +_,35 @@
if (state.is(Blocks.SNOW)) { if (state.is(Blocks.SNOW)) {
int currentLayers = state.getValue(SnowLayerBlock.LAYERS); int currentLayers = state.getValue(SnowLayerBlock.LAYERS);
if (currentLayers < Math.min(maxHeight, 8)) { if (currentLayers < Math.min(maxHeight, 8)) {
@@ -109,7 +109,7 @@
} }
} else { } else {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, topPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
@@ -789,7 +_,7 @@ @@ -1086,7 +_,7 @@
p -> p.is(PoiTypes.LIGHTNING_ROD), p -> p.is(PoiTypes.LIGHTNING_ROD),
lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1, lightningRodPos -> lightningRodPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, lightningRodPos.getX(), lightningRodPos.getZ()) - 1,
center, center,
@@ -118,7 +118,7 @@
PoiManager.Occupancy.ANY PoiManager.Occupancy.ANY
); );
return nearbyLightningRod.map(blockPos -> blockPos.above(1)); return nearbyLightningRod.map(blockPos -> blockPos.above(1));
@@ -837,8 +_,26 @@ @@ -1134,8 +_,26 @@
int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE); int percentage = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
Component message; Component message;
if (this.sleepStatus.areEnoughSleeping(percentage)) { if (this.sleepStatus.areEnoughSleeping(percentage)) {
@@ -145,7 +145,7 @@
message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage)); message = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(percentage));
} }
@@ -1004,6 +_,7 @@ @@ -1301,6 +_,7 @@
public void resetWeatherCycle() { public void resetWeatherCycle() {
WeatherData weatherData = this.getWeatherData(); WeatherData weatherData = this.getWeatherData();
// CraftBukkit start // CraftBukkit start
@@ -153,7 +153,7 @@
weatherData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents weatherData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value. // If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time.... // Not that everyone ever manages to get the whole server to sleep at the same time....
@@ -1011,6 +_,7 @@ @@ -1308,6 +_,7 @@
weatherData.setRainTime(0); weatherData.setRainTime(0);
} }
// CraftBukkit end // CraftBukkit end
@@ -161,7 +161,7 @@
weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents weatherData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start // CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value. // If we stop due to everyone sleeping we should reset the weather duration to some other random value.
@@ -1662,7 +_,7 @@ @@ -1970,7 +_,7 @@
Explosion.BlockInteraction blockInteraction = switch (interactionType) { Explosion.BlockInteraction blockInteraction = switch (interactionType) {
case NONE -> Explosion.BlockInteraction.KEEP; case NONE -> Explosion.BlockInteraction.KEEP;
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY); case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
@@ -170,7 +170,7 @@
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY) ? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
: Explosion.BlockInteraction.KEEP; : Explosion.BlockInteraction.KEEP;
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY); case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
@@ -2569,7 +_,7 @@ @@ -2901,7 +_,7 @@
// Spigot start // Spigot start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start - Fix merchant inventory not closing on entity removal // Paper start - Fix merchant inventory not closing on entity removal

View File

@@ -8,9 +8,9 @@
+ private boolean compassBar = false; // Purpur - Add compass command + private boolean compassBar = false; // Purpur - Add compass command
+ private boolean ramBar = false; // Purpur - Implement rambar commands + private boolean ramBar = false; // Purpur - Implement rambar commands
public ServerPlayer(final MinecraftServer server, final ServerLevel level, final GameProfile gameProfile, final ClientInformation clientInformation) { // Paper start - rewrite chunk system
super(level, gameProfile); private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
@@ -491,6 +_,9 @@ @@ -521,6 +_,9 @@
this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null); this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false); this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null); this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
@@ -20,7 +20,7 @@
// Paper start - Expand PlayerGameModeChangeEvent // Paper start - Expand PlayerGameModeChangeEvent
this.loadGameTypes(input); this.loadGameTypes(input);
} }
@@ -532,6 +_,9 @@ @@ -562,6 +_,9 @@
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight()); output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
} }
this.getBukkitEntity().setExtraData(output); // CraftBukkit this.getBukkitEntity().setExtraData(output); // CraftBukkit
@@ -30,7 +30,7 @@
} }
private void saveParentVehicle(final ValueOutput playerOutput) { private void saveParentVehicle(final ValueOutput playerOutput) {
@@ -1167,6 +_,7 @@ @@ -1197,6 +_,7 @@
// Paper - moved up to sendClientboundPlayerCombatKillPacket() // Paper - moved up to sendClientboundPlayerCombatKillPacket()
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
Team team = this.getTeam(); Team team = this.getTeam();
@@ -38,7 +38,7 @@
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) { if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false); this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) { } else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
@@ -1275,6 +_,13 @@ @@ -1305,6 +_,13 @@
if (this.isInvulnerableTo(level, source)) { if (this.isInvulnerableTo(level, source)) {
return false; return false;
} else { } else {
@@ -52,7 +52,7 @@
Entity entity = source.getEntity(); Entity entity = source.getEntity();
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false. if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
!(entity instanceof Player playerx && !this.canHarmPlayer(playerx)) !(entity instanceof Player playerx && !this.canHarmPlayer(playerx))
@@ -1534,6 +_,7 @@ @@ -1564,6 +_,7 @@
profiler.pop(); profiler.pop();
profiler.push("placing"); profiler.push("placing");
@@ -60,7 +60,7 @@
this.setServerLevel(newLevel); this.setServerLevel(newLevel);
this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit - use internal teleport without event this.connection.internalTeleport(PositionMoveRotation.of(transition), transition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition(); this.connection.resetPosition();
@@ -1650,7 +_,7 @@ @@ -1680,7 +_,7 @@
), ),
monster -> monster.isPreventingPlayerRest(this.level(), this) monster -> monster.isPreventingPlayerRest(this.level(), this)
); );
@@ -69,7 +69,7 @@
return Either.left(Player.BedSleepingProblem.NOT_SAFE); return Either.left(Player.BedSleepingProblem.NOT_SAFE);
} }
} }
@@ -1690,8 +_,19 @@ @@ -1720,8 +_,19 @@
CriteriaTriggers.SLEPT_IN_BED.trigger(this); CriteriaTriggers.SLEPT_IN_BED.trigger(this);
}); });
if (!this.level().canSleepThroughNights()) { if (!this.level().canSleepThroughNights()) {
@@ -90,7 +90,7 @@
this.level().updateSleepingPlayerList(); this.level().updateSleepingPlayerList();
return result; return result;
@@ -1785,6 +_,7 @@ @@ -1815,6 +_,7 @@
@Override @Override
public void openTextEdit(final SignBlockEntity sign, final boolean isFrontText) { public void openTextEdit(final SignBlockEntity sign, final boolean isFrontText) {
@@ -98,7 +98,7 @@
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos())); this.connection.send(new ClientboundBlockUpdatePacket(this.level(), sign.getBlockPos()));
this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), isFrontText)); this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), isFrontText));
} }
@@ -2128,6 +_,26 @@ @@ -2158,6 +_,26 @@
this.lastSentExp = -1; // CraftBukkit - Added to reset this.lastSentExp = -1; // CraftBukkit - Added to reset
} }
@@ -125,7 +125,7 @@
@Override @Override
public void completeUsingItem() { public void completeUsingItem() {
if (!this.useItem.isEmpty() && this.isUsingItem()) { if (!this.useItem.isEmpty() && this.isUsingItem()) {
@@ -2367,6 +_,20 @@ @@ -2397,6 +_,20 @@
); );
} }
@@ -146,7 +146,7 @@
@Override @Override
public void sendSystemMessage(final Component message) { public void sendSystemMessage(final Component message) {
this.sendSystemMessage(message, false); this.sendSystemMessage(message, false);
@@ -2518,7 +_,67 @@ @@ -2548,7 +_,67 @@
public void resetLastActionTime() { public void resetLastActionTime() {
this.lastActionTime = Util.getMillis(); this.lastActionTime = Util.getMillis();
@@ -215,7 +215,7 @@
public ServerStatsCounter getStats() { public ServerStatsCounter getStats() {
return this.stats; return this.stats;
@@ -3143,4 +_,65 @@ @@ -3173,4 +_,65 @@
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity(); return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
} }
// CraftBukkit end // CraftBukkit end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/WorldGenRegion.java --- a/net/minecraft/server/level/WorldGenRegion.java
+++ b/net/minecraft/server/level/WorldGenRegion.java +++ b/net/minecraft/server/level/WorldGenRegion.java
@@ -262,6 +_,7 @@ @@ -292,6 +_,7 @@
return true; return true;
} else { } else {
// Paper start - Buffer OOB setBlock calls // Paper start - Buffer OOB setBlock calls

View File

@@ -7,7 +7,7 @@
+ org.purpurmc.purpur.task.BossBarTask.addToAll(player); // Purpur - Implement TPSBar + org.purpurmc.purpur.task.BossBarTask.addToAll(player); // Purpur - Implement TPSBar
// CraftBukkit start - moved down // CraftBukkit start - moved down
LOGGER.info( LOGGER.info(
"{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // CraftBukkit - add world name "{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // Paper - add world identifier
@@ -436,6 +_,7 @@ @@ -436,6 +_,7 @@
} }
public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player, final net.kyori.adventure.text.Component leaveMessage) { public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player, final net.kyori.adventure.text.Component leaveMessage) {

View File

@@ -3,12 +3,12 @@
@@ -168,6 +_,7 @@ @@ -168,6 +_,7 @@
SlotProvider, SlotProvider,
DebugValueSource, DebugValueSource,
TypedInstance<EntityType<?>> { TypedInstance<EntityType<?>>, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes + public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes
// CraftBukkit start // CraftBukkit start
private static final int CURRENT_LEVEL = 2; private static final int CURRENT_LEVEL = 2;
static boolean isLevelAtLeast(ValueInput input, int level) { static boolean isLevelAtLeast(ValueInput input, int level) {
@@ -341,8 +_,9 @@ @@ -297,8 +_,9 @@
public double xOld; public double xOld;
public double yOld; public double yOld;
public double zOld; public double zOld;
@@ -19,7 +19,7 @@
public int tickCount; public int tickCount;
private int remainingFireTicks; private int remainingFireTicks;
private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA)); private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA));
@@ -374,8 +_,8 @@ @@ -330,8 +_,8 @@
public @Nullable PortalProcessor portalProcess; public @Nullable PortalProcessor portalProcess;
public int portalCooldown; public int portalCooldown;
private boolean invulnerable; private boolean invulnerable;
@@ -30,7 +30,7 @@
private boolean hasGlowingTag; private boolean hasGlowingTag;
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0}; private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
@@ -426,6 +_,7 @@ @@ -382,6 +_,7 @@
private final int despawnTime; // Paper - entity despawn time limit private final int despawnTime; // Paper - entity despawn time limit
public int totalEntityAge; // Paper - age-like counter for all entities public int totalEntityAge; // Paper - age-like counter for all entities
public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges
@@ -38,11 +38,11 @@
// Paper start - EAR 2 // Paper start - EAR 2
public final boolean defaultActivationState; public final boolean defaultActivationState;
public long activatedTick = Integer.MIN_VALUE; public long activatedTick = Integer.MIN_VALUE;
@@ -443,10 +_,22 @@ @@ -549,10 +_,22 @@
} }
// Paper end // Paper end - optimise entity tracker
+ // Purpur start - Add canSaveToDisk to Entity + // Purpur start - Add canSaveToDisk to Entity
+ public boolean canSaveToDisk() { + public boolean canSaveToDisk() {
+ return true; + return true;
+ } + }
@@ -61,7 +61,7 @@
this.position = Vec3.ZERO; this.position = Vec3.ZERO;
this.blockPosition = BlockPos.ZERO; this.blockPosition = BlockPos.ZERO;
this.chunkPosition = ChunkPos.ZERO; this.chunkPosition = ChunkPos.ZERO;
@@ -844,6 +_,7 @@ @@ -950,6 +_,7 @@
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v) && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) { && (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
// Paper end - Configurable nether ceiling damage // Paper end - Configurable nether ceiling damage
@@ -69,7 +69,7 @@
this.onBelowWorld(); this.onBelowWorld();
} }
} }
@@ -1857,7 +_,7 @@ @@ -2005,7 +_,7 @@
} }
public boolean fireImmune() { public boolean fireImmune() {
@@ -78,7 +78,7 @@
} }
public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) { public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) {
@@ -2443,7 +_,7 @@ @@ -2591,7 +_,7 @@
output.putBoolean("Bukkit.invisible", this.persistentInvisibility); output.putBoolean("Bukkit.invisible", this.persistentInvisibility);
} }
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir() // SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
@@ -87,7 +87,7 @@
output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply()); output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
} }
output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper
@@ -2530,6 +_,11 @@ @@ -2678,6 +_,11 @@
output.putBoolean("Paper.FreezeLock", true); output.putBoolean("Paper.FreezeLock", true);
} }
// Paper end // Paper end
@@ -99,7 +99,7 @@
} catch (Throwable var7) { } catch (Throwable var7) {
CrashReport report = CrashReport.forThrowable(var7, "Saving entity NBT"); CrashReport report = CrashReport.forThrowable(var7, "Saving entity NBT");
CrashReportCategory category = report.addCategory("Entity being saved"); CrashReportCategory category = report.addCategory("Entity being saved");
@@ -2652,6 +_,9 @@ @@ -2800,6 +_,9 @@
} }
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false); freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
// Paper end // Paper end
@@ -109,7 +109,7 @@
} catch (Throwable var7) { } catch (Throwable var7) {
CrashReport report = CrashReport.forThrowable(var7, "Loading entity NBT"); CrashReport report = CrashReport.forThrowable(var7, "Loading entity NBT");
CrashReportCategory category = report.addCategory("Entity being loaded"); CrashReportCategory category = report.addCategory("Entity being loaded");
@@ -2831,6 +_,7 @@ @@ -3068,6 +_,7 @@
if (this.isAlive() && this instanceof Leashable leashablex) { if (this.isAlive() && this instanceof Leashable leashablex) {
if (leashablex.getLeashHolder() == player) { if (leashablex.getLeashHolder() == player) {
if (!this.level().isClientSide()) { if (!this.level().isClientSide()) {
@@ -117,7 +117,7 @@
// Paper start - EntityUnleashEvent // Paper start - EntityUnleashEvent
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent( if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
leashablex, player, hand, !player.hasInfiniteMaterials(), true leashablex, player, hand, !player.hasInfiniteMaterials(), true
@@ -3261,15 +_,18 @@ @@ -3498,15 +_,18 @@
return Vec3.directionFromRotation(this.getRotationVector()); return Vec3.directionFromRotation(this.getRotationVector());
} }
@@ -137,7 +137,7 @@
} }
} }
} }
@@ -4000,7 +_,7 @@ @@ -4237,7 +_,7 @@
} }
public boolean canUsePortal(final boolean ignorePassenger) { public boolean canUsePortal(final boolean ignorePassenger) {
@@ -146,7 +146,7 @@
} }
public boolean canTeleport(final Level from, final Level to) { public boolean canTeleport(final Level from, final Level to) {
@@ -4548,6 +_,12 @@ @@ -4787,6 +_,12 @@
return Mth.lerp(partial, this.yRotO, this.yRot); return Mth.lerp(partial, this.yRotO, this.yRot);
} }
@@ -159,7 +159,7 @@
public boolean touchingUnloadedChunk() { public boolean touchingUnloadedChunk() {
AABB box = this.getBoundingBox().inflate(1.0); AABB box = this.getBoundingBox().inflate(1.0);
int x0 = Mth.floor(box.minX); int x0 = Mth.floor(box.minX);
@@ -4842,7 +_,7 @@ @@ -5090,7 +_,7 @@
} }
public float maxUpStep() { public float maxUpStep() {

View File

@@ -118,7 +118,7 @@
} }
private boolean hungry() { private boolean hungry() {
@@ -892,6 +_,7 @@ @@ -891,6 +_,7 @@
} }
public void spawnGolemIfNeeded(final ServerLevel level, final long timestamp, final int villagersNeededToAgree) { public void spawnGolemIfNeeded(final ServerLevel level, final long timestamp, final int villagersNeededToAgree) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/ItemStack.java --- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java
@@ -453,6 +_,7 @@ @@ -452,6 +_,7 @@
// revert back all captured blocks // revert back all captured blocks
for (org.bukkit.block.BlockState blockstate : blocks) { for (org.bukkit.block.BlockState blockstate : blocks) {
((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace(); ((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace();
@@ -8,15 +8,15 @@
} }
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
@@ -476,6 +_,7 @@ @@ -475,6 +_,7 @@
if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically
block.onPlace(serverLevel, newPos, oldBlock, true, context); block.onPlace(level, newPos, oldBlock, true, context);
} }
+ block.getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed + block.getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed
serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point level.notifyAndUpdatePhysics(newPos, null, oldBlock, block, level.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point
} }
@@ -592,6 +_,26 @@ @@ -591,6 +_,26 @@
return this.isDamageableItem() && this.getDamageValue() > 0; return this.isDamageableItem() && this.getDamageValue() > 0;
} }
@@ -43,7 +43,7 @@
public int getDamageValue() { public int getDamageValue() {
return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage()); return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage());
} }
@@ -1241,6 +_,12 @@ @@ -1240,6 +_,12 @@
public boolean isEnchanted() { public boolean isEnchanted() {
return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty(); return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
} }

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/EntityGetter.java --- a/net/minecraft/world/level/EntityGetter.java
+++ b/net/minecraft/world/level/EntityGetter.java +++ b/net/minecraft/world/level/EntityGetter.java
@@ -142,7 +_,7 @@ @@ -183,7 +_,7 @@
default boolean hasNearbyAlivePlayer(final double x, final double y, final double z, final double range) { default boolean hasNearbyAlivePlayer(final double x, final double y, final double z, final double range) {
for (Player player : this.players()) { for (Player player : this.players()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/Level.java --- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java
@@ -168,10 +_,54 @@ @@ -169,10 +_,54 @@
} }
// Paper end - add paper world config // Paper end - add paper world config
@@ -55,20 +55,20 @@
public CraftWorld getWorld() { public CraftWorld getWorld() {
return this.world; return this.world;
} }
@@ -214,6 +_,8 @@ @@ -848,6 +_,8 @@
) { // Paper end - getblock optimisations - cache world height/sections
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(bukkitName); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
+ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), environment); // Purpur - Purpur config files + this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), environment); // Purpur - Purpur config files
+ this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config + this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config
this.generator = generator; this.generator = generator;
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment); this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
@@ -1489,4 +_,14 @@ @@ -2188,4 +_,14 @@
return ret; return this.moonrise$getEntityLookup().getEntityCount(); // Paper - rewrite chunk system
} }
// Paper end - allow patching this logic // Paper end - allow patching this logic
+ +
+ // Purpur start - Add allow water in end world option + // Purpur start - Add allow water in end world option
+ public boolean isNether() { + public boolean isNether() {
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER; + return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/ServerExplosion.java --- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java
@@ -340,6 +_,23 @@ @@ -623,6 +_,23 @@
} }
public int explode() { public int explode() {
@@ -21,6 +21,6 @@
+ } + }
+ } + }
+ // Purpur end - Add PreExplodeEvents + // Purpur end - Add PreExplodeEvents
this.level.gameEvent(this.source, GameEvent.EXPLODE, this.center); // Paper start - collision optimisations
List<BlockPos> toBlow = this.calculateExplodedPositions(); this.blockCache = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>();
this.hurtEntities(); this.chunkPosCache = new long[CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH];

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -50,7 +_,7 @@ @@ -243,7 +_,7 @@
// Paper start // Paper start
private static void printOversizedLog(String msg, Path file, int x, int z) { private static void printOversizedLog(String msg, Path file, int x, int z) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/material/FlowingFluid.java --- a/net/minecraft/world/level/material/FlowingFluid.java
+++ b/net/minecraft/world/level/material/FlowingFluid.java +++ b/net/minecraft/world/level/material/FlowingFluid.java
@@ -193,7 +_,7 @@ @@ -235,7 +_,7 @@
} }
} }
@@ -9,7 +9,7 @@
BlockState belowState = level.getBlockState(mutablePos.setWithOffset(pos, Direction.DOWN)); BlockState belowState = level.getBlockState(mutablePos.setWithOffset(pos, Direction.DOWN));
FluidState belowFluid = belowState.getFluidState(); FluidState belowFluid = belowState.getFluidState();
if (belowState.isSolid() || this.isSourceBlockOfThisType(belowFluid)) { if (belowState.isSolid() || this.isSourceBlockOfThisType(belowFluid)) {
@@ -279,6 +_,12 @@ @@ -321,6 +_,12 @@
} }
protected abstract boolean canConvertToSource(ServerLevel level); protected abstract boolean canConvertToSource(ServerLevel level);

View File

@@ -36,10 +36,10 @@ index c5a866735d7d918ea58306ea2299a8b82be52f3f..d6ddbcff911ce4c97a20883af10d2b47
+ // Purpur end - Ridables + // Purpur end - Ridables
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 1651f3cc24120acffb073c2b736fbd410358f630..60bc33303bc2084ff13634d0997b6d811611433d 100644 index 8321fcec2344a67d59948b552cc1415b1166a920..370feb75737fd7a72445c9f51b6689959af63c35 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -646,6 +646,15 @@ public class CraftEventFactory { @@ -647,6 +647,15 @@ public class CraftEventFactory {
} }
craftServer.getPluginManager().callEvent(event); craftServer.getPluginManager().callEvent(event);
@@ -55,7 +55,7 @@ index 1651f3cc24120acffb073c2b736fbd410358f630..60bc33303bc2084ff13634d0997b6d81
return event; return event;
} }
@@ -1158,6 +1167,7 @@ public class CraftEventFactory { @@ -1159,6 +1168,7 @@ public class CraftEventFactory {
EntityDamageEvent event; EntityDamageEvent event;
if (damager != null) { if (damager != null) {
event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical); event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical);

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -419,6 +_,20 @@ @@ -415,6 +_,20 @@
this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager); this.paperPluginManager = new io.papermc.paper.plugin.manager.PaperPluginManagerImpl(this, this.commandMap, pluginManager);
this.pluginManager.paperPluginManager = this.paperPluginManager; this.pluginManager.paperPluginManager = this.paperPluginManager;
// Paper end // Paper end
@@ -21,7 +21,7 @@
CraftRegistry.setMinecraftRegistry(console.registryAccess()); CraftRegistry.setMinecraftRegistry(console.registryAccess());
@@ -994,6 +_,7 @@ @@ -990,6 +_,7 @@
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console); this.console.paperConfigurations.reloadConfigs(this.console);
@@ -29,7 +29,7 @@
for (ServerLevel world : this.console.getAllLevels()) { for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.isSpawningMonsters()); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) world.setSpawnSettings(world.isSpawningMonsters()); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -1009,6 +_,7 @@ @@ -1005,6 +_,7 @@
} }
} }
world.spigotConfig.init(); // Spigot world.spigotConfig.init(); // Spigot
@@ -37,7 +37,7 @@
} }
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1026,6 +_,7 @@ @@ -1022,6 +_,7 @@
org.spigotmc.SpigotConfig.registerCommands(); // Spigot org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
this.spark.registerCommandBeforePlugins(this); // Paper - spark this.spark.registerCommandBeforePlugins(this); // Paper - spark
@@ -45,7 +45,7 @@
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -1491,6 +_,60 @@ @@ -1479,6 +_,60 @@
return true; return true;
} }
@@ -106,7 +106,7 @@
@Override @Override
public List<Recipe> getRecipesFor(ItemStack result) { public List<Recipe> getRecipesFor(ItemStack result) {
Preconditions.checkArgument(result != null, "ItemStack cannot be null"); Preconditions.checkArgument(result != null, "ItemStack cannot be null");
@@ -2733,6 +_,18 @@ @@ -2725,6 +_,18 @@
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console); return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
} }
@@ -125,7 +125,7 @@
@Override @Override
public void restart() { public void restart() {
CraftServer.this.restart(); CraftServer.this.restart();
@@ -2968,4 +_,18 @@ @@ -2960,4 +_,18 @@
public void allowPausing(final Plugin plugin, final boolean value) { public void allowPausing(final Plugin plugin, final boolean value) {
this.console.addPluginAllowingSleep(plugin.getName(), value); this.console.addPluginAllowingSleep(plugin.getName(), value);
} }

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1925,6 +_,52 @@ @@ -1920,6 +_,52 @@
return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight()); return (this.getHandle().getDragonFight() == null) ? null : new CraftDragonBattle(this.getHandle().getDragonFight());
} }

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -291,6 +_,7 @@ @@ -293,6 +_,7 @@
@Override @Override
public void recalculatePermissions() { public void recalculatePermissions() {
this.perm.recalculatePermissions(); this.perm.recalculatePermissions();

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -585,10 +_,15 @@ @@ -586,10 +_,15 @@
@Override @Override
public void setPlayerListName(String name) { public void setPlayerListName(String name) {
@@ -17,7 +17,7 @@
if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined if (this.getHandle().connection == null) return; // Paper - Updates are possible before the player has fully joined
for (ServerPlayer player : this.server.getHandle().players) { for (ServerPlayer player : this.server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) { if (player.getBukkitEntity().canSee(this)) {
@@ -989,6 +_,80 @@ @@ -990,6 +_,80 @@
} }
} }
@@ -98,7 +98,7 @@
@Override @Override
public void sendBlockDamage(Location loc, float progress, org.bukkit.entity.Entity source) { public void sendBlockDamage(Location loc, float progress, org.bukkit.entity.Entity source) {
Preconditions.checkArgument(source != null, "source must not be null"); Preconditions.checkArgument(source != null, "source must not be null");
@@ -2501,6 +_,28 @@ @@ -2502,6 +_,28 @@
public float getWalkSpeed() { public float getWalkSpeed() {
return this.getHandle().getAbilities().walkingSpeed * 2f; return this.getHandle().getAbilities().walkingSpeed * 2f;
} }

View File

@@ -1,8 +1,8 @@
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -240,4 +_,11 @@ @@ -243,4 +_,11 @@
public void restock() { public void restock() {
getHandle().restock(); this.getHandle().restock();
} }
+ +
+ // Purpur start - Lobotomize stuck villagers + // Purpur start - Lobotomize stuck villagers

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -686,4 +_,285 @@ @@ -681,4 +_,285 @@
} }
// Paper end - data component API // Paper end - data component API

View File

@@ -1,9 +1,9 @@
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
@@ -43,6 +_,7 @@ @@ -36,6 +_,7 @@
stack = Ingredient.of(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map((mat) -> CraftItemType.bukkitToMinecraft(mat))); stack = Ingredient.of(((RecipeChoice.MaterialChoice) bukkit).getChoices().stream().map(CraftItemType::bukkitToMinecraft));
} else if (bukkit instanceof RecipeChoice.ExactChoice) { } else if (bukkit instanceof RecipeChoice.ExactChoice) {
stack = Ingredient.ofStacks(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map((mat) -> CraftItemStack.asNMSCopy(mat)).toList()); stack = Ingredient.ofStacks(((RecipeChoice.ExactChoice) bukkit).getChoices().stream().map(CraftItemStack::asNMSCopy).toList());
+ stack.predicate = ((RecipeChoice.ExactChoice) bukkit).getPredicate(); // Purpur - Add predicate to recipe's ExactChoice ingredient + stack.predicate = ((RecipeChoice.ExactChoice) bukkit).getPredicate(); // Purpur - Add predicate to recipe's ExactChoice ingredient
// Paper start - support "empty" choices - legacy method that spigot might incorrectly call // Paper start - support "empty" choices - legacy method that spigot might incorrectly call
// Their impl of Ingredient.of() will error, ingredients need at least one entry. // Their impl of Ingredient.of() will error, ingredients need at least one entry.

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -485,7 +_,7 @@ @@ -489,7 +_,7 @@
@Override @Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {