More more more more work

This commit is contained in:
Nassim Jahnke 2023-06-07 21:37:42 +02:00
parent 474a02835d
commit 0ed49782c5
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
40 changed files with 139 additions and 141 deletions

View File

@ -10,10 +10,10 @@ out due to a sync load, as the worldgen threads will be
stalling on profile lookups.
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index c5fb6adb353538360ef420faee41565626eea1dc..33ec55ed1f7d10a5235330ad082e7c7b54c42368 100644
index 01eb418bde1dadbbfa30954f81281199b2fec778..0f05d26248d8c999048a88796df227a6a1e3755f 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -81,6 +81,22 @@ public class Util {
@@ -82,6 +82,22 @@ public class Util {
private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads";
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main");

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add UnknownCommandEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index 36bbe7d0b2089361beda89097c15eca9ab48a57d..65d8c7d5aab8c6afe3c5671a90ad0fbc03bedfdd 100644
index fb381a7f3362b5c7848f9c326e9378b76f6fdad9..34fdef41d1eb3fe78bf688d69aae437d89a337bb 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -328,8 +328,13 @@ public class CommandSourceStack implements SharedSuggestionProvider {
@@ -348,8 +348,13 @@ public class CommandSourceStack implements SharedSuggestionProvider {
}
public void sendFailure(Component message) {
@ -25,10 +25,10 @@ index 36bbe7d0b2089361beda89097c15eca9ab48a57d..65d8c7d5aab8c6afe3c5671a90ad0fbc
}
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 971fc7f5f51ba82a7e8abafa6a5139c24a9aac0b..7f561ab6e56cd1749da8eff950080d3ae3f5e028 100644
index 2fdfc17ef3daf9fb5cc32c807292c71e256d5356..e3394864e29357fec036f9e616472aeab95d035e 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -136,6 +136,7 @@ public class Commands {
@@ -137,6 +137,7 @@ public class Commands {
public static final int LEVEL_ADMINS = 3;
public static final int LEVEL_OWNERS = 4;
private final com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher = new com.mojang.brigadier.CommandDispatcher();
@ -36,7 +36,7 @@ index 971fc7f5f51ba82a7e8abafa6a5139c24a9aac0b..7f561ab6e56cd1749da8eff950080d3a
public Commands(Commands.CommandSelection environment, CommandBuildContext commandRegistryAccess) {
this(); // CraftBukkit
@@ -226,6 +227,7 @@ public class Commands {
@@ -228,6 +229,7 @@ public class Commands {
if (environment.includeIntegrated) {
PublishCommand.register(this.dispatcher);
}
@ -44,7 +44,7 @@ index 971fc7f5f51ba82a7e8abafa6a5139c24a9aac0b..7f561ab6e56cd1749da8eff950080d3a
// CraftBukkit start
}
@@ -317,7 +319,16 @@ public class Commands {
@@ -319,7 +321,16 @@ public class Commands {
b1 = 0;
return b1;
} catch (CommandSyntaxException commandsyntaxexception) {
@ -62,7 +62,7 @@ index 971fc7f5f51ba82a7e8abafa6a5139c24a9aac0b..7f561ab6e56cd1749da8eff950080d3a
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> {
@@ -336,7 +347,18 @@ public class Commands {
@@ -338,7 +349,18 @@ public class Commands {
}
ichatmutablecomponent.append((Component) Component.translatable("command.context.here").withStyle(ChatFormatting.RED, ChatFormatting.ITALIC));
@ -83,7 +83,7 @@ index 971fc7f5f51ba82a7e8abafa6a5139c24a9aac0b..7f561ab6e56cd1749da8eff950080d3a
b1 = 0;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 544ab33166e6410339dbd0ef70b692dfe33cd4fe..97bd0993b49e18b47c2316663025564bca4d4b41 100644
index adc35bbaa95f852a7ff28eeaa974c30ad4d22baa..6b8e5200300f2c667002bb6dc7bb359638565338 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -523,6 +523,7 @@ public final class CraftServer implements Server {

View File

@ -565,7 +565,7 @@ index 0000000000000000000000000000000000000000..7ac27392a8647ef7d0dc78efe78703e9
+ @NotNull GameProfile buildGameProfile();
+}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index d58d44faa40be2421f4cb54740a3abdbad72875c..9ee4dc54039cbe6b8c9bd3018044c73f923a736e 100644
index 902317d2dc198a1cbfc679810bcb2173644354cb..7fe7e29d7966d7022cee721d880445887e881065 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -1,5 +1,7 @@
@ -575,16 +575,16 @@ index d58d44faa40be2421f4cb54740a3abdbad72875c..9ee4dc54039cbe6b8c9bd3018044c73f
+import com.destroystokyo.paper.profile.PlayerProfile;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import io.papermc.paper.math.Position;
import com.google.gson.JsonArray;
@@ -26,6 +28,7 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet;
@@ -13,6 +15,7 @@ import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import org.apache.commons.lang.exception.ExceptionUtils;
+import com.mojang.authlib.GameProfile;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.CraftWorld;
@@ -373,6 +376,10 @@ public final class MCUtil {
@@ -357,6 +360,10 @@ public final class MCUtil {
return run.get();
}
@ -596,7 +596,7 @@ index d58d44faa40be2421f4cb54740a3abdbad72875c..9ee4dc54039cbe6b8c9bd3018044c73f
* Calculates distance between 2 entities
* @param e1
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 26fa789a44a1d934944e78eae21f489213f50ae3..12ff7071a5b78a8ae5567aa42b69191166a7cbca 100644
index 72c2f0bf9434e09a0dd51294d3a2200f1e0ed1b1..13797f0a55d62a022eda19f3134fe6256d15ff67 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -170,7 +170,7 @@ public class Main {
@ -631,7 +631,7 @@ index 4038bb76339d43f18770624bd7fecc79b8d7f2a9..2456edc11b29a92b1648937cd3dd6a9a
String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 97bd0993b49e18b47c2316663025564bca4d4b41..d92f7eadf13cdab064a1f2a5c132faeabc2e25cb 100644
index 6b8e5200300f2c667002bb6dc7bb359638565338..ef42288a9e8b195201415732cae5024a2ae070e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -258,6 +258,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@ -652,7 +652,7 @@ index 97bd0993b49e18b47c2316663025564bca4d4b41..d92f7eadf13cdab064a1f2a5c132faea
CraftItemFactory.instance();
}
@@ -2665,5 +2669,37 @@ public final class CraftServer implements Server {
@@ -2663,5 +2667,37 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 11f1d8cc6f31b5a38db76ce411209a494c9e7e8a..0ed794b051cae00c71e94700dcd594da85bac0fa 100644
index 90aba22c91bf9950c4df2204afc3fc97e411ea9a..3fb88342aeab37cc397ba80077fdf580f71bd217 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2009,20 +2009,44 @@ public abstract class Player extends LivingEntity {
@@ -2036,20 +2036,45 @@ public abstract class Player extends LivingEntity {
}
@ -29,23 +29,24 @@ index 11f1d8cc6f31b5a38db76ce411209a494c9e7e8a..0ed794b051cae00c71e94700dcd594da
+ return entity;
+ }
+ // Paper - maintain old signature
private boolean spawnEntityFromShoulder(CompoundTag nbttagcompound) { // CraftBukkit void->boolean
- if (!this.level.isClientSide && !nbttagcompound.isEmpty()) {
+ return spawnEntityFromShoulder0(nbttagcompound) != null;
+
private boolean respawnEntityOnShoulder(CompoundTag nbttagcompound) { // CraftBukkit void->boolean
- if (!this.level().isClientSide && !nbttagcompound.isEmpty()) {
+ return this.spawnEntityFromShoulder0(nbttagcompound) != null;
+ }
+
+ // Paper - return entity
+ private Entity spawnEntityFromShoulder0(@Nullable CompoundTag nbttagcompound) {
+ if (!this.level.isClientSide && nbttagcompound != null && !nbttagcompound.isEmpty()) {
return EntityType.create(nbttagcompound, this.level).map((entity) -> { // CraftBukkit
+ private Entity respawnEntityOnShoulder0(CompoundTag nbttagcompound) { // CraftBukkit void->boolean
+ if (!this.level().isClientSide && nbttagcompound != null && !nbttagcompound.isEmpty()) {
return EntityType.create(nbttagcompound, this.level()).map((entity) -> { // CraftBukkit
if (entity instanceof TamableAnimal) {
((TamableAnimal) entity).setOwnerUUID(this.uuid);
}
entity.setPos(this.getX(), this.getY() + 0.699999988079071D, this.getZ());
- return ((ServerLevel) this.level).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit
- return ((ServerLevel) this.level()).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit
- }).orElse(true); // CraftBukkit
+ boolean addedToWorld = ((ServerLevel) this.level).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit
+ boolean addedToWorld = ((ServerLevel) this.level()).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit
+ return addedToWorld ? entity : null;
+ }).orElse(null); // CraftBukkit // Paper - true -> null
}
@ -58,7 +59,7 @@ index 11f1d8cc6f31b5a38db76ce411209a494c9e7e8a..0ed794b051cae00c71e94700dcd594da
@Override
public abstract boolean isSpectator();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index a26743682edcd9329d70ae1ff38310c8379f94e1..03a05d4d34181b34ca67bdbd6c66006071bdcdb4 100644
index d39869056d0ac57279e0e9e479ace4a7d402a941..c6b2f1b90735ec75492daf64031d9d33226cdac6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -518,6 +518,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner()
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1658a5263f0905c2938dae10b8d3d603fcd4bdca..579b0c70043a545798a6c2871a84c77a5f011744 100644
index 568631c8711788053af407574ab928cb57c11560..40cfaee167c3991392e7a82094b8e28361b65581 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -384,6 +384,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -388,6 +388,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// Spigot end
// Paper start
protected int numCollisions = 0; // Paper
@ -16,7 +16,7 @@ index 1658a5263f0905c2938dae10b8d3d603fcd4bdca..579b0c70043a545798a6c2871a84c77a
@javax.annotation.Nullable
private org.bukkit.util.Vector origin;
@javax.annotation.Nullable
@@ -2050,6 +2051,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2117,6 +2118,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
}
@ -27,7 +27,7 @@ index 1658a5263f0905c2938dae10b8d3d603fcd4bdca..579b0c70043a545798a6c2871a84c77a
// Paper end
return nbt;
} catch (Throwable throwable) {
@@ -2190,6 +2195,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2257,6 +2262,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.originWorld = originWorld;
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
}
@ -37,10 +37,10 @@ index 1658a5263f0905c2938dae10b8d3d603fcd4bdca..579b0c70043a545798a6c2871a84c77a
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 3d4e77327295344a5ef8d1fcde96f1ed2fecfbfa..faa4b1bfe8dcd2dcf897470964e7d0619bfcffaf 100644
index 64bd7d265a45575ce46c1a792f90cadc76763871..0f5a5168d168b39f0da3ed12389b11b586d168e6 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -163,6 +163,7 @@ public abstract class BaseSpawner {
@@ -164,6 +164,7 @@ public abstract class BaseSpawner {
}
// Spigot End
}
@ -49,7 +49,7 @@ index 3d4e77327295344a5ef8d1fcde96f1ed2fecfbfa..faa4b1bfe8dcd2dcf897470964e7d061
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
Entity vehicle = entity.getVehicle();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index e93fef1dc636e98ca11a942d7254256401eb3486..8f225b51c7d4792d97e4344ba66d5423aac55741 100644
index c9275f73be7332f79312037954f9685f6c1f800f..f1a382d26f6a64b1c3f81fd2f2d5a35c51a63fdb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1297,5 +1297,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index eeb01a1b54e450f95b33864b030d2183d29309da..162616d52d06bbaf0c21b190fe7f1a29301732db 100644
index 6e050a5cbb877c85595fc97a569c2aafb272ad41..ed9a956b0d88ddcf6c453757bf72287616b81fe2 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -452,5 +452,11 @@ public final class CraftItemFactory implements ItemFactory {
@@ -454,5 +454,11 @@ public final class CraftItemFactory implements ItemFactory {
public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName());
}

View File

@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 162616d52d06bbaf0c21b190fe7f1a29301732db..53915c38df347f8921677c1c175db3822d319009 100644
index ed9a956b0d88ddcf6c453757bf72287616b81fe2..f81ed24f624ff6f99ccad8361209cc409c6b9187 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -458,5 +458,18 @@ public final class CraftItemFactory implements ItemFactory {
@@ -460,5 +460,18 @@ public final class CraftItemFactory implements ItemFactory {
public ItemStack ensureServerConversions(ItemStack item) {
return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index ce2291fb34df531b783d34f8453128a7a01049e5..39cfbc7e109943878df038b7c3e26c64188104a3 100644
index 9089a25ce49e7e192f7e1c3de46ffe1f93c69bc5..3ab02a68d1cca67507cdf5e10f39199278d957ee 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -639,9 +639,9 @@ public abstract class PlayerList {
@@ -646,9 +646,9 @@ public abstract class PlayerList {
// return chatmessage;
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure
@ -21,7 +21,7 @@ index ce2291fb34df531b783d34f8453128a7a01049e5..39cfbc7e109943878df038b7c3e26c64
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
@@ -1025,7 +1025,23 @@ public abstract class PlayerList {
@@ -1032,7 +1032,23 @@ public abstract class PlayerList {
}
public boolean isWhiteListed(GameProfile profile) {

View File

@ -9,10 +9,10 @@ modified in order to prevent merge conflicts when Spigot changes/disables the wa
and to provide some level of hint without being disruptive.
diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java
index e43096e69a00f9ea96badd7c966443cfcf3e7b95..ac2b7b5161eaaca3620268ae865d6f2a80227fde 100644
index 89343863d0cf58ff65c66230855e1e83df078e26..e6e2c63b19d010569fb70b629188be3eec28025d 100644
--- a/src/main/java/net/minecraft/server/Bootstrap.java
+++ b/src/main/java/net/minecraft/server/Bootstrap.java
@@ -40,7 +40,7 @@ public class Bootstrap {
@@ -45,7 +45,7 @@ public class Bootstrap {
public static void bootStrap() {
if (!Bootstrap.isBootstrapped) {
// CraftBukkit start
@ -21,7 +21,7 @@ index e43096e69a00f9ea96badd7c966443cfcf3e7b95..ac2b7b5161eaaca3620268ae865d6f2a
switch (name) {
case "DispenserRegistry":
break;
@@ -54,7 +54,7 @@ public class Bootstrap {
@@ -59,7 +59,7 @@ public class Bootstrap {
System.err.println("*** WARNING: This server jar is unsupported, use at your own risk. ***");
System.err.println("**********************************************************************");
break;
@ -29,14 +29,14 @@ index e43096e69a00f9ea96badd7c966443cfcf3e7b95..ac2b7b5161eaaca3620268ae865d6f2a
+ }*/ // Paper
// CraftBukkit end
Bootstrap.isBootstrapped = true;
if (BuiltInRegistries.REGISTRY.keySet().isEmpty()) {
Instant instant = Instant.now();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index c5a403bc04fcb7a0fbc1dd1fe9ebf374e6a62af3..c79afabed432ca9094967ae0e48b04133dc4c51b 100644
index cb1f050efb85e3b31dba2063fb3a316db1e0430d..f707537227a729a48f63b86b69bbeb22743435ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -257,10 +257,12 @@ public class Main {
Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -21);
deadline.add(Calendar.DAY_OF_YEAR, -3);
if (buildDate.before(deadline.getTime())) {
- System.err.println("*** Error, this build is outdated ***");
+ // Paper start - This is some stupid bullshit

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Ocelot despawns should honor nametags and leash
diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
index 290a20bf54b3651c1c7cced04041a1aa1224bd01..f889e86bd6355ed72b85bf322d09ac2be4fb4954 100644
index 2d40564959570ddbcc952e41edd1a00e13624feb..8974c3cdae25bef239a908ce688e153d902c48c5 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
@@ -133,7 +133,7 @@ public class Ocelot extends Animal {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Reset spawner timer when spawner event is cancelled
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index faa4b1bfe8dcd2dcf897470964e7d0619bfcffaf..bd85887e4497be2f8aeccc6c0260a96a3b9c615f 100644
index 0f5a5168d168b39f0da3ed12389b11b586d168e6..8540905242fc84ab8a26cf0a8e875ef252bc3d5d 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -164,6 +164,7 @@ public abstract class BaseSpawner {
@@ -165,6 +165,7 @@ public abstract class BaseSpawner {
// Spigot End
}
entity.spawnedViaMobSpawner = true; // Paper
@ -16,7 +16,7 @@ index faa4b1bfe8dcd2dcf897470964e7d0619bfcffaf..bd85887e4497be2f8aeccc6c0260a96a
// Spigot Start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
Entity vehicle = entity.getVehicle();
@@ -188,7 +189,7 @@ public abstract class BaseSpawner {
@@ -189,7 +190,7 @@ public abstract class BaseSpawner {
((Mob) entity).spawnAnim();
}

View File

@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger.
diff --git a/build.gradle.kts b/build.gradle.kts
index 3e8f983cd7c69e9a95bcd863349adaf22be85128..2134a7d28cdf1a1b6ef50d4978e80e4411cf3c5a 100644
index 9fb608d9cfb0dcd8d937244ecbe97487757af479..967b675eb600282b881d966f95c9d3cde3edc4e8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,7 +17,7 @@ dependencies {

View File

@ -5,13 +5,13 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4578b9b3833f609787b7f1a1c1502b2b78e127d9..5d42ab9d3ad221aded255f8016a41d72f2c55f99 100644
index 5f79819a8168592138e0b2297825402502c6b54d..a50e9ceec700921b26e238068ac4c07e8a5903da 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1289,7 +1289,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag = d8 > 0.0D;
@@ -1285,7 +1285,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag = d7 > 0.0D;
if (this.player.isOnGround() && !packet.isOnGround() && flag) {
if (this.player.onGround() && !packet.isOnGround() && flag) {
- this.player.jumpFromGround();
+ // Paper start - Add player jump event
+ Player player = this.getCraftPlayer();

View File

@ -15,15 +15,15 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fd6900735b7d1544dcdbb2cd466d2cbb8de2d222..9ebbacca1818d246e999d08583e64fec265968ec 100644
index a50e9ceec700921b26e238068ac4c07e8a5903da..58b700a32d833e277da488fc3fc1ea8692f85361 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3145,14 +3145,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3101,14 +3101,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // CraftBukkit
+ //PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit
+ //PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime);

View File

@ -60,13 +60,13 @@ index 0000000000000000000000000000000000000000..a5a7624f1f372a26b982836cd31cff15
+
+}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index da13fd2cde9b54ab5bf87fbb4e90b5da47b6b8f2..07b2d28c5cba543b104ade6a180b0940a794e08c 100644
index 3ab557277cff7c8a43b0f3de45d17f2bf78f7747..ff1069f57227783f440e4ec9deb58fc709dfd0e7 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -114,6 +114,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
}
// Paper end - add pending task queue
@@ -92,6 +92,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
private int tickCount;
private boolean handlingFault;
public String hostname = ""; // CraftBukkit - add field
+ // Paper start - NetworkClient implementation
+ public int protocolVersion;
+ public java.net.InetSocketAddress virtualHost;
@ -75,7 +75,7 @@ index da13fd2cde9b54ab5bf87fbb4e90b5da47b6b8f2..07b2d28c5cba543b104ade6a180b0940
public Connection(PacketFlow side) {
this.receiving = side;
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index 2be1bd39ee1341128f02e38afe5698b837735827..cca08b8c6e1e15f13326a2a7e33e7f3225ad894b 100644
index 77d7f070cce1a47e41b5d4f5a1cc8c778352a126..a3b610cb1ed97a635677bc46ccdf0463c9918585 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -157,6 +157,10 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
@ -90,10 +90,10 @@ index 2be1bd39ee1341128f02e38afe5698b837735827..cca08b8c6e1e15f13326a2a7e33e7f32
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d9205d45b72c5d36feeb4da8a70532eaf0ff215f..aafaaa0457c2f52d6b9a30b9774246b564277256 100644
index 2dc0233821172a91f471bf7099f2c051c11331e6..e93fca6b851170232cdffc0e38bae86791ae6815 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -308,6 +308,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -233,6 +233,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}

View File

@ -17,7 +17,7 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fbab2e349560249382f87354449efadfedec1ed0..f6365bfdcd3c516ce1ce9ea780e0af3d4102a758 100644
index 58b700a32d833e277da488fc3fc1ea8692f85361..547f39b4e3c8e13e8d3d8c6abdfa0e2786b7c50a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -259,7 +259,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -42,15 +42,16 @@ index fbab2e349560249382f87354449efadfedec1ed0..f6365bfdcd3c516ce1ce9ea780e0af3d
this.server.getProfiler().push("keepAlive");
- long i = Util.getMillis();
+ // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
+ // This should effectively place the keepalive handling back to "as it was" before 1.12.2
+ long currentTime = Util.getMillis();
+ long elapsedTime = currentTime - this.keepAliveTime;
-
- if (i - this.keepAliveTime >= 25000L) { // CraftBukkit
- if (this.keepAlivePending) {
- this.disconnect(Component.translatable("disconnect.timeout"));
- } else {
+ // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
+ // This should effectively place the keepalive handling back to "as it was" before 1.12.2
+ long currentTime = Util.getMillis();
+ long elapsedTime = currentTime - this.keepAliveTime;
+
+ if (this.keepAlivePending) {
+ if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
+ ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info

View File

@ -6,56 +6,56 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 0ed794b051cae00c71e94700dcd594da85bac0fa..a5ff76a3eb9c6b08dc5c3ebbe2bbb8a9fcd036ed 100644
index 3fb88342aeab37cc397ba80077fdf580f71bd217..62112ea94bc6a022b69ab426cc2b71821b12c19e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1233,7 +1233,7 @@ public abstract class Player extends LivingEntity {
@@ -1234,7 +1234,7 @@ public abstract class Player extends LivingEntity {
int i = b0 + EnchantmentHelper.getKnockbackBonus(this);
if (this.isSprinting() && flag) {
- this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F);
- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
++i;
flag1 = true;
}
@@ -1308,7 +1308,7 @@ public abstract class Player extends LivingEntity {
@@ -1309,7 +1309,7 @@ public abstract class Player extends LivingEntity {
}
}
- this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F);
- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
this.sweepAttack();
}
@@ -1336,15 +1336,15 @@ public abstract class Player extends LivingEntity {
@@ -1337,15 +1337,15 @@ public abstract class Player extends LivingEntity {
}
if (flag2) {
- this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F);
- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
this.crit(target);
}
if (!flag2 && !flag3) {
if (flag) {
- this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F);
- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
} else {
- this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F);
- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
}
}
@@ -1396,7 +1396,7 @@ public abstract class Player extends LivingEntity {
@@ -1397,7 +1397,7 @@ public abstract class Player extends LivingEntity {
this.causeFoodExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
} else {
- this.level.playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F);
- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F);
+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility
if (flag4) {
target.clearFire();
}
@@ -1844,6 +1844,14 @@ public abstract class Player extends LivingEntity {
@@ -1871,6 +1871,14 @@ public abstract class Player extends LivingEntity {
public int getXpNeededForNextLevel() {
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2cd9c02fd664e263d9dae030d2c438a082c9e1b4..5ae5f58a6b521318703cf8ba044044992f0ef3f9 100644
index a266f06422ddf52666eb11663cbf287279245596..bb5cff4ddf9c442f93a87dff8ab2aeb16a0f7c04 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 2cd9c02fd664e263d9dae030d2c438a082c9e1b4..5ae5f58a6b521318703cf8ba04404499
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -2987,6 +2988,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3026,6 +3027,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
if (this.equipmentHasChanged(itemstack, itemstack1)) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 35eecb719a813fda6113da24a858188aef31466b..bc0b693b260368e1876bf3cc18a919acfaaf324d 100644
index 3d04a9f0e9dd14e34c82c0b6225a6ee6d464ee5c..eb2078ed63b818beb96a7c41b0868db2dfe6b736 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -728,6 +728,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -716,6 +716,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start
// Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0;
@ -17,7 +17,7 @@ index 35eecb719a813fda6113da24a858188aef31466b..bc0b693b260368e1876bf3cc18a919ac
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
@@ -735,7 +737,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -723,7 +725,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity == null) {
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
tilesThisCycle--;
@ -25,7 +25,7 @@ index 35eecb719a813fda6113da24a858188aef31466b..bc0b693b260368e1876bf3cc18a919ac
continue;
}
// Spigot end
@@ -743,12 +744,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -731,12 +732,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity.isRemoved()) {
// Spigot start
tilesThisCycle--;

View File

@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index bc0b693b260368e1876bf3cc18a919acfaaf324d..7c8069e237a41bf5d9fc09199ff1ac247e245d9d 100644
index eb2078ed63b818beb96a7c41b0868db2dfe6b736..eb2f9464b15f4e6e25c419761c055b6ee4c03279 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -155,7 +155,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -154,7 +154,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false;
@ -30,7 +30,7 @@ index bc0b693b260368e1876bf3cc18a919acfaaf324d..7c8069e237a41bf5d9fc09199ff1ac24
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
public List<ItemEntity> captureDrops;
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
@@ -386,7 +386,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -385,7 +385,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {
@ -39,7 +39,7 @@ index bc0b693b260368e1876bf3cc18a919acfaaf324d..7c8069e237a41bf5d9fc09199ff1ac24
if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate);
@@ -406,7 +406,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -405,7 +405,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start - capture blockstates
boolean captured = false;
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
@ -49,7 +49,7 @@ index bc0b693b260368e1876bf3cc18a919acfaaf324d..7c8069e237a41bf5d9fc09199ff1ac24
this.capturedBlockStates.put(pos.immutable(), blockstate);
captured = true;
}
@@ -618,7 +619,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -606,7 +607,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public BlockState getBlockState(BlockPos pos) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {

View File

@ -13,10 +13,10 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE
If Tile Entity was null, correct Sign to return empty lines instead of null
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 b701a1344db066b9368841f2377ee493514bf282..5768ff2c3e15c038d132c7ad391332fb36251871 100644
index 63acd109a79ed752a05df3d4f1b99309297c2055..d156f7cc71050f13b2feca00c52ca6b64572b60e 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
@@ -45,6 +45,7 @@ public abstract class BlockEntity {
@@ -44,6 +44,7 @@ public abstract class BlockEntity {
this.type = type;
this.worldPosition = pos.immutable();
this.blockState = state;
@ -24,7 +24,7 @@ index b701a1344db066b9368841f2377ee493514bf282..5768ff2c3e15c038d132c7ad391332fb
}
public static BlockPos getPosFromTag(CompoundTag nbt) {
@@ -66,7 +67,7 @@ public abstract class BlockEntity {
@@ -65,7 +66,7 @@ public abstract class BlockEntity {
// CraftBukkit start - read container
public void load(CompoundTag nbt) {
@ -33,7 +33,7 @@ index b701a1344db066b9368841f2377ee493514bf282..5768ff2c3e15c038d132c7ad391332fb
net.minecraft.nbt.Tag persistentDataTag = nbt.get("PublicBukkitValues");
if (persistentDataTag instanceof CompoundTag) {
@@ -240,8 +241,15 @@ public abstract class BlockEntity {
@@ -239,8 +240,15 @@ public abstract class BlockEntity {
// CraftBukkit start - add method
public InventoryHolder getOwner() {
@ -51,7 +51,7 @@ index b701a1344db066b9368841f2377ee493514bf282..5768ff2c3e15c038d132c7ad391332fb
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 7019d4424360e150cb8962bab64077d3ce9c0ba8..2f01b47b9aa669bff551a3966a5a2caf0fee0de7 100644
index 0c2a2b69eed7022f6636ced634a1d31d1fa99ad7..d6b44134781007d29f4042d5ab707188c965331b 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -333,6 +333,13 @@ public class CraftBlock implements Block {
@ -114,10 +114,10 @@ index 7629a51ec284cab0db7e9238027d6acfa4f3083c..a76cce199acdcecfdd8b998ec08974c2
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index 7de568a342244cadbc8d4bb6e923a5daa35540aa..cf76ca2ebead64d194ce03ee024085d32d02077a 100644
index a69a03a7954b03a0aeca7a74d89756dd38ca6faf..17e1131c79ad140c0803a914621ce7924f0f2a6d 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -376,15 +376,30 @@ public final class CraftBlockStates {
@@ -379,15 +379,30 @@ public final class CraftBlockStates {
}
public static BlockState getBlockState(Block block) {

View File

@ -16,10 +16,10 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent
Co-authored-by: Aikar <aikar@aikar.co>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index be2b8c7cf8c36242f4eee12c9f7b8217f31b12ab..efc9b3bf0a63f87f8d1cab57b8f521a306aef5f3 100644
index 547f39b4e3c8e13e8d3d8c6abdfa0e2786b7c50a..8abd8d7e1bbdd59338725ae075117ec26d567a86 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -780,12 +780,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -788,27 +788,58 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
@ -29,18 +29,14 @@ index be2b8c7cf8c36242f4eee12c9f7b8217f31b12ab..efc9b3bf0a63f87f8d1cab57b8f521a3
+ // Paper end
@Override
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
+ // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
+ // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
// CraftBukkit start
if (this.chatSpamTickCount.addAndGet(1) > 500 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
- this.disconnect(Component.translatable("disconnect.spam"));
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper
return;
}
// Paper start
@@ -796,18 +800,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Paper end
// CraftBukkit end
+ // Paper start - async tab completion
+ TAB_COMPLETE_EXECUTOR.execute(() -> {
@ -91,10 +87,10 @@ index be2b8c7cf8c36242f4eee12c9f7b8217f31b12ab..efc9b3bf0a63f87f8d1cab57b8f521a3
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d92f7eadf13cdab064a1f2a5c132faeabc2e25cb..5dcbb06370cdf6a5f700ebd09a9a765c9587a688 100644
index ef42288a9e8b195201415732cae5024a2ae070e6..495d904c24c13419675e94c4ecc9beca266f9ce6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2118,7 +2118,7 @@ public final class CraftServer implements Server {
@@ -2116,7 +2116,7 @@ public final class CraftServer implements Server {
offers = this.tabCompleteChat(player, message);
}

View File

@ -6,13 +6,13 @@ Subject: [PATCH] PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index e952aae85a80a020087c3697624c8c13eab3f914..c0c0090ab271dba1cc367e216fea3d9f73e5b887 100644
index 558b09a482da3035e37c108e60e9d08849017a8d..74e86c76631f779d7edb92de4d2a94c4ccca4afb 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -305,7 +305,7 @@ public class ExperienceOrb extends Entity {
@@ -310,7 +310,7 @@ public class ExperienceOrb extends Entity {
@Override
public void playerTouch(Player player) {
if (!this.level.isClientSide) {
if (!this.level().isClientSide) {
- if (player.takeXpDelay == 0) {
+ if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper
player.takeXpDelay = CraftEventFactory.callPlayerXpCooldownEvent(player, 2, PlayerExpCooldownChangeEvent.ChangeReason.PICKUP_ORB).getNewCooldown(); // CraftBukkit - entityhuman.takeXpDelay = 2;

View File

@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index aafaaa0457c2f52d6b9a30b9774246b564277256..6ec434b6e07aba63b28f9f03eadc3550e43f9998 100644
index e93fca6b851170232cdffc0e38bae86791ae6815..b7f071d7d0128d4c0990b59bd843fd88f8320ca8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1536,7 +1536,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1467,7 +1467,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override

View File

@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 9246ce9f654ad4db6155b026778a83d4ee79624d..526ffddc27d85237dd2f8a1028945fa58ffaefb2 100644
index 19bd6f9aee3ccb1af1b010ee51a54aa2d0bf9c84..ab01080c3b00a3988f2dd48fd4ecf1488bfcce8b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -695,7 +695,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1191,7 +1191,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@ -23,7 +23,7 @@ index 9246ce9f654ad4db6155b026778a83d4ee79624d..526ffddc27d85237dd2f8a1028945fa5
// Spigot end
long i = chunkcoordintpair.toLong();
@@ -712,6 +714,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1208,6 +1210,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
@ -40,10 +40,10 @@ index 9246ce9f654ad4db6155b026778a83d4ee79624d..526ffddc27d85237dd2f8a1028945fa5
return true;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 80d108ae7faf3fdcb024931e93032215935fe70b..c021733342c09adb04ce3f675209543f84ac4bda 100644
index fc1afda5a60ab0f3c275f849d8af08d308b36c3f..d0330d1baf89f949c05b2380ce875366802834e3 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -715,6 +715,15 @@ public class ServerChunkCache extends ChunkSource {
@@ -718,6 +718,15 @@ public class ServerChunkCache extends ChunkSource {
boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
Collections.shuffle(list);
@ -60,7 +60,7 @@ index 80d108ae7faf3fdcb024931e93032215935fe70b..c021733342c09adb04ce3f675209543f
while (iterator1.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 7395cdcf618033f10482001cb9e2a7727e1e8bb2..8797bfcf1115fd7011aff9b1d3c0e5ae80aa6d8c 100644
index 8b35e6804aba52865bda5d9f17ca5cb8576fba6f..4a16b00058ce985c3080af9212a9d0331a5e5c62 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1,5 +1,6 @@

View File

@ -15,10 +15,10 @@ instead and save a lot of server resources.
See: https://github.com/PaperMC/Paper/issues/917
diff --git a/src/main/java/net/minecraft/util/SpawnUtil.java b/src/main/java/net/minecraft/util/SpawnUtil.java
index 1b3c7b3fb869215badacdb604199d5b96f74e384..83ef8cb27db685cceb5c2b7c9674e17b93ba081c 100644
index b77ebe04f1018962b85110258c8a0a2db8612485..028d69907a988e191213a17e072ef22710b5bc83 100644
--- a/src/main/java/net/minecraft/util/SpawnUtil.java
+++ b/src/main/java/net/minecraft/util/SpawnUtil.java
@@ -18,10 +18,10 @@ public class SpawnUtil {
@@ -22,10 +22,10 @@ public class SpawnUtil {
public static <T extends Mob> Optional<T> trySpawnMob(EntityType<T> entityType, MobSpawnType reason, ServerLevel world, BlockPos pos, int tries, int horizontalRange, int verticalRange, SpawnUtil.Strategy requirements) {
// CraftBukkit start
@ -31,7 +31,7 @@ index 1b3c7b3fb869215badacdb604199d5b96f74e384..83ef8cb27db685cceb5c2b7c9674e17b
// CraftBukkit end
BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable();
@@ -31,6 +31,26 @@ public class SpawnUtil {
@@ -35,6 +35,26 @@ public class SpawnUtil {
blockposition_mutableblockposition.setWithOffset(blockposition, i1, k, j1);
if (worldserver.getWorldBorder().isWithinBounds((BlockPos) blockposition_mutableblockposition) && SpawnUtil.moveToPossibleSpawnPosition(worldserver, k, blockposition_mutableblockposition, spawnutil_a)) {
@ -59,7 +59,7 @@ index 1b3c7b3fb869215badacdb604199d5b96f74e384..83ef8cb27db685cceb5c2b7c9674e17b
if (t0 != null) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index bb0f57be7ecb6a36f447294cc04edc74708427af..fa54a27d224113d5565b300693bd58b460bf086d 100644
index 93a43ef867d0961b46f9ecadc2c7be6a4b17c72b..c2aafe4e1afec2793735bf7b0bbd6af94ad393f8 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -413,6 +413,20 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -84,10 +84,10 @@ index bb0f57be7ecb6a36f447294cc04edc74708427af..fa54a27d224113d5565b300693bd58b4
if (t0 != null) {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index 806c49c127578a8f0a0bde11a4ad213e18d629af..caab72b733eabfe6a78c2a75e252817def49cbd0 100644
index 68594d2621267f4b112b4d14d2bec3a0dd6a044a..73a5750dd47cf8869070f92594cfb926193c8761 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -963,7 +963,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -966,7 +966,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}).limit(5L).collect(Collectors.toList());
if (list1.size() >= requiredCount) {
@ -97,7 +97,7 @@ index 806c49c127578a8f0a0bde11a4ad213e18d629af..caab72b733eabfe6a78c2a75e252817d
}
}
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index bd85887e4497be2f8aeccc6c0260a96a3b9c615f..4e1d28fbe67bc7a3d0741acd490be8db787480ae 100644
index 8540905242fc84ab8a26cf0a8e875ef252bc3d5d..3294e5b5ed0288af08067c36ca34514d02d200d3 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -128,6 +128,27 @@ public abstract class BaseSpawner {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index dd149e037e90067fb2f9b02520a2f29a12d90f13..6802e1def5e93c208d01a68f5cfc4c8809bb910f 100644
index 8f7ca41726551fd99b028e2fb3ff72df50a36d88..100781852965e09c92aca34785673c5de51c7107 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -228,6 +228,12 @@ public class PlayerAdvancements {

View File

@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds
when cancelling interaction.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index fc42bc68ae31f4fad1c382ef3d3c482c1f335f52..21401c872035d4dc46a05c066b321d99e0d94b72 100644
index 2e3b1eb4c4303d40f12c2e80f0608f2308225e97..0d72be376615f84934b031243ef283b6efc0bd13 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -186,6 +186,11 @@ public class ServerPlayerGameMode {

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index a5ff76a3eb9c6b08dc5c3ebbe2bbb8a9fcd036ed..ad723fc78d7fc57c67b5a74bb7dd2fd6623d18dd 100644
index 62112ea94bc6a022b69ab426cc2b71821b12c19e..0bf9425d001660816b36674c2757ec9e85cbd296 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1240,6 +1240,7 @@ public abstract class Player extends LivingEntity {
@@ -1241,6 +1241,7 @@ public abstract class Player extends LivingEntity {
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;
+ flag2 = flag2 && !level.paperConfig().entities.behavior.disablePlayerCrits; // Paper
flag2 = flag2 && !this.isSprinting();