mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-22 16:39:22 +00:00
Updated Upstream (Gale/Purpur)
This commit is contained in:
@@ -2,7 +2,7 @@ group = cn.dreeam.leaf
|
||||
mcVersion = 1.21
|
||||
version = 1.21-R0.1-SNAPSHOT
|
||||
|
||||
galeCommit = ada349d08f048fd80bd55f8bfcb881cd16794832
|
||||
galeCommit = b0fa55650a17377380cc2d7ccada3c6f6e9b6ac1
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: 39617d5c9df0ed67f4b9c7cbcbc4f23a0dbae37e
|
||||
Commit: 1ab7990b142ad633a758449d88671ff2a62e71e3
|
||||
|
||||
Patches below are removed in this patch:
|
||||
Pufferfish-API-Changes.patch
|
||||
@@ -1240,7 +1240,7 @@ index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 8bbd98ea729755e7666403b96f277fd419560951..cb37a8af9e54349fc8a3eb70bbe2fddaaa3767d6 100644
|
||||
index b3abe3bde05d4a360e31e490bff8a859dc2bd4a6..9b8b958ce181b60eb5db89d4720380153152a2ac 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -19,6 +19,17 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
@@ -2414,6 +2414,97 @@ index 0000000000000000000000000000000000000000..519809eab5d926dc7b0a7bad5d446d0d
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/PlayerSetTrialSpawnerTypeWithEggEvent.java b/src/main/java/org/purpurmc/purpur/event/PlayerSetTrialSpawnerTypeWithEggEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..c8d206abf8f6a08f746322e63d198a368311f28d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/event/PlayerSetTrialSpawnerTypeWithEggEvent.java
|
||||
@@ -0,0 +1,85 @@
|
||||
+package org.purpurmc.purpur.event;
|
||||
+
|
||||
+import org.bukkit.block.Block;
|
||||
+import org.bukkit.block.TrialSpawner;
|
||||
+import org.bukkit.entity.EntityType;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+public class PlayerSetTrialSpawnerTypeWithEggEvent extends PlayerEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final Block block;
|
||||
+ private final TrialSpawner spawner;
|
||||
+ private EntityType type;
|
||||
+ private boolean cancel;
|
||||
+
|
||||
+ public PlayerSetTrialSpawnerTypeWithEggEvent(@NotNull Player player, @NotNull Block block, @NotNull TrialSpawner spawner, @NotNull EntityType type) {
|
||||
+ super(player);
|
||||
+ this.block = block;
|
||||
+ this.spawner = spawner;
|
||||
+ this.type = type;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the spawner Block in the world
|
||||
+ *
|
||||
+ * @return Spawner Block
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Block getBlock() {
|
||||
+ return block;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the spawner state
|
||||
+ *
|
||||
+ * @return Spawner state
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public TrialSpawner getSpawner() {
|
||||
+ return spawner;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the EntityType being set on the spawner
|
||||
+ *
|
||||
+ * @return EntityType being set
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public EntityType getEntityType() {
|
||||
+ return type;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the EntityType being set on the spawner
|
||||
+ *
|
||||
+ * @param type EntityType to set
|
||||
+ */
|
||||
+ public void setEntityType(@NotNull EntityType type) {
|
||||
+ this.type = type;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancel = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java b/src/main/java/org/purpurmc/purpur/event/PreBlockExplodeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..8ea97ddceedb7c719e8a50a0dd8f3f0919ca1647
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur generated-api Changes
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: 39617d5c9df0ed67f4b9c7cbcbc4f23a0dbae37e
|
||||
Commit: 1ab7990b142ad633a758449d88671ff2a62e71e3
|
||||
|
||||
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 3add91218dd3f07052aa932f0503d1f10ac3799b..3e41a4141095bce989c75e989293deb3f47e8e6d 100644
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 13d1908b378e5311d8bb7f9317b4b1c2d82ea042..4c35e52cd78963238a457ba3efece5c8a1bcc260 100644
|
||||
index eae5b87677ac577ceafc6371647e92178627116f..955413bc5717b73054777d36c8b06da8817f8271 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -13,7 +13,7 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
@@ -150,10 +150,10 @@ index b24265573fdef5d9a964bcd76146f34542c420cf..aa25fd3ee043003f359b2c67a6d0f670
|
||||
|
||||
public SystemReport getSystemReport() {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 25d1b4512f81802c658a5e0a03c8212ad69ac04e..44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e 100644
|
||||
index 603c50248cf8ea5b1d55cdd1c84c7d49b1c5f8ff..dd5e21e737ebcec7a69ef66908c50a959786b17e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -956,7 +956,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1018,7 +1018,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
|
||||
@@ -32,10 +32,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 02d870e451b7eb1cff89a97fee7530b667affd50..7318904311c4b15f4588a61009a2652c140cbf07 100644
|
||||
index 0d1c24dc6da1541e934aeb6294f748d0ed358318..9258b0b48ecf76d4227c6851ea15986c6ee4ca1e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -700,6 +700,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -717,6 +717,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
this.timings.entityTick.startTiming(); // Spigot
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
@@ -44,10 +44,10 @@ index 02d870e451b7eb1cff89a97fee7530b667affd50..7318904311c4b15f4588a61009a2652c
|
||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
entity.discard();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4d7c4907e0b73f63db3d7625b33eaa3439a2b801..e65023682f1527f86c311229646b5b2a7c6d62bb 100644
|
||||
index 0170337bc9b2837d542d0235039c15d5e8dffba2..41949355c18e45424ee94107ad09922a13a05a61 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -430,6 +430,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -431,6 +431,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean fixedPose = false; // Paper - Expand Pose API
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPL v3
|
||||
Original project: https://github.com/pufferfish-gg/Pufferfish
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 1fc95388c3391082f19455c5cff65e98c856b797..55f544a7a7253cd6619ef43d26f17b38ccb375ea 100644
|
||||
index 41949355c18e45424ee94107ad09922a13a05a61..c820ea4aa07c00bcd3a66616e774662950b65451 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -828,6 +828,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -829,6 +829,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
|
||||
@@ -8,7 +8,7 @@ TODO - Dreeam: Check Fix-pufferfish-issues.patch
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: 39617d5c9df0ed67f4b9c7cbcbc4f23a0dbae37e
|
||||
Commit: 1ab7990b142ad633a758449d88671ff2a62e71e3
|
||||
|
||||
Patches below are removed in this patch:
|
||||
Brand changes in Rebrand.patch
|
||||
@@ -699,7 +699,7 @@ index 8841f0376a7676922362b6d06c2af752d1319737..207f8f864f0cf5874f8cad9bd15fa5e9
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015c200b886 100644
|
||||
index dd5e21e737ebcec7a69ef66908c50a959786b17e..200e76648fb98a5d289682c75a2ecb6b614ec4af 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -719,7 +719,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
@@ -971,6 +974,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1033,6 +1036,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
MinecraftTimings.stopServer(); // Paper
|
||||
@@ -734,7 +734,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
@@ -1066,6 +1077,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1128,6 +1139,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.safeShutdown(waitForShutdown, false);
|
||||
}
|
||||
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
||||
@@ -743,7 +743,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1185,6 +1198,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1247,6 +1260,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
|
||||
@@ -760,7 +760,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
while (this.running) {
|
||||
long i;
|
||||
|
||||
@@ -1221,6 +1244,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1283,6 +1306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.recentTps[0] = tps1.getAverage();
|
||||
this.recentTps[1] = tps5.getAverage();
|
||||
this.recentTps[2] = tps15.getAverage();
|
||||
@@ -768,7 +768,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
tickSection = currentTime;
|
||||
}
|
||||
// Paper end - further improve server tick loop
|
||||
@@ -1245,6 +1269,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1307,6 +1331,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - rewrite chunk system
|
||||
this.mayHaveDelayedTasks = true;
|
||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
|
||||
@@ -781,7 +781,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
this.startMeasuringTaskExecutionTime();
|
||||
this.waitUntilNextTick();
|
||||
this.finishMeasuringTaskExecutionTime();
|
||||
@@ -1674,7 +1704,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1737,7 +1767,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
long worldTime = level.getGameTime();
|
||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||
for (Player entityhuman : level.players()) {
|
||||
@@ -790,7 +790,7 @@ index 44a9ed9f06818f8bcf4caf673c4e6b02f6ed924e..b5fd90764d954acd0381cf42c38d5015
|
||||
continue;
|
||||
}
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
@@ -1694,6 +1724,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1757,6 +1787,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
||||
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
||||
@@ -1098,7 +1098,7 @@ index 8090e9b6bd8a3e93532322b5a61058545c7c3a6d..c8082ef01f956750565e82b93f3ce383
|
||||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
||||
this.trackedPlayers = trackedPlayers;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab5672c1af7dd 100644
|
||||
index 9258b0b48ecf76d4227c6851ea15986c6ee4ca1e..cf05c216f05a81b5a666aba0d944586d4a3cff05 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -220,6 +220,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1118,7 +1118,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
|
||||
public LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
|
||||
@@ -519,7 +522,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -536,7 +539,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.dragonParts = new Int2ObjectOpenHashMap();
|
||||
this.tickTime = flag1;
|
||||
this.server = minecraftserver;
|
||||
@@ -1144,7 +1144,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
this.serverLevelData = iworlddataserver;
|
||||
ChunkGenerator chunkgenerator = worlddimension.generator();
|
||||
// CraftBukkit start
|
||||
@@ -590,6 +610,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -607,6 +627,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.chunkTaskScheduler = new ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler((ServerLevel)(Object)this, ca.spottedleaf.moonrise.common.util.MoonriseCommon.WORKER_POOL);
|
||||
// Paper end - rewrite chunk system
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
@@ -1152,7 +1152,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -636,7 +657,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -653,7 +674,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
long j;
|
||||
|
||||
@@ -1161,7 +1161,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
// CraftBukkit start
|
||||
j = this.levelData.getDayTime() + 24000L;
|
||||
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
|
||||
@@ -758,6 +779,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -775,6 +796,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.serverLevelData.setGameTime(i);
|
||||
this.serverLevelData.getScheduledEvents().tick(this.server, i);
|
||||
if (this.levelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
||||
@@ -1175,7 +1175,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||
}
|
||||
|
||||
@@ -766,8 +794,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -783,8 +811,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
public void setDayTime(long timeOfDay) {
|
||||
this.serverLevelData.setDayTime(timeOfDay);
|
||||
@@ -1198,7 +1198,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) {
|
||||
Iterator iterator = this.customSpawners.iterator();
|
||||
|
||||
@@ -804,10 +846,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -828,10 +870,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper - Configurable spawn chances for skeleton horses
|
||||
|
||||
if (flag1) {
|
||||
@@ -1219,7 +1219,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
entityhorseskeleton.setAge(0);
|
||||
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -912,7 +962,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -951,7 +1001,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
return holder.is(PoiTypes.LIGHTNING_ROD);
|
||||
}, (blockposition1) -> {
|
||||
return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1;
|
||||
@@ -1228,7 +1228,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
|
||||
return optional.map((blockposition1) -> {
|
||||
return blockposition1.above(1);
|
||||
@@ -961,11 +1011,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1000,11 +1050,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
if (this.canSleepThroughNights()) {
|
||||
if (!this.getServer().isSingleplayer() || this.getServer().isPublished()) {
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
@@ -1257,7 +1257,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i));
|
||||
}
|
||||
|
||||
@@ -1105,6 +1171,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1144,6 +1210,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@VisibleForTesting
|
||||
public void resetWeatherCycle() {
|
||||
// CraftBukkit start
|
||||
@@ -1265,7 +1265,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
this.serverLevelData.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.
|
||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||
@@ -1112,6 +1179,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1151,6 +1218,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.serverLevelData.setRainTime(0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -1273,7 +1273,7 @@ index 7318904311c4b15f4588a61009a2652c140cbf07..4b4529f68e4b2514e05b5403b2dab567
|
||||
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// CraftBukkit start
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
@@ -2486,7 +2554,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -2535,7 +2603,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// Spigot Start
|
||||
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
|
||||
@@ -1886,7 +1886,7 @@ index 1d11d0388b9763a0e0e5f3398425dafa2bb01488..72cf1372a7e685b3ff4cc852c3d38f7d
|
||||
}
|
||||
} catch (AuthenticationUnavailableException authenticationunavailableexception) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index b74f809138d657bcfcaa68fc30984e591b1e908b..d2153c3e909e7e75529ce6e41d649bf54b48752b 100644
|
||||
index 28354aa3ed55f7a86c210f805b1aecb5ae06b466..811a0c7ed06ecba3d6b4cd5d45a81c2d483bc53b 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -494,6 +494,7 @@ public abstract class PlayerList {
|
||||
@@ -1914,7 +1914,7 @@ index b74f809138d657bcfcaa68fc30984e591b1e908b..d2153c3e909e7e75529ce6e41d649bf5
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_FULL, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure
|
||||
}
|
||||
}
|
||||
@@ -1077,6 +1079,20 @@ public abstract class PlayerList {
|
||||
@@ -1078,6 +1080,20 @@ public abstract class PlayerList {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1935,7 +1935,7 @@ index b74f809138d657bcfcaa68fc30984e591b1e908b..d2153c3e909e7e75529ce6e41d649bf5
|
||||
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
||||
Iterator iterator = this.players.iterator();
|
||||
|
||||
@@ -1180,6 +1196,7 @@ public abstract class PlayerList {
|
||||
@@ -1181,6 +1197,7 @@ public abstract class PlayerList {
|
||||
} else {
|
||||
b0 = (byte) (24 + permissionLevel);
|
||||
}
|
||||
@@ -1943,7 +1943,7 @@ index b74f809138d657bcfcaa68fc30984e591b1e908b..d2153c3e909e7e75529ce6e41d649bf5
|
||||
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, b0));
|
||||
}
|
||||
@@ -1188,6 +1205,27 @@ public abstract class PlayerList {
|
||||
@@ -1189,6 +1206,27 @@ public abstract class PlayerList {
|
||||
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
|
||||
this.server.getCommands().sendCommands(player);
|
||||
} // Paper - Add sendOpLevel API
|
||||
@@ -2228,7 +2228,7 @@ index f43bf280999ff3860cc702def50cc62b131eb1bd..66d9e99a351f5fc6cf58be3bee4397d9
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779beccdb6dea6 100644
|
||||
index c820ea4aa07c00bcd3a66616e774662950b65451..2c669b29d858d8d020484db7a06bf1e132e41529 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -168,7 +168,7 @@ import org.bukkit.plugin.PluginManager;
|
||||
@@ -2240,7 +2240,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first setPositionRotation
|
||||
@@ -344,6 +344,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -345,6 +345,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public double xOld;
|
||||
public double yOld;
|
||||
public double zOld;
|
||||
@@ -2248,7 +2248,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
public boolean noPhysics;
|
||||
public final RandomSource random;
|
||||
public int tickCount;
|
||||
@@ -384,7 +385,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -385,7 +386,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
private final Set<String> tags;
|
||||
private final double[] pistonDeltas;
|
||||
private long pistonDeltasGameTime;
|
||||
@@ -2257,7 +2257,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
private float eyeHeight;
|
||||
public boolean isInPowderSnow;
|
||||
public boolean wasInPowderSnow;
|
||||
@@ -432,6 +433,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -433,6 +434,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public boolean fixedPose = false; // Paper - Expand Pose API
|
||||
public boolean activatedPriorityReset = false; // Pufferfish - DAB
|
||||
public int activatedPriority = org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.maximumActivationPrio; // Pufferfish - DAB (golf score)
|
||||
@@ -2265,7 +2265,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -533,6 +535,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -534,6 +536,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.getIndirectPassengersStream().anyMatch((entity) -> entity instanceof Player);
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
@@ -2293,7 +2293,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
|
||||
public Entity(EntityType<?> type, Level world) {
|
||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||
@@ -541,7 +564,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -542,7 +565,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.bb = Entity.INITIAL_AABB;
|
||||
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||
this.nextStep = 1.0F;
|
||||
@@ -2302,7 +2302,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
this.remainingFireTicks = -this.getFireImmuneTicks();
|
||||
this.fluidHeight = new Object2DoubleArrayMap(2);
|
||||
this.fluidOnEyes = new HashSet();
|
||||
@@ -924,10 +947,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -925,10 +948,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
public void checkBelowWorld() {
|
||||
// Paper start - Configurable nether ceiling damage
|
||||
@@ -2315,7 +2315,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
this.onBelowWorld();
|
||||
}
|
||||
|
||||
@@ -1763,7 +1787,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1764,7 +1788,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -2324,7 +2324,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -1836,7 +1860,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1837,7 +1861,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.isInWater() || flag;
|
||||
}
|
||||
|
||||
@@ -2333,7 +2333,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
Entity entity = this.getVehicle();
|
||||
|
||||
if (entity instanceof Boat entityboat) {
|
||||
@@ -2482,6 +2506,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2483,6 +2507,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -2345,7 +2345,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2629,6 +2658,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2630,6 +2659,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
@@ -2357,7 +2357,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -2790,6 +2824,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2791,6 +2825,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (this.isAlive() && this instanceof Leashable leashable) {
|
||||
if (leashable.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -2365,7 +2365,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
// Paper start - Expand EntityUnleashEvent
|
||||
org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials());
|
||||
@@ -2993,6 +3028,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2994,6 +3029,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.passengers = ImmutableList.copyOf(list);
|
||||
}
|
||||
|
||||
@@ -2379,7 +2379,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
|
||||
}
|
||||
}
|
||||
@@ -3032,6 +3074,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3033,6 +3075,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -2394,7 +2394,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -3110,13 +3160,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3111,13 +3161,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -2411,7 +2411,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
} else {
|
||||
this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
||||
}
|
||||
@@ -3324,7 +3377,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3325,7 +3378,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -2420,7 +2420,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -4054,6 +4107,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4055,6 +4108,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return SlotAccess.NULL;
|
||||
}
|
||||
|
||||
@@ -2441,7 +2441,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
@Override
|
||||
public void sendSystemMessage(Component message) {}
|
||||
|
||||
@@ -4322,6 +4389,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4323,6 +4390,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return Mth.lerp(delta, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -2454,7 +2454,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
if (false && this.touchingUnloadedChunk()) { // Gale - Airplane - reduce entity fluid lookups if no fluids - cost of a lookup here is the same cost as below, so skip
|
||||
return false;
|
||||
@@ -4729,7 +4802,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4730,7 +4803,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
@@ -2463,7 +2463,7 @@ index 5210fc4a74dde64bd0e40a4521aa320424bde428..7c3aec4c19954b3823ece1122c779bec
|
||||
}
|
||||
|
||||
public void onExplosionHit(@Nullable Entity entity) {}
|
||||
@@ -4921,4 +4994,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4922,4 +4995,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
||||
}
|
||||
// Paper end - Expose entity id counter
|
||||
@@ -2647,7 +2647,7 @@ index 09fdea983772612ef3fff6b2da3cf469a34e4ec0..b69d924fa8034eabbf4aab8d3434f4f4
|
||||
protected ParticleOptions getInkParticle() {
|
||||
return ParticleTypes.GLOW_SQUID_INK;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057843aa95a 100644
|
||||
index 3c13810d03bf1c343195b9366554a046ff6112da..9f4257aaeedd6fcee6d7dc30a98423872c4f8e9b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -236,9 +236,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2824,7 +2824,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
LivingEntity entityliving2 = entitywolf.getOwner();
|
||||
|
||||
if (entityliving2 instanceof net.minecraft.world.entity.player.Player) {
|
||||
@@ -1631,6 +1681,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1636,6 +1686,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2843,7 +2843,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
||||
EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
||||
event.setCancelled(itemstack == null);
|
||||
@@ -1797,7 +1859,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1802,7 +1864,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = false;
|
||||
|
||||
if (this.dead && adversary instanceof WitherBoss) { // Paper
|
||||
@@ -2852,7 +2852,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
BlockPos blockposition = this.blockPosition();
|
||||
BlockState iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
|
||||
|
||||
@@ -1833,7 +1895,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1838,7 +1900,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
boolean flag = this.lastHurtByPlayerTime > 0;
|
||||
|
||||
this.dropEquipment(); // CraftBukkit - from below
|
||||
@@ -2862,7 +2862,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
this.dropFromLootTable(damageSource, flag);
|
||||
// Paper start
|
||||
final boolean prev = this.clearEquipmentSlots;
|
||||
@@ -1842,6 +1905,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1847,6 +1910,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
// Paper end
|
||||
this.dropCustomDeathLoot(world, damageSource, flag);
|
||||
this.clearEquipmentSlots = prev; // Paper
|
||||
@@ -2870,7 +2870,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
}
|
||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||
org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, damageSource, this.drops, () -> {
|
||||
@@ -2614,7 +2678,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2619,7 +2683,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@Override
|
||||
protected void onBelowWorld() {
|
||||
@@ -2879,7 +2879,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
}
|
||||
|
||||
protected void updateSwingTime() {
|
||||
@@ -2972,6 +3036,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2977,6 +3041,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
if (f3 > 0.0F) {
|
||||
this.playSound(this.getFallDamageSound((int) f3), 1.0F, 1.0F);
|
||||
@@ -2887,7 +2887,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
this.hurt(this.damageSources().flyIntoWall(), f3);
|
||||
}
|
||||
}
|
||||
@@ -3526,8 +3591,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3531,8 +3596,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
this.pushEntities();
|
||||
// Paper start - Add EntityMoveEvent
|
||||
@@ -2900,7 +2900,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
|
||||
Location to = new Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
|
||||
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
|
||||
@@ -3537,12 +3604,55 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3542,12 +3609,55 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.absMoveTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
|
||||
}
|
||||
}
|
||||
@@ -2956,7 +2956,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
}
|
||||
|
||||
public boolean isSensitiveToWater() {
|
||||
@@ -3563,7 +3673,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3568,7 +3678,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
int j = i / 10;
|
||||
|
||||
if (j % 2 == 0) {
|
||||
@@ -2974,7 +2974,7 @@ index 88bb6eb1a8c6551cb7fe71893f2e7f3c9db8c7bd..3b1789d448f07060dec6f5e097814057
|
||||
}
|
||||
|
||||
this.gameEvent(GameEvent.ELYTRA_GLIDE);
|
||||
@@ -4502,6 +4621,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -4507,6 +4626,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return EquipmentSlot.MAINHAND;
|
||||
}
|
||||
|
||||
@@ -3268,18 +3268,18 @@ index f0703302e7dbbda88de8c648d20d87c55ed9b1e0..a913ebabaa5f443afa987b972355a8f8
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
index f053ee19875e6c1586ffe4ebb0284172af5fbb23..848452ba2068c9b0ec6e253da0d0ef10fdec48b0 100644
|
||||
index b5242f2d450f863a3eb774d8a14bb00cbe699a16..4a13566621613f28a0a69b925c60fc211231f91e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -81,7 +81,7 @@ public class AcquirePoi {
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class AcquirePoi {
|
||||
};
|
||||
Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllClosestFirstWithType(
|
||||
- poiPredicate, predicate2, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE
|
||||
+ poiPredicate, predicate2, entity.blockPosition(), world.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE // Purpur
|
||||
)
|
||||
.limit(5L)
|
||||
.collect(Collectors.toSet());
|
||||
// Paper start - optimise POI access
|
||||
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
- io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes);
|
||||
+ io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), world.purpurConfig.villagerAcquirePoiSearchRadius, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); // Purpur
|
||||
Set<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes);
|
||||
// Paper end - optimise POI access
|
||||
Path path = findPathToPois(entity, set);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
index 2ade08d1466660ee1787fa97908002ef56389712..8d4e206aa05b95b7bfec5d23496085cf55a3e1de 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
@@ -3604,18 +3604,18 @@ index 13f8c2cb42334ba3b573ca44ace1d3df76e41ff7..baca552e52c728867fcb0527b6c3eb39
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
index d5a549f08b98c80a5cf0eef02cb8a389c32dfecb..222c87e80cb089867ce9a7d2dceebe21b4bfe0de 100644
|
||||
index 92731b6b593289e9f583c9b705b219e81fcd8e73..51fbe27281a9d5d8af1b0fa19d3ffa44f04dedc3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
@@ -54,7 +54,7 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||
}
|
||||
};
|
||||
Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllWithType(
|
||||
- holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY
|
||||
+ holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), world.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY
|
||||
)
|
||||
.collect(Collectors.toSet());
|
||||
Path path = AcquirePoi.findPathToPois(entity, set);
|
||||
@@ -56,7 +56,7 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||
// Paper start - optimise POI access
|
||||
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
// don't ask me why it's unbounded. ask mojang.
|
||||
- io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes);
|
||||
+ io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), world.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes);
|
||||
Path path = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
||||
// Paper end - optimise POI access
|
||||
if (path != null && path.canReach()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
index ce8851c2cacfd3145b1e2c11443140a0759a1b07..9419f230910d0338fc4ac6e2e7b749ee7d5ee362 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
|
||||
@@ -6262,7 +6262,7 @@ index 3d03ffe2e12eca82dfa2f414471d12bb362d4552..2d04addd17d2c358fff598012b323cd7
|
||||
return "entity.minecraft.tropical_fish.predefined." + variant;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
index 4bfa947531c4a67989e18032754dabf4c69e989c..55d83c57d76e73d73dca1400f4c0c18661d49a94 100644
|
||||
index caf4120721be8f2f7e2d737abbf73296cbe170b5..15a8c4e2772e1529204e3892914e49f9a17852aa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -87,6 +87,44 @@ public class Turtle extends Animal {
|
||||
@@ -6308,7 +6308,7 @@ index 4bfa947531c4a67989e18032754dabf4c69e989c..55d83c57d76e73d73dca1400f4c0c186
|
||||
+ }
|
||||
+
|
||||
public void setHomePos(BlockPos pos) {
|
||||
this.entityData.set(Turtle.HOME_POS, pos);
|
||||
this.entityData.set(Turtle.HOME_POS, pos.immutable()); // Paper - called with mutablepos...
|
||||
}
|
||||
@@ -189,6 +227,7 @@ public class Turtle extends Animal {
|
||||
|
||||
@@ -12997,7 +12997,7 @@ index f403fc311a974558233028663dbe14c27b27d3f9..337bd2011c471361653c317004f8380c
|
||||
Vec3 vec3d5 = this.getDeltaMovement();
|
||||
double d21 = vec3d5.x;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
index 907f751c859855484151fb5d607acee2f2a35076..c45bb20e5355b0e0f87447572b6f60e8e2ee47be 100644
|
||||
index edd30d872d151f953df28c8f6d40efa8d39f5e36..ac4779937eec01c34efe076c21b42bb5c770b756 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
||||
@@ -543,6 +543,7 @@ public class Boat extends VehicleEntity implements Leashable, VariantHolder<Boat
|
||||
@@ -14132,21 +14132,30 @@ index 32b170551a2f5bdc88d29f4d03750bfe3974e71b..a41fb0dd26af367fc2470a7913a84d86
|
||||
com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) user.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entitysnowball.getBukkitEntity());
|
||||
if (event.callEvent() && world.addFreshEntity(entitysnowball)) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/SpawnEggItem.java b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
index 9cea8da84f39bb3f687139ef213ccea358724dee..d43be19fdb4ca917d08f84cda5a67667960f28fe 100644
|
||||
index 9cea8da84f39bb3f687139ef213ccea358724dee..c513e3b414a1b87b1aa37bb5d51fc2dd0fae1c54 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/SpawnEggItem.java
|
||||
@@ -74,6 +74,15 @@ public class SpawnEggItem extends Item {
|
||||
@@ -74,6 +74,24 @@ public class SpawnEggItem extends Item {
|
||||
Spawner spawner = (Spawner) tileentity;
|
||||
|
||||
entitytypes = this.getType(itemstack);
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (spawner instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity) {
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.CreatureSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(entitytypes.getName()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ entitytypes = EntityType.getFromBukkitType(event.getEntityType());
|
||||
+ } else if (spawner instanceof net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity) {
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent event = new org.purpurmc.purpur.event.PlayerSetTrialSpawnerTypeWithEggEvent((org.bukkit.entity.Player) context.getPlayer().getBukkitEntity(), bukkitBlock, (org.bukkit.block.TrialSpawner) bukkitBlock.getState(), org.bukkit.entity.EntityType.fromName(entitytypes.getName()));
|
||||
+ if (!event.callEvent()) {
|
||||
+ return InteractionResult.FAIL;
|
||||
+ }
|
||||
+ entitytypes = EntityType.getFromBukkitType(event.getEntityType());
|
||||
+ }
|
||||
+ // Purpur end
|
||||
spawner.setEntityId(entitytypes, world.getRandom());
|
||||
world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -14420,7 +14429,7 @@ index 26d5440007db5c820405e4184ededb1ffabf2934..3e2d1f0429a44e1d87319454194be182
|
||||
Set<BlockPos> set = Sets.newHashSet();
|
||||
boolean flag = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index beedd65eafc386ca9644b149c91f8247a85898e0..fc0c2115781fa7d6adb120f64513462462ec8260 100644
|
||||
index 3b94e292881f631656450638592e69b91ae0a39f..2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -14431,9 +14440,9 @@ index beedd65eafc386ca9644b149c91f8247a85898e0..fc0c2115781fa7d6adb120f645134624
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
@@ -183,6 +184,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
||||
@@ -185,6 +186,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
|
||||
public final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); // Gale - Pufferfish - move random tick random
|
||||
|
||||
+ // Purpur start
|
||||
+ private com.google.common.cache.Cache<BreedingCooldownPair, Object> playerBreedingCooldowns;
|
||||
@@ -14481,7 +14490,7 @@ index beedd65eafc386ca9644b149c91f8247a85898e0..fc0c2115781fa7d6adb120f645134624
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -272,6 +316,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -279,6 +323,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
|
||||
@@ -14490,7 +14499,7 @@ index beedd65eafc386ca9644b149c91f8247a85898e0..fc0c2115781fa7d6adb120f645134624
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
@@ -1589,4 +1635,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1612,4 +1658,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
return null;
|
||||
}
|
||||
// Paper end - optimize redstone (Alternate Current)
|
||||
@@ -14505,7 +14514,7 @@ index beedd65eafc386ca9644b149c91f8247a85898e0..fc0c2115781fa7d6adb120f645134624
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 7e707fe1d800debf1eef8800fe98eb4e1dbd800b..d490429ddbb8cd82aeda5e03540075c9167b095e 100644
|
||||
index d0383cef6e204cc806903666d296287e1c530ed3..27fccd091535f7587aaaa1621361dc1835381b89 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -251,7 +251,7 @@ public final class NaturalSpawner {
|
||||
@@ -17881,7 +17890,7 @@ index 52649f82351ab4f675c3cc3cd6640956b0f76b91..eb51c88c7a0658190d3a8bfd5d18dca7
|
||||
DefaultPermissions.registerPermission(CommandPermissions.PREFIX + "seed", "Allows the user to view the seed of the world", PermissionDefault.OP, commands);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..71787e9efaa8a711f4c41849793f01f3087add1a
|
||||
index 0000000000000000000000000000000000000000..83fabd290d3c64f2766b3244f5cd695e1c674a2f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -0,0 +1,576 @@
|
||||
@@ -18380,7 +18389,7 @@ index 0000000000000000000000000000000000000000..71787e9efaa8a711f4c41849793f01f3
|
||||
+
|
||||
+ private static void blastResistanceSettings() {
|
||||
+ getMap("settings.blast-resistance-overrides", Collections.emptyMap()).forEach((blockId, value) -> {
|
||||
+ Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.withDefaultNamespace(blockId));
|
||||
+ Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(blockId));
|
||||
+ if (block == Blocks.AIR) {
|
||||
+ log(Level.SEVERE, "Invalid block for `settings.blast-resistance-overrides`: " + blockId);
|
||||
+ return;
|
||||
|
||||
@@ -27,7 +27,7 @@ index e94224ed280247ee69dfdff8dc960f2b8729be33..5b9725a9a81c0850dc2809c150529e5f
|
||||
|
||||
for (Component component : formatProviders(spigotPlugins, sender)) { // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index b5fd90764d954acd0381cf42c38d5015c200b886..6a652ed876128addfef881903272fc9a891b13b6 100644
|
||||
index 200e76648fb98a5d289682c75a2ecb6b614ec4af..19dde0087e9c285191ab6c25d9e505e227be893c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -48,7 +48,7 @@ index b5fd90764d954acd0381cf42c38d5015c200b886..6a652ed876128addfef881903272fc9a
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
@@ -982,6 +984,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1044,6 +1046,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.error("[UPnP] Failed to close port {}", this.getPort());
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ index b5fd90764d954acd0381cf42c38d5015c200b886..6a652ed876128addfef881903272fc9a
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
@@ -1241,9 +1244,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1303,9 +1306,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
tps15.add(currentTps, diff);
|
||||
|
||||
// Backwards compat with bad plugins
|
||||
@@ -86,10 +86,10 @@ index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb73
|
||||
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
|
||||
this.repaint();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 8367edebdfa2f022bcda1ec2b0e7881285d8bb9c..023533e9ea342c8ff0d993544c45416af88bf5ab 100644
|
||||
index ed53e5698e2217c7b6847fd8369bff93e7b32f4d..730affea063da4d35e0e11fb88dfdf75fd23a3b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -458,7 +458,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -460,7 +460,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
// Gale start - MultiPaper - skip unnecessary mob spawning computations
|
||||
} else {
|
||||
@@ -100,10 +100,10 @@ index 8367edebdfa2f022bcda1ec2b0e7881285d8bb9c..023533e9ea342c8ff0d993544c45416a
|
||||
// Gale end - MultiPaper - skip unnecessary mob spawning computations
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 4b4529f68e4b2514e05b5403b2dab5672c1af7dd..cb97a4de383df7c8fd5af86aade4237893a3a2b7 100644
|
||||
index cf05c216f05a81b5a666aba0d944586d4a3cff05..0b882b74b01a6d9da90ff9e56dd7ad7d89345459 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -657,7 +657,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -674,7 +674,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
long j;
|
||||
|
||||
@@ -113,10 +113,10 @@ index 4b4529f68e4b2514e05b5403b2dab5672c1af7dd..cb97a4de383df7c8fd5af86aade42378
|
||||
j = this.levelData.getDayTime() + 24000L;
|
||||
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 7c3aec4c19954b3823ece1122c779beccdb6dea6..747dfc5795cf9e9c5f67ee7478f09f827eba5f79 100644
|
||||
index 2c669b29d858d8d020484db7a06bf1e132e41529..8ed91095025dd9323d87df9a28c28fc04d8fb306 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -542,13 +542,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -543,13 +543,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
// Purpur end
|
||||
|
||||
// Purpur start - copied from Mob - API for any mob to burn daylight
|
||||
@@ -149,7 +149,7 @@ index 7c3aec4c19954b3823ece1122c779beccdb6dea6..747dfc5795cf9e9c5f67ee7478f09f82
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -853,7 +869,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -854,7 +870,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public void tick() {
|
||||
// Pufferfish start - entity TTL
|
||||
if (type != EntityType.PLAYER && type.ttl >= 0 && this.tickCount >= type.ttl) {
|
||||
@@ -159,7 +159,7 @@ index 7c3aec4c19954b3823ece1122c779beccdb6dea6..747dfc5795cf9e9c5f67ee7478f09f82
|
||||
}
|
||||
// Pufferfish end - entity TTL
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 3b1789d448f07060dec6f5e097814057843aa95a..8c424f1eb1ff09c7761fd228279dafb9fe538ad0 100644
|
||||
index 9f4257aaeedd6fcee6d7dc30a98423872c4f8e9b..a27e39cfa13173fcac62d4bb2e6936e200f2e9f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1043,17 +1043,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6a652ed876128addfef881903272fc9a891b13b6..12f41f1bc9ea5f5be7e32236aae380f633abee0e 100644
|
||||
index 19dde0087e9c285191ab6c25d9e505e227be893c..821e55c3b2de5cf3b7f9539345949d3bd74d1772 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1868,7 +1868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1931,7 +1931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -907,7 +907,7 @@ index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..f7197f1347251a37dd0f6d9ffa2f09bc
|
||||
} catch (Exception exception) {
|
||||
if (exception instanceof ReportedException) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661cc799765 100644
|
||||
index 821e55c3b2de5cf3b7f9539345949d3bd74d1772..e1ba263d890f1030c6ab38e91bd951bdedb88802 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -187,8 +187,6 @@ import org.bukkit.craftbukkit.CraftRegistry;
|
||||
@@ -919,7 +919,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer { // Paper - rewrite chunk system
|
||||
|
||||
public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable
|
||||
@@ -975,7 +973,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1037,7 +1035,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -927,7 +927,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
// Purpur start
|
||||
if (upnp) {
|
||||
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
||||
@@ -1434,7 +1431,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1496,7 +1493,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
protected void waitUntilNextTick() {
|
||||
@@ -935,7 +935,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
|
||||
this.managedBlock(() -> {
|
||||
return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick
|
||||
@@ -1545,15 +1541,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1608,15 +1604,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -953,7 +953,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
// Paper end
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||
|
||||
@@ -1575,11 +1570,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1638,11 +1633,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftServer.LOGGER.debug("Autosave finished");
|
||||
}
|
||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||
@@ -966,7 +966,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
// Paper start - Server Tick Events
|
||||
long endTime = System.nanoTime();
|
||||
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
||||
@@ -1599,7 +1590,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1662,7 +1653,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - Add tick times API and /mspt command
|
||||
this.logTickMethodTime(i);
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
@@ -974,7 +974,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
}
|
||||
|
||||
private void logTickMethodTime(long tickStartTime) {
|
||||
@@ -1670,9 +1660,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1733,9 +1723,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||
entityplayer.connection.suspendFlushing();
|
||||
});
|
||||
@@ -984,7 +984,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
getAllLevels().forEach(level -> {
|
||||
@@ -1688,20 +1676,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1751,20 +1739,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
});
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
@@ -1005,7 +1005,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
// Paper start - Perf: Optimize time updates
|
||||
for (final ServerLevel level : this.getAllLevels()) {
|
||||
@@ -1721,7 +1704,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1784,7 +1767,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
// Paper end - Perf: Optimize time updates
|
||||
@@ -1013,7 +1013,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
||||
@@ -1739,9 +1721,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1802,9 +1784,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end */
|
||||
|
||||
try {
|
||||
@@ -1023,7 +1023,7 @@ index 12f41f1bc9ea5f5be7e32236aae380f633abee0e..0eac388d53d65d6dbd6900040be4d661
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
@@ -1753,21 +1733,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1816,21 +1796,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
@@ -1136,7 +1136,7 @@ index 79057c2db0e6163f2d5466f50716a4ce230bfdf2..55ae1991316e5e67159c5babbc501190
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 023533e9ea342c8ff0d993544c45416af88bf5ab..c60c9c6eaecadcf6c8ababd803aeeaf49befb6c7 100644
|
||||
index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4ce31d74b8 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -356,9 +356,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -1174,7 +1174,7 @@ index 023533e9ea342c8ff0d993544c45416af88bf5ab..c60c9c6eaecadcf6c8ababd803aeeaf4
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -411,7 +403,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -412,7 +404,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
if (!this.level.isDebug()) {
|
||||
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
||||
Iterator iterator = this.chunkMap.getChunks().iterator();
|
||||
@@ -1182,7 +1182,7 @@ index 023533e9ea342c8ff0d993544c45416af88bf5ab..c60c9c6eaecadcf6c8ababd803aeeaf4
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
|
||||
@@ -429,7 +420,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -431,7 +422,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
boolean flagAndHasNaturalSpawn = flag && this.anySpawnCategoryIsSpawnedThisTick();
|
||||
if (flagAndHasNaturalSpawn) {
|
||||
// Gale end - MultiPaper - skip unnecessary mob spawning computations
|
||||
@@ -1190,7 +1190,7 @@ index 023533e9ea342c8ff0d993544c45416af88bf5ab..c60c9c6eaecadcf6c8ababd803aeeaf4
|
||||
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - Optional per player mob spawns
|
||||
int naturalSpawnChunkCount = k;
|
||||
@@ -453,7 +443,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -455,7 +445,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
|
||||
}
|
||||
// Paper end - Optional per player mob spawns
|
||||
@@ -1198,7 +1198,7 @@ index 023533e9ea342c8ff0d993544c45416af88bf5ab..c60c9c6eaecadcf6c8ababd803aeeaf4
|
||||
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
// Gale start - MultiPaper - skip unnecessary mob spawning computations
|
||||
@@ -493,19 +482,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -500,19 +489,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ index 023533e9ea342c8ff0d993544c45416af88bf5ab..c60c9c6eaecadcf6c8ababd803aeeaf4
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3ba0d311d 100644
|
||||
index 0b882b74b01a6d9da90ff9e56dd7ad7d89345459..fe8de1945c4044c7a622d4b326f934fd34506d25 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1,7 +1,6 @@
|
||||
@@ -1230,7 +1230,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
@@ -682,27 +681,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -699,27 +698,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.tickTime();
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
}
|
||||
|
||||
this.handlingTick = false;
|
||||
@@ -713,13 +704,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -730,13 +721,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
if (flag1 || this.emptyTime++ < 300) {
|
||||
@@ -1272,7 +1272,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
entity.activatedPriorityReset = false; // Pufferfish - DAB
|
||||
if (!entity.isRemoved()) {
|
||||
@@ -756,8 +745,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -773,8 +762,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1281,24 +1281,24 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
this.tickBlockEntities();
|
||||
}
|
||||
|
||||
@@ -882,7 +869,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -909,7 +896,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
} // Paper - Option to disable ice and snow
|
||||
|
||||
- timings.chunkTicksBlocks.startTiming(); // Paper
|
||||
if (randomTickSpeed > 0) {
|
||||
LevelChunkSection[] achunksection = chunk.getSections();
|
||||
|
||||
@@ -912,8 +898,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
// Paper start - optimize random block ticking
|
||||
LevelChunkSection[] sections = chunk.getSections();
|
||||
@@ -942,8 +928,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
}
|
||||
// Paper end - optimise random block ticking
|
||||
-
|
||||
- timings.chunkTicksBlocks.stopTiming(); // Paper
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -1213,31 +1197,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1262,31 +1246,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
public void tickNonPassenger(Entity entity) {
|
||||
@@ -1330,7 +1330,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1245,8 +1219,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1294,8 +1268,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
this.tickPassenger(entity, entity1);
|
||||
}
|
||||
@@ -1339,7 +1339,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
}
|
||||
|
||||
private void tickPassenger(Entity vehicle, Entity passenger) {
|
||||
@@ -1254,9 +1226,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1303,9 +1275,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
||||
// Paper - EAR 2
|
||||
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
||||
@@ -1349,7 +1349,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
passenger.setOldPosAndRot();
|
||||
++passenger.tickCount;
|
||||
|
||||
@@ -1278,8 +1247,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1327,8 +1296,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
this.tickPassenger(passenger, entity2);
|
||||
}
|
||||
@@ -1358,7 +1358,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
}
|
||||
} else {
|
||||
passenger.stopRiding();
|
||||
@@ -1301,7 +1268,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1350,7 +1317,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
if (!savingDisabled) {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
||||
@@ -1366,7 +1366,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
if (progressListener != null) {
|
||||
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
||||
}
|
||||
@@ -1311,10 +1277,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1360,10 +1326,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
progressListener.progressStage(Component.translatable("menu.savingChunks"));
|
||||
}
|
||||
|
||||
@@ -1378,7 +1378,7 @@ index cb97a4de383df7c8fd5af86aade4237893a3a2b7..818da592d23f533d60f0bf5fb7b250f3
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d2153c3e909e7e75529ce6e41d649bf54b48752b..33fd3c88f84a5d6f7f7c0212f364a83870c88fc7 100644
|
||||
index 811a0c7ed06ecba3d6b4cd5d45a81c2d483bc53b..75728fe1e02cc7042e30d954bc913fefd107ef94 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -1388,7 +1388,7 @@ index d2153c3e909e7e75529ce6e41d649bf54b48752b..33fd3c88f84a5d6f7f7c0212f364a838
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -1282,11 +1281,9 @@ public abstract class PlayerList {
|
||||
@@ -1283,11 +1282,9 @@ public abstract class PlayerList {
|
||||
|
||||
public void saveAll() {
|
||||
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
|
||||
@@ -1541,7 +1541,7 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..ac67dd7a30616fe70f73426e332972b7
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index fc0c2115781fa7d6adb120f64513462462ec8260..bec9696ebca39c96b456ed5f2a6fb06da8362d57 100644
|
||||
index 2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e..61d2244031e4cf3116683acc88b0d84b5acf52cb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -176,7 +176,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1552,7 +1552,7 @@ index fc0c2115781fa7d6adb120f64513462462ec8260..bec9696ebca39c96b456ed5f2a6fb06d
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
private org.spigotmc.TickLimiter tileLimiter;
|
||||
@@ -400,7 +399,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -407,7 +406,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
||||
});
|
||||
// CraftBukkit end
|
||||
@@ -1560,7 +1560,7 @@ index fc0c2115781fa7d6adb120f64513462462ec8260..bec9696ebca39c96b456ed5f2a6fb06d
|
||||
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
||||
this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system
|
||||
@@ -999,15 +997,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1006,15 +1004,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -1576,7 +1576,7 @@ index fc0c2115781fa7d6adb120f64513462462ec8260..bec9696ebca39c96b456ed5f2a6fb06d
|
||||
// Spigot start
|
||||
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
||||
boolean flag = this.tickRateManager().runsNormally();
|
||||
@@ -1031,9 +1026,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1045,9 +1040,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
@@ -1587,7 +1587,7 @@ index fc0c2115781fa7d6adb120f64513462462ec8260..bec9696ebca39c96b456ed5f2a6fb06d
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index d490429ddbb8cd82aeda5e03540075c9167b095e..d556089907bb695a9d87df1961ef0b0ae4382cad 100644
|
||||
index 27fccd091535f7587aaaa1621361dc1835381b89..885d7c9ef96dd3c7576c28606e5ab83d2a75de71 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -127,7 +127,6 @@ public final class NaturalSpawner {
|
||||
@@ -1645,10 +1645,10 @@ index cd0e43f4c53a746dd6183a8406269f9b11ad3571..54657ac895fb2fa9c58910d5421f0082
|
||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
public CraftPersistentDataContainer persistentDataContainer;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 5752576087e5ff411ff8c89fde7a761083945c23..95f306d6d896e6aa4ada7ee20880ed862e0e48d8 100644
|
||||
index f15b81fd738825543eecf6eb4afc007fe828090d..873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -622,7 +622,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -635,7 +635,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system
|
||||
|
||||
if (this.needsDecoration) {
|
||||
@@ -1656,7 +1656,7 @@ index 5752576087e5ff411ff8c89fde7a761083945c23..95f306d6d896e6aa4ada7ee20880ed86
|
||||
this.needsDecoration = false;
|
||||
java.util.Random random = new java.util.Random();
|
||||
random.setSeed(this.level.getSeed());
|
||||
@@ -642,7 +641,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -655,7 +654,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
}
|
||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
||||
@@ -1664,7 +1664,7 @@ index 5752576087e5ff411ff8c89fde7a761083945c23..95f306d6d896e6aa4ada7ee20880ed86
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -979,7 +977,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -992,7 +990,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
if (LevelChunk.this.isTicking(blockposition)) {
|
||||
try {
|
||||
@@ -1672,7 +1672,7 @@ index 5752576087e5ff411ff8c89fde7a761083945c23..95f306d6d896e6aa4ada7ee20880ed86
|
||||
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
||||
|
||||
if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||
@@ -1002,14 +999,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1015,14 +1012,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
|
||||
LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
// Paper end - Prevent block entity and entity crashes
|
||||
|
||||
@@ -19,10 +19,10 @@ index d573ae3fee994614bcc6c699bcbe8210874ca414..30f984553e823b3c928b0e2181baf5d2
|
||||
// Paper start - rewrite chunk system
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 33fd3c88f84a5d6f7f7c0212f364a83870c88fc7..360b52002fe8bc9dd27a4fe3831ed6f5dfe8d6c6 100644
|
||||
index 75728fe1e02cc7042e30d954bc913fefd107ef94..5a46f2b5f2903adbb5410c509aac62a5af7dbcc9 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -898,10 +898,10 @@ public abstract class PlayerList {
|
||||
@@ -899,10 +899,10 @@ public abstract class PlayerList {
|
||||
ServerLevel worldserver1 = entityplayer1.serverLevel();
|
||||
LevelData worlddata = worldserver1.getLevelData();
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves
|
||||
Commit: e234432bd99e1c4b07c24d1dd247977226a7516a
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 747dfc5795cf9e9c5f67ee7478f09f827eba5f79..a270eb3b94ffc439499c0dcf37c7a35f3d5700ac 100644
|
||||
index 8ed91095025dd9323d87df9a28c28fc04d8fb306..83ee59ff3d61f65fe354f7429d352929b077f23f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -434,6 +434,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -435,6 +435,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public boolean activatedPriorityReset = false; // Pufferfish - DAB
|
||||
public int activatedPriority = org.dreeam.leaf.config.modules.opt.DynamicActivationofBrain.maximumActivationPrio; // Pufferfish - DAB (golf score)
|
||||
public @Nullable Boolean immuneToFire = null; // Purpur - Fire immune API
|
||||
@@ -20,7 +20,7 @@ index 747dfc5795cf9e9c5f67ee7478f09f827eba5f79..a270eb3b94ffc439499c0dcf37c7a35f
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -2527,6 +2528,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2528,6 +2529,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
nbttagcompound.putBoolean("Purpur.FireImmune", immuneToFire);
|
||||
}
|
||||
// Purpur end
|
||||
@@ -28,7 +28,7 @@ index 747dfc5795cf9e9c5f67ee7478f09f827eba5f79..a270eb3b94ffc439499c0dcf37c7a35f
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2679,6 +2681,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2680,6 +2682,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
immuneToFire = nbt.getBoolean("Purpur.FireImmune");
|
||||
}
|
||||
// Purpur end
|
||||
@@ -40,7 +40,7 @@ index 747dfc5795cf9e9c5f67ee7478f09f827eba5f79..a270eb3b94ffc439499c0dcf37c7a35f
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -5050,4 +5057,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5051,4 +5058,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return false;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -40,10 +40,10 @@ index a4f9de18d40d5d85a809af3777b00eb75b1af027..b2048639f652cb16358901052af0c6c6
|
||||
};
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 0eac388d53d65d6dbd6900040be4d661cc799765..3d6be33c3310da2bfacba887e8ba12840d2f811c 100644
|
||||
index e1ba263d890f1030c6ab38e91bd951bdedb88802..a43a139100bb69e4aef0e85933146dfcf88f03ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1739,6 +1739,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1802,6 +1802,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ index b66fdb789fcb460d63fd81540112d655c9a0c3f2..ae0d0310d50f1ada082e045a58a24a43
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 360b52002fe8bc9dd27a4fe3831ed6f5dfe8d6c6..44abb103462dc5a2718b3112e94342c39dead554 100644
|
||||
index 5a46f2b5f2903adbb5410c509aac62a5af7dbcc9..1fd31b5e3ecab5627a33660add036e232c311074 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -363,6 +363,8 @@ public abstract class PlayerList {
|
||||
|
||||
@@ -11,10 +11,10 @@ Commit: e234432bd99e1c4b07c24d1dd247977226a7516a
|
||||
This patch is Powered by Xaero Map
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 44abb103462dc5a2718b3112e94342c39dead554..5075e22ae84191b3d94ce7a8bcbf0ef7735e7f28 100644
|
||||
index 1fd31b5e3ecab5627a33660add036e232c311074..53a2891015a5122cb3194ef06ce3a5e3dfd798c5 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1314,6 +1314,7 @@ public abstract class PlayerList {
|
||||
@@ -1315,6 +1315,7 @@ public abstract class PlayerList {
|
||||
player.connection.send(new ClientboundInitializeBorderPacket(worldborder));
|
||||
player.connection.send(new ClientboundSetTimePacket(world.getGameTime(), world.getDayTime(), world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)));
|
||||
player.connection.send(new ClientboundSetDefaultSpawnPositionPacket(world.getSharedSpawnPos(), world.getSharedSpawnAngle()));
|
||||
|
||||
@@ -27,13 +27,13 @@ index 26a2dbc431146828a79c34543bdabca877b6fa42..37a7fdb543cb39d67716bdbca306d700
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
index 848452ba2068c9b0ec6e253da0d0ef10fdec48b0..f702131a5ac60936257816c3d6549853e6079f0b 100644
|
||||
index 4a13566621613f28a0a69b925c60fc211231f91e..465257cd16b2e46012777dd1915a6059612e44c8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -85,6 +85,38 @@ public class AcquirePoi {
|
||||
)
|
||||
.limit(5L)
|
||||
.collect(Collectors.toSet());
|
||||
io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), world.purpurConfig.villagerAcquirePoiSearchRadius, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); // Purpur
|
||||
Set<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes);
|
||||
// Paper end - optimise POI access
|
||||
+ // Kaiiju start - petal - Async path processing
|
||||
+ if (org.dreeam.leaf.config.modules.async.AsyncPathfinding.enabled) {
|
||||
+ // await on path async
|
||||
@@ -468,16 +468,16 @@ index ce7398a617abe6e800c1e014b3ac5c970eb15c8a..dbf43209417d8453ff39839392eba45b
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
index 222c87e80cb089867ce9a7d2dceebe21b4bfe0de..e57b60f1656d80d1307f0c9b000358a2598b7c75 100644
|
||||
index 51fbe27281a9d5d8af1b0fa19d3ffa44f04dedc3..2258eedf6d58097782f092ffda5e6cc954530935 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
@@ -57,6 +57,25 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||
holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), world.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY
|
||||
)
|
||||
.collect(Collectors.toSet());
|
||||
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
// don't ask me why it's unbounded. ask mojang.
|
||||
io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), world.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes);
|
||||
+ // Kaiiju start - await on async path processing
|
||||
+ if (org.dreeam.leaf.config.modules.async.AsyncPathfinding.enabled) {
|
||||
+ Path possiblePath = AcquirePoi.findPathToPois(entity, set);
|
||||
+ Path possiblePath = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
||||
+ org.dreeam.leaf.async.path.AsyncPathProcessor.awaitProcessing(entity, possiblePath, path -> {
|
||||
+ // read canReach check
|
||||
+ if ((path == null || !path.canReach()) && this.triedCount < 5) {
|
||||
@@ -494,10 +494,10 @@ index 222c87e80cb089867ce9a7d2dceebe21b4bfe0de..e57b60f1656d80d1307f0c9b000358a2
|
||||
+ });
|
||||
+ } else {
|
||||
+ // Kaiiju end
|
||||
Path path = AcquirePoi.findPathToPois(entity, set);
|
||||
Path path = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
||||
// Paper end - optimise POI access
|
||||
if (path != null && path.canReach()) {
|
||||
BlockPos blockPos = path.getTarget();
|
||||
@@ -67,6 +86,7 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||
@@ -68,6 +87,7 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||
} else if (this.triedCount < 5) {
|
||||
this.batchCache.long2LongEntrySet().removeIf(entry -> entry.getLongValue() < this.lastUpdate);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ index a74732902c0494c67e6acf2fc04581ff9c46b832..8b60c922750e71f526976782a1f156e9
|
||||
LivingEntity entityliving1 = deadEntity.getLastHurtByMob();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 95f306d6d896e6aa4ada7ee20880ed862e0e48d8..b30badb7c7806ef2f1672a0a89b0e3f4287ff382 100644
|
||||
index 873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503..353f33b9562f87498ba6d0e303774c67bcf56189 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -81,7 +81,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -61,7 +61,7 @@ index 95f306d6d896e6aa4ada7ee20880ed862e0e48d8..b30badb7c7806ef2f1672a0a89b0e3f4
|
||||
private final LevelChunkTicks<Block> blockTicks;
|
||||
private final LevelChunkTicks<Fluid> fluidTicks;
|
||||
|
||||
@@ -93,7 +104,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -105,7 +116,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
super(pos, upgradeData, world, net.minecraft.server.MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.BIOME), inhabitedTime, sectionArrayInitializer, blendingData); // Paper - Anti-Xray - The world isn't ready yet, use server singleton for registry
|
||||
this.tickersInLevel = Maps.newHashMap();
|
||||
this.level = (ServerLevel) world; // CraftBukkit - type
|
||||
@@ -70,7 +70,7 @@ index 95f306d6d896e6aa4ada7ee20880ed862e0e48d8..b30badb7c7806ef2f1672a0a89b0e3f4
|
||||
Heightmap.Types[] aheightmap_type = Heightmap.Types.values();
|
||||
int j = aheightmap_type.length;
|
||||
|
||||
@@ -197,9 +208,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -210,9 +221,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
Level world = this.level;
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
@@ -97,7 +97,7 @@ index 95f306d6d896e6aa4ada7ee20880ed862e0e48d8..b30badb7c7806ef2f1672a0a89b0e3f4
|
||||
} else {
|
||||
return super.getListenerRegistry(ySectionCoord);
|
||||
}
|
||||
@@ -583,7 +608,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -596,7 +621,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
|
||||
private void removeGameEventListenerRegistry(int ySectionCoord) {
|
||||
|
||||
@@ -7,10 +7,10 @@ Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Co-authored by: MachineBreaker <machinebreaker>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index e49a3c0d803caf00070b21422bfa97bdc9ba30bc..338a8b4eff661e18892c3f044e53f0ed4436be6c 100644
|
||||
index 61d2244031e4cf3116683acc88b0d84b5acf52cb..0d7ee7ab6cf9f91a46a03d8741917282fe2b966f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -424,17 +424,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -431,17 +431,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
for (int i = 0, len = entities.size(); i < len; ++i) {
|
||||
Entity entity = entities.get(i);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ index 9c6f5b55b1f1376fa75e216cd366ee47c79fafc4..7762c8186035fdf60e11d9f1844516b6
|
||||
static RandomSource createThreadSafe() {
|
||||
return new ThreadSafeLegacyRandomSource(RandomSupport.generateUniqueSeed());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 338a8b4eff661e18892c3f044e53f0ed4436be6c..8c6ec4d8f30aa67f5fc3277d3286e33874aaf395 100644
|
||||
index 0d7ee7ab6cf9f91a46a03d8741917282fe2b966f..e3c7627e69679d50c3b288d9993f02ba57079b29 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -127,6 +127,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -34,22 +34,23 @@ index 338a8b4eff661e18892c3f044e53f0ed4436be6c..8c6ec4d8f30aa67f5fc3277d3286e338
|
||||
@Deprecated
|
||||
private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index d556089907bb695a9d87df1961ef0b0ae4382cad..bac9e491f18edaec4d441e415938db2a1f0ba503 100644
|
||||
index 885d7c9ef96dd3c7576c28606e5ab83d2a75de71..455e7958ddec5f6c2f3090aa3d6994385e9482bc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -405,11 +405,12 @@ public final class NaturalSpawner {
|
||||
@@ -405,12 +405,14 @@ public final class NaturalSpawner {
|
||||
|
||||
private static BlockPos getRandomPosWithin(Level world, LevelChunk chunk) {
|
||||
private static BlockPos getRandomPosWithin(ServerLevel world, LevelChunk chunk) { // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - accept ServerLevel
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
- int i = chunkcoordintpair.getMinBlockX() + world.random.nextInt(16);
|
||||
- int j = chunkcoordintpair.getMinBlockZ() + world.random.nextInt(16);
|
||||
+ // Leaf start - Generate random seed faster
|
||||
// Gale start - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
- int i = chunkcoordintpair.getMinBlockX() + world.randomTickRandom.nextInt(16);
|
||||
- int j = chunkcoordintpair.getMinBlockZ() + world.randomTickRandom.nextInt(16);
|
||||
+ int i = chunkcoordintpair.getMinBlockX() + world.randomFaster.nextInt(16);
|
||||
+ int j = chunkcoordintpair.getMinBlockZ() + world.randomFaster.nextInt(16);
|
||||
// Gale end - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
int k = chunk.getHeight(Heightmap.Types.WORLD_SURFACE, i, j) + 1;
|
||||
- int l = Mth.randomBetweenInclusive(world.random, world.getMinBuildHeight(), k);
|
||||
-
|
||||
+ int l = Mth.randomBetweenInclusive(world.randomFaster, world.getMinBuildHeight(), k);
|
||||
- int l = Mth.randomBetweenInclusive(world.randomTickRandom, world.getMinBuildHeight(), k); // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
+ int l = Mth.randomBetweenInclusive(world.randomFaster, world.getMinBuildHeight(), k); // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
+ // Leaf end - Generate random seed faster
|
||||
return new BlockPos(i, l, j);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ Replace `thenApply` with `thenCompose`. Once one task is completed then the next
|
||||
to prevent blocking threads while waiting to complete all tasks. But may cause the sequence of future compose disorder.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
||||
index 42d7ecfab6f72517904451d9df3f0404b176fdb2..37888505f6f4af5e6ecf76396531439bce63644e 100644
|
||||
index 5869f2f5c72f736e6b077683327c64b9e0e0c733..ad40341f7a2cbed895b25d8de288f034626ed417 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -489,13 +489,27 @@ public class Util {
|
||||
@@ -490,13 +490,27 @@ public class Util {
|
||||
return object;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ index 62484ebf4550b05182f693a3180bbac5d5fd906d..67800e426445060a8343e27a7452b8d7
|
||||
throw new IllegalStateException("Ticking retired scheduler");
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3d6be33c3310da2bfacba887e8ba12840d2f811c..ef14203da6f9d0f5cad4335c98095522209023cd 100644
|
||||
index a43a139100bb69e4aef0e85933146dfcf88f03ca..2cf519e48ded94a23579120d65169f09a2889f8a 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -86,7 +86,7 @@ index 3d6be33c3310da2bfacba887e8ba12840d2f811c..ef14203da6f9d0f5cad4335c98095522
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@@ -1663,6 +1664,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1726,6 +1727,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
@@ -105,7 +105,7 @@ index 3d6be33c3310da2bfacba887e8ba12840d2f811c..ef14203da6f9d0f5cad4335c98095522
|
||||
getAllLevels().forEach(level -> {
|
||||
for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
|
||||
if (entity.isRemoved()) {
|
||||
@@ -1674,6 +1687,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1737,6 +1750,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix MC-2025
|
||||
Mojang issues: https://bugs.mojang.com/browse/MC-2025
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a270eb3b94ffc439499c0dcf37c7a35f3d5700ac..0f7dba6335cc85b8fcc814bbc6fdeaf37ccef48f 100644
|
||||
index 83ee59ff3d61f65fe354f7429d352929b077f23f..37e65d66ba5da001322924a3f00fc948aab0d91d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2529,6 +2529,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2530,6 +2530,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
// Purpur end
|
||||
nbttagcompound.put("Leaves.Data", leavesData); // Leaves - leaves ex data
|
||||
@@ -26,7 +26,7 @@ index a270eb3b94ffc439499c0dcf37c7a35f3d5700ac..0f7dba6335cc85b8fcc814bbc6fdeaf3
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2606,6 +2616,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2607,6 +2617,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.reapplyPosition();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove useless creating stats json bases on player name logic
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 5075e22ae84191b3d94ce7a8bcbf0ef7735e7f28..cc1039af787cff402afc54edbd53a3f271f66cd2 100644
|
||||
index 53a2891015a5122cb3194ef06ce3a5e3dfd798c5..47e640a8be96f5e415a1ec8655b4eb7c64604a99 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1518,6 +1518,8 @@ public abstract class PlayerList {
|
||||
@@ -1519,6 +1519,8 @@ public abstract class PlayerList {
|
||||
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
|
||||
File file1 = new File(file, String.valueOf(uuid) + ".json");
|
||||
|
||||
@@ -17,7 +17,7 @@ index 5075e22ae84191b3d94ce7a8bcbf0ef7735e7f28..cc1039af787cff402afc54edbd53a3f2
|
||||
if (!file1.exists()) {
|
||||
File file2 = new File(file, displayName + ".json"); // CraftBukkit
|
||||
Path path = file2.toPath();
|
||||
@@ -1526,6 +1528,8 @@ public abstract class PlayerList {
|
||||
@@ -1527,6 +1529,8 @@ public abstract class PlayerList {
|
||||
file2.renameTo(file1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,10 +117,10 @@ index ae0d0310d50f1ada082e045a58a24a43f8079da8..eea19f895588c51bce86f20b3ec505fd
|
||||
if (packet == null || this.processedDisconnect) { // Spigot
|
||||
return;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index a10185c655e22d03f2756582d4628e3da1775c85..230eef32faed2c7744447e23f5608790c1d491a8 100644
|
||||
index 7ec41f90aede76efd11aa7ea0aa5bf3abcbeda93..b665969cf7232a4bbc060c91b1cf802df3b0c908 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1472,7 +1472,7 @@ public abstract class PlayerList {
|
||||
@@ -1473,7 +1473,7 @@ public abstract class PlayerList {
|
||||
// Paper end
|
||||
boolean flag = this.verifyChatTrusted(message);
|
||||
|
||||
@@ -129,7 +129,7 @@ index a10185c655e22d03f2756582d4628e3da1775c85..230eef32faed2c7744447e23f5608790
|
||||
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
|
||||
boolean flag1 = false;
|
||||
|
||||
@@ -1501,6 +1501,7 @@ public abstract class PlayerList {
|
||||
@@ -1502,6 +1502,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 230eef32faed2c7744447e23f5608790c1d491a8..180b50c9c23c6934d3e99500a25635df32f7169c 100644
|
||||
index b665969cf7232a4bbc060c91b1cf802df3b0c908..44b05a126360072f1966d7f0d2a822fd84ada921 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -26,6 +26,7 @@ import java.util.UUID;
|
||||
@@ -43,7 +43,7 @@ index 230eef32faed2c7744447e23f5608790c1d491a8..180b50c9c23c6934d3e99500a25635df
|
||||
this.cserver.getPluginManager().callEvent(playerQuitEvent);
|
||||
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
|
||||
|
||||
@@ -1645,4 +1646,29 @@ public abstract class PlayerList {
|
||||
@@ -1646,4 +1647,29 @@ public abstract class PlayerList {
|
||||
public boolean isAllowCommandsForAllPlayers() {
|
||||
return this.allowCommandsForAllPlayers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user