More more more work

This commit is contained in:
Nassim Jahnke 2021-11-23 13:15:10 +01:00 committed by MiniDigger | Martin
parent c8cb91bb99
commit e9954ed32a
79 changed files with 356 additions and 330 deletions

View file

@ -259,3 +259,6 @@ public net.minecraft.world.level.block.state.BlockBehaviour hasCollision
# add per world spawn limits
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
# Optimize isValidLocation
public net.minecraft.world.level.chunk.LevelChunkSection states

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 03d8ac1b41659540d7eb3d7e218cdfaa4acb683b..7e0ec58ea1d23501f0273882ebae8e45513b02cf 100644
index 10cb6088c4618f228c757f4e592b44edab81c2dc..65088203d29798efe211612dfadb356f457ed466 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -663,5 +663,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent

View file

@ -65,7 +65,7 @@ index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d
public class Spigot {
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 3fa8a69376cf6d5cc5987fea5cbbce228b1408d1..e0254ef7412b4935edd0c4b9801d8eccca7d4a0c 100644
index 6ec4b1408dbbe31f0f06e72d81f142e57b1d5cee..08979f50d125a62d05389da86f08f5ac77e48b11 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1489,6 +1489,62 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
Change Javadoc to be accurate
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 574ecfe2e4f576f80b519f04e740fa00530a7cfa..9fca4fb1cbf5a098e023eeba947f7cf4a3151a0d 100644
index 7da8180e4408a233af334a13661ebbc6781318ec..0b6299a586e25f97eb734e650728e50d19ad16ce 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -319,6 +319,30 @@ public final class Bukkit {
@ -41,7 +41,7 @@ index 574ecfe2e4f576f80b519f04e740fa00530a7cfa..9fca4fb1cbf5a098e023eeba947f7cf4
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 759237106df6cc2798330be22f7bdb8d18e8f427..e654e00c145fb6f0ce2238d88de9be5d31fbfa51 100644
index ad16ce2f62d6519efe8ec6da94aa2ae255521480..797ff4d2b16fba1a423c8dc247fde0ad9199b5c1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -262,6 +262,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@ -76,7 +76,7 @@ index 759237106df6cc2798330be22f7bdb8d18e8f427..e654e00c145fb6f0ce2238d88de9be5d
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index e0254ef7412b4935edd0c4b9801d8eccca7d4a0c..19b9a14b855a5e15c9a6fc9544873265bdbaf203 100644
index 08979f50d125a62d05389da86f08f5ac77e48b11..64557d549dd7d72ec78ecfac324b788657e6a0b4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -707,6 +707,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index 7c9a0c85c0e23d6a569c3583e87b005938923d95..39ce012fcf2b22471a2ace9218f4f696ec93f466 100644
index f98d46fa45bb7c842d791b09f082a0968ae537fb..e330a0d2be7a73ff84ec18499de6aecbceb5166c 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -1,6 +1,9 @@

View file

@ -432,7 +432,7 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 19b9a14b855a5e15c9a6fc9544873265bdbaf203..9468b955e035e3aa733b62f17417d8e99f37ac9f 100644
index 64557d549dd7d72ec78ecfac324b788657e6a0b4..12acaa06a00a2a2d0c03e52920bb041af29bc01e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2,6 +2,7 @@ package org.bukkit.entity;

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index 6ebea1d9fafb08ede7e37dfe1b145a676c7aaaf9..533600dfb2e73736857cc2a10525db7dc2452433 100644
index 50cee5c955b1a57e18f202897efa807f78b15635..283e2aefa17fe38ab10073761db2b77ba0ae8b46 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,9 @@ dependencies {
@ -362,7 +362,7 @@ index a850f0780de05463fc0d3f9e15ff7f19d88b2aed..9026e108ccd3a88aee1267ee275137be
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 2e306c7b984a02e12a74fac14589bf29ab6488bf..79ac529017aac059d13fe342f279e9c8faeba599 100644
index a3bc4155536f612ee2ae38ec7f16b974bdd24ab2..b7cd98f20de3421cd3b8a95cfa2155fa77afa8b1 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -291,21 +291,7 @@ public final class JavaPluginLoader implements PluginLoader {

View file

@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd9b81e4b1 100644
index 15163398f96b4eda94d99b4b48ab2b06622bd2af..608b6218f5c59ecb3e7137121b8c4c2188479297 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -283,7 +283,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -281,7 +281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
public ConsoleReader reader;
@ -24,7 +24,7 @@ index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod;
public Commands vanillaCommandDispatcher;
@@ -292,7 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -290,7 +290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start
public static final int TPS = 20;
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
@ -33,7 +33,7 @@ index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd
public final double[] recentTps = new double[ 3 ];
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end
@@ -1007,6 +1007,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -990,6 +990,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
{
return ( avg * exp ) + ( tps * ( 1 - exp ) );
}
@ -91,7 +91,7 @@ index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd
// Spigot End
protected void runServer() {
@@ -1019,26 +1070,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1002,26 +1053,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start
Arrays.fill( recentTps, 20 );
@ -133,7 +133,7 @@ index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd
tickSection = curTime;
}
// Spigot end
@@ -1048,7 +1106,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1031,7 +1089,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
}
@ -144,10 +144,10 @@ index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd
this.startMetricsRecordingTick();
this.profiler.push("tick");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 55bc67744d41c3416dc7be1ae1acc37e8f798e56..47b212ca59b1c30b7224cac6a96f527fdfe659f8 100644
index 6381ef19b4ea9ddcbf797eaae8103fe88d5d7fb7..c365a1cd02dbb8a248ba6247d3feb9553a22dfe6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2304,6 +2304,17 @@ public final class CraftServer implements Server {
@@ -2316,6 +2316,17 @@ public final class CraftServer implements Server {
return CraftMagicNumbers.INSTANCE;
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b139868f1c84a97d145634d37cf0f658871f93c6..767bb340e4d7c1cd96a097145c9a9ad0cd2509b9 100644
index 6b945d22a84b77f835500ea8215748de24d5a00d..22c317d3762b9e2d8f70bd413555507c68b0cae4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1460,12 +1460,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1447,12 +1447,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setFlying(boolean value) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9d00198c74bae8507df75553c9005ba847fd7c11..29cff1fba174be7fb6b26958db61bd4ea6c3125d 100644
index 0486dc411f7cbda85c4e02fc85512a122522e035..057285ca421dc7e9a0c6449238409eaf42235ef5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1946,6 +1946,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1980,6 +1980,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
entity.valid = true; // CraftBukkit
@ -25,10 +25,10 @@ index 9d00198c74bae8507df75553c9005ba847fd7c11..29cff1fba174be7fb6b26958db61bd4e
public void onTrackingEnd(Entity entity) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f903453fd129f6fb5023615088bd84d33052f0dc..3d6b2a74182485af701838be075edd999520ddf2 100644
index 969017958ff8ea6d8efba261ce1fe6e5c3a3f518..ff233d417d3f4f8fa4fa9ae9e77de7640102a172 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -281,6 +281,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -285,6 +285,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only
public boolean forceExplosionKnockback; // SPIGOT-949
public boolean persistentInvisibility = false;
@ -56,7 +56,7 @@ index f903453fd129f6fb5023615088bd84d33052f0dc..3d6b2a74182485af701838be075edd99
// Spigot start
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
@@ -1818,6 +1839,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1847,6 +1868,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.bukkitEntity.storeBukkitValues(nbt);
}
// CraftBukkit end
@ -72,7 +72,7 @@ index f903453fd129f6fb5023615088bd84d33052f0dc..3d6b2a74182485af701838be075edd99
return nbt;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -1944,6 +1974,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1973,6 +2003,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
// CraftBukkit end
@ -94,10 +94,10 @@ index f903453fd129f6fb5023615088bd84d33052f0dc..3d6b2a74182485af701838be075edd99
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 91c0e425de193be1e4e9779d1c92c8ea577e29e0..1d538f490c7aa48991446fb55c7f0916bb5d5e29 100644
index 1cc849fadd1e1cf4ef1d1009c8e42febe92a6e28..0366303a986ae6da8e95ed3051610c432a790194 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -330,6 +330,14 @@ public class FallingBlockEntity extends Entity {
@@ -345,6 +345,14 @@ public class FallingBlockEntity extends Entity {
this.blockState = Blocks.SAND.defaultBlockState();
}
@ -111,9 +111,9 @@ index 91c0e425de193be1e4e9779d1c92c8ea577e29e0..1d538f490c7aa48991446fb55c7f0916
+ // Paper end
}
public Level getLevel() {
public void setHurtsEntities(float fallHurtAmount, int fallHurtMax) {
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
index 394164f50256ad9a167e15531a9202875abb6cb6..8ad1b3cb16533d62deda643ce0cdda308743f78e 100644
index 1f61dcc3d6f33f69fbebaaaee0554403c3e13adf..7135e22a2ee274eaef52804d60f15002176ff1db 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -120,6 +120,14 @@ public class PrimedTnt extends Entity {
@ -132,7 +132,7 @@ index 394164f50256ad9a167e15531a9202875abb6cb6..8ad1b3cb16533d62deda643ce0cdda30
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index a527e4e04babfaf6f324e4aa3b93a86009664166..5d5c6d1cfaa25f3a05976ee496d14fb32b052785 100644
index b80b834fc35201746f5bba079aff6d95874f8f57..506bc08a7aadf5246f57e6935dbaa81ca482fb9a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1146,4 +1146,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity and entity crashes
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e8469eaad83932024a6f817674e0a50ae7df75aa..9745f583f8ba4a654e8ad81e54ad3d95d9849dd7 100644
index e112598c854a2c93a8e6b6bda3cfdd4ee4091980..1195a4b79103d62ed4f8c91dd36ccd77fa561f01 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -736,11 +736,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -737,11 +737,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try {
tickConsumer.accept(entity);
} catch (Throwable throwable) {
@ -26,10 +26,10 @@ index e8469eaad83932024a6f817674e0a50ae7df75aa..9745f583f8ba4a654e8ad81e54ad3d95
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
index 7b333e2d6884b272abefbc820bcce8026a4cdf7e..66ab4deedd177f507d170a61ceca4c3ebbac9adc 100644
index e1cbecc402bfc14fb9e36d5c449cd404f119752d..52b4c231faa2f33f766f50399e52e30184fb01a7 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -196,7 +196,12 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject {
@@ -233,7 +233,12 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
return minecraftkey + " // " + this.getClass().getCanonicalName();
});
if (this.level != null) {
@ -44,10 +44,10 @@ index 7b333e2d6884b272abefbc820bcce8026a4cdf7e..66ab4deedd177f507d170a61ceca4c3e
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index be1d7d2be46c746b593c3842030412940e2e57f8..ea894662b41cddfc5702a7d6305978be71da79b4 100644
index 3e4ece7b607d06c9d88322ce79f4888e1cc07aee..cadcafec7dc8af1e938b20d07bd9a24acd350ab1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1247,11 +1247,11 @@ public class LevelChunk implements ChunkAccess {
@@ -1029,11 +1029,11 @@ public class LevelChunk extends ChunkAccess {
gameprofilerfiller.pop();
} catch (Throwable throwable) {

View file

@ -29,10 +29,10 @@ index 1cfa6ae0a2fc42cd83c1323d49151ec2bbbacf83..08281351cc99e904a3a388607425dde4
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 30502371b8d49738787b7cddab713472b6f2ce41..3acb00b025d5e45c7244cb62b59c5466d16a88dc 100644
index ff233d417d3f4f8fa4fa9ae9e77de7640102a172..6bc8c8e15e66cd54cbb6ebc6d09a6fe8652b5d18 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -628,7 +628,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -634,7 +634,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
}
public void checkOutOfWorld() {

View file

@ -20,10 +20,10 @@ index 08281351cc99e904a3a388607425dde4c83f13e2..58c8c6db87492cf70de3a26d23209a93
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0e7c09c80509c83a52f32f735a1b19960bb369ee..a29058a772bcb908de631c34cd9743f4721cf1ae 100644
index a3436596d05547a60c9906c92f709bb56a9175bd..88b6be62678fc09b5a39db28c6d71cc31b16dbcd 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -936,6 +936,7 @@ public class ServerPlayer extends Player {
@@ -974,6 +974,7 @@ public class ServerPlayer extends Player {
this.unRide();
this.getLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
if (!this.wonGame) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix lag from explosions processing dead entities
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 73a2b98a7080f7f033ac79c097f0758fefdba5c0..83f542bc7c5cb9a309202bb37affac3432bb0535 100644
index a0e364c3f6d5c513c8b37de60ced9ef6433b6cda..996e02be9f3150ba125d52e3d544599c2b8dd968 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -208,7 +208,7 @@ public class Explosion {
@@ -207,7 +207,7 @@ public class Explosion {
int i1 = Mth.floor(this.y + (double) f2 + 1.0D);
int j1 = Mth.floor(this.z - (double) f2 - 1.0D);
int k1 = Mth.floor(this.z + (double) f2 + 1.0D);

View file

@ -25,10 +25,10 @@ index 58c8c6db87492cf70de3a26d23209a931c6726b2..ef0ec6b45cee27547e06ead7ef5acd6e
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bfb835174390f6265d78c980cd56cd48ab1f4994..564517db80c3e7346f01746600d497becf0f0cff 100644
index 608b6218f5c59ecb3e7137121b8c4c2188479297..5cf85636e089a4bf2422d76b8df52c1166d3f148 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1423,6 +1423,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1405,6 +1405,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
this.profiler.pop();
@ -37,10 +37,10 @@ index bfb835174390f6265d78c980cd56cd48ab1f4994..564517db80c3e7346f01746600d497be
this.profiler.popPush("connection");
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 83f542bc7c5cb9a309202bb37affac3432bb0535..f833041bb004203f327d33dc7aaade8e9ab36772 100644
index 996e02be9f3150ba125d52e3d544599c2b8dd968..688ebb68209beb4550293f72b1fa7b39852be453 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -227,7 +227,7 @@ public class Explosion {
@@ -226,7 +226,7 @@ public class Explosion {
d8 /= d11;
d9 /= d11;
d10 /= d11;
@ -49,7 +49,7 @@ index 83f542bc7c5cb9a309202bb37affac3432bb0535..f833041bb004203f327d33dc7aaade8e
double d13 = (1.0D - d7) * d12;
// CraftBukkit start
@@ -446,4 +446,84 @@ public class Explosion {
@@ -444,4 +444,84 @@ public class Explosion {
private BlockInteraction() {}
}
@ -135,10 +135,10 @@ index 83f542bc7c5cb9a309202bb37affac3432bb0535..f833041bb004203f327d33dc7aaade8e
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 9745f583f8ba4a654e8ad81e54ad3d95d9849dd7..dd2dd8c12a8dfe252ab90ba5defd98a15dea14eb 100644
index 1195a4b79103d62ed4f8c91dd36ccd77fa561f01..d8da1dfdc58726eda01e1bfb059c144e98ce7fe8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -155,6 +155,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -156,6 +156,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;

View file

@ -19,10 +19,10 @@ index ef0ec6b45cee27547e06ead7ef5acd6e51380a52..dc8a1e4c5375fdd733146f671df91f59
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2e1857e80797c9012e203f69f44d5a6126d48ea7..c5fb30aec04bd46ab4ad376382889f99015f63b9 100644
index 906c23068d1f5be76a6985b7255f6f155335b673..deef28110441cd2965c6b531bc255ee2aa994ace 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1380,6 +1380,7 @@ public abstract class LivingEntity extends Entity {
@@ -1375,6 +1375,7 @@ public abstract class LivingEntity extends Entity {
}
}
@ -30,7 +30,7 @@ index 2e1857e80797c9012e203f69f44d5a6126d48ea7..c5fb30aec04bd46ab4ad376382889f99
if (flag1) {
if (flag) {
this.level.broadcastEntityEvent(this, (byte) 29);
@@ -1400,6 +1401,7 @@ public abstract class LivingEntity extends Entity {
@@ -1395,6 +1396,7 @@ public abstract class LivingEntity extends Entity {
b0 = 2;
}
@ -38,7 +38,7 @@ index 2e1857e80797c9012e203f69f44d5a6126d48ea7..c5fb30aec04bd46ab4ad376382889f99
this.level.broadcastEntityEvent(this, b0);
}
@@ -1423,6 +1425,7 @@ public abstract class LivingEntity extends Entity {
@@ -1418,6 +1420,7 @@ public abstract class LivingEntity extends Entity {
}
}
@ -47,10 +47,10 @@ index 2e1857e80797c9012e203f69f44d5a6126d48ea7..c5fb30aec04bd46ab4ad376382889f99
if (!this.checkTotemDeathProtection(source)) {
SoundEvent soundeffect = this.getDeathSound();
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index f833041bb004203f327d33dc7aaade8e9ab36772..35ea80a18234d8125397edb5bab9e86ea526d3ca 100644
index 688ebb68209beb4550293f72b1fa7b39852be453..32c8403d6a5f5fbd52679b12b07936147744b8a4 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -243,14 +243,14 @@ public class Explosion {
@@ -241,14 +241,14 @@ public class Explosion {
double d14 = d13;
if (entity instanceof LivingEntity) {

View file

@ -19,10 +19,10 @@ index dc8a1e4c5375fdd733146f671df91f59817f8377..3ca83e07060e184cbd19a5585d44f5e7
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 55dda62e7ec3b92a406ce85d345dd7af422e2783..2649c180cbfcc210458ca795d3f14fa0b6017546 100644
index 057285ca421dc7e9a0c6449238409eaf42235ef5..0fd9ad873ed681dab1b297bf5cdf700e43be2200 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -644,7 +644,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -556,7 +556,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("thunder");
BlockPos blockposition;

View file

@ -19,10 +19,10 @@ index 3ca83e07060e184cbd19a5585d44f5e7a5354462..bf0c767af0ca5129b69b3c8dcfe54cde
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2649c180cbfcc210458ca795d3f14fa0b6017546..6899be05202c114a6e6086bc3fdf739d3ab97fd7 100644
index 0fd9ad873ed681dab1b297bf5cdf700e43be2200..032e1e08413f2d0f601cdc32fe12145e2c1fec5f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -668,7 +668,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -580,7 +580,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
gameprofilerfiller.popPush("iceandsnow");

View file

@ -19,18 +19,18 @@ index bf0c767af0ca5129b69b3c8dcfe54cdee989854b..cff814a123e02aea96197c1be092c210
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index a003e1c0d99a4d4c88269ea5bad250ba73bbc9c9..65744b55f06c225745e3e145e5f5e60ebefd304c 100644
index b3a4c907bb15907d82e58247cb049e3f9fcf990e..840a47fdfa67b166bbafd5d7958462b32fb26681 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -46,6 +46,7 @@ public abstract class BaseSpawner {
public int requiredPlayerRange;
public int spawnRange;
private final Random random;
@@ -42,6 +42,7 @@ public abstract class BaseSpawner {
public int requiredPlayerRange = 16;
public int spawnRange = 4;
private final Random random = new Random();
+ private int tickDelay = 0; // Paper
public BaseSpawner() {
this.spawnPotentials = BaseSpawner.EMPTY_POTENTIALS;
@@ -101,13 +102,18 @@ public abstract class BaseSpawner {
public BaseSpawner() {}
@@ -75,13 +76,18 @@ public abstract class BaseSpawner {
}
public void serverTick(ServerLevel world, BlockPos pos) {
@ -51,7 +51,7 @@ index a003e1c0d99a4d4c88269ea5bad250ba73bbc9c9..65744b55f06c225745e3e145e5f5e60e
} else {
boolean flag = false;
@@ -156,8 +162,7 @@ public abstract class BaseSpawner {
@@ -146,8 +152,7 @@ public abstract class BaseSpawner {
((Mob) entity).finalizeSpawn(world, world.getCurrentDifficultyAt(entity.blockPosition()), MobSpawnType.SPAWNER, (SpawnGroupData) null, (CompoundTag) null);
}
// Spigot Start

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 3f3404d7d890864fcdcde7d65f726d288ddec688..da722cddaaa8c40715748de81104a5b213c2fea8 100644
index 88b6be62678fc09b5a39db28c6d71cc31b16dbcd..352bfe795aea26307de9c998d67a43af3e4845f0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1709,7 +1709,7 @@ public class ServerPlayer extends Player {
@@ -1727,7 +1727,7 @@ public class ServerPlayer extends Player {
return s;
}
@ -17,7 +17,7 @@ index 3f3404d7d890864fcdcde7d65f726d288ddec688..da722cddaaa8c40715748de81104a5b2
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
public void updateOptions(ServerboundClientInformationPacket packet) {
// CraftBukkit start
@@ -1717,9 +1717,10 @@ public class ServerPlayer extends Player {
@@ -1735,9 +1735,10 @@ public class ServerPlayer extends Player {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@ -25,15 +25,15 @@ index 3f3404d7d890864fcdcde7d65f726d288ddec688..da722cddaaa8c40715748de81104a5b2
+ if (this.locale == null || !this.locale.equals(packet.language)) { // Paper - check for null
PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(this.getBukkitEntity(), packet.language);
this.server.server.getPluginManager().callEvent(event);
+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packet.language).callEvent(); // Paper
+ this.server.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packet.language)); // Paper
}
this.locale = packet.language;
// Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4592ac12058e7cf575ceb47a0021528f5dd91b0a..8fc027fbbc3f5fc3ecdd8fce4f3b2eb510fa76da 100644
index 22c317d3762b9e2d8f70bd413555507c68b0cae4..60807ed83e4240cdf1e05654d24c55313aba813f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1913,8 +1913,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1778,8 +1778,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public String getLocale() {

View file

@ -0,0 +1,98 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 6 May 2019 01:29:25 -0400
Subject: [PATCH] Per-Player View Distance API placeholders
I hope to look at this more in-depth soon. It appears doable.
However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 352bfe795aea26307de9c998d67a43af3e4845f0..4689d52cd314a607d17be3657099157e95f34d47 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -167,6 +167,8 @@ import org.bukkit.inventory.MainHand;
public class ServerPlayer extends Player {
+ public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder
+
private static final Logger LOGGER = LogManager.getLogger();
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 277b946bec2cfd8cfb4054504133f6ab9059ba8c..a465ef627169e62132287cded07efb5b05e1ed36 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1750,6 +1750,31 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public int getSimulationDistance() {
return world.spigotConfig.simulationDistance;
}
+
+ @Override
+ public void setViewDistance(int viewDistance) {
+ throw new UnsupportedOperationException(); //TODO
+ }
+
+ @Override
+ public int getNoTickViewDistance() {
+ throw new UnsupportedOperationException(); //TODO
+ }
+
+ @Override
+ public void setNoTickViewDistance(int viewDistance) {
+ throw new UnsupportedOperationException(); //TODO
+ }
+
+ @Override
+ public int getSendViewDistance() {
+ throw new UnsupportedOperationException(); //TODO
+ }
+
+ @Override
+ public void setSendViewDistance(int viewDistance) {
+ throw new UnsupportedOperationException(); //TODO
+ }
// Spigot end
// Spigot start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 60807ed83e4240cdf1e05654d24c55313aba813f..4fc2310287c2f0d366ac9ad23607125541a3c8bb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -377,6 +377,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
}
}
+
+ @Override
+ public int getViewDistance() {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public void setViewDistance(int viewDistance) {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public int getNoTickViewDistance() {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public void setNoTickViewDistance(int viewDistance) {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public int getSendViewDistance() {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public void setSendViewDistance(int viewDistance) {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
// Paper end
@Override

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index 5406ca495dd3dcb23929605d5b27bb4370a63d4d..0fa01b98f4a2ce2a7d34437a71d8c1cc7e718fb1 100644
index f51c5c07f8f877f778535ee2d0ecc9dff01cca0c..76a401bcfdacded2137142ed38d739ed65d9fae6 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -43,6 +43,10 @@ import net.minecraft.world.phys.AABB;
@@ -42,6 +42,10 @@ import net.minecraft.world.phys.AABB;
import org.bukkit.craftbukkit.potion.CraftPotionUtil;
import org.bukkit.potion.PotionEffect;
// CraftBukkit end
@ -19,7 +19,7 @@ index 5406ca495dd3dcb23929605d5b27bb4370a63d4d..0fa01b98f4a2ce2a7d34437a71d8c1cc
public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
@@ -274,15 +278,23 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
@@ -273,15 +277,23 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
}
}
@ -47,7 +47,7 @@ index 5406ca495dd3dcb23929605d5b27bb4370a63d4d..0fa01b98f4a2ce2a7d34437a71d8c1cc
}
}
}
@@ -305,10 +317,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
@@ -304,10 +316,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
int j = BeaconBlockEntity.getLevel(beaconLevel);
List list = BeaconBlockEntity.getHumansInRange(world, pos, beaconLevel);

View file

@ -19,10 +19,10 @@ index cff814a123e02aea96197c1be092c210c2fcf781..0f93c6ba2bc1b6207f8a5c3f9a39cb08
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index d263d9ce353312fe6954cdd2ef1a2c4c0260f168..3f3404d7d890864fcdcde7d65f726d288ddec688 100644
index 4689d52cd314a607d17be3657099157e95f34d47..3a97690a1e65db9a1c184fa4df5899cfda3d44bc 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -217,6 +217,7 @@ public class ServerPlayer extends Player {
@@ -220,6 +220,7 @@ public class ServerPlayer extends Player {
private int containerCounter;
public int latency;
public boolean wonGame;
@ -30,7 +30,7 @@ index d263d9ce353312fe6954cdd2ef1a2c4c0260f168..3f3404d7d890864fcdcde7d65f726d28
// CraftBukkit start
public String displayName;
@@ -587,7 +588,12 @@ public class ServerPlayer extends Player {
@@ -591,7 +592,12 @@ public class ServerPlayer extends Player {
--this.invulnerableTime;
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index dd2dd8c12a8dfe252ab90ba5defd98a15dea14eb..5f047982b559087ae6eaffbc89ea83d289609de5 100644
index d8da1dfdc58726eda01e1bfb059c144e98ce7fe8..8e06ce1d838b9eaa71a699a999e91dcd5d596a7b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -702,9 +702,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -703,9 +703,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start
// Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0;

View file

@ -9,10 +9,10 @@ This is a duplicate API from spigot, so use our duplicate subclass and
improve setPosition to use raw
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 14cf49b910bd789f1dd61d303b88d53a93c3abd6..0ea5574ab43141a69e6aa5e05aeb548660f126e1 100644
index 1cfeaeeddbc97e28f51c79ab3082a5d387daaead..db52eb4df917c9ad3ba807e40f1d44ea9c52aae8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -216,7 +216,7 @@ public abstract class PlayerList {
@@ -217,7 +217,7 @@ public abstract class PlayerList {
// Spigot start - spawn location event
Player spawnPlayer = player.getBukkitEntity();
@ -21,9 +21,9 @@ index 14cf49b910bd789f1dd61d303b88d53a93c3abd6..0ea5574ab43141a69e6aa5e05aeb5486
this.cserver.getPluginManager().callEvent(ev);
Location loc = ev.getSpawnLocation();
@@ -224,7 +224,10 @@ public abstract class PlayerList {
@@ -225,7 +225,10 @@ public abstract class PlayerList {
player.setLevel(worldserver1);
player.spawnIn(worldserver1);
player.gameMode.setLevel((ServerLevel) player.level);
- player.absMoveTo(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
+ // Paper start - set raw so we aren't fully joined to the world (not added to chunk or world)

View file

@ -20,7 +20,7 @@ index 0f93c6ba2bc1b6207f8a5c3f9a39cb086797e800..0ccb86aed122ecd54a460db426163d0d
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
index 1c1998c15849a56241b397bd2dfa8b00d39f610b..1891cfb8f7ebae5a95a55f706bb04f8206121d32 100644
index 306fd5b1893d8a68af2073978bab7e590e936ef5..db726697b00afdee6078849fd224263483349912 100644
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
@@ -362,6 +362,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements

View file

@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren
that it is happening so that plugin authors can fix their code to stop executing commands async.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index da9f4b3337b49597c17b50964656457cd629a0b7..22c2c121bbcc7b0e15d73d20c9cc83d5fb085e5f 100644
index 11687dc95f606750e9042b043f333e3b00eb171c..38909ef14fcfd4b93d83512f4cacbe2c3fe431a1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1846,6 +1846,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1852,6 +1852,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
}
if (!async && s.startsWith("/")) {
@ -48,10 +48,10 @@ index da9f4b3337b49597c17b50964656457cd629a0b7..22c2c121bbcc7b0e15d73d20c9cc83d5
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 47b212ca59b1c30b7224cac6a96f527fdfe659f8..52a20a67ac25018c04d037c54b014d15ee2c1e95 100644
index c365a1cd02dbb8a248ba6247d3feb9553a22dfe6..7292cc72e9d8227b4354f1d91246d27d639c5abb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -787,6 +787,28 @@ public final class CraftServer implements Server {
@@ -796,6 +796,28 @@ public final class CraftServer implements Server {
Validate.notNull(commandLine, "CommandLine cannot be null");
org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot

View file

@ -19,7 +19,7 @@ index 0ccb86aed122ecd54a460db426163d0d2639c609..84df54523eada327033bb8821a7009df
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index b42fa1aa311cab14580906c1f77d02c418ce2285..239f3a17ab8cff4e6c97044e4f8e6755abac193d 100644
index 19a2702d9053037203c192d7f26f3c9afbe6f782..11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -323,7 +323,7 @@ public class Slime extends Mob implements Enemy {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 52a20a67ac25018c04d037c54b014d15ee2c1e95..8f24d4e8eb26b02f8aa2160d69a7a61807a9580a 100644
index 7292cc72e9d8227b4354f1d91246d27d639c5abb..c66577e495b59acd9bc666e1291c6417cfa9e477 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1923,6 +1923,7 @@ public final class CraftServer implements Server {
@@ -1934,6 +1934,7 @@ public final class CraftServer implements Server {
return this.helpMap;
}

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 6c4cb5a8878f2738048d9dc8386cbb985843cf50..8e97b3985056caa2aa692ec6250022e095d0b3a6 100644
index a6192a7edd94e63c568ca8196e0ed9fa993da6bb..1d3cd79634366718cd354cd2f55c6fc974ad3525 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -99,7 +99,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Ensure inv drag is in bounds
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index 13e5dbc79dc8b70d158717ad48f64240a2643714..60a67f75b4f772654e064e2b19f68a907ca4c93b 100644
index ccb6ff0cf31e619ce555d404a6454750f0958f12..36834f30ccefd229df4da2dbc7b22edcb83429c3 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -406,7 +406,7 @@ public abstract class AbstractContainerMenu {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 22bc8fa039375a3205bdfdf05b6c73c856fb1b16..b10cf0c5800397520f57c0bbc88a52e52db6a4c8 100644
index 0053474ab7c25de6d86c16e3079feb21f75d1c11..303b877bc467de7c046cc221d061fac841c1d9f3 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -357,6 +357,11 @@ public class FriendlyByteBuf extends ByteBuf {
@@ -356,6 +356,11 @@ public class FriendlyByteBuf extends ByteBuf {
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) {
return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144);
}
@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4
// Paper end
buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6572528a3a664f10d8c3a0d0808c411fcd031f71..ca8987d38f1fcbc094f0f5f13f12dfbf7dd2718a 100644
index 4fc2310287c2f0d366ac9ad23607125541a3c8bb..b7dae85766f3077f92ab014562cf0143bff7c9d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@
@ -73,7 +73,7 @@ index 6572528a3a664f10d8c3a0d0808c411fcd031f71..ca8987d38f1fcbc094f0f5f13f12dfbf
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.BaseEncoding;
@@ -242,6 +243,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -248,6 +249,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}

View file

@ -23,12 +23,12 @@ index 84df54523eada327033bb8821a7009df62dc7bca..304883dc18bab3bf4740006a5e6d7c58
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3acb00b025d5e45c7244cb62b59c5466d16a88dc..3456dcbac4984d4485c85b432f33ab33e76d1361 100644
index 6bc8c8e15e66cd54cbb6ebc6d09a6fe8652b5d18..8161cbd3cfed89bee74209c718d0ceff2b401890 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2906,7 +2906,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
double d4 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType());
BlockPos blockposition = new BlockPos(Mth.clamp(this.getX() * d4, d0, d2), this.getY(), Mth.clamp(this.getZ() * d4, d1, d3));
@@ -2939,7 +2939,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType());
BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0);
// CraftBukkit start
- CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16);
+ // Paper start
@ -42,15 +42,15 @@ index 3acb00b025d5e45c7244cb62b59c5466d16a88dc..3456dcbac4984d4485c85b432f33ab33
return null;
}
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 4d186a7d6ccf09092c5e1577e4b49e0975787980..d5ba2e679ed1858ea18e18feffce50544ae036c2 100644
index 194465751c351a921100e621a0ef1616c7e5f3fb..80811386c1006d56824ff4d43830f2a140aaee30 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
@@ -44,7 +44,7 @@ public class PortalForcer {
@@ -43,7 +43,7 @@ public class PortalForcer {
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos destPos, boolean destIsNether) {
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, boolean destIsNether, WorldBorder worldborder) {
// CraftBukkit start
- return this.findPortal(destPos, destIsNether ? 16 : 128); // Search Radius
+ return this.findPortal(destPos, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius
- return this.findPortalAround(blockposition, worldborder, destIsNether ? 16 : 128); // Search Radius
+ return this.findPortalAround(blockposition, worldborder, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius
}
public Optional<BlockUtil.FoundRectangle> findPortal(BlockPos blockposition, int i) {
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8f24d4e8eb26b02f8aa2160d69a7a61807a9580a..cde74a4785e4197f4b39ee28663801726a9e4dca 100644
index c66577e495b59acd9bc666e1291c6417cfa9e477..e62ee04cbe0f3281783aff8ef74d7165447b34ba 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -285,6 +285,7 @@ public final class CraftServer implements Server {
@@ -289,6 +289,7 @@ public final class CraftServer implements Server {
public boolean ignoreVanillaPermissions = false;
private final List<CraftPlayer> playerView;
public int reloadCount;
@ -17,7 +17,7 @@ index 8f24d4e8eb26b02f8aa2160d69a7a61807a9580a..cde74a4785e4197f4b39ee2866380172
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 5d5c6d1cfaa25f3a05976ee496d14fb32b052785..2c638d95b396044841ab0dea8d8ce829077992fe 100644
index 506bc08a7aadf5246f57e6935dbaa81ca482fb9a..78b3be2ea6351cb6375b77340218615aa75b87f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -436,10 +436,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View file

@ -30,15 +30,15 @@ index 304883dc18bab3bf4740006a5e6d7c58bab12348..6d1473a5267ecd3617d76fee23527bde
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5a90d36915ab14aea6bf6431a1894031a5c9ee96..8eac81867ff299d45427fd71d9b085439deb95d8 100644
index b7dae85766f3077f92ab014562cf0143bff7c9d3..3c7ae0966f2e8d0ab0924047653792ac7ac75f10 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -898,7 +898,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -905,7 +905,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (fromWorld == toWorld) {
entity.connection.teleport(to);
} else {
- server.getHandle().moveToWorld(entity, toWorld, true, to, true);
+ server.getHandle().moveToWorld(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper
- server.getHandle().respawn(entity, toWorld, true, to, true);
+ server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper
}
return true;
}

View file

@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index d3213114aaaaef575efb79f0c66d5c23baf8614d..fb3b0693abb6f2f044d39508b727fb3a2ad16823 100644
index cab03a81a97d851db61e517cfe3a43fa8afd32b2..9dd0279f9d33fabd1dc4ff029f0ad76a9cc8cb21 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -875,6 +875,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -924,6 +924,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return true;
} catch (Exception exception) {
ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception);
@ -61,7 +61,7 @@ index d3213114aaaaef575efb79f0c66d5c23baf8614d..fb3b0693abb6f2f044d39508b727fb3a
}
}
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index b0ed7d12bee6b247762fff3d5a24f0cc9411e3dc..f6cb864c45f960811acc02829d1f7883b916de29 100644
index 38403f62a9539382d5330f9231fe9ef618b87c21..876658b685ea09adb4c01d436da56daadb7eedaa 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -1,5 +1,6 @@
@ -88,7 +88,7 @@ index b0ed7d12bee6b247762fff3d5a24f0cc9411e3dc..f6cb864c45f960811acc02829d1f7883
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962deee180ef3 100644
index 4cde8d630a0951f297622af4ef781f5b3fabf9af..7044d8c71e85551e11bf2d96b767e08811bdb9fe 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java
@@ -1,5 +1,7 @@
@ -99,7 +99,7 @@ index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962de
import java.util.Iterator;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
@@ -119,6 +121,7 @@ public class VillageSiege implements CustomSpawner {
@@ -118,6 +120,7 @@ public class VillageSiege implements CustomSpawner {
entityzombie.finalizeSpawn(world, world.getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.EVENT, (SpawnGroupData) null, (CompoundTag) null);
} catch (Exception exception) {
VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception);
@ -108,7 +108,7 @@ index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962de
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5f047982b559087ae6eaffbc89ea83d289609de5..dccf23a64bad4fbfcef56eace434884e35919add 100644
index 8e06ce1d838b9eaa71a699a999e91dcd5d596a7b..79764895307139b34f2b018f3be86d6610503b64 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@
@ -122,7 +122,7 @@ index 5f047982b559087ae6eaffbc89ea83d289609de5..dccf23a64bad4fbfcef56eace434884e
import com.google.common.collect.Lists;
import com.mojang.serialization.Codec;
import java.io.IOException;
@@ -738,6 +743,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -739,6 +744,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable);
@ -131,10 +131,10 @@ index 5f047982b559087ae6eaffbc89ea83d289609de5..dccf23a64bad4fbfcef56eace434884e
// Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index ac815b900f58f67a2c656fc1dbf8f53ffc15b96e..0432ad7ab00c336e7c566f24c3ec92b399cb6e9d 100644
index 81b61b6cc1e99328d4d339ca32895d1268c88ca7..28a7c53d98450cc79bee953411a18f50cfed26c2 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -313,6 +313,7 @@ public final class NaturalSpawner {
@@ -316,6 +316,7 @@ public final class NaturalSpawner {
}
} catch (Exception exception) {
NaturalSpawner.LOGGER.warn("Failed to create mob", exception);
@ -142,8 +142,8 @@ index ac815b900f58f67a2c656fc1dbf8f53ffc15b96e..0432ad7ab00c336e7c566f24c3ec92b3
return null;
}
}
@@ -415,6 +416,7 @@ public final class NaturalSpawner {
entity = biomesettingsmobs_c.type.create((Level) world.getLevel());
@@ -422,6 +423,7 @@ public final class NaturalSpawner {
entity = biomesettingsmobs_c.type.create(world.getLevel());
} catch (Exception exception) {
NaturalSpawner.LOGGER.warn("Failed to create mob", exception);
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper
@ -151,7 +151,7 @@ index ac815b900f58f67a2c656fc1dbf8f53ffc15b96e..0432ad7ab00c336e7c566f24c3ec92b3
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da92742b5f519 100644
index cadcafec7dc8af1e938b20d07bd9a24acd350ab1..ac17877ea6e210acfb54961a2818ca1ae7f6c738 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1,6 +1,7 @@
@ -160,9 +160,9 @@ index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da927
import com.google.common.collect.ImmutableList;
+import com.destroystokyo.paper.exception.ServerInternalException;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.common.collect.UnmodifiableIterator;
@@ -615,10 +616,15 @@ public class LevelChunk implements ChunkAccess {
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@@ -547,10 +548,15 @@ public class LevelChunk extends ChunkAccess {
this.removeBlockEntity(blockEntity.getBlockPos());
// Paper end
} else {
@ -182,7 +182,7 @@ index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da927
// CraftBukkit end
}
}
@@ -1250,6 +1256,7 @@ public class LevelChunk implements ChunkAccess {
@@ -1032,6 +1038,7 @@ public class LevelChunk extends ChunkAccess {
// Paper start - Prevent tile entity and entity crashes
final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());
net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable);
@ -191,10 +191,10 @@ index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da927
// Paper end
// Spigot start
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index 1441888430687b9de2a67f21ed426f16d5b30538..f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9 100644
index c87faa811ec3eafa206d74c89927259d382fb492..9f3223947d2fcc1aaf259effe6afce7a47888858 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -277,6 +277,7 @@ public class RegionFile implements AutoCloseable {
@@ -274,6 +274,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@ -202,7 +202,7 @@ index 1441888430687b9de2a67f21ed426f16d5b30538..f514c29e64a9c7a66ff4edd5ba8c2a3d
return false;
}
}
@@ -358,6 +359,7 @@ public class RegionFile implements AutoCloseable {
@@ -355,6 +356,7 @@ public class RegionFile implements AutoCloseable {
((java.nio.Buffer) bytebuffer).position(5); // CraftBukkit - decompile error
filechannel.write(bytebuffer);
} catch (Throwable throwable) {

View file

@ -25,10 +25,10 @@ index 6d1473a5267ecd3617d76fee23527bde58283bb1..1ab2ede5e9d8939f69fb430084437fda
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3456dcbac4984d4485c85b432f33ab33e76d1361..bd64589488506c018dde86ff3a47836168dd7025 100644
index 8161cbd3cfed89bee74209c718d0ceff2b401890..a957a168450ee5c34a58ed993f281ca774fccfc1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2555,6 +2555,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -2588,6 +2588,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
@Nullable
public Team getTeam() {
@ -37,10 +37,10 @@ index 3456dcbac4984d4485c85b432f33ab33e76d1361..bd64589488506c018dde86ff3a478361
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index c5fb30aec04bd46ab4ad376382889f99015f63b9..0f27ee2ed35f54e30e2169941706eb0fc11275d5 100644
index deef28110441cd2965c6b531bc255ee2aa994ace..60356e889f2da17b313ee5cf223ee0c5066182c4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -803,6 +803,7 @@ public abstract class LivingEntity extends Entity {
@@ -798,6 +798,7 @@ public abstract class LivingEntity extends Entity {
if (nbt.contains("Team", 8)) {
String s = nbt.getString("Team");
PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s);

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add methods for working with arrows stuck in living entities
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 72ddddde1dafad3be501d0aba73e04515d218d18..5d5ad28d01ff66a8b9f608f82b5213d112243e4d 100644
index 1d3cd79634366718cd354cd2f55c6fc974ad3525..b65d44780c7e6e1e2e8724df838d1aa54edcc30a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -717,4 +717,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9..84327c8fe1dc62c7b99950261a344042b4456616 100644
index 9f3223947d2fcc1aaf259effe6afce7a47888858..7b69007609ed421ee72ddc3d6f2a7b64888babf1 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -277,7 +277,7 @@ public class RegionFile implements AutoCloseable {
@@ -274,7 +274,7 @@ public class RegionFile implements AutoCloseable {
return true;
}
} catch (IOException ioexception) {
@ -19,26 +19,18 @@ index f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9..84327c8fe1dc62c7b99950261a344042
}
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index 344d281f0abc93488e41565efac130108745f861..a0516f72671522a6d7d9ea649506760f120b88bd 100644
index 8ba1c073387fa21a20bd42a873ec3cc314eae64e..eaf22cec54b512e0f57606f50627d5fe9b39bd5c 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -11,6 +11,7 @@ import java.io.IOException;
import javax.annotation.Nullable;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtIo;
+import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ExceptionCollector;
import net.minecraft.world.level.ChunkPos;
@@ -101,6 +102,7 @@ public class RegionFileStorage implements AutoCloseable {
@@ -131,6 +131,7 @@ public class RegionFileStorage implements AutoCloseable {
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
RegionFile regionfile = this.getFile(pos, false); // CraftBukkit
RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
if (nbt == null) {
regionfile.clear(pos);
@@ -126,6 +128,18 @@ public class RegionFileStorage implements AutoCloseable {
@@ -156,6 +157,18 @@ public class RegionFileStorage implements AutoCloseable {
}
}
@ -51,7 +43,7 @@ index 344d281f0abc93488e41565efac130108745f861..a0516f72671522a6d7d9ea649506760f
+
+ if (laste != null) {
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste);
+ MinecraftServer.LOGGER.error("Failed to save chunk", laste);
+ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk", laste);
+ }
+ // Paper end
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d217c3b7a72127e6421b2bfa224536e86e27e260..b4bcceeaec778103e07d69f9565f21a9d7e50ff2 100644
index 38909ef14fcfd4b93d83512f4cacbe2c3fe431a1..76e34fb4bb6b3d194e155bec30d36887350f3ee3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1628,8 +1628,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -1634,8 +1634,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName());
this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect"));
}
@ -23,10 +23,10 @@ index d217c3b7a72127e6421b2bfa224536e86e27e260..b4bcceeaec778103e07d69f9565f21a9
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8eac81867ff299d45427fd71d9b085439deb95d8..1a790c9913e8d83276ca3c3158562b2a03e2c82e 100644
index 3c7ae0966f2e8d0ab0924047653792ac7ac75f10..97a21ecae2b2b17c9041cd7e5148c68472929d6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -126,6 +126,7 @@ import org.bukkit.metadata.MetadataValue;
@@ -132,6 +132,7 @@ import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.messaging.StandardMessenger;
import org.bukkit.scoreboard.Scoreboard;
@ -34,7 +34,7 @@ index 8eac81867ff299d45427fd71d9b085439deb95d8..1a790c9913e8d83276ca3c3158562b2a
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
@@ -142,6 +143,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -148,6 +149,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private double health = 20;
private boolean scaledHealth = false;
private double healthScale = 20;
@ -45,7 +45,7 @@ index 8eac81867ff299d45427fd71d9b085439deb95d8..1a790c9913e8d83276ca3c3158562b2a
public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity);
@@ -1909,6 +1914,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1918,6 +1923,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean getAffectsSpawning() {
return this.getHandle().affectsSpawning;
}

View file

@ -30,10 +30,10 @@ index 701a2ffd04df48d437b2cb963dd150af99725b6e..817d4572c9991992b720b3ba163188ac
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cde74a4785e4197f4b39ee28663801726a9e4dca..a929d46ad3a079d68c46246d9321de08f0d6dcaa 100644
index e62ee04cbe0f3281783aff8ef74d7165447b34ba..49725d304ade26d537552788952f18291c64f927 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -424,6 +424,7 @@ public final class CraftServer implements Server {
@@ -428,6 +428,7 @@ public final class CraftServer implements Server {
if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear();
this.helpMap.initializeGeneralTopics();
@ -41,7 +41,7 @@ index cde74a4785e4197f4b39ee28663801726a9e4dca..a929d46ad3a079d68c46246d9321de08
}
Plugin[] plugins = this.pluginManager.getPlugins();
@@ -443,7 +444,7 @@ public final class CraftServer implements Server {
@@ -447,7 +448,7 @@ public final class CraftServer implements Server {
this.commandMap.registerServerAliases();
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a929d46ad3a079d68c46246d9321de08f0d6dcaa..36de0faea986ecbbdc5cab7351d3b51049f9b633 100644
index 49725d304ade26d537552788952f18291c64f927..657c810f86c73cdbb2c044c742803c835e6d4c50 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2434,5 +2434,23 @@ public final class CraftServer implements Server {
@@ -2446,5 +2446,23 @@ public final class CraftServer implements Server {
}
return this.adventure$audiences;
}

View file

@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 36de0faea986ecbbdc5cab7351d3b51049f9b633..9db5f614512d05eb99b4811c71fbc914e50c712e 100644
index 657c810f86c73cdbb2c044c742803c835e6d4c50..bf18ed30b1e66cb94f346b1e63a67ec5f4030b0b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -904,8 +904,16 @@ public final class CraftServer implements Server {
@@ -913,8 +913,16 @@ public final class CraftServer implements Server {
world.paperConfig.init(); // Paper
}

View file

@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564254932b5 100644
index df787c12053f799b111c539d866ff8c751e21611..4019a8cd594f8c093cf790600a92f0725250e82b 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -13,6 +13,8 @@ import java.text.DecimalFormatSymbols;
@ -29,7 +29,7 @@ index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564
+import java.util.Comparator;
import java.util.Locale;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Optional;
@@ -151,6 +153,23 @@ public final class ItemStack {
return this.getItem().getTooltipImage(this);
}
@ -54,23 +54,19 @@ index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564
public ItemStack(ItemLike item) {
this(item, 1);
}
@@ -194,6 +213,7 @@ public final class ItemStack {
@@ -194,9 +213,11 @@ public final class ItemStack {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy();
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
+ this.processEnchantOrder(this.tag); // Paper
this.getItem().verifyTagAfterLoad(this.tag);
}
@@ -747,6 +767,7 @@ public final class ItemStack {
// Paper end
public void setTag(@Nullable CompoundTag tag) {
this.tag = tag;
+ processEnchantOrder(this.tag); // Paper
if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue());
}
@@ -1054,6 +1075,7 @@ public final class ItemStack {
@@ -1055,6 +1076,7 @@ public final class ItemStack {
ListTag nbttaglist = this.tag.getList("Enchantments", 10);
nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level));
@ -79,7 +75,7 @@ index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564
public boolean isEnchanted() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index d6467a42d54954dffe919482294cb9355f217f21..84f11780a22b3369519fc8f80d6c274360045df7 100644
index e88df908377450964ae5b6ff97ee97bd2f09c05f..ba70ac49222c517a38e20e86cee1fd38aecb6318 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -6,7 +6,6 @@ import java.util.Map;
@ -203,7 +199,7 @@ index d6467a42d54954dffe919482294cb9355f217f21..84f11780a22b3369519fc8f80d6c2743
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571baab297799 100644
index af2d0bfab14cf7133eeaff484895cba6b37391e8..0baca5f3c3f73323b6f5b283fc00be39477ccf59 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -214,15 +210,15 @@ index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571ba
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
@@ -22,6 +23,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
@@ -23,6 +24,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Collection;
+import java.util.Comparator; // Paper
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
@@ -32,6 +34,7 @@ import java.util.Map;
@@ -33,6 +35,7 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
@ -243,8 +239,8 @@ index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571ba
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
private CompoundTag internalTag;
- private final Map<String, Tag> unhandledTags = new HashMap<String, Tag>();
+ private final Map<String, Tag> unhandledTags = new TreeMap<>(); // Paper
- final Map<String, Tag> unhandledTags = new HashMap<String, Tag>(); // Visible for testing only
+ final Map<String, Tag> unhandledTags = new TreeMap<String, Tag>(); // Visible for testing only // Paper
private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY);
private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only

View file

@ -30,7 +30,7 @@ index 1ab2ede5e9d8939f69fb430084437fda63879fb7..e5d5f4c692e80c616ccde58ab1360477
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 860c4ca60adfbf265299c0db41eadc0384f68779..97a4d3b3709028d322617efdfe9a5aabe2197d82 100644
index 04bd882525235e6712082d6b710f33abe555884c..68b15e3061e1e8637a34ee5e0f0953dd23645f49 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -310,7 +310,7 @@ public abstract class AbstractArrow extends Projectile {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c9ee1a12b6fe92db6896cd4abd7e7833b094c9da..41dab560595a6d052c82b4474d824a584756371a 100644
index 032e1e08413f2d0f601cdc32fe12145e2c1fec5f..19c97a14cbf23130db2de80e3f7f6e0c4ff27662 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -199,7 +199,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -206,7 +206,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
@ -19,10 +19,10 @@ index c9ee1a12b6fe92db6896cd4abd7e7833b094c9da..41dab560595a6d052c82b4474d824a58
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index dccf23a64bad4fbfcef56eace434884e35919add..123a34b97fe76bd694214ded6174ecb26b970438 100644
index 79764895307139b34f2b018f3be86d6610503b64..507d38a8e7b643712fe235c73f440c0a52b6d8b2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -312,11 +312,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -313,11 +313,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
@Override

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 5335312b9a8c8166590df69a78311652b4b36d7e..4b41ad3d9feeaf7f75c8459fb8acdab9ac1fce61 100644
index 60356e889f2da17b313ee5cf223ee0c5066182c4..c8e60153986e9be21a1e372d5c1cb25c762ab81b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3564,9 +3564,10 @@ public abstract class LivingEntity extends Entity {
@@ -3563,9 +3563,10 @@ public abstract class LivingEntity extends Entity {
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@ -20,7 +20,7 @@ index 5335312b9a8c8166590df69a78311652b4b36d7e..4b41ad3d9feeaf7f75c8459fb8acdab9
level.getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -3580,6 +3581,13 @@ public abstract class LivingEntity extends Entity {
@@ -3579,6 +3580,13 @@ public abstract class LivingEntity extends Entity {
} else {
itemstack = this.useItem.finishUsingItem(this.level, this);
}
@ -34,7 +34,7 @@ index 5335312b9a8c8166590df69a78311652b4b36d7e..4b41ad3d9feeaf7f75c8459fb8acdab9
// CraftBukkit end
if (itemstack != this.useItem) {
@@ -3587,6 +3595,11 @@ public abstract class LivingEntity extends Entity {
@@ -3586,6 +3594,11 @@ public abstract class LivingEntity extends Entity {
}
this.stopUsingItem();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169beac275b 100644
index c8e60153986e9be21a1e372d5c1cb25c762ab81b..e5a0f6edbb1d43f8c918b9cee9a291db630663b4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -764,7 +764,13 @@ public abstract class LivingEntity extends Entity {
@@ -759,7 +759,13 @@ public abstract class LivingEntity extends Entity {
@Override
public void readAdditionalSaveData(CompoundTag nbt) {
@ -23,7 +23,7 @@ index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169
if (nbt.contains("Attributes", 9) && this.level != null && !this.level.isClientSide) {
this.getAttributes().load(nbt.getList("Attributes", 10));
}
@@ -1251,6 +1257,10 @@ public abstract class LivingEntity extends Entity {
@@ -1246,6 +1252,10 @@ public abstract class LivingEntity extends Entity {
}
public void setHealth(float health) {
@ -34,7 +34,7 @@ index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169
// CraftBukkit start - Handle scaled health
if (this instanceof ServerPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity();
@@ -3399,7 +3409,7 @@ public abstract class LivingEntity extends Entity {
@@ -3398,7 +3408,7 @@ public abstract class LivingEntity extends Entity {
}
public void setAbsorptionAmount(float amount) {
@ -44,10 +44,10 @@ index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1a790c9913e8d83276ca3c3158562b2a03e2c82e..f65140c04efd036019c7f91643ecd9644cd498df 100644
index 97a21ecae2b2b17c9041cd7e5148c68472929d6a..e41df687f7d681574bc16f5d3b1572a3ea9902f0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1716,6 +1716,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1723,6 +1723,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void setRealHealth(double health) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 9fbe3ed59416d773dc5c19d5ea73f95ddd9b5143..287ee89418e28366866e70bd104cd11b5ae0aad6 100644
index a957a168450ee5c34a58ed993f281ca774fccfc1..30d30c2fd66b312a45d3bf706d41b38724d52a7b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -153,6 +153,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -153,6 +153,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
@ -31,7 +31,7 @@ index 9fbe3ed59416d773dc5c19d5ea73f95ddd9b5143..287ee89418e28366866e70bd104cd11b
private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() {
@@ -330,7 +345,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -334,7 +349,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;
@ -41,10 +41,10 @@ index 9fbe3ed59416d773dc5c19d5ea73f95ddd9b5143..287ee89418e28366866e70bd104cd11b
this.fluidHeight = new Object2DoubleArrayMap(2);
this.firstTick = true;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
index 552f758b046e750e1020f309a21d0e475befee10..3ffc1ee8a9ae63c8678c12736fab5d6ba0a21a5b 100644
index 09ec4d66aaa5b9e4ef09750a76cebc389a4306fd..370513fbc39f178f903ce140ced1a97029dd39db 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -50,7 +50,7 @@ public class Squid extends WaterAnimal {
@@ -47,7 +47,7 @@ public class Squid extends WaterAnimal {
public Squid(EntityType<? extends Squid> type, Level world) {
super(type, world);

View file

@ -22,10 +22,10 @@ index e5d5f4c692e80c616ccde58ab13604777eb71101..7addb5c66c88da73a4d80da1e898d629
+ }
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e47fffb3a8e2ce12dedce764fbd7ff52a0616426..53713875d95af656abbb30bc7b8c4ba251677615 100644
index 19c97a14cbf23130db2de80e3f7f6e0c4ff27662..9f7bbd602c19f317d05cd8b72453c2e37d8acff5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -648,7 +648,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -560,7 +560,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
@ -33,4 +33,4 @@ index e47fffb3a8e2ce12dedce764fbd7ff52a0616426..53713875d95af656abbb30bc7b8c4ba2
+ boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
if (flag1) {
SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create((Level) this);
SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this);

View file

@ -13,12 +13,12 @@ Replace all calls to the new place to the unnecessary forward.
Optimize getType and getBlockData to manually inline and optimize the calls
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
index f484cf19e1ed6f4e14a6c324c59511e822335ba7..f924f2b20800dfde93eeafea3614203661d35389 100644
index 543d5a67e76a3114f6eac29a053ff04ceecb6256..c33bac27edfdab4c3ee618c9ed39c629b1513f09 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -21,6 +21,15 @@ public class Vec3i implements Comparable<Vec3i> {
private int y;
private int z;
@@ -33,6 +33,15 @@ public class Vec3i implements Comparable<Vec3i> {
return CODEC.flatXmap(checkOffsetAxes(maxAbsValue), checkOffsetAxes(maxAbsValue));
}
+ // Paper start
+ public boolean isValidLocation(net.minecraft.world.level.LevelHeightAccessor levelHeightAccessor) {
@ -33,10 +33,10 @@ index f484cf19e1ed6f4e14a6c324c59511e822335ba7..f924f2b20800dfde93eeafea36142036
this.x = x;
this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 123a34b97fe76bd694214ded6174ecb26b970438..1f1601f0e7f30bb44c57c771b93e7aa8be3e9725 100644
index 507d38a8e7b643712fe235c73f440c0a52b6d8b2..b6f2be487720e31a548a3cee4cd73319f402f6ff 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -262,7 +262,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -263,7 +263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public boolean isInWorldBounds(BlockPos pos) {
@ -46,23 +46,23 @@ index 123a34b97fe76bd694214ded6174ecb26b970438..1f1601f0e7f30bb44c57c771b93e7aa8
public static boolean isInSpawnableBounds(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
index 6a3f98edbc2b4056c5baf00277caee327e444a77..974ab04b08bbd3c27a394b37c1af112be5f28f43 100644
index 2e5619a581d18008df31f4b2a279e7418264aa4f..7bec92f343d5c79fdff43b36272c0e979c6879d4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -29,6 +29,7 @@ public interface ChunkAccess extends BlockGetter, FeatureAccess {
@@ -113,6 +113,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
return GameEventDispatcher.NOOP;
}
+ BlockState getType(final int x, final int y, final int z); // Paper
+ public abstract BlockState getType(final int x, final int y, final int z); // Paper
@Nullable
BlockState setBlockState(BlockPos pos, BlockState state, boolean moved);
public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean moved);
diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
index 84ebfdfc4350fb57ca2959e000b33b8d5efa6e0b..69c2454533e6f21c70792b555ec02c6bc6d169b3 100644
index 31d01f8df394e718f1f2a268ddccee77b6706eb9..25e9cc39d748dfd99d38f504c14f40f9ec7bdd2d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java
@@ -19,6 +19,11 @@ public class EmptyLevelChunk extends LevelChunk {
super(world, pos, new EmptyLevelChunk.EmptyChunkBiomeContainer(world));
@@ -18,6 +18,11 @@ public class EmptyLevelChunk extends LevelChunk {
super(world, pos);
}
+ // Paper start
@ -74,10 +74,10 @@ index 84ebfdfc4350fb57ca2959e000b33b8d5efa6e0b..69c2454533e6f21c70792b555ec02c6b
public BlockState getBlockState(BlockPos pos) {
return Blocks.VOID_AIR.defaultBlockState();
diff --git a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1140e1c62 100644
index 65967fd834d8aadf9a6af3ee26164819488dc680..de235aadb3aebcd173fea7ea4783c1e8aa8f4c6a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java
@@ -40,6 +40,11 @@ public class ImposterProtoChunk extends ProtoChunk {
@@ -46,6 +46,11 @@ public class ImposterProtoChunk extends ProtoChunk {
public BlockState getBlockState(BlockPos pos) {
return this.wrapped.getBlockState(pos);
}
@ -90,11 +90,11 @@ index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1
@Override
public FluidState getFluidState(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index aa6db78339d6b0661ac3be12c82da92742b5f519..29fda19d7e1a8b6675598de22967e2aec81091fa 100644
index ac17877ea6e210acfb54961a2818ca1ae7f6c738..6e998ca50d07e1ecb0cd0639b81cc07e8be71cb8 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess {
return this.sections;
@@ -287,12 +287,28 @@ public class LevelChunk extends ChunkAccess {
});
}
+ // Paper start - Optimize getBlockData to reduce instructions
@ -126,49 +126,23 @@ index aa6db78339d6b0661ac3be12c82da92742b5f519..29fda19d7e1a8b6675598de22967e2ae
BlockState iblockdata = null;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index 03fd5684aec8fa0d87963f2adcd8244e92840917..5fd66020a937b641e2a060cf38df731a43f3bf55 100644
index 10848c41b7f2f83717df650bd1fac7149c3a32af..92a42aea3f54c49e2055e8000645d91da9471e09 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -15,10 +15,10 @@ public class LevelChunkSection {
@@ -20,7 +20,7 @@ public class LevelChunkSection {
public static final int SECTION_SIZE = 4096;
public static final Palette<BlockState> GLOBAL_BLOCKSTATE_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY, Blocks.AIR.defaultBlockState());
public static final int BIOME_CONTAINER_BITS = 2;
private final int bottomBlockY;
- private short nonEmptyBlockCount;
+ short nonEmptyBlockCount; // Paper - package-private
private short tickingBlockCount;
private short tickingFluidCount;
- private final PalettedContainer<BlockState> states;
+ final PalettedContainer<BlockState> states; // Paper - package-private
public LevelChunkSection(int yOffset) {
this(yOffset, (short)0, (short)0, (short)0);
@@ -37,7 +37,7 @@ public class LevelChunkSection {
}
public BlockState getBlockState(int x, int y, int z) {
- return this.states.get(x, y, z);
+ return this.states.get(y << 8 | z << 4 | x); // Paper - inline
}
public FluidState getFluidState(int x, int y, int z) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 527238373b944a1e4a6e3a408534c72dd4c84035..bb8fd88aebb550edec8c679622a02a595cbc6694 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -135,7 +135,7 @@ public class PalettedContainer<T> implements PaletteResize<T> {
}
public T get(int x, int y, int z) {
- return this.get(getIndex(x, y, z));
+ return this.get(y << 8 | z << 4 | x); // Paper - inline
}
protected T get(int index) {
public final PalettedContainer<BlockState> states;
diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..873fea54aecca411b6dee1ed3566f93c4fb9670f 100644
index b7dbdcb0ce7948c6f98ec67d0cf2033a8e348085..568dc3c9cbf009a3892766cacdd00667556e27c5 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java
@@ -104,14 +104,18 @@ public class ProtoChunk implements ChunkAccess {
@@ -87,14 +87,18 @@ public class ProtoChunk extends ChunkAccess {
@Override
public BlockState getBlockState(BlockPos pos) {
@ -181,10 +155,10 @@ index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..873fea54aecca411b6dee1ed3566f93c
+ if (this.isOutsideBuildHeight(y)) {
return Blocks.VOID_AIR.defaultBlockState();
} else {
- LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(i)];
- return LevelChunkSection.isEmpty(levelChunkSection) ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15);
+ LevelChunkSection chunksection = this.getSections()[this.getSectionIndex(y)];
+ return chunksection == LevelChunk.EMPTY_SECTION || chunksection.isEmpty() ? Blocks.AIR.defaultBlockState() : chunksection.getBlockState(x & 15, y & 15, z & 15);
- LevelChunkSection levelChunkSection = this.getSection(this.getSectionIndex(i));
- return levelChunkSection.hasOnlyAir() ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15);
+ LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(y)];
+ return levelChunkSection.hasOnlyAir() ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(x & 15, y & 15, z & 15);
}
}
+ // Paper end

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2450bb69e08190804212172a298c1f12cd5345d7..d6195f7b0bac1bd1ababe8c4eec07654c323c014 100644
index 5cf85636e089a4bf2422d76b8df52c1166d3f148..697f2e6c10a74cb60191ed8c1cb563360089c8ea 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1384,6 +1384,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1366,6 +1366,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@ -18,10 +18,10 @@ index 2450bb69e08190804212172a298c1f12cd5345d7..d6195f7b0bac1bd1ababe8c4eec07654
this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 75fa3f2392936d86d29fee73079507c642660b30..525cf19c9ecc5886720d0505f0554b667ef3267f 100644
index 9f7bbd602c19f317d05cd8b72453c2e37d8acff5..bd53d00db453767fb43ba0e50c0dc0a7730d55a4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -198,6 +198,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -205,6 +205,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private int tickPosition;
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
@ -30,10 +30,10 @@ index 75fa3f2392936d86d29fee73079507c642660b30..525cf19c9ecc5886720d0505f0554b66
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 1f1601f0e7f30bb44c57c771b93e7aa8be3e9725..322edb169e9b482aac71292b992d4a3c2622b2d8 100644
index b6f2be487720e31a548a3cee4cd73319f402f6ff..bb6083b40e211964730f88057df509f6d860bc11 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -473,7 +473,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -474,7 +474,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld();
@ -42,7 +42,7 @@ index 1f1601f0e7f30bb44c57c771b93e7aa8be3e9725..322edb169e9b482aac71292b992d4a3c
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getCraftServer().getPluginManager().callEvent(event);
@@ -586,7 +586,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -587,7 +587,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try {
// CraftBukkit start
CraftWorld world = ((ServerLevel) this).getWorld();
@ -73,7 +73,7 @@ index 24227939493f852a88477c84160bda1605291eb0..1f8cf302d2309aec2955832ffafd87f1
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
index 9edf1b87e59d589b053e5b4fee15faa221718c2f..65a163d93a293e1e0a12a300d6335a700099cac2 100644
index bad85ac1f369d1044fa2e68b6e49cebc3c253c5b..e12b76238cb52a1007f2102473b7f892f8521b62 100644
--- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
@@ -4,6 +4,7 @@ import javax.annotation.Nullable;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c2dc2ec29949074e71d0b4e5244ec71587f01178..9d6ff9aff140574038b7f619cdfebf47d4b3a14c 100644
index bd53d00db453767fb43ba0e50c0dc0a7730d55a4..9582da4afcc68b3c898be86dcf74f0833258e34c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1956,6 +1956,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1990,6 +1990,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
}
// Paper end
@ -16,7 +16,7 @@ index c2dc2ec29949074e71d0b4e5244ec71587f01178..9d6ff9aff140574038b7f619cdfebf47
}
public void onTrackingEnd(Entity entity) {
@@ -2020,6 +2021,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2054,6 +2055,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
entity.valid = false; // CraftBukkit

View file

@ -30,15 +30,20 @@ index 7addb5c66c88da73a4d80da1e898d629d76074f0..a0688ef7eb38e7c156193db3d94c44a3
+ }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 29fda19d7e1a8b6675598de22967e2aec81091fa..702dbe24bfd19b0999648d4364f68a5675bee6e0 100644
index 6e998ca50d07e1ecb0cd0639b81cc07e8be71cb8..e641779c58b503c88cb533a45a3614f45c4b8fa3 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -984,7 +984,7 @@ public class LevelChunk implements ChunkAccess {
@Override
public long getInhabitedTime() {
- return this.inhabitedTime;
+ return this.level.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : this.level.paperConfig.fixedInhabitedTime; // Paper
@@ -280,6 +280,13 @@ public class LevelChunk extends ChunkAccess {
return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks);
}
+ // Paper start
+ @Override
+ public long getInhabitedTime() {
+ return this.level.paperConfig.fixedInhabitedTime < 0 ? super.getInhabitedTime() : this.level.paperConfig.fixedInhabitedTime;
+ }
+ // Paper end
+
@Override
public GameEventDispatcher getEventDispatcher(int ySectionCoord) {
return (GameEventDispatcher) this.gameEventDispatcherSections.computeIfAbsent(ySectionCoord, (j) -> {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent
Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
index 3afe97f4e330016164e741934c888f5b85824e67..6cdb0f0f881ea57c95821914262208c4b636587e 100644
index 57a17458dbe1629ebbf58fea9f43f09511b91fb0..dda38820f763f93513b5d83a4239197b48a45238 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
@@ -35,7 +35,7 @@ public class FlyingPathNavigation extends PathNavigation {
@ -19,10 +19,10 @@ index 3afe97f4e330016164e741934c888f5b85824e67..6cdb0f0f881ea57c95821914262208c4
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
index d2e71f1e70a8b3360110f7e5e6c5ec278218ae27..f351b1eb923cc72bc5bb7f891d27246af14f4e1d 100644
index a9fd90d5282bd013e031b9d7481e3f777d6892c6..a6f8ca71ba5d107cfbd24b8e8a225195dc233637 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
@@ -70,7 +70,7 @@ public class GroundPathNavigation extends PathNavigation {
@@ -69,7 +69,7 @@ public class GroundPathNavigation extends PathNavigation {
@Override
public Path createPath(Entity entity, int distance) {
@ -32,7 +32,7 @@ index d2e71f1e70a8b3360110f7e5e6c5ec278218ae27..f351b1eb923cc72bc5bb7f891d27246a
private int getSurfaceY() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a9be8dd4d 100644
index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395c021b8ab 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos;
@ -43,7 +43,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
@@ -108,7 +109,13 @@ public abstract class PathNavigation {
@@ -110,7 +111,13 @@ public abstract class PathNavigation {
@Nullable
public Path createPath(BlockPos target, int distance) {
@ -58,7 +58,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a
}
@Nullable
@@ -118,7 +125,7 @@ public abstract class PathNavigation {
@@ -120,7 +127,7 @@ public abstract class PathNavigation {
@Nullable
public Path createPath(Entity entity, int distance) {
@ -67,7 +67,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a
}
@Nullable
@@ -128,6 +135,16 @@ public abstract class PathNavigation {
@@ -130,6 +137,16 @@ public abstract class PathNavigation {
@Nullable
protected Path createPath(Set<BlockPos> positions, int range, boolean useHeadPos, int distance, float followRange) {
@ -84,7 +84,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a
if (positions.isEmpty()) {
return null;
} else if (this.mob.getY() < (double)this.level.getMinBuildHeight()) {
@@ -137,6 +154,23 @@ public abstract class PathNavigation {
@@ -139,6 +156,23 @@ public abstract class PathNavigation {
} else if (this.path != null && !this.path.isDone() && positions.contains(this.targetPos)) {
return this.path;
} else {

View file

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 6 May 2019 01:29:25 -0400
Subject: [PATCH] Per-Player View Distance API placeholders
I hope to look at this more in-depth soon. It appears doable.
However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 6bee392787a517d5ab8966b94c035db00eeb7d99..ae63083b1283a5628fa900827c0af6e9254592c2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -171,6 +171,8 @@ import org.bukkit.inventory.MainHand;
public class ServerPlayer extends Player {
+ public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder
+
private static final Logger LOGGER = LogManager.getLogger();
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index cb91db9a25b96b0ad2b9c6a61ba26cd6d638b8a0..6572528a3a664f10d8c3a0d0808c411fcd031f71 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -371,6 +371,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message);
}
}
+
+ @Override
+ public int getViewDistance() {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
+
+ @Override
+ public void setViewDistance(int viewDistance) {
+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO
+ }
// Paper end
@Override