More more more more more more more more more more more work

This commit is contained in:
Nassim Jahnke 2021-11-24 12:38:00 +01:00 committed by MiniDigger | Martin
parent 0358549f7b
commit 8f67d293a2
48 changed files with 238 additions and 240 deletions

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ea67d9e95f0c9ca0b0ae3afba67563e43743abec..396e3e32e71a310702cb5d8138e1ee378656d10e 100644 index ddaee386c6039eabb349481c2a66ec1292d0bfde..93f6168f2748f127d94a13a3c92e257135bfc534 100644
--- a/src/main/java/org/bukkit/Bukkit.java --- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java
@@ -119,6 +119,18 @@ public final class Bukkit { @@ -133,6 +133,18 @@ public final class Bukkit {
return server.getBukkitVersion(); return server.getBukkitVersion();
} }
@ -28,10 +28,10 @@ index ea67d9e95f0c9ca0b0ae3afba67563e43743abec..396e3e32e71a310702cb5d8138e1ee37
* Gets a view of all currently logged in players. This {@linkplain * Gets a view of all currently logged in players. This {@linkplain
* Collections#unmodifiableCollection(Collection) view} is a reused * Collections#unmodifiableCollection(Collection) view} is a reused
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 451a75c2716b23ca61ff53927d594034493da359..f9fe3c20b749acf89c7ea78e73a11a96448940d7 100644 index dd263faad52612a076847c717582e8fc09dc3345..3b370b0cefe2debacb187d74e8c47ae56c7397e1 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -98,6 +98,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -110,6 +110,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull @NotNull
public String getBukkitVersion(); public String getBukkitVersion();

View file

@ -227,10 +227,10 @@ index 0000000000000000000000000000000000000000..e21f7574763dd4f13794f91bbef192ef
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..fb0c77c66ca117eaff9487a41f1e280afe6253c6 index 0000000000000000000000000000000000000000..2405254739a83b2fb517da7fa4ea0721c68f9f6d
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java +++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -0,0 +1,288 @@ @@ -0,0 +1,289 @@
+package com.destroystokyo.paper.entity.ai; +package com.destroystokyo.paper.entity.ai;
+ +
+import com.destroystokyo.paper.entity.RangedEntity; +import com.destroystokyo.paper.entity.RangedEntity;
@ -428,6 +428,7 @@ index 0000000000000000000000000000000000000000..fb0c77c66ca117eaff9487a41f1e280a
+ GoalKey<Raider> OBTAIN_RAID_LEADER_BANNER = GoalKey.of(Raider.class, NamespacedKey.minecraft("obtain_raid_leader_banner")); + GoalKey<Raider> OBTAIN_RAID_LEADER_BANNER = GoalKey.of(Raider.class, NamespacedKey.minecraft("obtain_raid_leader_banner"));
+ GoalKey<Raider> RAIDER_CELEBRATION = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_celebration")); + GoalKey<Raider> RAIDER_CELEBRATION = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_celebration"));
+ GoalKey<Raider> RAIDER_MOVE_THROUGH_VILLAGE = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_move_through_village")); + GoalKey<Raider> RAIDER_MOVE_THROUGH_VILLAGE = GoalKey.of(Raider.class, NamespacedKey.minecraft("raider_move_through_village"));
+ GoalKey<Creature> PARROT_WANDER = GoalKey.of(Creature.class, NamespacedKey.minecraft("parrot_wander"));
+ +
+ /** + /**
+ * @deprecated removed in 1.16 + * @deprecated removed in 1.16
@ -520,10 +521,10 @@ index 0000000000000000000000000000000000000000..fb0c77c66ca117eaff9487a41f1e280a
+ @Deprecated GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset")); + @Deprecated GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset"));
+} +}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 796f72b1026371fff09e8ce60536d30609987449..84dc57bc02d1496afc3fe3df0b94417079c2ee6b 100644 index 93f6168f2748f127d94a13a3c92e257135bfc534..338f0938fbae7eec6cecaf3f1cd30d3e27ad40d6 100644
--- a/src/main/java/org/bukkit/Bukkit.java --- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2007,6 +2007,16 @@ public final class Bukkit { @@ -2033,6 +2033,16 @@ public final class Bukkit {
public static boolean isStopping() { public static boolean isStopping() {
return server.isStopping(); return server.isStopping();
} }
@ -541,10 +542,10 @@ index 796f72b1026371fff09e8ce60536d30609987449..84dc57bc02d1496afc3fe3df0b944170
@NotNull @NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 552b56995ffb0898ffd459e0175af57341f39f46..3633fcb9155e35479005bfa0c13661b1c9fa726a 100644 index 3b370b0cefe2debacb187d74e8c47ae56c7397e1..5a98eaeafafc11a7f925701187fc96eb5c675efe 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -1761,5 +1761,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -1783,5 +1783,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return true if server is in the process of being shutdown * @return true if server is in the process of being shutdown
*/ */
boolean isStopping(); boolean isStopping();

View file

@ -8,49 +8,49 @@ so inline where possible, and avoid the abstraction of the
Either class. Either class.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 89e88a1de65a5724d05e926cd41733c9cd6cd740..09d06ffb0d3c9920f80843c65e2d0831b9d94f95 100644 index cdacb26699a54659d1e43ec0f73640556a743700..32bfde94533fcba205e0de3bc55baa8359f8fae6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2118,15 +2118,18 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2136,15 +2136,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
public boolean isPositionTickingWithEntitiesLoaded(BlockPos blockposition) { }
long i = ChunkPos.asLong(blockposition);
- return this.chunkSource.isPositionTicking(i) && this.areEntitiesLoaded(i); private boolean isPositionTickingWithEntitiesLoaded(long chunkPos) {
- return this.areEntitiesLoaded(chunkPos) && this.chunkSource.isPositionTicking(chunkPos);
+ // Paper start - optimize is ticking ready type functions + // Paper start - optimize is ticking ready type functions
+ ChunkHolder chunkHolder = this.chunkSource.chunkMap.getVisibleChunkIfPresent(i); + ChunkHolder chunkHolder = this.chunkSource.chunkMap.getVisibleChunkIfPresent(chunkPos);
+ return chunkHolder != null && chunkHolder.isTickingReady() && this.areEntitiesLoaded(i); + return chunkHolder != null && chunkHolder.isTickingReady() && this.areEntitiesLoaded(chunkPos);
+ // Paper end + // Paper end
} }
public boolean isPositionEntityTicking(BlockPos blockposition) { public boolean isPositionEntityTicking(BlockPos pos) {
- return this.entityManager.isPositionTicking(blockposition); - return this.entityManager.isPositionTicking(pos);
+ return this.entityManager.isPositionTicking(ChunkPos.asLong(blockposition)); // Paper + return this.entityManager.isPositionTicking(ChunkPos.asLong(pos)); // Paper
} }
public boolean isPositionEntityTicking(ChunkPos chunkcoordintpair) { public boolean isPositionEntityTicking(ChunkPos pos) {
- return this.entityManager.isPositionTicking(chunkcoordintpair); - return this.entityManager.isPositionTicking(pos);
+ return this.entityManager.isPositionTicking(chunkcoordintpair.toLong()); // Paper + return this.entityManager.isPositionTicking(pos.toLong()); // Paper
} }
private final class EntityCallbacks implements LevelCallback<Entity> { private final class EntityCallbacks implements LevelCallback<Entity> {
diff --git a/src/main/java/net/minecraft/world/level/ChunkPos.java b/src/main/java/net/minecraft/world/level/ChunkPos.java diff --git a/src/main/java/net/minecraft/world/level/ChunkPos.java b/src/main/java/net/minecraft/world/level/ChunkPos.java
index 439f82a48e6f6ce7b4773505ced32324cacb302d..2a99aa989ac5c19d99bb3cbc0934425e46573cd7 100644 index 18c8988dcb5b475c8738a313f1775b73c9d961f4..32037377737cd45fa55ecbe19c201f424a127714 100644
--- a/src/main/java/net/minecraft/world/level/ChunkPos.java --- a/src/main/java/net/minecraft/world/level/ChunkPos.java
+++ b/src/main/java/net/minecraft/world/level/ChunkPos.java +++ b/src/main/java/net/minecraft/world/level/ChunkPos.java
@@ -48,7 +48,7 @@ public class ChunkPos { @@ -49,7 +49,7 @@ public class ChunkPos {
} }
public static long asLong(BlockPos blockPos) { public static long asLong(BlockPos pos) {
- return asLong(SectionPos.blockToSectionCoord(blockPos.getX()), SectionPos.blockToSectionCoord(blockPos.getZ())); - return asLong(SectionPos.blockToSectionCoord(pos.getX()), SectionPos.blockToSectionCoord(pos.getZ()));
+ return (((long)blockPos.getX() >> 4) & 4294967295L) | ((((long)blockPos.getZ() >> 4) & 4294967295L) << 32); // Paper - inline + return (((long)pos.getX() >> 4) & 4294967295L) | ((((long)pos.getZ() >> 4) & 4294967295L) << 32); // Paper - inline
} }
public static int getX(long pos) { public static int getX(long pos) {
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
index be65a8a5a853d4e014d44730a48ccf247acf08d2..573e5ba276d270b8f67727dc1fbe6bfd7f2a28b1 100644 index e19f5b2c8f485d596a64d5d96e75fa1f4a8255b5..ccafd28e3dc9a03f310eb5bdde85fcb277ef5116 100644
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java --- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java +++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
@@ -389,6 +389,11 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A @@ -383,6 +383,11 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
public LevelEntityGetter<T> getEntityGetter() { public LevelEntityGetter<T> getEntityGetter() {
return this.entityGetter; return this.entityGetter;
} }
@ -60,5 +60,5 @@ index be65a8a5a853d4e014d44730a48ccf247acf08d2..573e5ba276d270b8f67727dc1fbe6bfd
+ } + }
+ // Paper end + // Paper end
public boolean isPositionTicking(BlockPos blockposition) { public boolean isPositionTicking(BlockPos pos) {
return ((Visibility) this.chunkVisibility.get(ChunkPos.asLong(blockposition))).isTicking(); return ((Visibility) this.chunkVisibility.get(ChunkPos.asLong(pos))).isTicking();

View file

@ -30,7 +30,7 @@ index 79f2b3942a3ccccd8fe8719db12de458212e8659..d113b4835e86a789c0ba124eb839e1c5
@@ -205,15 +206,9 @@ public class ChunkSerializer { @@ -205,15 +206,9 @@ public class ChunkSerializer {
object2 = protochunkticklist1; object2 = protochunkticklist1;
} }
- object = new LevelChunk(world.getLevel(), pos, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, k, achunksection, (chunk) -> { - object = new LevelChunk(world.getLevel(), pos, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, k, achunksection, (chunk) -> {
- ChunkSerializer.postLoadChunk(world, nbttagcompound1, chunk); - ChunkSerializer.postLoadChunk(world, nbttagcompound1, chunk);
- // CraftBukkit start - load chunk persistent data from nbt - // CraftBukkit start - load chunk persistent data from nbt
@ -45,7 +45,7 @@ index 79f2b3942a3ccccd8fe8719db12de458212e8659..d113b4835e86a789c0ba124eb839e1c5
+ );// Paper end + );// Paper end
} else { } else {
ProtoChunk protochunk = new ProtoChunk(pos, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, world, world); // Paper - add level ProtoChunk protochunk = new ProtoChunk(pos, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, world, world); // Paper - add level
@@ -319,6 +314,50 @@ public class ChunkSerializer { @@ -319,6 +314,50 @@ public class ChunkSerializer {
return new InProgressChunkHolder(protochunk1, tasksToExecuteOnMain); // Paper - Async chunk loading return new InProgressChunkHolder(protochunk1, tasksToExecuteOnMain); // Paper - Async chunk loading
} }

View file

@ -17,11 +17,11 @@ This allows servers with smaller worlds who do less long distance exploring to s
wasting cpu cycles on saving/unloading/reloading chunks repeatedly. wasting cpu cycles on saving/unloading/reloading chunks repeatedly.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index c0805c5bafbe3ae9da00969796c7ee4cc791249d..c0bb172aeaabcaa05aa4b05353f345d6d8501769 100644 index a5361e1dba7c025667c7627b8851655bba2c9c6a..ef50517fa00fd219e05c4a725350a78635604b2f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -575,6 +575,15 @@ public class PaperWorldConfig { @@ -545,6 +545,15 @@ public class PaperWorldConfig {
this.noTickViewDistance = this.getInt("viewdistances.no-tick-view-distance", -1); lightQueueSize = getInt("light-queue-size", lightQueueSize);
} }
+ public long delayChunkUnloadsBy; + public long delayChunkUnloadsBy;
@ -37,10 +37,10 @@ index c0805c5bafbe3ae9da00969796c7ee4cc791249d..c0bb172aeaabcaa05aa4b05353f345d6
public java.util.Map<org.bukkit.Material, Integer> altItemDespawnRateMap; public java.util.Map<org.bukkit.Material, Integer> altItemDespawnRateMap;
private void altItemDespawnRate() { private void altItemDespawnRate() {
diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java diff --git a/src/main/java/net/minecraft/server/level/DistanceManager.java b/src/main/java/net/minecraft/server/level/DistanceManager.java
index 577b391dcba1db712c1e2c83296e1c87b3e34ab2..d94241bcca4f2fd5e464a860bd356af504dc68b7 100644 index 1a6c75a33c6dfec63eabef0b8a0a5d8812aeeb4c..fb570511f2e12cb3794d32fa72b6fb886e6f1199 100644
--- a/src/main/java/net/minecraft/server/level/DistanceManager.java --- a/src/main/java/net/minecraft/server/level/DistanceManager.java
+++ b/src/main/java/net/minecraft/server/level/DistanceManager.java +++ b/src/main/java/net/minecraft/server/level/DistanceManager.java
@@ -181,6 +181,27 @@ public abstract class DistanceManager { @@ -195,6 +195,27 @@ public abstract class DistanceManager {
boolean removed = false; // CraftBukkit boolean removed = false; // CraftBukkit
if (arraysetsorted.remove(ticket)) { if (arraysetsorted.remove(ticket)) {
removed = true; // CraftBukkit removed = true; // CraftBukkit

View file

@ -11,10 +11,10 @@ This will drastically cut down on packet sending cost for worlds with
lots of players in them. lots of players in them.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 004381c9a7366b6caabc14160ec6ff58874c75af..60abb3e64c083a6867c242a473d0d7049c1eb1cd 100644 index c2cc59f476a67224774503009439fec2ad1ec62d..54cbcea8e3eb4d2fdeced2ebc3c4819af429da9d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1138,16 +1138,40 @@ public abstract class PlayerList { @@ -1134,16 +1134,40 @@ public abstract class PlayerList {
} }
public void broadcast(@Nullable net.minecraft.world.entity.player.Player player, double x, double y, double z, double distance, ResourceKey<Level> worldKey, Packet<?> packet) { public void broadcast(@Nullable net.minecraft.world.entity.player.Player player, double x, double y, double z, double distance, ResourceKey<Level> worldKey, Packet<?> packet) {

View file

@ -25,18 +25,18 @@ This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps. for heightmaps.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 41f8afe938ea4fc9ceb4e57867bde5ae9aa6530e..291b7bd1c7951293d76b8bab399450628cd51d39 100644 index 0758f0983c17e7e4b5b5aea64ea12e990f7a22e4..f3021f34a73c11ad2e181deda8a43d026280bef0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -168,6 +168,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -172,6 +172,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}; };
// CraftBukkit end // CraftBukkit end
+ final CallbackExecutor chunkLoadConversionCallbackExecutor = new CallbackExecutor(); // Paper + final CallbackExecutor chunkLoadConversionCallbackExecutor = new CallbackExecutor(); // Paper
// Paper start - distance maps // Paper start - distance maps
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
// Paper start - no-tick view distance
@@ -1056,7 +1057,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -976,7 +977,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return Either.left(chunk); return Either.left(chunk);
}); });
}, (runnable) -> { }, (runnable) -> {
@ -46,10 +46,10 @@ index 41f8afe938ea4fc9ceb4e57867bde5ae9aa6530e..291b7bd1c7951293d76b8bab39945062
completablefuture1.thenAcceptAsync((either) -> { completablefuture1.thenAcceptAsync((either) -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index ec0d8e58a518a20634b902769251d6d04750433e..fe9711daa67151187906128c9d07ad967b72e677 100644 index 2f31cae237b74e8281142c5ccf9ac4272607b8eb..d56eb5071ed3ae2b9d5636cafb3aca9b2cd71d15 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -1136,6 +1136,7 @@ public class ServerChunkCache extends ChunkSource { @@ -1137,6 +1137,7 @@ public class ServerChunkCache extends ChunkSource {
return super.pollTask() || execChunkTask; // Paper return super.pollTask() || execChunkTask; // Paper
} }
} finally { } finally {

View file

@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick
delays anymore. delays anymore.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 291b7bd1c7951293d76b8bab399450628cd51d39..3a546b879d093702e36118231020cf41fe972410 100644 index f3021f34a73c11ad2e181deda8a43d026280bef0..5592f879ef2c1b8f15bc63b38edb57f19e9d589d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1566,6 +1566,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1555,6 +1555,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
.printStackTrace(); .printStackTrace();
return; return;
} }
@ -40,10 +40,10 @@ index 291b7bd1c7951293d76b8bab399450628cd51d39..3a546b879d093702e36118231020cf41
if (!(entity instanceof EnderDragonPart)) { if (!(entity instanceof EnderDragonPart)) {
EntityType<?> entitytypes = entity.getType(); EntityType<?> entitytypes = entity.getType();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 2f102c6160a01177820c3b82dce138c71a492526..4433734f070cecbec058648a619b10567e44eeab 100644 index cdb0eb8e21299ca70ed7ed5c1195d07f44e47838..6d59a813aa752b4233dbe1894cfc8273473c24e9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -243,6 +243,7 @@ public class ServerPlayer extends Player { @@ -246,6 +246,7 @@ public class ServerPlayer extends Player {
public double maxHealthCache; public double maxHealthCache;
public boolean joining = true; public boolean joining = true;
public boolean sentListPacket = false; public boolean sentListPacket = false;
@ -52,12 +52,12 @@ index 2f102c6160a01177820c3b82dce138c71a492526..4433734f070cecbec058648a619b1056
// CraftBukkit end // CraftBukkit end
public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d..9609579e6d61c3975740d07a394680aeef952516 100644 index ccf03feb976d22f8c4ca4f60b6bc1d1d773c485f..492fc4e450b961e4d3421da88fcf8c1737bc3ded 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -277,6 +277,12 @@ public abstract class PlayerList { @@ -276,6 +276,12 @@ public abstract class PlayerList {
this.playersByUUID.put(player.getUUID(), player); this.playersByUUID.put(player.getUUID(), player);
// this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{entityplayer})); // CraftBukkit - replaced with loop below // this.broadcastAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, new EntityPlayer[]{entityplayer})); // CraftBukkit - replaced with loop below
+ // Paper start - correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks + // Paper start - correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks
+ player.supressTrackerForLogin = true; + player.supressTrackerForLogin = true;
@ -68,8 +68,8 @@ index c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d..9609579e6d61c3975740d07a394680ae
// CraftBukkit start // CraftBukkit start
CraftPlayer bukkitPlayer = player.getBukkitEntity(); CraftPlayer bukkitPlayer = player.getBukkitEntity();
@@ -317,6 +323,8 @@ public abstract class PlayerList { @@ -316,6 +322,8 @@ public abstract class PlayerList {
player.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[] { entityplayer1})); player.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[]{entityplayer1}));
} }
player.sentListPacket = true; player.sentListPacket = true;
+ player.supressTrackerForLogin = false; // Paper + player.supressTrackerForLogin = false; // Paper
@ -77,7 +77,7 @@ index c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d..9609579e6d61c3975740d07a394680ae
// CraftBukkit end // CraftBukkit end
player.connection.send(new ClientboundSetEntityDataPacket(player.getId(), player.getEntityData(), true)); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn player.connection.send(new ClientboundSetEntityDataPacket(player.getId(), player.getEntityData(), true)); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn
@@ -342,6 +350,11 @@ public abstract class PlayerList { @@ -341,6 +349,11 @@ public abstract class PlayerList {
playerconnection.send(new ClientboundUpdateMobEffectPacket(player.getId(), mobeffect)); playerconnection.send(new ClientboundUpdateMobEffectPacket(player.getId(), mobeffect));
} }
@ -89,7 +89,7 @@ index c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d..9609579e6d61c3975740d07a394680ae
if (nbttagcompound != null && nbttagcompound.contains("RootVehicle", 10)) { if (nbttagcompound != null && nbttagcompound.contains("RootVehicle", 10)) {
CompoundTag nbttagcompound1 = nbttagcompound.getCompound("RootVehicle"); CompoundTag nbttagcompound1 = nbttagcompound.getCompound("RootVehicle");
// CraftBukkit start // CraftBukkit start
@@ -390,6 +403,10 @@ public abstract class PlayerList { @@ -389,6 +402,10 @@ public abstract class PlayerList {
} }
} }
@ -100,7 +100,7 @@ index c6d7d546ca79f71aadafe92d5d91f7ace8a07a0d..9609579e6d61c3975740d07a394680ae
player.initInventoryMenu(); player.initInventoryMenu();
// CraftBukkit - Moved from above, added world // CraftBukkit - Moved from above, added world
// Paper start - Add to collideRule team if needed // Paper start - Add to collideRule team if needed
@@ -399,6 +416,7 @@ public abstract class PlayerList { @@ -398,6 +415,7 @@ public abstract class PlayerList {
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
} }
// Paper end // Paper end

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 4433734f070cecbec058648a619b10567e44eeab..40692f3559eec910a653e89d3bc199fb9f17db27 100644 index 6d59a813aa752b4233dbe1894cfc8273473c24e9..beebb7a0e6b8b1fa4e7d2f9fdf1962357cc2ebc3 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -178,6 +178,7 @@ public class ServerPlayer extends Player { @@ -174,6 +174,7 @@ public class ServerPlayer extends Player {
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection; public ServerGamePacketListenerImpl connection;
@ -16,7 +16,7 @@ index 4433734f070cecbec058648a619b10567e44eeab..40692f3559eec910a653e89d3bc199fb
public final MinecraftServer server; public final MinecraftServer server;
public final ServerPlayerGameMode gameMode; public final ServerPlayerGameMode gameMode;
private final PlayerAdvancements advancements; private final PlayerAdvancements advancements;
@@ -244,6 +245,7 @@ public class ServerPlayer extends Player { @@ -247,6 +248,7 @@ public class ServerPlayer extends Player {
public boolean joining = true; public boolean joining = true;
public boolean sentListPacket = false; public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper public boolean supressTrackerForLogin = false; // Paper
@ -37,10 +37,10 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8
public static final TicketType<ChunkPos> UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1); public static final TicketType<ChunkPos> UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1);
public static final TicketType<Unit> PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit public static final TicketType<Unit> PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d4fac789cebd17e7b244002a7382d94cf0d80bb2..f585cd4f4682a9d2a6ebc2367a32995d8660d591 100644 index 97c67fe091b2042a3aa98cc53d5e1ea1163a0966..f2960cc42295833a788a22becfa28cca76e15930 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -220,6 +220,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -219,6 +219,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private static final int LATENCY_CHECK_INTERVAL = 15000; private static final int LATENCY_CHECK_INTERVAL = 15000;
public final Connection connection; public final Connection connection;
private final MinecraftServer server; private final MinecraftServer server;
@ -48,7 +48,7 @@ index d4fac789cebd17e7b244002a7382d94cf0d80bb2..f585cd4f4682a9d2a6ebc2367a32995d
public ServerPlayer player; public ServerPlayer player;
private int tickCount; private int tickCount;
private long keepAliveTime = Util.getMillis(); private long keepAliveTime = Util.getMillis();
@@ -294,6 +295,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -293,6 +294,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end // CraftBukkit end
public void tick() { public void tick() {
@ -64,7 +64,7 @@ index d4fac789cebd17e7b244002a7382d94cf0d80bb2..f585cd4f4682a9d2a6ebc2367a32995d
this.resetPosition(); this.resetPosition();
this.player.xo = this.player.getX(); this.player.xo = this.player.getX();
this.player.yo = this.player.getY(); this.player.yo = this.player.getY();
@@ -335,7 +345,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -334,7 +344,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.lastVehicle = null; this.lastVehicle = null;
this.clientVehicleIsFloating = false; this.clientVehicleIsFloating = false;
this.aboveGroundVehicleTickCount = 0; this.aboveGroundVehicleTickCount = 0;
@ -74,7 +74,7 @@ index d4fac789cebd17e7b244002a7382d94cf0d80bb2..f585cd4f4682a9d2a6ebc2367a32995d
this.server.getProfiler().push("keepAlive"); this.server.getProfiler().push("keepAlive");
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index b5d8987d2903086d69bbd6ba8092e568c94be63f..bd1203a5b58bac7cccf1f81337fa2967a0e9eb40 100644 index bb767f5b626225e70a8af273384bb74dbd21430d..301042e7a0d372a914f27ec0988dd938cf2a8262 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -88,7 +88,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -88,7 +88,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@ -94,12 +94,12 @@ index b5d8987d2903086d69bbd6ba8092e568c94be63f..bd1203a5b58bac7cccf1f81337fa2967
+ ServerPlayer entityplayer = this.server.getPlayerList().getActivePlayer(this.gameProfile.getId()); // Paper + ServerPlayer entityplayer = this.server.getPlayerList().getActivePlayer(this.gameProfile.getId()); // Paper
try { try {
ServerPlayer entityplayer1 = this.server.getPlayerList().processLogin(this.gameProfile, s); // CraftBukkit - add player reference ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a097670be5 100644 index 492fc4e450b961e4d3421da88fcf8c1737bc3ded..c2cc59f476a67224774503009439fec2ad1ec62d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -40,6 +40,7 @@ import net.minecraft.network.protocol.Packet; @@ -39,6 +39,7 @@ import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket; import net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket;
import net.minecraft.network.protocol.game.ClientboundChatPacket; import net.minecraft.network.protocol.game.ClientboundChatPacket;
import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket; import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket;
@ -107,7 +107,7 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
import net.minecraft.network.protocol.game.ClientboundEntityEventPacket; import net.minecraft.network.protocol.game.ClientboundEntityEventPacket;
import net.minecraft.network.protocol.game.ClientboundGameEventPacket; import net.minecraft.network.protocol.game.ClientboundGameEventPacket;
import net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket; import net.minecraft.network.protocol.game.ClientboundInitializeBorderPacket;
@@ -135,6 +136,7 @@ public abstract class PlayerList { @@ -134,6 +135,7 @@ public abstract class PlayerList {
private final IpBanList ipBans; private final IpBanList ipBans;
private final ServerOpList ops; private final ServerOpList ops;
private final UserWhiteList whitelist; private final UserWhiteList whitelist;
@ -136,7 +136,7 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
// CraftBukkit end // CraftBukkit end
if (nbttagcompound != null) { if (nbttagcompound != null) {
@@ -260,6 +267,52 @@ public abstract class PlayerList { @@ -259,6 +266,52 @@ public abstract class PlayerList {
player.getRecipeBook().sendInitialRecipeBook(player); player.getRecipeBook().sendInitialRecipeBook(player);
this.updateEntireScoreboard(worldserver1.getScoreboard(), player); this.updateEntireScoreboard(worldserver1.getScoreboard(), player);
this.server.invalidateStatus(); this.server.invalidateStatus();
@ -189,7 +189,7 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
TranslatableComponent chatmessage; TranslatableComponent chatmessage;
if (player.getGameProfile().getName().equalsIgnoreCase(s)) { if (player.getGameProfile().getName().equalsIgnoreCase(s)) {
@@ -503,6 +556,7 @@ public abstract class PlayerList { @@ -502,6 +555,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) { protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
@ -197,7 +197,7 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
this.playerIo.save(player); this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
@@ -530,7 +584,7 @@ public abstract class PlayerList { @@ -529,7 +583,7 @@ public abstract class PlayerList {
} }
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName()))); PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, com.destroystokyo.paper.PaperConfig.useDisplayNameInQuit ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
@ -206,7 +206,7 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
if (server.isSameThread()) entityplayer.doTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog) if (server.isSameThread()) entityplayer.doTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog)
@@ -575,6 +629,13 @@ public abstract class PlayerList { @@ -574,6 +628,13 @@ public abstract class PlayerList {
// this.advancements.remove(uuid); // this.advancements.remove(uuid);
// CraftBukkit end // CraftBukkit end
} }
@ -219,8 +219,8 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
+ // Paper end + // Paper end
// CraftBukkit start // CraftBukkit start
// this.sendAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer})); // this.broadcastAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer}));
@@ -592,7 +653,7 @@ public abstract class PlayerList { @@ -591,7 +652,7 @@ public abstract class PlayerList {
this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
// CraftBukkit end // CraftBukkit end
@ -229,7 +229,7 @@ index 9609579e6d61c3975740d07a394680aeef952516..6b23b9389ff92ae8016d4adb289ac2a0
} }
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
@@ -611,6 +672,13 @@ public abstract class PlayerList { @@ -610,6 +671,13 @@ public abstract class PlayerList {
list.add(entityplayer); list.add(entityplayer);
} }
} }

View file

@ -7,10 +7,10 @@ The code following this has better support for null worlds to move
them back to the world spawn. them back to the world spawn.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1164fc5915f0121b697ea10fac73919597902026..5802b1721a0d8e1c40d87be099d4f1b1c8a921d7 100644 index c7581c1b306d9c6498e18456d67f5acd067357e6..5a26fe2b8c468063618dd02056da43f001173812 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2010,9 +2010,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2038,9 +2038,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
bworld = server.getWorld(worldName); bworld = server.getWorld(worldName);
} }

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 478204aa91d33232f33708816fcc7ea2fe1b55d4..fab8098ce72feb9b08960e55ab1a4aebaae22276 100644 index ba3aae873c2bd23a1bb35bb7746907d0bcfd0dd3..6c4fd054a06830947dbb4728e62dc320a51f43f0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2040,7 +2040,16 @@ public abstract class LivingEntity extends Entity { @@ -2039,7 +2039,16 @@ public abstract class LivingEntity extends Entity {
EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption);
if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) { if (damagesource.getEntity() instanceof net.minecraft.world.entity.player.Player) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Don't fire BlockFade on worldgen threads
Caused a deadlock Caused a deadlock
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
index 8ce3dea66a1f45bb3f416bca1765c563394ad8ed..4156f212461201e8f8001f3fbcd7fb683e86ed6b 100644 index 33752432af861a708e0dbb1afafcd5968d795931..08bc35b40720ca001d3f6c1185bdd11c61ec9ee1 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
@@ -101,6 +101,7 @@ public class FireBlock extends BaseFireBlock { @@ -100,6 +100,7 @@ public class FireBlock extends BaseFireBlock {
@Override @Override
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
// CraftBukkit start // CraftBukkit start
@ -17,7 +17,7 @@ index 8ce3dea66a1f45bb3f416bca1765c563394ad8ed..4156f212461201e8f8001f3fbcd7fb68
if (!this.canSurvive(state, world, pos)) { if (!this.canSurvive(state, world, pos)) {
// Suppress during worldgen // Suppress during worldgen
if (!(world instanceof Level)) { if (!(world instanceof Level)) {
@@ -116,7 +117,7 @@ public class FireBlock extends BaseFireBlock { @@ -115,7 +116,7 @@ public class FireBlock extends BaseFireBlock {
return blockState.getHandle(); return blockState.getHandle();
} }
} }

View file

@ -5,52 +5,50 @@ Subject: [PATCH] Add phantom creative and insomniac controls
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 6bda3fc058045d637564fde569b6c44aabdfd099..4e43d4fbd5f69d278f94b69c0704d2bc3569296e 100644 index ab37621a4955b122415ceace9c9eb135b71099cd..d59d8bc43ade0843a3eef62f7c7954e8225783a3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -557,6 +557,13 @@ public class PaperWorldConfig { @@ -600,4 +600,11 @@ public class PaperWorldConfig {
lightQueueSize = getInt("light-queue-size", lightQueueSize); }
perPlayerMobSpawns = getBoolean("per-player-mob-spawns", true);
} }
+
+ public boolean phantomIgnoreCreative = true; + public boolean phantomIgnoreCreative = true;
+ public boolean phantomOnlyAttackInsomniacs = true; + public boolean phantomOnlyAttackInsomniacs = true;
+ private void phantomSettings() { + private void phantomSettings() {
+ phantomIgnoreCreative = getBoolean("phantoms-do-not-spawn-on-creative-players", phantomIgnoreCreative); + phantomIgnoreCreative = getBoolean("phantoms-do-not-spawn-on-creative-players", phantomIgnoreCreative);
+ phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs); + phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs);
+ } + }
+ }
public int noTickViewDistance;
private void viewDistance() {
this.noTickViewDistance = this.getInt("viewdistances.no-tick-view-distance", -1);
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
index d17b75ad13bbc8a38cdc2f2d77ee5d88438cec31..8fb89326395a7e70982c0d757b506565e98b12a4 100644 index b91a61be7c4829fce0ff8da290eab580e20bb78d..22f36cd3df49160f1b6668befdd05c2268edaa49 100644
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
+++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java
@@ -26,6 +26,7 @@ public final class EntitySelector { @@ -27,6 +27,7 @@ public final class EntitySelector {
public static final Predicate<Entity> NO_SPECTATORS = (entity) -> {
return !entity.isSpectator(); return !entity.isSpectator();
}; };
public static final Predicate<Entity> CAN_BE_COLLIDED_WITH = EntitySelector.NO_SPECTATORS.and(Entity::canBeCollidedWith);
+ public static Predicate<Player> isInsomniac = (player) -> net.minecraft.util.Mth.clamp(((net.minecraft.server.level.ServerPlayer) player).getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper + public static Predicate<Player> isInsomniac = (player) -> net.minecraft.util.Mth.clamp(((net.minecraft.server.level.ServerPlayer) player).getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper
private EntitySelector() {} private EntitySelector() {}
// Paper start // Paper start
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
index 080f6d12838faf47ead0958d6bc08f26f78c4671..53cb932d5af963c51b026440da49bdc402cae9fd 100644 index 451be9232eaa513ed66ff0d2b93c932317ad6729..7344301e1cdeccd95375b77f6955edb508362a7b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -547,6 +547,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -548,6 +548,7 @@ public class Phantom extends FlyingMob implements Enemy {
Player entityhuman = (Player) iterator.next(); Player entityhuman = (Player) iterator.next();
if (Phantom.this.canAttack((LivingEntity) entityhuman, TargetingConditions.DEFAULT)) { if (Phantom.this.canAttack(entityhuman, TargetingConditions.DEFAULT)) {
+ if (!level.paperConfig.phantomOnlyAttackInsomniacs || EntitySelector.isInsomniac.test(entityhuman)) // Paper + if (!level.paperConfig.phantomOnlyAttackInsomniacs || EntitySelector.isInsomniac.test(entityhuman)) // Paper
Phantom.this.setGoalTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason Phantom.this.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason
return true; return true;
} }
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index 42effcbd3ca7c38a4e8b1aa835543ad243112a33..79504dc3448402e73b09c4232b1fd0488872cf68 100644 index 891c12b8cfcdc7a2915955bdd08e50b5b9465e02..1e21d6cf2f03219fb2b7217c9a72bdd83c2146f7 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java --- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -53,7 +53,7 @@ public class PhantomSpawner implements CustomSpawner { @@ -51,7 +51,7 @@ public class PhantomSpawner implements CustomSpawner {
while (iterator.hasNext()) { while (iterator.hasNext()) {
Player entityhuman = (Player) iterator.next(); Player entityhuman = (Player) iterator.next();

View file

@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed. same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe1631fe78 100644 index 5a26fe2b8c468063618dd02056da43f001173812..640ea4522419fe90a0a390c2cf0379aab8d060b2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2159,11 +2159,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2188,11 +2188,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
} else { } else {
// CraftBukkit start - Capture drops for death event // CraftBukkit start - Capture drops for death event
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
@ -34,7 +34,7 @@ index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe
entityitem.setDefaultPickUpDelay(); entityitem.setDefaultPickUpDelay();
// CraftBukkit start // CraftBukkit start
@@ -2905,6 +2906,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2943,6 +2944,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
@Nullable @Nullable
public Entity teleportTo(ServerLevel worldserver, BlockPos location) { public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
// CraftBukkit end // CraftBukkit end
@ -47,7 +47,7 @@ index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe
if (this.level instanceof ServerLevel && !this.isRemoved()) { if (this.level instanceof ServerLevel && !this.isRemoved()) {
this.level.getProfiler().push("changeDimension"); this.level.getProfiler().push("changeDimension");
// CraftBukkit start // CraftBukkit start
@@ -2925,6 +2932,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2963,6 +2970,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
// CraftBukkit end // CraftBukkit end
this.level.getProfiler().popPush("reloading"); this.level.getProfiler().popPush("reloading");
@ -56,10 +56,10 @@ index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe
+ ((Mob) this).dropLeash(true, true); // Paper drop lead + ((Mob) this).dropLeash(true, true); // Paper drop lead
+ } + }
+ // Paper end + // Paper end
Entity entity = this.getType().create((Level) worldserver); Entity entity = this.getType().create(worldserver);
if (entity != null) { if (entity != null) {
@@ -2938,10 +2950,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2976,10 +2988,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
// CraftBukkit start - Forward the CraftEntity to the new entity // CraftBukkit start - Forward the CraftEntity to the new entity
this.getBukkitEntity().setHandle(entity); this.getBukkitEntity().setHandle(entity);
entity.bukkitEntity = this.getBukkitEntity(); entity.bukkitEntity = this.getBukkitEntity();
@ -70,7 +70,7 @@ index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe
// CraftBukkit end // CraftBukkit end
} }
@@ -3066,7 +3074,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -3100,7 +3108,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
} }
public boolean canChangeDimensions() { public boolean canChangeDimensions() {
@ -80,10 +80,10 @@ index 5802b1721a0d8e1c40d87be099d4f1b1c8a921d7..fbcbe0443f843d04738938f10b433bfe
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index b41e6fb0b7e02b50e5ad05555ed911d09055d694..c5e9273055ff7302941b7475d8175be53eaece1f 100644 index a3a900d10440ed5ebe24370a77ccb6cad911cfc9..0d468631b9c260091e732925da43c177ebda892f 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -611,7 +611,7 @@ public class ArmorStand extends LivingEntity { @@ -610,7 +610,7 @@ public class ArmorStand extends LivingEntity {
for (i = 0; i < this.handItems.size(); ++i) { for (i = 0; i < this.handItems.size(); ++i) {
itemstack = (ItemStack) this.handItems.get(i); itemstack = (ItemStack) this.handItems.get(i);
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
@ -92,7 +92,7 @@ index b41e6fb0b7e02b50e5ad05555ed911d09055d694..c5e9273055ff7302941b7475d8175be5
this.handItems.set(i, ItemStack.EMPTY); this.handItems.set(i, ItemStack.EMPTY);
} }
} }
@@ -619,7 +619,7 @@ public class ArmorStand extends LivingEntity { @@ -618,7 +618,7 @@ public class ArmorStand extends LivingEntity {
for (i = 0; i < this.armorItems.size(); ++i) { for (i = 0; i < this.armorItems.size(); ++i) {
itemstack = (ItemStack) this.armorItems.get(i); itemstack = (ItemStack) this.armorItems.get(i);
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
@ -102,7 +102,7 @@ index b41e6fb0b7e02b50e5ad05555ed911d09055d694..c5e9273055ff7302941b7475d8175be5
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 4c2ebb2eb93c1f8a805dbe0919f9726ccb4fff1f..54aa3a95118176e7f91f4d669253790167fcd958 100644 index bf7c61c767bdfe8ddb63367f1b38dbbeba17ba02..4cdac8044d3a14861dab5b018479c735d094adcf 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -827,7 +827,8 @@ public class CraftEventFactory { @@ -827,7 +827,8 @@ public class CraftEventFactory {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Villager Restocks API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
index 18fbf866fd7a6de2ed037b8d9c53e25d180be98b..83b7b136794ad855eb0faf839edfcf4a024b2c2a 100644 index 503c547451b8754342197d8b6f9bb0f1298f83c2..e9a51b5b387ff91b5840bbd13ed6c5b776283ed9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -83,6 +83,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { @@ -83,6 +83,18 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 11d9e22c9ef64db62528da73066de8c118565054..fa291673ab392af499c38d0a3b31bbdb664a3a68 100644 index f2960cc42295833a788a22becfa28cca76e15930..bb1244d895c6e5fd668b5a01f507624fdac847f0 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -876,7 +876,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -875,7 +875,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handlePickItem(ServerboundPickItemPacket packet) { public void handlePickItem(ServerboundPickItemPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6b1bc025d0072aa5d0c7609d1da355b9eae7df2d..9a6d9f2a4bb1efad247f70e7639da9540409a327 100644 index c7e2ce7d2fa80c6c97ebe94ec5c36c9eb7356f45..6b9fedc5abeab73a74ca86ee7c3893e0bdc24dd6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -541,6 +541,13 @@ public final class CraftServer implements Server { @@ -579,6 +579,13 @@ public final class CraftServer implements Server {
return this.bukkitVersion; return this.bukkitVersion;
} }

View file

@ -68,10 +68,10 @@ index 9e0afab2329e560c4b2512548dd4b02dd1a2e69f..06662dbff8180751a8684841aa35f709
this.firstIndices = new int[k]; this.firstIndices = new int[k];
this.secondIndices = new int[k]; this.secondIndices = new int[k];
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
index ee5fa14d2232b145806aefcaffb5c6348a08058a..18eeb49a4859a8ab9cbef97caf63c0639bc63233 100644 index 48812329969b7192acd948db974bb77bb546f979..f7708920c62ea3040ba5c931d2141fa1d6ff613d 100644
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java --- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java +++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
@@ -336,9 +336,21 @@ public final class Shapes { @@ -337,9 +337,21 @@ public final class Shapes {
} }
@VisibleForTesting @VisibleForTesting
@ -94,7 +94,7 @@ index ee5fa14d2232b145806aefcaffb5c6348a08058a..18eeb49a4859a8ab9cbef97caf63c063
if (first instanceof CubePointRange && second instanceof CubePointRange) { if (first instanceof CubePointRange && second instanceof CubePointRange) {
long l = lcm(i, j); long l = lcm(i, j);
if ((long)size * l <= 256L) { if ((long)size * l <= 256L) {
@@ -346,13 +358,22 @@ public final class Shapes { @@ -347,13 +359,22 @@ public final class Shapes {
} }
} }

View file

@ -17,7 +17,7 @@ keeping long lived large direct buffers in cache.
Set system properly at server startup if not set already to help protect from this. Set system properly at server startup if not set already to help protect from this.
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 1d63b1da588ef8930133d4cf7ca541fe4d753a4b..c687df04b3543df763a4d5225342357355fab7ec 100644 index 1ade239c9aacf2334c6dee773e0b37f3969723da..450518903c0a10301b177d8dd7fe05aca3b8b37e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -28,6 +28,7 @@ public class Main { @@ -28,6 +28,7 @@ public class Main {

View file

@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 42642e923b68e1074ee322d290983370cdf8881f..d986d03ee40866880ff7a4f39e83b06e1bcc7b6e 100644 index 77820cd4d464f2582b57f60d34bc0c2f3622e4ae..7ca3752aa6f4e626c4437857821000101162b2bc 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -937,6 +937,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -918,6 +918,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
private boolean hasStopped = false; private boolean hasStopped = false;
public volatile boolean hasFullyShutdown = false; // Paper public volatile boolean hasFullyShutdown = false; // Paper
@ -40,7 +40,7 @@ index 42642e923b68e1074ee322d290983370cdf8881f..d986d03ee40866880ff7a4f39e83b06e
private final Object stopLock = new Object(); private final Object stopLock = new Object();
public final boolean hasStopped() { public final boolean hasStopped() {
synchronized (this.stopLock) { synchronized (this.stopLock) {
@@ -951,6 +952,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -932,6 +933,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hasStopped) return; if (this.hasStopped) return;
this.hasStopped = true; this.hasStopped = true;
} }
@ -48,7 +48,7 @@ index 42642e923b68e1074ee322d290983370cdf8881f..d986d03ee40866880ff7a4f39e83b06e
// Paper start - kill main thread, and kill it hard // Paper start - kill main thread, and kill it hard
shutdownThread = Thread.currentThread(); shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper org.spigotmc.WatchdogThread.doStop(); // Paper
@@ -1061,6 +1063,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1040,6 +1042,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void safeShutdown(boolean flag, boolean isRestarting) { public void safeShutdown(boolean flag, boolean isRestarting) {
this.isRestarting = isRestarting; this.isRestarting = isRestarting;
@ -58,12 +58,12 @@ index 42642e923b68e1074ee322d290983370cdf8881f..d986d03ee40866880ff7a4f39e83b06e
this.running = false; this.running = false;
if (flag) { if (flag) {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index bd1203a5b58bac7cccf1f81337fa2967a0e9eb40..6468a675862ee2956308b760012fe25cf505563f 100644 index 301042e7a0d372a914f27ec0988dd938cf2a8262..1766a22e65af2e08611a9435c7384377120406de 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -207,6 +207,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -208,6 +208,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
}
} catch (Exception exception) { } catch (Exception exception) {
ServerLoginPacketListenerImpl.LOGGER.error("Couldn't place player in world", exception);
TranslatableComponent chatmessage = new TranslatableComponent("multiplayer.disconnect.invalid_player_data"); TranslatableComponent chatmessage = new TranslatableComponent("multiplayer.disconnect.invalid_player_data");
+ // Paper start + // Paper start
+ if (MinecraftServer.getServer().isDebugging()) { + if (MinecraftServer.getServer().isDebugging()) {
@ -74,10 +74,10 @@ index bd1203a5b58bac7cccf1f81337fa2967a0e9eb40..6468a675862ee2956308b760012fe25c
this.connection.send(new ClientboundDisconnectPacket(chatmessage)); this.connection.send(new ClientboundDisconnectPacket(chatmessage));
this.connection.disconnect(chatmessage); this.connection.disconnect(chatmessage);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9a6d9f2a4bb1efad247f70e7639da9540409a327..1e34f8d2c3b14ed6a42930099d3130c4d589d48c 100644 index 6b9fedc5abeab73a74ca86ee7c3893e0bdc24dd6..194de00bdff499ac5159f266f17f95c8e4e2f0b2 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -956,6 +956,7 @@ public final class CraftServer implements Server { @@ -999,6 +999,7 @@ public final class CraftServer implements Server {
plugin.getDescription().getFullName(), plugin.getDescription().getFullName(),
"This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin" "This plugin is not properly shutting down its async tasks when it is being reloaded. This may cause conflicts with the newly loaded version of the plugin"
)); ));

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index a482ad74b9a5d06a982ac2a6d9b6c5dc9f664f46..974f0bbbd3d271d28ce884490dc68b68849a07c3 100644 index 44f5a30a16f3d5604cd99bb39c8d744bb607d923..8f65d5d3a5fa58394b0e398bed80044aec3fcc7c 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -1,7 +1,9 @@ @@ -1,7 +1,9 @@
@ -31,24 +31,24 @@ index a482ad74b9a5d06a982ac2a6d9b6c5dc9f664f46..974f0bbbd3d271d28ce884490dc68b68
} }
dependencies { dependencies {
@@ -46,6 +53,8 @@ dependencies { @@ -43,6 +50,8 @@ dependencies {
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0")
implementation("io.netty:netty-all:4.1.65.Final") // Paper runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0")
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation + implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
+ +
testImplementation("junit:junit:4.13.1") testImplementation("junit:junit:4.13.1")
testImplementation("org.hamcrest:hamcrest-library:1.3") testImplementation("org.hamcrest:hamcrest-library:1.3")
} }
@@ -95,6 +104,7 @@ relocation { @@ -87,6 +96,7 @@ relocation {
relocate("org.bukkit.craftbukkit" to "org.bukkit.craftbukkit.v$packageVersion") {
exclude("org.bukkit.craftbukkit.Main*")
}
+ relocate("net.fabricmc.mapping-io" to "io.papermc.dependency.mappingio") // Paper
}
relocate("org.jline:jline-terminal-jansi", "org.jline" to cb("jline")) val generatePom = tasks.named<GenerateMavenPom>("generatePomFileForMavenPublication")
sequenceOf( @@ -111,6 +121,45 @@ tasks.shadowJar {
+ "net.fabricmc:mapping-io" to "net.fabricmc.mappingio", // Paper
"commons-codec:commons-codec" to "org.apache.commons.codec",
"commons-io:commons-io" to "org.apache.commons.io",
//"it.unimi.dsi:fastutil" to "it.unimi", // Paper - don't relocate fastutil
@@ -139,6 +149,45 @@ tasks.shadowJar {
transform(ModifiedLog4j2PluginsCacheFileTransformer::class.java) transform(ModifiedLog4j2PluginsCacheFileTransformer::class.java)
} }
@ -95,10 +95,10 @@ index a482ad74b9a5d06a982ac2a6d9b6c5dc9f664f46..974f0bbbd3d271d28ce884490dc68b68
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
} }
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 4bdc154ce5b91c3d5c4b5dc63ff32a7fe094bd37..e1d91a95c306e71ac77b3658de77ec9d18c4f8e6 100644 index a074df5708624bd4b0bc2ad3dcbd4bc4ff737595..68dc68238adc8d288052132e9f70663e8bba1e80 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -436,4 +436,9 @@ public class PaperConfig { @@ -429,4 +429,9 @@ public class PaperConfig {
log("Async Chunks: Enabled - Chunks will be loaded much faster, without lag."); log("Async Chunks: Enabled - Chunks will be loaded much faster, without lag.");
} }
} }
@ -523,10 +523,10 @@ index 3941e14d1c3e6e688e28904948039c8b2200de5f..a4fda4a3bae9ce600e778b44cd3ef432
} }
} }
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index a335d48467d1730bfed25eb5fd9046e115f23ed0..8098875a5c4146dec81f5daed0e34ddfe17a26c6 100644 index 0716aaf29f9d76240a0de4ca02daba442b36ec7d..2b7ba5d8dda0297c8b35a0cea68c3ae10188e3f2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -214,6 +214,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -212,6 +212,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
com.destroystokyo.paper.PaperConfig.registerCommands(); com.destroystokyo.paper.PaperConfig.registerCommands();
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index f802d9e803b406cb9b5b4bce7de6858eba0fae7e..27f8a99f35a22f334e8023c1c9048e3a88a63d6f 100644 index 8f65d5d3a5fa58394b0e398bed80044aec3fcc7c..eaeed610e3f1a622b2ece220d595fbca9c750d20 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -55,6 +55,7 @@ dependencies { @@ -52,6 +52,7 @@ dependencies {
implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
@ -735,23 +735,25 @@ index 0000000000000000000000000000000000000000..0d30e0b21b9024df939a9d070bd4a99b
+ } + }
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java diff --git a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
index 9df0006c1a283f77c4d01d9fce9062fc1c9bbb1f..b3329c6fcd6758a781a51f5ba8f5052ac1c77b49 100644 index 66f6423d2732d23809fe86418537e35d40d24373..964f68fc3cbdb658c13d5d0213abf2ee3ce9557d 100644
--- a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java --- a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
+++ b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java +++ b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
@@ -64,4 +64,8 @@ public final class OptimizedSmallEnumSet<E extends Enum<E>> { @@ -67,6 +67,10 @@ public final class OptimizedSmallEnumSet<E extends Enum<E>> {
public boolean hasCommonElements(final OptimizedSmallEnumSet<E> other) {
return (other.backingSet & this.backingSet) != 0; return (other.backingSet & this.backingSet) != 0;
} }
+
+ public boolean hasElement(final E element) { + public boolean hasElement(final E element) {
+ return (this.backingSet & (1L << element.ordinal())) != 0; + return (this.backingSet & (1L << element.ordinal())) != 0;
+ } + }
} +
public void forEach(final E[] values, final Consumer<E> action) {
long iterator = this.getBackingSet();
int wrappedGoalSize = this.size();
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java b/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java b/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java
index fabd20265863751ad980ee4a697f3f0d47df101f..3a4da2bb86a742985d309eb325dc843ae405cd8b 100644 index 4379b9948f1eecfe6fd7dea98e298ad5f761019a..3f081183521603824430709886a9cc313c28e7cb 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/Goal.java
@@ -6,6 +6,14 @@ public abstract class Goal { @@ -7,6 +7,14 @@ public abstract class Goal {
private final EnumSet<Goal.Flag> flags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be. private final EnumSet<Goal.Flag> flags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
@ -766,7 +768,7 @@ index fabd20265863751ad980ee4a697f3f0d47df101f..3a4da2bb86a742985d309eb325dc843a
public abstract boolean canUse(); public abstract boolean canUse();
public boolean canContinueToUse() { public boolean canContinueToUse() {
@@ -29,6 +37,10 @@ public abstract class Goal { @@ -34,6 +42,10 @@ public abstract class Goal {
// Paper start - remove streams from pathfindergoalselector // Paper start - remove streams from pathfindergoalselector
this.goalTypes.clear(); this.goalTypes.clear();
this.goalTypes.addAllUnchecked(controls); this.goalTypes.addAllUnchecked(controls);
@ -777,8 +779,8 @@ index fabd20265863751ad980ee4a697f3f0d47df101f..3a4da2bb86a742985d309eb325dc843a
// Paper end - remove streams from pathfindergoalselector // Paper end - remove streams from pathfindergoalselector
} }
@@ -43,7 +55,19 @@ public abstract class Goal { @@ -56,7 +68,19 @@ public abstract class Goal {
// Paper end - remove streams from pathfindergoalselector return Mth.positiveCeilDiv(serverTicks, 2);
} }
+ // Paper start - mob goal api + // Paper start - mob goal api
@ -798,10 +800,10 @@ index fabd20265863751ad980ee4a697f3f0d47df101f..3a4da2bb86a742985d309eb325dc843a
LOOK, LOOK,
JUMP, JUMP,
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1e34f8d2c3b14ed6a42930099d3130c4d589d48c..df5a9d6b1b8117080ede57f443dc79b875145461 100644 index 194de00bdff499ac5159f266f17f95c8e4e2f0b2..7a44029f6ab3372bfd246ec3d61aa81541b7b968 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2570,5 +2570,11 @@ public final class CraftServer implements Server { @@ -2616,5 +2616,11 @@ public final class CraftServer implements Server {
public boolean isStopping() { public boolean isStopping() {
return net.minecraft.server.MinecraftServer.getServer().hasStopped(); return net.minecraft.server.MinecraftServer.getServer().hasStopped();
} }

View file

@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..0f10c333d88f2e1c56a6c7f22d421084
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
index 3eb1d640f53e0b8be53fa78aaa7bca6a7963d912..01df536b3b61281828ca2be03ac1bbb6a1096423 100644 index 23dda5721fe6b706428075cd868ae0d68f986382..5498ec7049318dc2d10bb2ef7fbfefcf1e6e1e72 100644
--- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java --- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java +++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
@@ -29,7 +29,7 @@ import net.minecraft.util.VisibleForDebug; @@ -29,7 +29,7 @@ import net.minecraft.util.VisibleForDebug;
@ -62,7 +62,7 @@ index 3eb1d640f53e0b8be53fa78aaa7bca6a7963d912..01df536b3b61281828ca2be03ac1bbb6
static class GossipEntry { static class GossipEntry {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
index 83b7b136794ad855eb0faf839edfcf4a024b2c2a..1c2a086445b1dd59299eef89056990bc3d1152f8 100644 index e9a51b5b387ff91b5840bbd13ed6c5b776283ed9..67cf86dfad91ee5afea3b4b48f89224af3ea2354 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java
@@ -16,6 +16,13 @@ import org.bukkit.entity.Villager; @@ -16,6 +16,13 @@ import org.bukkit.entity.Villager;

View file

@ -5,24 +5,22 @@ Subject: [PATCH] Option for maximum exp value when merging orbs
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index f036c3179f4e7633eac4e1889c029383c291da92..16b4711496ce4cc7b8e53de4614836d2590a5704 100644 index d59d8bc43ade0843a3eef62f7c7954e8225783a3..a5361e1dba7c025667c7627b8851655bba2c9c6a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -397,6 +397,12 @@ public class PaperWorldConfig { @@ -607,4 +607,10 @@ public class PaperWorldConfig {
log("Creeper lingering effect: " + disableCreeperLingeringEffect); phantomIgnoreCreative = getBoolean("phantoms-do-not-spawn-on-creative-players", phantomIgnoreCreative);
phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs);
} }
+
+ public int expMergeMaxValue; + public int expMergeMaxValue;
+ private void expMergeMaxValue() { + private void expMergeMaxValue() {
+ expMergeMaxValue = getInt("experience-merge-max-value", -1); + expMergeMaxValue = getInt("experience-merge-max-value", -1);
+ log("Experience Merge Max Value: " + expMergeMaxValue); + log("Experience Merge Max Value: " + expMergeMaxValue);
+ } + }
+ }
public double squidMaxSpawnHeight;
private void squidMaxSpawnHeight() {
squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 54aa3a95118176e7f91f4d669253790167fcd958..b07247dda5f7be1186c47ce5cb490ca0a46cc56c 100644 index 4cdac8044d3a14861dab5b018479c735d094adcf..147839ff49ad5ac20dfd1cfdb09a25dafc6ae03c 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -630,16 +630,30 @@ public class CraftEventFactory { @@ -630,16 +630,30 @@ public class CraftEventFactory {

View file

@ -9,7 +9,7 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor
metadata such as spawn reason, or conditionally move data from source to target. metadata such as spawn reason, or conditionally move data from source to target.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b07247dda5f7be1186c47ce5cb490ca0a46cc56c..ff2149572a82d6605a0b28f2fdd0dadb86af25a1 100644 index 147839ff49ad5ac20dfd1cfdb09a25dafc6ae03c..5fea023590fd1456a4d43c1ebc5b8c243e185631 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -640,7 +640,7 @@ public class CraftEventFactory { @@ -640,7 +640,7 @@ public class CraftEventFactory {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Fix PotionEffect ignores icon flag
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index e617e4ecd3763dea795d524b92f8a979fd7d3c48..0d64e930f0a30e15b180cd845a692d3ff61c8927 100644 index be1540b0a5f95f8a85f91d5fe398cd2cf8832ec4..639d376bf382409410e26385134d36fd6e3b5f0c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -412,7 +412,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -412,7 +412,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -8,7 +8,7 @@ Adds a new method to fetch the location of a player's bed without generating any
getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 8836e8cf912948199f0233c3ec22b079268db79d..2be54303ad01fd2b464a8962ec1afe81d045b098 100644 index 9ad94aea2959082dfd44edd63c0a5aa1cec1e655..a0af465056786f0c8e177a3f48bbf51c0f79b949 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -12,6 +12,7 @@ import net.minecraft.nbt.CompoundTag; @@ -12,6 +12,7 @@ import net.minecraft.nbt.CompoundTag;

View file

@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does. if any are still running after that delay just as reload does.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d986d03ee40866880ff7a4f39e83b06e1bcc7b6e..62b17026df08cc4d8c1dd98f451fc606c92c57f1 100644 index 7ca3752aa6f4e626c4437857821000101162b2bc..22885b3d7931f2e439769cad39a37e8af3b3de54 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -972,6 +972,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -953,6 +953,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.disablePlugins(); this.server.disablePlugins();
@ -22,10 +22,10 @@ index d986d03ee40866880ff7a4f39e83b06e1bcc7b6e..62b17026df08cc4d8c1dd98f451fc606
// CraftBukkit end // CraftBukkit end
if (this.getConnection() != null) { if (this.getConnection() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index df5a9d6b1b8117080ede57f443dc79b875145461..acae4ffc1e97ba54056b7b30679404de6ff54fca 100644 index 7a44029f6ab3372bfd246ec3d61aa81541b7b968..a603013de589fad75ff783771a04f10e3bf2ee90 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -965,6 +965,35 @@ public final class CraftServer implements Server { @@ -1008,6 +1008,35 @@ public final class CraftServer implements Server {
org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload
} }

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure EntityRaider respects game and entity rules for
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index 37f4becb39d6d4c13aa0c3901ed123083518cdbf..54b5cfa35e5fe9138d39a73f2085f594f1987cda 100644 index b2786cd7135ae85f04c899a99d47af5a3ac71bb3..039544609aa4fd2f5ab5075792a2e51ef315dc37 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -314,6 +314,7 @@ public abstract class Raider extends PatrollingMonster { @@ -313,6 +313,7 @@ public abstract class Raider extends PatrollingMonster {
@Override @Override
public boolean canUse() { public boolean canUse() {

View file

@ -13,10 +13,10 @@ A config is provided if you rather let players use these exploits, and let
them destroy the worlds End Portals and get on top of the nether easy. them destroy the worlds End Portals and get on top of the nether easy.
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index e1d91a95c306e71ac77b3658de77ec9d18c4f8e6..c9bf57298c7023b2d609d5271609a4070bb1c773 100644 index 68dc68238adc8d288052132e9f70663e8bba1e80..bfaaa80a5b144bd46ff3ea6a782aa87e5c51e8ea 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -441,4 +441,15 @@ public class PaperConfig { @@ -434,4 +434,15 @@ public class PaperConfig {
private static void loggerSettings() { private static void loggerSettings() {
deobfuscateStacktraces = getBoolean("settings.loggers.deobfuscate-stacktraces", deobfuscateStacktraces); deobfuscateStacktraces = getBoolean("settings.loggers.deobfuscate-stacktraces", deobfuscateStacktraces);
} }
@ -33,10 +33,10 @@ index e1d91a95c306e71ac77b3658de77ec9d18c4f8e6..c9bf57298c7023b2d609d5271609a407
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index a861b4b55862b1c5583101fe7f28a3a43c547468..1575fb0bbad6e11f25fb9ce51fd1f15a1b11e0fe 100644 index 548f103e648d9670d7434182c6598dc29ae77b57..f0c789d339fe8402c9c2a684d7e0415fa298b20e 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java --- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -174,6 +174,7 @@ public class Explosion { @@ -173,6 +173,7 @@ public class Explosion {
for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) {
BlockPos blockposition = new BlockPos(d4, d5, d6); BlockPos blockposition = new BlockPos(d4, d5, d6);
BlockState iblockdata = this.level.getBlockState(blockposition); BlockState iblockdata = this.level.getBlockState(blockposition);
@ -44,7 +44,7 @@ index a861b4b55862b1c5583101fe7f28a3a43c547468..1575fb0bbad6e11f25fb9ce51fd1f15a
FluidState fluid = iblockdata.getFluidState(); // Paper FluidState fluid = iblockdata.getFluidState(); // Paper
if (!this.level.isInWorldBounds(blockposition)) { if (!this.level.isInWorldBounds(blockposition)) {
@@ -332,7 +333,7 @@ public class Explosion { @@ -330,7 +331,7 @@ public class Explosion {
BlockState iblockdata = this.level.getBlockState(blockposition); BlockState iblockdata = this.level.getBlockState(blockposition);
Block block = iblockdata.getBlock(); Block block = iblockdata.getBlock();
@ -54,10 +54,10 @@ index a861b4b55862b1c5583101fe7f28a3a43c547468..1575fb0bbad6e11f25fb9ce51fd1f15a
this.level.getProfiler().push("explosion_blocks"); this.level.getProfiler().push("explosion_blocks");
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index c1f545f48cea7afea53342e3053c669d295851f0..d01687250a9a022000b4e57b839b8c0751caef29 100644 index 46adef4de2f9e5888dce1e669619dd0386b90470..9d628996437959e79348679e2c85e07bc138475e 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -416,6 +416,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -413,6 +413,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {
@ -69,10 +69,10 @@ index c1f545f48cea7afea53342e3053c669d295851f0..d01687250a9a022000b4e57b839b8c07
if (blockstate == null) { if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 6a31e3a3466369ede28e28bc3b9fda8dcb77e136..d6a3f3a2edae806b0ebf5bf5ac445116c0d64535 100644 index b77eda6af8b430311e502465a2590d83555ff6cf..a37213bce34f45898f56a22196b0d5ef1470e812 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -91,6 +91,19 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -89,6 +89,19 @@ public class Block extends BlockBehaviour implements ItemLike {
protected final StateDefinition<Block, BlockState> stateDefinition; protected final StateDefinition<Block, BlockState> stateDefinition;
private BlockState defaultBlockState; private BlockState defaultBlockState;
// Paper start // Paper start
@ -93,10 +93,10 @@ index 6a31e3a3466369ede28e28bc3b9fda8dcb77e136..d6a3f3a2edae806b0ebf5bf5ac445116
public co.aikar.timings.Timing getTiming() { public co.aikar.timings.Timing getTiming() {
if (timing == null) { if (timing == null) {
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
index c345bd7542f3ffa09719864887e1516f1182e7e3..4eac07022a7d896ee8921afa6d35cba7f0c89941 100644 index 2f1345d3c3671953a806cb243a152e080fbb9108..e9b315fb5a7b466e2ac65ae4ae69e893dd992739 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java --- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
@@ -200,6 +200,12 @@ public class PistonBaseBlock extends DirectionalBlock { @@ -199,6 +199,12 @@ public class PistonBaseBlock extends DirectionalBlock {
@Override @Override
public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) { public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) {
Direction enumdirection = (Direction) state.getValue(PistonBaseBlock.FACING); Direction enumdirection = (Direction) state.getValue(PistonBaseBlock.FACING);
@ -109,7 +109,7 @@ index c345bd7542f3ffa09719864887e1516f1182e7e3..4eac07022a7d896ee8921afa6d35cba7
if (!world.isClientSide) { if (!world.isClientSide) {
boolean flag = this.getNeighborSignal(world, pos, enumdirection); boolean flag = this.getNeighborSignal(world, pos, enumdirection);
@@ -232,7 +238,7 @@ public class PistonBaseBlock extends DirectionalBlock { @@ -231,7 +237,7 @@ public class PistonBaseBlock extends DirectionalBlock {
BlockState iblockdata1 = (BlockState) ((BlockState) Blocks.MOVING_PISTON.defaultBlockState().setValue(MovingPistonBlock.FACING, enumdirection)).setValue(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); BlockState iblockdata1 = (BlockState) ((BlockState) Blocks.MOVING_PISTON.defaultBlockState().setValue(MovingPistonBlock.FACING, enumdirection)).setValue(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT);
world.setBlock(pos, iblockdata1, 20); world.setBlock(pos, iblockdata1, 20);
@ -118,7 +118,7 @@ index c345bd7542f3ffa09719864887e1516f1182e7e3..4eac07022a7d896ee8921afa6d35cba7
world.blockUpdated(pos, iblockdata1.getBlock()); world.blockUpdated(pos, iblockdata1.getBlock());
iblockdata1.updateNeighbourShapes(world, pos, 2); iblockdata1.updateNeighbourShapes(world, pos, 2);
if (this.isSticky) { if (this.isSticky) {
@@ -261,7 +267,14 @@ public class PistonBaseBlock extends DirectionalBlock { @@ -260,7 +266,14 @@ public class PistonBaseBlock extends DirectionalBlock {
} }
} }
} else { } else {
@ -135,10 +135,10 @@ index c345bd7542f3ffa09719864887e1516f1182e7e3..4eac07022a7d896ee8921afa6d35cba7
world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F); world.playSound((Player) null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F);
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index 6e34d0fb002e61460ab21edcbd23a6d00ac2730c..e218e4f1dfc399cff4131cc5210184af85855d57 100644 index 987a4180a1eb902c512c2e6a36d692cbdd9b1563..e1beb18dfb5529f48c312bf7ff85be18f6c935b5 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -206,7 +206,7 @@ public abstract class BlockBehaviour { @@ -205,7 +205,7 @@ public abstract class BlockBehaviour {
@Deprecated @Deprecated
public boolean canBeReplaced(BlockState state, BlockPlaceContext context) { public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
@ -147,7 +147,7 @@ index 6e34d0fb002e61460ab21edcbd23a6d00ac2730c..e218e4f1dfc399cff4131cc5210184af
} }
@Deprecated @Deprecated
@@ -664,7 +664,11 @@ public abstract class BlockBehaviour { @@ -663,7 +663,11 @@ public abstract class BlockBehaviour {
public Block getBlock() { public Block getBlock() {
return (Block) this.owner; return (Block) this.owner;
} }
@ -160,7 +160,7 @@ index 6e34d0fb002e61460ab21edcbd23a6d00ac2730c..e218e4f1dfc399cff4131cc5210184af
public Material getMaterial() { public Material getMaterial() {
return this.material; return this.material;
} }
@@ -762,7 +766,7 @@ public abstract class BlockBehaviour { @@ -761,7 +765,7 @@ public abstract class BlockBehaviour {
} }
public PushReaction getPistonPushReaction() { public PushReaction getPistonPushReaction() {
@ -170,13 +170,13 @@ index 6e34d0fb002e61460ab21edcbd23a6d00ac2730c..e218e4f1dfc399cff4131cc5210184af
public boolean isSolidRender(BlockGetter world, BlockPos pos) { public boolean isSolidRender(BlockGetter world, BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
index d5ba2e679ed1858ea18e18feffce50544ae036c2..ca3e143e641933fa6b9499bbaaa1836877d90c52 100644 index 80811386c1006d56824ff4d43830f2a140aaee30..2aa59b14b171ff4efbb113816c04675da0954d0e 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
@@ -209,6 +209,13 @@ public class PortalForcer { @@ -210,6 +210,13 @@ public class PortalForcer {
for (int j = -1; j < 3; ++j) { for (int j = -1; j < 3; ++j) {
for (int k = -1; k < 4; ++k) { for (int k = -1; k < 4; ++k) {
temp.setWithOffset((Vec3i) pos, portalDirection.getStepX() * j + enumdirection1.getStepX() * distanceOrthogonalToPortal, k, portalDirection.getStepZ() * j + enumdirection1.getStepZ() * distanceOrthogonalToPortal); temp.setWithOffset(pos, portalDirection.getStepX() * j + enumdirection1.getStepX() * distanceOrthogonalToPortal, k, portalDirection.getStepZ() * j + enumdirection1.getStepZ() * distanceOrthogonalToPortal);
+ // Paper start - prevent destroying unbreakable blocks + // Paper start - prevent destroying unbreakable blocks
+ if (!com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits) { + if (!com.destroystokyo.paper.PaperConfig.allowBlockPermanentBreakingExploits) {
+ if (!this.level.getBlockState(temp).isDestroyable()) { + if (!this.level.getBlockState(temp).isDestroyable()) {

View file

@ -5,31 +5,30 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 790761848d0ea0934b07c852675e8f746edac211..cec1906adc4d2953b50d262abb1c2cb61cb3ba41 100644 index 5592f879ef2c1b8f15bc63b38edb57f19e9d589d..2e127a2eb9b00eabe1f5c9c966e405e280c38756 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -2102,9 +2102,14 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially @@ -1828,9 +1828,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void updatePlayer(ServerPlayer player) { public void updatePlayer(ServerPlayer player) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (player != this.entity) { if (player != this.entity) {
- Vec3 vec3d = player.position().subtract(this.entity.position()); // MC-155077, SPIGOT-5113 - Vec3 vec3d = player.position().subtract(this.entity.position()); // MC-155077, SPIGOT-5113
+ // Paper start - remove allocation of Vec3D here + // Paper start - remove allocation of Vec3D here
+ //Vec3D vec3d = entityplayer.getPositionVector().d(this.tracker.getPositionVector()); // MC-155077, SPIGOT-5113 + //Vec3 vec3d = player.position().subtract(this.entity.position()); // MC-155077, SPIGOT-5113
+ double vec3d_dx = player.getX() - this.entity.getX(); + double vec3d_dx = player.getX() - this.entity.getX();
+ double vec3d_dy = player.getY() - this.entity.getY();
+ double vec3d_dz = player.getZ() - this.entity.getZ(); + double vec3d_dz = player.getZ() - this.entity.getZ();
+ // Paper end - remove allocation of Vec3D here + // Paper end - remove allocation of Vec3D here
int i = Math.min(this.getEffectiveRange(), (ChunkMap.this.viewDistance - 1) * 16); double d0 = (double) Math.min(this.getEffectiveRange(), (ChunkMap.this.viewDistance - 1) * 16);
- boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.entity.broadcastToPlayer(player); - double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
+ boolean flag = vec3d_dx >= (double) (-i) && vec3d_dx <= (double) i && vec3d_dz >= (double) (-i) && vec3d_dz <= (double) i && this.entity.broadcastToPlayer(player); // Paper - remove allocation of Vec3D here + double d1 = vec3d_dx * vec3d_dx + vec3d_dz * vec3d_dz; // Paper
double d2 = d0 * d0;
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player);
// CraftBukkit start - respect vanish API
if (this.entity instanceof ServerPlayer) {
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 58cae4202e61cded7d5dfa9652bbfb9735927f7e..2f3e69ad809199ffc2661d524bb627ec8dbc2e80 100644 index ceba19ea3bb9664899b83f82f28af06476b7ff56..f6b6ac1ab31c364646151866c54c9e46dee12516 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -144,8 +144,12 @@ public class ServerEntity { @@ -143,8 +143,12 @@ public class ServerEntity {
++this.teleportDelay; ++this.teleportDelay;
i = Mth.floor(this.entity.getYRot() * 256.0F / 360.0F); i = Mth.floor(this.entity.getYRot() * 256.0F / 360.0F);
j = Mth.floor(this.entity.getXRot() * 256.0F / 360.0F); j = Mth.floor(this.entity.getXRot() * 256.0F / 360.0F);
@ -44,7 +43,7 @@ index 58cae4202e61cded7d5dfa9652bbfb9735927f7e..2f3e69ad809199ffc2661d524bb627ec
Packet<?> packet1 = null; Packet<?> packet1 = null;
boolean flag2 = flag1 || this.tickCount % 60 == 0; boolean flag2 = flag1 || this.tickCount % 60 == 0;
boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1; boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1;
@@ -162,9 +166,11 @@ public class ServerEntity { @@ -161,9 +165,11 @@ public class ServerEntity {
// CraftBukkit end // CraftBukkit end
if (this.tickCount > 0 || this.entity instanceof AbstractArrow) { if (this.tickCount > 0 || this.entity instanceof AbstractArrow) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure safe gateway teleport
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index f41dfe8bff59d17000f3eb17670c524102adb276..0b238666a506816b8948d1db7397c26ca50b89d3 100644 index 1d8af8475d0aac71a4ed8a2fed9861dd89d8319b..bc028de0ac71e69e8d714db5f65286f306544bf1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -105,7 +105,14 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { @@ -104,7 +104,14 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
List<Entity> list = world.getEntitiesOfClass(Entity.class, new AABB(pos), TheEndGatewayBlockEntity::canEntityTeleport); List<Entity> list = world.getEntitiesOfClass(Entity.class, new AABB(pos), TheEndGatewayBlockEntity::canEntityTeleport);
if (!list.isEmpty()) { if (!list.isEmpty()) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add option for console having all permissions
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index c9bf57298c7023b2d609d5271609a4070bb1c773..31e127151d2a046bf1652a909bc3ea64f95f2d1f 100644 index bfaaa80a5b144bd46ff3ea6a782aa87e5c51e8ea..374cb5a2fb8c44b7d914beff5688cf36fc08640c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -452,4 +452,9 @@ public class PaperConfig { @@ -445,4 +445,9 @@ public class PaperConfig {
config.set("settings.unsupported-settings.allow-permanent-block-break-exploits-readme", "This setting controls if players should be able to break bedrock, end portals and other intended to be permanent blocks."); config.set("settings.unsupported-settings.allow-permanent-block-break-exploits-readme", "This setting controls if players should be able to break bedrock, end portals and other intended to be permanent blocks.");
allowBlockPermanentBreakingExploits = getBoolean("settings.unsupported-settings.allow-permanent-block-break-exploits", allowBlockPermanentBreakingExploits); allowBlockPermanentBreakingExploits = getBoolean("settings.unsupported-settings.allow-permanent-block-break-exploits", allowBlockPermanentBreakingExploits);
} }

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix villager trading demand - MC-163962
Prevent demand from going negative and tending to negative infinity Prevent demand from going negative and tending to negative infinity
diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
index 3a59f610145504a096ccf4793ea4140120b00f48..75827fcad36a551d832f4be094167936092b6caf 100644 index a9970cd2cdca15d6ea2d3acd3c361dd99f64061b..29b65a80e890e7e513336cb78d052c9d2c535a35 100644
--- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java --- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
+++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java +++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java
@@ -109,7 +109,7 @@ public class MerchantOffer { @@ -109,7 +109,7 @@ public class MerchantOffer {

View file

@ -15,10 +15,10 @@ Previously maps would load all chunks in a certain radius depending on
five ticks that movement occur in anyways. five ticks that movement occur in anyways.
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 2ac84599cd9c71c1a32d70e447b014dc6711cda7..d44cbcfc9e59365149823b594e3b313ed48ec511 100644 index 65fbc22b3b03d1e95cf76da37babd052d8ae4445..27862f85307e2de5f3fe2195b62a1a9bd3f496de 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java --- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java +++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -132,9 +132,9 @@ public class MapItem extends ComplexItem { @@ -131,9 +131,9 @@ public class MapItem extends ComplexItem {
int k2 = (j / i + k1 - 64) * i; int k2 = (j / i + k1 - 64) * i;
int l2 = (k / i + l1 - 64) * i; int l2 = (k / i + l1 - 64) * i;
Multiset<MaterialColor> multiset = LinkedHashMultiset.create(); Multiset<MaterialColor> multiset = LinkedHashMultiset.create();

View file

@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 7 Jun 2020 19:25:13 -0400
Subject: [PATCH] Use seed based lookup for Treasure Maps - Fixes lag from
carto/sunken maps
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 27862f85307e2de5f3fe2195b62a1a9bd3f496de..602e6bc05c053baf821c11c30b24538320b9ac61 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -256,7 +256,7 @@ public class MapItem extends ComplexItem {
for (l = 0; l < 128 * i; ++l) {
for (i1 = 0; i1 < 128 * i; ++i1) {
- Biome.BiomeCategory biomebase_geography = world.getBiome(new BlockPos((j / i - 64) * i + i1, 0, (k / i - 64) * i + l)).getBiomeCategory();
+ Biome.BiomeCategory biomebase_geography = world.getUncachedNoiseBiome((j / i - 64) * i + i1, 0, (k / i - 64) * i + l).getBiomeCategory(); // Paper
aboolean[l * 128 * i + i1] = biomebase_geography == Biome.BiomeCategory.OCEAN || biomebase_geography == Biome.BiomeCategory.RIVER || biomebase_geography == Biome.BiomeCategory.SWAMP;
}

View file

@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 7 Jun 2020 19:25:13 -0400
Subject: [PATCH] Use seed based lookup for Treasure Maps - Fixes lag from
carto/sunken maps
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index d44cbcfc9e59365149823b594e3b313ed48ec511..24700c7e6a32cc30c97dccc21c5f3e3e6b6438e5 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -258,7 +258,7 @@ public class MapItem extends ComplexItem {
for (l = 0; l < 128 * i; ++l) {
for (i1 = 0; i1 < 128 * i; ++i1) {
- abiomebase[l * 128 * i + i1] = world.getBiome(new BlockPos((j / i - 64) * i + i1, 0, (k / i - 64) * i + l));
+ abiomebase[l * 128 * i + i1] = world.getUncachedNoiseBiome((j / i - 64) * i + i1, 0, (k / i - 64) * i + l); // Paper
}
}