This commit is contained in:
Jason Penilla 2021-11-24 02:04:30 -08:00 committed by MiniDigger | Martin
parent 0050c2a090
commit e208af9741
16 changed files with 53 additions and 67 deletions

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add tick times API
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 caa3d77b5906a2227f6409a877bd0ba14d05caba..411d06b14a0892531ac578e51d0b166f670adbd6 100644 index 8580bc20e24c3bde5b57f0727f79051c9d7d0f2e..a5f1191abb99a63dc2e20ef59688e4df30e12f67 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
@@ -1720,6 +1720,25 @@ public final class Bukkit { @@ -1734,6 +1734,25 @@ public final class Bukkit {
public static double[] getTPS() { public static double[] getTPS() {
return server.getTPS(); return server.getTPS();
} }
@ -35,10 +35,10 @@ index caa3d77b5906a2227f6409a877bd0ba14d05caba..411d06b14a0892531ac578e51d0b166f
/** /**
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 bf1920857008c272d557f602544009986c3ed284..1cabf4de832b60abae8c25c0d80d409e8fa727cc 100644 index b765aa35680e67bb919c020b54830ee5aca9d27f..0c5776e05e53802c45caea39002828507155fed5 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
@@ -1460,6 +1460,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -1472,6 +1472,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/ */
@NotNull @NotNull
public double[] getTPS(); public double[] getTPS();

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
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 411d06b14a0892531ac578e51d0b166f670adbd6..796f72b1026371fff09e8ce60536d30609987449 100644 index a5f1191abb99a63dc2e20ef59688e4df30e12f67..ddaee386c6039eabb349481c2a66ec1292d0bfde 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
@@ -1998,6 +1998,15 @@ public final class Bukkit { @@ -2012,6 +2012,15 @@ public final class Bukkit {
public static int getCurrentTick() { public static int getCurrentTick() {
return server.getCurrentTick(); return server.getCurrentTick();
} }
@ -26,10 +26,10 @@ index 411d06b14a0892531ac578e51d0b166f670adbd6..796f72b1026371fff09e8ce60536d306
@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 1cabf4de832b60abae8c25c0d80d409e8fa727cc..552b56995ffb0898ffd459e0175af57341f39f46 100644 index 0c5776e05e53802c45caea39002828507155fed5..dd263faad52612a076847c717582e8fc09dc3345 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
@@ -1754,5 +1754,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -1766,5 +1766,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return Current tick * @return Current tick
*/ */
int getCurrentTick(); int getCurrentTick();

View file

@ -11,10 +11,10 @@ errors.
This isn't an issue on Spigot This isn't an issue on Spigot
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index a3027c1c6109bcb20d0468f6d0cd37182bb279ea..20b4ef7a94e00d9264b8ecc126ce5853b584ea8c 100644 index 3457dd6a86f927dd38edd200121aad5364d8abd5..0d9d729a18b5388b06ab0a3749e55f91f838be88 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -595,7 +595,7 @@ public final class SimplePluginManager implements PluginManager { @@ -605,7 +605,7 @@ public final class SimplePluginManager implements PluginManager {
// Paper - replace callEvent by merging to below method // Paper - replace callEvent by merging to below method
if (event.isAsynchronous() && server.isPrimaryThread()) { if (event.isAsynchronous() && server.isPrimaryThread()) {
throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously."); throw new IllegalStateException(event.getEventName() + " may only be triggered asynchronously.");

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Make JavaPluginLoader thread-safe
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index f26303315c9c93356f0b04440136855dd54d32b7..ce751577623eaad0f31e2eb7bf0842d1ab73e845 100644 index 922bb2cbfaf1e4cd111b7ad286c867c4d9f47e05..4397fed2b41e5ab444aa7e3c9b5d7dccc50f4e04 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -52,6 +52,8 @@ import org.yaml.snakeyaml.error.YAMLException; @@ -52,6 +52,8 @@ import org.yaml.snakeyaml.error.YAMLException;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Set spigots verbose world setting to false by def
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 769a492305a3ce83e0da0b3de4ebd73859d1e1d9..c931a46650ba4857805bbfa126c75a9b86b1d707 100644 index 6d36aa5006d3adc3ff30d196bdfd287ad38a564a..3de37f8eb99a41a8d99f22ed0afc81f44254f1d2 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -20,7 +20,7 @@ public class SpigotWorldConfig @@ -20,7 +20,7 @@ public class SpigotWorldConfig

View file

@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..d0211d4f39f9d6af1d751ac66342b42c
+ } + }
+} +}
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 217779a280b70ba5b3bbe1f5412dd149c12b40fa..4bdc154ce5b91c3d5c4b5dc63ff32a7fe094bd37 100644 index 4875e323e8ba52cf91259262b8418310061718ad..a074df5708624bd4b0bc2ad3dcbd4bc4ff737595 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
@@ -69,6 +69,7 @@ public class PaperConfig { @@ -69,6 +69,7 @@ public class PaperConfig {
@ -87,10 +87,10 @@ index 217779a280b70ba5b3bbe1f5412dd149c12b40fa..4bdc154ce5b91c3d5c4b5dc63ff32a7f
version = getInt("config-version", 24); version = getInt("config-version", 24);
set("config-version", 24); set("config-version", 24);
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 9683c29c583e8b7e4f41d088160455714033a135..5edbb9132d2895da2b693fe35d4a25000982b636 100644 index 758a972589b607447dc507c6c4f4b2a62f6a2832..56682365381d34784b63d36ab50a1deedfb73e74 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
@@ -248,6 +248,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -245,6 +245,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private String motd; private String motd;
private int playerIdleTimeout; private int playerIdleTimeout;
public final long[] tickTimes; public final long[] tickTimes;
@ -102,7 +102,7 @@ index 9683c29c583e8b7e4f41d088160455714033a135..5edbb9132d2895da2b693fe35d4a2500
@Nullable @Nullable
private KeyPair keyPair; private KeyPair keyPair;
@Nullable @Nullable
@@ -1392,6 +1397,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1369,6 +1374,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.averageTickTime = this.averageTickTime * 0.8F + (float) l / 1000000.0F * 0.19999999F; this.averageTickTime = this.averageTickTime * 0.8F + (float) l / 1000000.0F * 0.19999999F;
long i1 = Util.getNanos(); long i1 = Util.getNanos();
@ -115,7 +115,7 @@ index 9683c29c583e8b7e4f41d088160455714033a135..5edbb9132d2895da2b693fe35d4a2500
this.frameTimer.logFrameDuration(i1 - i); this.frameTimer.logFrameDuration(i1 - i);
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -2463,4 +2474,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2458,4 +2469,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}; };
} }
} }
@ -146,10 +146,10 @@ index 9683c29c583e8b7e4f41d088160455714033a135..5edbb9132d2895da2b693fe35d4a2500
+ // Paper end + // Paper end
} }
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 8242d6d7471c78cc298d5c385f075e368ab80edf..c81230560a729492557bce00aeecb683ade1b072 100644 index 8d1cbefc82f64a120eeea8c6bdd6361ffa513099..f8ea93b531a3162f6d14dedf5f0c6abfa575930a 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
@@ -2380,6 +2380,16 @@ public final class CraftServer implements Server { @@ -2426,6 +2426,16 @@ public final class CraftServer implements Server {
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
}; };
} }

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
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 c81230560a729492557bce00aeecb683ade1b072..6de0c6aa40b2962237584156c6270489fdbaa45a 100644 index f8ea93b531a3162f6d14dedf5f0c6abfa575930a..b9b5c7c3d4e991dd62ed7acb33e02c2523fe5d46 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
@@ -2557,5 +2557,10 @@ public final class CraftServer implements Server { @@ -2603,5 +2603,10 @@ public final class CraftServer implements Server {
public int getCurrentTick() { public int getCurrentTick() {
return net.minecraft.server.MinecraftServer.currentTick; return net.minecraft.server.MinecraftServer.currentTick;
} }

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format. Serializes using NBT which is safer for server data migrations than bukkits format.
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index f8cb210390958ddba9f9685f2ec1f8bb91690162..3b727b96c4166e88ec23df3e3e1e98d6aed58637 100644 index db33d1eb9bee8178072cc3b430b88b044a66cd92..114890cceaf786ca7f76f8d2a62d6243b039285b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -378,6 +378,53 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -378,6 +378,53 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -10,10 +10,10 @@ When not per player it will use the Vanilla mechanic of one delay per
world and the world age for the start day. world and the world age for the start day.
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 c6e721b19ddc9e01ffbed765aaf52bef50e80b1d..00d1ea2440aecd81fc0e23a06f53890c55424ab3 100644 index 7c1e0c45f6456026be8d7c1d84cec3600d0a55ac..ab37621a4955b122415ceace9c9eb135b71099cd 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
@@ -510,10 +510,21 @@ public class PaperWorldConfig { @@ -498,10 +498,21 @@ public class PaperWorldConfig {
} }
public boolean disablePillagerPatrols = false; public boolean disablePillagerPatrols = false;
@ -36,10 +36,10 @@ index c6e721b19ddc9e01ffbed765aaf52bef50e80b1d..00d1ea2440aecd81fc0e23a06f53890c
private void entitiesTargetWithFollowRange() { private void entitiesTargetWithFollowRange() {
entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange); entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange);
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 4ca8f2f63e04da730a85a36d57058a481d1f9104..f515ef16ef0c92c6cf59301d2818ad714554030a 100644 index 01b9edc8aaf472650f171f1b88229807bcfdc145..06d13cca9179156a14571785e8ed3c4d8f956ccd 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
@@ -220,6 +220,7 @@ public class ServerPlayer extends Player { @@ -223,6 +223,7 @@ public class ServerPlayer extends Player {
public boolean wonGame; public boolean wonGame;
private int containerUpdateDelay; // Paper private int containerUpdateDelay; // Paper
public long loginTime; // Paper public long loginTime; // Paper
@ -48,24 +48,10 @@ index 4ca8f2f63e04da730a85a36d57058a481d1f9104..f515ef16ef0c92c6cf59301d2818ad71
public boolean queueHealthUpdatePacket = false; public boolean queueHealthUpdatePacket = false;
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java
index 744b58d59a5f34ed3bd6f2d4a0f876acfa6a7135..a3bb1d83e413a1f31b9ece4291e9ef11b3a70f0c 100644 index 4fc90f8a1fa199a1af6c125ccadcb78c970671ec..2d54bfd3c4156b2191bb95bf8bc7f172f50e0bd8 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java --- a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java +++ b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java
@@ -4,11 +4,12 @@ import java.util.Random; @@ -23,7 +23,7 @@ public class PatrolSpawner implements CustomSpawner {
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
+import net.minecraft.server.level.ServerPlayer;
+import net.minecraft.stats.Stats;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobSpawnType;
import net.minecraft.world.entity.SpawnGroupData;
import net.minecraft.world.entity.monster.PatrollingMonster;
-import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.CustomSpawner;
import net.minecraft.world.level.GameRules;
@@ -26,7 +27,7 @@ public class PatrolSpawner implements CustomSpawner {
@Override @Override
public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) { public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) {
@ -74,7 +60,7 @@ index 744b58d59a5f34ed3bd6f2d4a0f876acfa6a7135..a3bb1d83e413a1f31b9ece4291e9ef11
if (!spawnMonsters) { if (!spawnMonsters) {
return 0; return 0;
} else if (!world.getGameRules().getBoolean(GameRules.RULE_DO_PATROL_SPAWNING)) { } else if (!world.getGameRules().getBoolean(GameRules.RULE_DO_PATROL_SPAWNING)) {
@@ -34,23 +35,51 @@ public class PatrolSpawner implements CustomSpawner { @@ -31,23 +31,51 @@ public class PatrolSpawner implements CustomSpawner {
} else { } else {
Random random = world.random; Random random = world.random;
@ -87,7 +73,7 @@ index 744b58d59a5f34ed3bd6f2d4a0f876acfa6a7135..a3bb1d83e413a1f31b9ece4291e9ef11
return 0; return 0;
+ } + }
+ +
+ ServerPlayer entityhuman = world.players().get(random.nextInt(j)); + net.minecraft.server.level.ServerPlayer entityhuman = world.players().get(random.nextInt(j));
+ if (entityhuman.isSpectator()) { + if (entityhuman.isSpectator()) {
+ return 0; + return 0;
+ } + }
@ -108,7 +94,7 @@ index 744b58d59a5f34ed3bd6f2d4a0f876acfa6a7135..a3bb1d83e413a1f31b9ece4291e9ef11
+ } else { + } else {
+ long days; + long days;
+ if (world.paperConfig.patrolPerPlayerStart) { + if (world.paperConfig.patrolPerPlayerStart) {
+ days = entityhuman.getStats().getValue(Stats.CUSTOM.get(Stats.PLAY_TIME)) / 24000L; // PLAY_ONE_MINUTE is actually counting in ticks, a misnomer by Mojang + days = entityhuman.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.PLAY_TIME)) / 24000L; // PLAY_ONE_MINUTE is actually counting in ticks, a misnomer by Mojang
+ } else { + } else {
+ days = world.getDayTime() / 24000L; + days = world.getDayTime() / 24000L;
+ } + }

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Remote Connections shouldn't hold up shutdown
Bugs in the connection logic appears to leave stale connections even, preventing shutdown Bugs in the connection logic appears to leave stale connections even, preventing shutdown
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 047ec5fe63789fb0ac003ecee641542f5e9cba2f..b6ccc8cacb615a35a60c73f145b7bd1cf0b891ee 100644 index 9a2c040c3a513fe51c5fa9c5deaba13a01639f38..049eb5693dc98e1d0ec3bd88c73a41fdb2f59bff 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
@@ -441,11 +441,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -431,11 +431,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} }
if (this.rconThread != null) { if (this.rconThread != null) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Do not allow bees to load chunks for beehives
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 2487d636338cb968496166c68c3155d2913d6c41..083640b7e4aee75db9b884aebd640c9410e669ca 100644 index 678912a37167a12695388682bef634d3715def68..5a9d9926fb6fc356ee250d4e38f3bc303e280d45 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -409,6 +409,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -410,6 +410,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
if (this.hivePos == null) { if (this.hivePos == null) {
return false; return false;
} else { } else {
@ -16,7 +16,7 @@ index 2487d636338cb968496166c68c3155d2913d6c41..083640b7e4aee75db9b884aebd640c94
BlockEntity tileentity = this.level.getBlockEntity(this.hivePos); BlockEntity tileentity = this.level.getBlockEntity(this.hivePos);
return tileentity instanceof BeehiveBlockEntity && ((BeehiveBlockEntity) tileentity).isFireNearby(); return tileentity instanceof BeehiveBlockEntity && ((BeehiveBlockEntity) tileentity).isFireNearby();
@@ -441,6 +442,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -443,6 +444,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
} }
private boolean doesHiveHaveSpace(BlockPos pos) { private boolean doesHiveHaveSpace(BlockPos pos) {
@ -24,7 +24,7 @@ index 2487d636338cb968496166c68c3155d2913d6c41..083640b7e4aee75db9b884aebd640c94
BlockEntity tileentity = this.level.getBlockEntity(pos); BlockEntity tileentity = this.level.getBlockEntity(pos);
return tileentity instanceof BeehiveBlockEntity ? !((BeehiveBlockEntity) tileentity).isFull() : false; return tileentity instanceof BeehiveBlockEntity ? !((BeehiveBlockEntity) tileentity).isFull() : false;
@@ -914,6 +916,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -922,6 +924,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override @Override
public boolean canBeeUse() { public boolean canBeeUse() {
if (Bee.this.hasHive() && Bee.this.wantsToEnterHive() && Bee.this.hivePos.closerThan((Position) Bee.this.position(), 2.0D)) { if (Bee.this.hasHive() && Bee.this.wantsToEnterHive() && Bee.this.hivePos.closerThan((Position) Bee.this.position(), 2.0D)) {
@ -32,7 +32,7 @@ index 2487d636338cb968496166c68c3155d2913d6c41..083640b7e4aee75db9b884aebd640c94
BlockEntity tileentity = Bee.this.level.getBlockEntity(Bee.this.hivePos); BlockEntity tileentity = Bee.this.level.getBlockEntity(Bee.this.hivePos);
if (tileentity instanceof BeehiveBlockEntity) { if (tileentity instanceof BeehiveBlockEntity) {
@@ -937,6 +940,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { @@ -945,6 +948,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override @Override
public void start() { public void start() {

View file

@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing. Stack will identify any causer of this and warn instead of crashing.
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 be9ae4f0f19da069ae44e45a772096bb09918219..764e33719471dcd8549e0feee2ceb5f5318316be 100644 index 04c63334c4387965b2f9fc2643c28b8a954c936d..847d1b447e3796cc03e26df46b92815a76707b81 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
@@ -1557,6 +1557,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1546,6 +1546,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void addEntity(Entity entity) { public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
@ -26,10 +26,10 @@ index be9ae4f0f19da069ae44e45a772096bb09918219..764e33719471dcd8549e0feee2ceb5f5
EntityType<?> entitytypes = entity.getType(); EntityType<?> entitytypes = entity.getType();
int i = entitytypes.clientTrackingRange() * 16; int i = entitytypes.clientTrackingRange() * 16;
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 140014d0eb3b70f8415484afc36f700fd737d9d9..89e88a1de65a5724d05e926cd41733c9cd6cd740 100644 index 1ac40d31c5abefb062886757a78adc65daede768..cdacb26699a54659d1e43ec0f73640556a743700 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
@@ -2149,7 +2149,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2167,7 +2167,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTrackingStart(Entity entity) { public void onTrackingStart(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
@ -38,7 +38,7 @@ index 140014d0eb3b70f8415484afc36f700fd737d9d9..89e88a1de65a5724d05e926cd41733c9
if (entity instanceof ServerPlayer) { if (entity instanceof ServerPlayer) {
ServerLevel.this.players.add((ServerPlayer) entity); ServerLevel.this.players.add((ServerPlayer) entity);
ServerLevel.this.updateSleepingPlayerList(); ServerLevel.this.updateSleepingPlayerList();
@@ -2171,6 +2171,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2189,6 +2189,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
entity.valid = true; // CraftBukkit entity.valid = true; // CraftBukkit

View file

@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla. This is safe because Spectators are skipped in unloaded chunks too in vanilla.
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 bbc8f7909b6ae8452a8f3c697bfba92d0170dbe1..ce5efb4bf439005d8a25aff1607238389e856cd8 100644 index 06d13cca9179156a14571785e8ed3c4d8f956ccd..fd609c7b757b570206c17444867f786c1767aa69 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
@@ -638,7 +638,7 @@ public class ServerPlayer extends Player { @@ -643,7 +643,7 @@ public class ServerPlayer extends Player {
public void doTick() { public void doTick() {
try { try {

View file

@ -7,10 +7,10 @@ This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead. due to 1.15's new queue but processed while dead.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 19b5538e54f1c6073c3478393c1388ffca33291e..e9db4d972abfd7807137e32abc8b1096be4776b5 100644 index 6927eeb04a9aa1a33666f3655f2bb889bf046dc9..869c765fba6b8b7f37f0699a05b74b312dfde30d 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1104,7 +1104,7 @@ public abstract class Player extends LivingEntity { @@ -1106,7 +1106,7 @@ public abstract class Player extends LivingEntity {
@Override @Override
protected boolean isImmobile() { protected boolean isImmobile() {

View file

@ -10,19 +10,19 @@ larger than the keep loaded range.
By skipping this, we avoid potential for a large spike on server start. By skipping this, we avoid potential for a large spike on server start.
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 ce5efb4bf439005d8a25aff1607238389e856cd8..642ef5b0b6660f4fbee91c46c016125960bb9e9d 100644 index fd609c7b757b570206c17444867f786c1767aa69..d507adcb538933fcf36e9a4bfb561106d509c26f 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
@@ -310,7 +310,7 @@ public class ServerPlayer extends Player { @@ -313,7 +313,7 @@ public class ServerPlayer extends Player {
this.stats = server.getPlayerList().getStatisticManager(this); this.stats = server.getPlayerList().getPlayerStats(this);
this.advancements = server.getPlayerList().getPlayerAdvancements(this); this.advancements = server.getPlayerList().getPlayerAdvancements(this);
this.maxUpStep = 1.0F; this.maxUpStep = 1.0F;
- this.fudgeSpawnLocation(world); - this.fudgeSpawnLocation(world);
+ //this.c(worldserver); // Paper - don't move to spawn on login, only first join + //this.fudgeSpawnLocation(world); // Paper - don't move to spawn on login, only first join
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
@@ -528,7 +528,7 @@ public class ServerPlayer extends Player { @@ -531,7 +531,7 @@ public class ServerPlayer extends Player {
position = Vec3.atCenterOf(((ServerLevel) world).getSharedSpawnPos()); position = Vec3.atCenterOf(((ServerLevel) world).getSharedSpawnPos());
} }
this.level = world; this.level = world;
@ -32,7 +32,7 @@ index ce5efb4bf439005d8a25aff1607238389e856cd8..642ef5b0b6660f4fbee91c46c0161259
this.gameMode.setLevel((ServerLevel) world); this.gameMode.setLevel((ServerLevel) world);
} }
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 b828d6b2ce20a058acbabba5594e743d91df3060..6f3187aae34c24c6a9b22074d487006926afe524 100644 index 494b18a3dfa05b5e6ecbb9b99abf06bfe6e1d166..af93692bb5cc232397cec69ce2bd836a956550ef 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
@@ -210,6 +210,8 @@ public abstract class PlayerList { @@ -210,6 +210,8 @@ public abstract class PlayerList {