13
0
geforkt von Mirrors/Paper

More more more more more work

Dieser Commit ist enthalten in:
Nassim Jahnke 2021-11-23 15:03:50 +01:00 committet von MiniDigger | Martin
Ursprung d7cdc72bdf
Commit 6f3591fd6d
90 geänderte Dateien mit 203 neuen und 211 gelöschten Zeilen

Datei anzeigen

@ -8,3 +8,4 @@
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: # To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner()
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 7e0ec58ea1d23501f0273882ebae8e45513b02cf..d794ed97bd14c67584af9190bad7d0cd07001b05 100644 index 65088203d29798efe211612dfadb356f457ed466..71f519b8f03d2a52f2c5a9283a18c74c1ca52328 100644
--- a/src/main/java/org/bukkit/entity/Entity.java --- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -673,5 +673,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent @@ -673,5 +673,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent

Datei anzeigen

@ -14,7 +14,7 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction. several layers of logging abstraction.
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 533600dfb2e73736857cc2a10525db7dc2452433..02f80c9a34a23c2285a1e05b41f53b4bafc28c5a 100644 index 283e2aefa17fe38ab10073761db2b77ba0ae8b46..0446e0131198ecd6d6d1e381eec5bbab18031b62 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -37,6 +37,8 @@ dependencies { @@ -37,6 +37,8 @@ dependencies {

Datei anzeigen

@ -10,7 +10,7 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added. Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b4c7f2d6de64d32804c8630f0ea1563a876b3510..96f1f1544d03d2928e95daa0dd02579ef3fdc87c 100644 index a0782b81e787630cb45b38a863f1e98506014735..8d5ddb1451ea1d7a7a5c9eefb843a4adb885d20e 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -985,12 +985,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -985,12 +985,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM

Datei anzeigen

@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index befd34cfdd37451532f14feeba5e728d3f86751a..c85fc0cb1c4927fe637f20a4e2499bce7707d633 100644 index 6c7b1e172a9acc881ecade6543245e8a64e251f6..b0457e7740dda723b6eda481bcea3560d55333f1 100644
--- a/src/main/java/org/bukkit/Bukkit.java --- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java
@@ -559,6 +559,20 @@ public final class Bukkit { @@ -559,6 +559,20 @@ public final class Bukkit {
@ -34,7 +34,7 @@ index befd34cfdd37451532f14feeba5e728d3f86751a..c85fc0cb1c4927fe637f20a4e2499bce
* Gets the plugin manager for interfacing with plugins. * Gets the plugin manager for interfacing with plugins.
* *
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 89fc36a73b8ae26f19b06cb0f9376ec33724b939..1a80dad1fa0bf3f33f5669f846912092132f8d64 100644 index 8021598d78170ea1676cf21bac63858528398f53..44a5e05fbc00aa878cd31879677d0aad779eb175 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -477,6 +477,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -477,6 +477,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi

Datei anzeigen

@ -20,7 +20,7 @@ index a0688ef7eb38e7c156193db3d94c44a3c290d8f2..53692c9a72a75cb5280165a99c956679
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
index 954defe131bdcd81178e3bd31755eb18b9aef026..be5ad056571f6522a205b8e9de8940ad1fe8c988 100644 index 954defe131bdcd81178e3bd31755eb18b9aef026..29f4da5962bf596da7c557d9aa61677f5604b0a0 100644
--- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java --- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
@@ -3,6 +3,7 @@ package net.minecraft.world.level.block; @@ -3,6 +3,7 @@ package net.minecraft.world.level.block;
@ -31,13 +31,11 @@ index 954defe131bdcd81178e3bd31755eb18b9aef026..be5ad056571f6522a205b8e9de8940ad
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.FluidTags; import net.minecraft.tags.FluidTags;
import net.minecraft.tags.Tag; import net.minecraft.tags.Tag;
@@ -40,7 +41,8 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock { @@ -40,6 +41,7 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock {
@Override @Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
- if (!SpreadingSnowyDirtBlock.canBeGrass(state, world, pos)) {
+ if (this instanceof GrassBlock && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper + if (this instanceof GrassBlock && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper
+ if (!SpreadingSnowyDirtBlock.canBeGrass(state, (LevelReader) world, pos)) { if (!SpreadingSnowyDirtBlock.canBeGrass(state, world, pos)) {
// CraftBukkit start // CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) { if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.DIRT.defaultBlockState()).isCancelled()) {
return;

Datei anzeigen

@ -22,7 +22,7 @@ index 7de279a1bef44a76173a1b71b98425ca6aa219aa..2584c02a5f6511ade260986a6aacef40
double deltaZ = this.getZ() - player.getZ(); double deltaZ = this.getZ() - player.getZ();
double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; double distanceSquared = deltaX * deltaX + deltaZ * deltaZ;
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
index 6fde138a3da49fee4fdbf36e0ab58438e114e196..09c862ff597629bccd3bf98ef168aa96fb69d230 100644 index 6fde138a3da49fee4fdbf36e0ab58438e114e196..4f9f64def9b5da5bd2714c5f3ba36a4339623758 100644
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -272,8 +272,9 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob @@ -272,8 +272,9 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
@ -30,8 +30,9 @@ index 6fde138a3da49fee4fdbf36e0ab58438e114e196..09c862ff597629bccd3bf98ef168aa96
// CraftBukkit start - Use relative location for far away sounds // CraftBukkit start - Use relative location for far away sounds
// this.world.globalLevelEvent(1023, new BlockPosition(this), 0); // this.world.globalLevelEvent(1023, new BlockPosition(this), 0);
- int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; - int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16;
- for (ServerPlayer player : (List<ServerPlayer>) MinecraftServer.getServer().getPlayerList().players) {
+ //int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API + //int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API
for (ServerPlayer player : (List<ServerPlayer>) MinecraftServer.getServer().getPlayerList().players) { + for (ServerPlayer player : (List<ServerPlayer>)this.level.players()) { // Paper
+ final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch + final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch
double deltaX = this.getX() - player.getX(); double deltaX = this.getX() - player.getX();
double deltaZ = this.getZ() - player.getZ(); double deltaZ = this.getZ() - player.getZ();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 9611388a6aeebb86b19d89c526f53dfed4d3ed27..d17af2ec8f72bf0cbe5928e7a83c06ba5ad4503d 100644 index 6df6204c9d4099afeb8ff07dd747f756d8e380d6..68fdfba22ebb35023299c776d4764d4f1555f435 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -379,6 +379,7 @@ public class ItemEntity extends Entity { @@ -378,6 +378,7 @@ public class ItemEntity extends Entity {
// CraftBukkit start - fire PlayerPickupItemEvent // CraftBukkit start - fire PlayerPickupItemEvent
int canHold = player.getInventory().canHold(itemstack); int canHold = player.getInventory().canHold(itemstack);
int remaining = i - canHold; int remaining = i - canHold;
@ -16,7 +16,7 @@ index 9611388a6aeebb86b19d89c526f53dfed4d3ed27..d17af2ec8f72bf0cbe5928e7a83c06ba
if (this.pickupDelay <= 0 && canHold > 0) { if (this.pickupDelay <= 0 && canHold > 0) {
itemstack.setCount(canHold); itemstack.setCount(canHold);
@@ -386,8 +387,14 @@ public class ItemEntity extends Entity { @@ -385,8 +386,14 @@ public class ItemEntity extends Entity {
PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining);
playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems()); playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems());
this.level.getCraftServer().getPluginManager().callEvent(playerEvent); this.level.getCraftServer().getPluginManager().callEvent(playerEvent);
@ -31,7 +31,7 @@ index 9611388a6aeebb86b19d89c526f53dfed4d3ed27..d17af2ec8f72bf0cbe5928e7a83c06ba
return; return;
} }
@@ -417,7 +424,11 @@ public class ItemEntity extends Entity { @@ -416,7 +423,11 @@ public class ItemEntity extends Entity {
// CraftBukkit end // CraftBukkit end
if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(player.getUUID())) && player.getInventory().add(itemstack)) { if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(player.getUUID())) && player.getInventory().add(itemstack)) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index d17af2ec8f72bf0cbe5928e7a83c06ba5ad4503d..54025e401eb02fceb47afb182f0ede620ca23a8d 100644 index 68fdfba22ebb35023299c776d4764d4f1555f435..db42d22f58df5daefc41720206405dda4f7ad633 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -37,6 +37,7 @@ import net.minecraft.stats.Stats; @@ -36,6 +36,7 @@ import net.minecraft.util.Mth;
import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent;
// CraftBukkit end // CraftBukkit end
@ -16,7 +16,7 @@ index d17af2ec8f72bf0cbe5928e7a83c06ba5ad4503d..54025e401eb02fceb47afb182f0ede62
public class ItemEntity extends Entity { public class ItemEntity extends Entity {
@@ -381,6 +382,22 @@ public class ItemEntity extends Entity { @@ -380,6 +381,22 @@ public class ItemEntity extends Entity {
int remaining = i - canHold; int remaining = i - canHold;
boolean flyAtPlayer = false; // Paper boolean flyAtPlayer = false; // Paper

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add UnknownCommandEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 696e2495ee8046c78ed53126db0e6c696c77c00d..e01f800130f183bf10a383e298b7da3d5f11e3a2 100644 index de85382893132efa9c60e0c9bb0f07faaf6f442c..21b7620eb13cc297acecd7dcb2ba22fab028983a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -817,7 +817,13 @@ public final class CraftServer implements Server { @@ -826,7 +826,13 @@ public final class CraftServer implements Server {
// Spigot start // Spigot start
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {

Datei anzeigen

@ -315,7 +315,7 @@ index 0000000000000000000000000000000000000000..84551164b76bc8f064a3a0c030c3a1b4
+} +}
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..d64d45eb01c65864fca1077982d89bc05e0f811b index 0000000000000000000000000000000000000000..1459a1f99fe614d072a087cda18788cf13102645
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java +++ b/src/main/java/com/destroystokyo/paper/profile/PaperAuthenticationService.java
@@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
@ -332,7 +332,7 @@ index 0000000000000000000000000000000000000000..d64d45eb01c65864fca1077982d89bc0
+ private final Environment environment; + private final Environment environment;
+ public PaperAuthenticationService(Proxy proxy) { + public PaperAuthenticationService(Proxy proxy) {
+ super(proxy); + super(proxy);
+ this.environment = (Environment)EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD);; + this.environment = EnvironmentParser.getEnvironmentFromProperties().orElse(YggdrasilEnvironment.PROD.getEnvironment());
+ } + }
+ +
+ @Override + @Override
@ -429,7 +429,7 @@ index 0000000000000000000000000000000000000000..3cdd06d3af7ff94f1fe1a11b9a9275e1
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index f0fed1d2c297d8d2a6903d2caa219b458c5e43c2..aa96017819712f42e16c7eac57222301600b66a5 100644 index ff4def7ec3dcfa30fdc0135bd1add8e47989fb36..4f45ac04a219e619c13b31befd2c4e452057079c 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java --- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
@ -460,10 +460,10 @@ index f0fed1d2c297d8d2a6903d2caa219b458c5e43c2..aa96017819712f42e16c7eac57222301
* Calculates distance between 2 entities * Calculates distance between 2 entities
* @param e1 * @param e1
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index c8385460701395cb5c65fba41335469ffb2d9b9a..fb0b3c5770f66cc3590f5ac4e690a33cb6179be3 100644 index a497b281d03c097587b21e9f141a6a66f36e4dad..4ab820c43ddc79f5a280e2d4b322a667b9ba725f 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -130,7 +130,7 @@ public class Main { @@ -135,7 +135,7 @@ public class Main {
} }
File file = (File) optionset.valueOf("universe"); // CraftBukkit File file = (File) optionset.valueOf("universe"); // CraftBukkit
@ -473,7 +473,7 @@ index c8385460701395cb5c65fba41335469ffb2d9b9a..fb0b3c5770f66cc3590f5ac4e690a33c
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName())); GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7..61405c2b53e03a4b83e2c70c6e4d3739ca9676cb 100644 index 00f783aafd81fa7e836e4eea5bfeac7434f33b0f..3789441e2df9410aa1c6efe59054aaba2c738633 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java +++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
@@ -135,6 +135,13 @@ public class GameProfileCache { @@ -135,6 +135,13 @@ public class GameProfileCache {
@ -491,10 +491,10 @@ index 6e1b7d5b20e9f6ed1b650eb9d6ac9f8c4867b4b7..61405c2b53e03a4b83e2c70c6e4d3739
String s1 = name.toLowerCase(Locale.ROOT); String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); 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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index e01f800130f183bf10a383e298b7da3d5f11e3a2..a337967295f61f4892a2ae7dd65aeaba75a06172 100644 index 21b7620eb13cc297acecd7dcb2ba22fab028983a..a48067a7cc48c375854d443e483398c0c1f65e05 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -246,6 +246,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -250,6 +250,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
import net.md_5.bungee.api.chat.BaseComponent; // Spigot import net.md_5.bungee.api.chat.BaseComponent; // Spigot
@ -504,7 +504,7 @@ index e01f800130f183bf10a383e298b7da3d5f11e3a2..a337967295f61f4892a2ae7dd65aeaba
public final class CraftServer implements Server { public final class CraftServer implements Server {
private final String serverName = "Paper"; // Paper private final String serverName = "Paper"; // Paper
private final String serverVersion; private final String serverVersion;
@@ -2494,5 +2497,24 @@ public final class CraftServer implements Server { @@ -2506,5 +2509,24 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() { public boolean suggestPlayerNamesWhenNullTabCompletions() {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
} }

Datei anzeigen

@ -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 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 a4eb5de429f6934cf6f2b771d62db51e328f8987..193d73c53c7c3cc31246dd19c6d7ff4cb39cac1b 100644 index 6da451d587c419ffead981876731b847ce3e81db..b7b4b4b3e3fbebd359f5ea199151a0d5978c47b3 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1951,20 +1951,44 @@ public abstract class Player extends LivingEntity { @@ -1949,20 +1949,44 @@ public abstract class Player extends LivingEntity {
} }
@ -43,11 +43,11 @@ index a4eb5de429f6934cf6f2b771d62db51e328f8987..193d73c53c7c3cc31246dd19c6d7ff4c
} }
entity.setPos(this.getX(), this.getY() + 0.699999988079071D, this.getZ()); entity.setPos(this.getX(), this.getY() + 0.699999988079071D, this.getZ());
- return ((ServerLevel) this.level).addEntitySerialized(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit - return ((ServerLevel) this.level).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit
- }).orElse(true); // CraftBukkit - }).orElse(true); // CraftBukkit
+ boolean addedToWorld = ((ServerLevel) this.level).addEntitySerialized(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit + boolean addedToWorld = ((ServerLevel) this.level).addWithUUID(entity, CreatureSpawnEvent.SpawnReason.SHOULDER_ENTITY); // CraftBukkit
+ return addedToWorld ? entity : null; + return addedToWorld ? entity : null;
+ }).orElse(null); // CraftBukkit // Paper - false -> null + }).orElse(null); // CraftBukkit // Paper - true -> null
} }
- return true; // CraftBukkit - return true; // CraftBukkit
@ -58,7 +58,7 @@ index a4eb5de429f6934cf6f2b771d62db51e328f8987..193d73c53c7c3cc31246dd19c6d7ff4c
@Override @Override
public abstract boolean isSpectator(); 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 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 841dbf4a86b19d7c8ea41930ecb1f88c660fa117..54947f02f29dd3dc546ee0d0f4600630242f003d 100644 index afb71ae8bd5f417f6cd99e26c3b45e5b544beb21..cc1caa32ea430f69d0dcfb76e1a08fb78650877d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -500,6 +500,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -500,6 +500,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Block player logins during server shutdown
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index a60b40d8cc802456374625af216c27998f8348b3..ab3409dd3a7671b46cba210cfa326311d10a7ef4 100644 index 58617412e4759fe6c1c975f352c0c8281b744de1..bf2dbc99a9b9580816d6a51e2774f8cde2989eef 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -69,6 +69,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -69,6 +69,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener

Datei anzeigen

@ -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 diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index bf52f5f9b13e8b4eb3c7ee19b0e57bb872d2af1d..3b2334e9ba44205a4e0ec12045eab4fad91bb15a 100644 index 4f1add992cef7bfa194a9e464ae9ea56eab1f191..31c502705ed3daef86df6e81215c0c7f9e8d22f8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -322,6 +322,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -326,6 +326,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState; public final boolean defaultActivationState;
public long activatedTick = Integer.MIN_VALUE; public long activatedTick = Integer.MIN_VALUE;
@ -16,7 +16,7 @@ index bf52f5f9b13e8b4eb3c7ee19b0e57bb872d2af1d..3b2334e9ba44205a4e0ec12045eab4fa
protected int numCollisions = 0; // Paper protected int numCollisions = 0; // Paper
public void inactiveTick() { } public void inactiveTick() { }
// Spigot end // Spigot end
@@ -1868,6 +1869,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -1897,6 +1898,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
} }
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
} }
@ -27,7 +27,7 @@ index bf52f5f9b13e8b4eb3c7ee19b0e57bb872d2af1d..3b2334e9ba44205a4e0ec12045eab4fa
// Paper end // Paper end
return nbt; return nbt;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -2007,6 +2012,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -2036,6 +2041,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
this.originWorld = originWorld; this.originWorld = originWorld;
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2)); origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
} }
@ -37,10 +37,10 @@ index bf52f5f9b13e8b4eb3c7ee19b0e57bb872d2af1d..3b2334e9ba44205a4e0ec12045eab4fa
} catch (Throwable throwable) { } 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 diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 65744b55f06c225745e3e145e5f5e60ebefd304c..e720c751518af3f38fba0c1b22e4c01a46561b00 100644 index 840a47fdfa67b166bbafd5d7958462b32fb26681..49fc9fc724a59e53527ac9fbea8ea605f42a117c 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -167,6 +167,7 @@ public abstract class BaseSpawner { @@ -157,6 +157,7 @@ public abstract class BaseSpawner {
} }
// Spigot End // Spigot End
} }

Datei anzeigen

@ -7,7 +7,7 @@ Not all horses with Saddles have armor. This lets us break up the horses with sa
and access their saddle state separately from an interface shared with Armor. and access their saddle state separately from an interface shared with Armor.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
index 6f473dbf949552afd288382b36223ea036eaa857..27a1ca43792644fc239af81dea5510f25d3328e9 100644 index 5edd8c38a4a73c1d4a6314159eea99b3881f8eeb..6151df2086d92fd5f428e2efe0df8d1c154ff891 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
@@ -5,6 +5,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; @@ -5,6 +5,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;

Datei anzeigen

@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0eea43c994e76b466fdda8ecd145d0b1c9273cea..17f56157d60d33695c4eac0e4fc94120a2101214 100644 index 61086dbcd852bdb2e5b6083ae8781a5265db7829..4f56bb45b9bdaf3de02c5f331760339f4397eafc 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -615,9 +615,9 @@ public abstract class PlayerList { @@ -615,9 +615,9 @@ public abstract class PlayerList {

Datei anzeigen

@ -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. 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 diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java
index c7d5018cb6acef12e6da90626c75543ac279a101..64576ddd8363be55755fa50d1c16d95e4e02402d 100644 index bf42e5687935022fe5bcb1ed40bab09bfe189e88..b111200a8f5d3255de29c9836f70fc7ffd003c6e 100644
--- a/src/main/java/net/minecraft/server/Bootstrap.java --- a/src/main/java/net/minecraft/server/Bootstrap.java
+++ b/src/main/java/net/minecraft/server/Bootstrap.java +++ b/src/main/java/net/minecraft/server/Bootstrap.java
@@ -42,7 +42,7 @@ public class Bootstrap { @@ -48,7 +48,7 @@ public class Bootstrap {
public static void bootStrap() { public static void bootStrap() {
if (!Bootstrap.isBootstrapped) { if (!Bootstrap.isBootstrapped) {
// CraftBukkit start // CraftBukkit start
@ -21,7 +21,7 @@ index c7d5018cb6acef12e6da90626c75543ac279a101..64576ddd8363be55755fa50d1c16d95e
switch (name) { switch (name) {
case "DispenserRegistry": case "DispenserRegistry":
break; break;
@@ -56,7 +56,7 @@ public class Bootstrap { @@ -62,7 +62,7 @@ public class Bootstrap {
System.err.println("*** WARNING: This server jar is unsupported, use at your own risk. ***"); System.err.println("*** WARNING: This server jar is unsupported, use at your own risk. ***");
System.err.println("**********************************************************************"); System.err.println("**********************************************************************");
break; break;
@ -31,12 +31,12 @@ index c7d5018cb6acef12e6da90626c75543ac279a101..64576ddd8363be55755fa50d1c16d95e
Bootstrap.isBootstrapped = true; Bootstrap.isBootstrapped = true;
if (Registry.REGISTRY.keySet().isEmpty()) { if (Registry.REGISTRY.keySet().isEmpty()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index bbf552bf586de94d8dfc5fb1c18e0af6f75aebe1..1da136f365664d4f8ace3d2d135b19eb97e55304 100644 index 29e4b0282bd85c55700c07480b6c8911a1708dad..cd75c62770f872a5c270f63adfe3016156e2efc9 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -228,10 +228,12 @@ public class Main { @@ -228,10 +228,12 @@ public class Main {
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -28); deadline.add(Calendar.DAY_OF_YEAR, -7);
if (buildDate.before(deadline.getTime())) { if (buildDate.before(deadline.getTime())) {
- System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Error, this build is outdated ***");
+ // Paper start - This is some stupid bullshit + // Paper start - This is some stupid bullshit

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] LivingEntity#setKiller
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index e955126fc82dfcdadb824c8d2d15e8b1f33bc67f..90b70935242757b5c302bac7777eb1428d69619e 100644 index b65d44780c7e6e1e2e8724df838d1aa54edcc30a..6455a81fea0de79173419587171b5ed025c30592 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -8,6 +8,7 @@ import java.util.Iterator; @@ -8,6 +8,7 @@ import java.util.Iterator;

Datei anzeigen

@ -5,15 +5,15 @@ 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 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 b223b54c80bdc2c9b620e5c9e44cab0c9abdd44c..49122e7baa5c0cd3691bcb48176fdefbdb79026b 100644 index b18546b6816ee77f1458a7ca44b32f76c33f2fe9..a781048b0c43e63e441e6afecec125d7f838c342 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java --- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
+++ b/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 { @@ -134,7 +134,7 @@ public class Ocelot extends Animal {
@Override @Override
public boolean removeWhenFarAway(double distanceSquared) { public boolean removeWhenFarAway(double distanceSquared) {
- return !this.isTrusting() /*&& this.ticksLived > 2400*/; // CraftBukkit - return !this.isTrusting() /*&& this.tickCount > 2400*/; // CraftBukkit
+ return !this.isTrusting() && !this.hasCustomName() && !this.isLeashed() /*&& this.ticksLived > 2400*/; // CraftBukkit // Paper - honor name and leash + return !this.isTrusting() && !this.hasCustomName() && !this.isLeashed() /*&& this.tickCount > 2400*/; // CraftBukkit // Paper - honor name and leash
} }
public static AttributeSupplier.Builder createAttributes() { public static AttributeSupplier.Builder createAttributes() {

Datei anzeigen

@ -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 diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index e720c751518af3f38fba0c1b22e4c01a46561b00..14188ac6f158b36755abe23c0a967763cf7367d8 100644 index 49fc9fc724a59e53527ac9fbea8ea605f42a117c..802ff419ae74a16bcd570b996be2dd85e21ea3e8 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -168,6 +168,7 @@ public abstract class BaseSpawner { @@ -158,6 +158,7 @@ public abstract class BaseSpawner {
// Spigot End // Spigot End
} }
entity.spawnedViaMobSpawner = true; // Paper entity.spawnedViaMobSpawner = true; // Paper
@ -16,7 +16,7 @@ index e720c751518af3f38fba0c1b22e4c01a46561b00..14188ac6f158b36755abe23c0a967763
// Spigot Start // Spigot Start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
Entity vehicle = entity.getVehicle(); Entity vehicle = entity.getVehicle();
@@ -191,7 +192,7 @@ public abstract class BaseSpawner { @@ -181,7 +182,7 @@ public abstract class BaseSpawner {
((Mob) entity).spawnAnim(); ((Mob) entity).spawnAnim();
} }

Datei anzeigen

@ -27,10 +27,10 @@ index 7a69f9d9bb9c05474d8fbab22d626529a41a66a1..f4735cc330822183e098a67f2c0f00f2
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index ab3409dd3a7671b46cba210cfa326311d10a7ef4..82d0979e3239dddf3951df4a8b65ae7319d3d5b5 100644 index bf2dbc99a9b9580816d6a51e2774f8cde2989eef..b057dfd42e9439cd8a2a2933b736f0581da53b85 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -297,6 +297,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -298,6 +298,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile); ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile);
ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT; ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
} else { } else {

Datei anzeigen

@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger. the plugin logger.
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 9b70376813531718c02082633e9f8105f4879a63..fc8ffeea3e808eb1381f85972adffc614937ef6d 100644 index ff067710300454ed284d38a75cd6b3e5f04cf794..ef5af1965d54e9ba9ff84d4f22ae77e4ccfa461c 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -25,7 +25,7 @@ dependencies { @@ -25,7 +25,7 @@ dependencies {
@ -26,7 +26,7 @@ index 9b70376813531718c02082633e9f8105f4879a63..fc8ffeea3e808eb1381f85972adffc61
+ implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation + implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
// Paper end // Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") // Paper
implementation("org.apache.logging.log4j:log4j-api:2.14.1") // Paper implementation("org.ow2.asm:asm:9.2")
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index f8a9d6a394f796634e4663ef4078a4c98447e13c..d73dfe72a54b621c0f944c90904df3e3bc709445 100644 index f8a9d6a394f796634e4663ef4078a4c98447e13c..d73dfe72a54b621c0f944c90904df3e3bc709445 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java

Datei anzeigen

@ -5,10 +5,10 @@ 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 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 41f1b355a8a90216964e89432244a7d6929c9152..7759bf2afb9edeaca24726aace9358a8d5eafc64 100644 index 1eac0962c59fffe47a33903238f7f43e5f77450e..397a6e095c5aa5674d1ef5c3bb820e864cc88d1a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1174,7 +1174,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -1173,7 +1173,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
boolean flag = d8 > 0.0D; boolean flag = d8 > 0.0D;
if (this.player.isOnGround() && !packet.isOnGround() && flag) { if (this.player.isOnGround() && !packet.isOnGround() && flag) {

Datei anzeigen

@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients. 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 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 89588d6478ebd7d4892dceb03026dff89e1844db..7b6e6e646511bc47d2215c512b4d839b3f3a1c55 100644 index 397a6e095c5aa5674d1ef5c3bb820e864cc88d1a..a0cd15635635074b88841a1b43c3a08b9f32e74f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2771,14 +2771,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -2776,14 +2776,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) { public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

Datei anzeigen

@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..a5a7624f1f372a26b982836cd31cff15
+ +
+} +}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index b62e373445406ae84b37ec0570ebb1da02cff0b7..06e965996a5c50bce617847e594ae0dd83403484 100644 index 7d177d38f3311ab941dd126c844d22e0018e25a1..84fe0f6cfc928d95d0967ad368a38afb71543af7 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -83,6 +83,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -83,6 +83,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -90,10 +90,10 @@ index c4ba069f5124ec151e05813beddf293fddc3b804..484221e5a9c246aa91e0eacef3911b0e
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4233f5ffa673801c57e3f929cd9ae919d6c7169f..e5e12d1672588138e4f56007fcdd14a1bb8ec1ca 100644 index d475f9a3eb3b4e3c0ed78bef1d233dde26c391b9..5afc4c55c9ec8ed70b36a805b553613e18747c1f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -193,6 +193,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -199,6 +199,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }

Datei anzeigen

@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer. 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 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 652703b1582e63148658a3a9d2604afa55674c23..cf42d59254f2786bfe8785249ad270d35996417a 100644 index a0cd15635635074b88841a1b43c3a08b9f32e74f..7e80a929bc0ddcf94f27f4febedf10ad07a531ff 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -221,9 +221,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -220,9 +220,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private final MinecraftServer server; private final MinecraftServer server;
public ServerPlayer player; public ServerPlayer player;
private int tickCount; private int tickCount;
@ -31,9 +31,9 @@ index 652703b1582e63148658a3a9d2604afa55674c23..cf42d59254f2786bfe8785249ad270d3
+ private boolean keepAlivePending; + private boolean keepAlivePending;
+ private long keepAliveChallenge; + private long keepAliveChallenge;
// CraftBukkit start - multithreaded fields // CraftBukkit start - multithreaded fields
private AtomicInteger chatSpamTickCount = new AtomicInteger(); private final AtomicInteger chatSpamTickCount = new AtomicInteger();
// CraftBukkit end // CraftBukkit end
@@ -252,6 +252,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -251,6 +251,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
private int aboveGroundVehicleTickCount; private int aboveGroundVehicleTickCount;
private int receivedMovePacketCount; private int receivedMovePacketCount;
private int knownMovePacketCount; private int knownMovePacketCount;
@ -41,7 +41,7 @@ index 652703b1582e63148658a3a9d2604afa55674c23..cf42d59254f2786bfe8785249ad270d3
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.server = server; this.server = server;
@@ -334,18 +335,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -333,18 +334,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} }
this.server.getProfiler().push("keepAlive"); this.server.getProfiler().push("keepAlive");

Datei anzeigen

@ -6,7 +6,7 @@ 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 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 193d73c53c7c3cc31246dd19c6d7ff4cb39cac1b..8c20af91c9298cb36fdb2700d042b1e2fccf5f54 100644 index b7b4b4b3e3fbebd359f5ea199151a0d5978c47b3..f6a55bb449bcb06821f5b83d3d4d493df277721e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent; @@ -30,6 +30,7 @@ import net.minecraft.network.chat.MutableComponent;
@ -17,8 +17,8 @@ index 193d73c53c7c3cc31246dd19c6d7ff4cb39cac1b..8c20af91c9298cb36fdb2700d042b1e2
import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.network.syncher.SynchedEntityData;
@@ -1181,7 +1182,7 @@ public abstract class Player extends LivingEntity { @@ -1179,7 +1180,7 @@ public abstract class Player extends LivingEntity {
int i = b0 + EnchantmentHelper.getKnockbackBonus((LivingEntity) this); int i = b0 + EnchantmentHelper.getKnockbackBonus(this);
if (this.isSprinting() && flag) { 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);
@ -26,7 +26,7 @@ index 193d73c53c7c3cc31246dd19c6d7ff4cb39cac1b..8c20af91c9298cb36fdb2700d042b1e2
++i; ++i;
flag1 = true; flag1 = true;
} }
@@ -1256,7 +1257,7 @@ public abstract class Player extends LivingEntity { @@ -1254,7 +1255,7 @@ public abstract class Player extends LivingEntity {
} }
} }
@ -35,7 +35,7 @@ index 193d73c53c7c3cc31246dd19c6d7ff4cb39cac1b..8c20af91c9298cb36fdb2700d042b1e2
this.sweepAttack(); this.sweepAttack();
} }
@@ -1284,15 +1285,15 @@ public abstract class Player extends LivingEntity { @@ -1282,15 +1283,15 @@ public abstract class Player extends LivingEntity {
} }
if (flag2) { if (flag2) {
@ -54,16 +54,16 @@ index 193d73c53c7c3cc31246dd19c6d7ff4cb39cac1b..8c20af91c9298cb36fdb2700d042b1e2
} }
} }
@@ -1344,7 +1345,7 @@ public abstract class Player extends LivingEntity { @@ -1342,7 +1343,7 @@ public abstract class Player extends LivingEntity {
this.applyExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value this.causeFoodExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
} else { } 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 + 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) { if (flag4) {
target.clearFire(); target.clearFire();
} }
@@ -1791,6 +1792,14 @@ public abstract class Player extends LivingEntity { @@ -1789,6 +1790,14 @@ public abstract class Player extends LivingEntity {
public int getXpNeededForNextLevel() { public int getXpNeededForNextLevel() {
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
} }

Datei anzeigen

@ -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 diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 5f24963bd2681cab15d20221154a9a758be53b03..375959ed616596e604dc07d3b30d708b08d7ce57 100644 index 77b96f632342026fcd2c37e34e63db3e11396c34..5c9f9b6a1bd66d33fd194ad1d78a907b005a101c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index 5f24963bd2681cab15d20221154a9a758be53b03..375959ed616596e604dc07d3b30d708b
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
@@ -2941,6 +2942,13 @@ public abstract class LivingEntity extends Entity { @@ -2940,6 +2941,13 @@ public abstract class LivingEntity extends Entity {
ItemStack itemstack1 = this.getItemBySlot(enumitemslot); ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
if (!ItemStack.matches(itemstack1, itemstack)) { if (!ItemStack.matches(itemstack1, itemstack)) {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Prevent logins from being processed when the player has
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 82d0979e3239dddf3951df4a8b65ae7319d3d5b5..109d7f1bf37e442ff80f7f63d50e27e6e30e0b5e 100644 index b057dfd42e9439cd8a2a2933b736f0581da53b85..40feb2fbbe3c73b73124cae62f4661f000fad6cb 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -76,7 +76,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -76,7 +76,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener

Datei anzeigen

@ -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 diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index acfa844c87e5814c033cad4318813800f57885fd..b327e10a5708d523b9d4a6c77c1359521f2927d5 100644 index 8fbf239cdc5bc2f1ec7b91eaee85d032e65f250f..8844a6d3e06d5a29013fdf78072109cc50819d71 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -730,6 +730,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -731,6 +731,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start // Spigot start
// Iterator iterator = this.blockEntityTickers.iterator(); // Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0; int tilesThisCycle = 0;
@ -17,7 +17,7 @@ index acfa844c87e5814c033cad4318813800f57885fd..b327e10a5708d523b9d4a6c77c135952
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition); TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
@@ -737,7 +739,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -738,7 +740,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity == null) { if (tickingblockentity == null) {
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
tilesThisCycle--; tilesThisCycle--;
@ -25,14 +25,14 @@ index acfa844c87e5814c033cad4318813800f57885fd..b327e10a5708d523b9d4a6c77c135952
continue; continue;
} }
// Spigot end // Spigot end
@@ -745,12 +746,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -746,12 +747,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity.isRemoved()) { if (tickingblockentity.isRemoved()) {
// Spigot start // Spigot start
tilesThisCycle--; tilesThisCycle--;
- this.blockEntityTickers.remove(this.tileTickPosition--); - this.blockEntityTickers.remove(this.tileTickPosition--);
+ toRemove.add(tickingblockentity); // Paper - use removeAll + toRemove.add(tickingblockentity); // Paper - use removeAll
// Spigot end // Spigot end
} else { } else if (this.shouldTickBlocksAt(ChunkPos.asLong(tickingblockentity.getPos()))) {
tickingblockentity.tick(); tickingblockentity.tick();
} }
} }

Datei anzeigen

@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled. 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 diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b327e10a5708d523b9d4a6c77c1359521f2927d5..233a8fcfae4ac568ad1f73cc61d8ae5b66a01ac2 100644 index 8844a6d3e06d5a29013fdf78072109cc50819d71..21491224a8383cef2d41b0da2e7de9362fe1d27f 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -141,7 +141,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -142,7 +142,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710 public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false; public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false; public boolean captureTreeGeneration = false;
@ -30,7 +30,7 @@ index b327e10a5708d523b9d4a6c77c1359521f2927d5..233a8fcfae4ac568ad1f73cc61d8ae5b
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>(); public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
public List<ItemEntity> captureDrops; public List<ItemEntity> captureDrops;
public long ticksPerAnimalSpawns; public long ticksPerAnimalSpawns;
@@ -361,7 +361,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -362,7 +362,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {
@ -39,7 +39,7 @@ index b327e10a5708d523b9d4a6c77c1359521f2927d5..233a8fcfae4ac568ad1f73cc61d8ae5b
if (blockstate == null) { if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate); this.capturedBlockStates.put(pos.immutable(), blockstate);
@@ -381,7 +381,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -382,7 +382,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start - capture blockstates // CraftBukkit start - capture blockstates
boolean captured = false; boolean captured = false;
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) { if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
@ -49,7 +49,7 @@ index b327e10a5708d523b9d4a6c77c1359521f2927d5..233a8fcfae4ac568ad1f73cc61d8ae5b
this.capturedBlockStates.put(pos.immutable(), blockstate); this.capturedBlockStates.put(pos.immutable(), blockstate);
captured = true; captured = true;
} }
@@ -650,7 +651,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -651,7 +652,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public BlockState getBlockState(BlockPos pos) { public BlockState getBlockState(BlockPos pos) {
// CraftBukkit start - tree generation // CraftBukkit start - tree generation
if (this.captureTreeGeneration) { if (this.captureTreeGeneration) {

Datei anzeigen

@ -13,18 +13,18 @@ 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 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 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 27895fbe1cd7ee6ee025ed3e320671e3e971764d..1d1764766d2b4a0b7bf4078ce428bb1474f709df 100644 index 67315a86e5db51029d0f355c6dc223e93e4141db..29167adb4eeb83c108445c37e01dc4035b4c4be7 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -42,6 +42,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { @@ -45,6 +45,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
this.type = type; this.type = type;
this.worldPosition = pos.immutable(); this.worldPosition = pos.immutable();
this.blockState = state; this.blockState = state;
+ this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY); // Paper - always init + this.persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY); // Paper - always init
} }
// Paper start public static BlockPos getPosFromTag(CompoundTag nbt) {
@@ -79,7 +80,7 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { @@ -86,7 +87,7 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
// CraftBukkit start - read container // CraftBukkit start - read container
public void load(CompoundTag nbt) { public void load(CompoundTag nbt) {
@ -33,7 +33,7 @@ index 27895fbe1cd7ee6ee025ed3e320671e3e971764d..1d1764766d2b4a0b7bf4078ce428bb14
net.minecraft.nbt.Tag persistentDataTag = nbt.get("PublicBukkitValues"); net.minecraft.nbt.Tag persistentDataTag = nbt.get("PublicBukkitValues");
if (persistentDataTag instanceof CompoundTag) { if (persistentDataTag instanceof CompoundTag) {
@@ -222,10 +223,15 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { @@ -259,10 +260,15 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject {
// CraftBukkit start - add method // CraftBukkit start - add method
public InventoryHolder getOwner() { public InventoryHolder getOwner() {
@ -51,7 +51,7 @@ index 27895fbe1cd7ee6ee025ed3e320671e3e971764d..1d1764766d2b4a0b7bf4078ce428bb14
return null; return null;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index e6b8dd52cd503f45ca9bb868891ae4c8b29b3fcb..f1c4c3a3392c2d4d836fa10d7a38558d08084d9d 100644 index 155c0dee5d3485310c60b4f4c3240d1ac07eb873..3ba1c033e00b56abcef005c04fa88cd24dae93ad 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -314,7 +314,20 @@ public class CraftBlock implements Block { @@ -314,7 +314,20 @@ public class CraftBlock implements Block {
@ -76,7 +76,7 @@ index e6b8dd52cd503f45ca9bb868891ae4c8b29b3fcb..f1c4c3a3392c2d4d836fa10d7a38558d
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
index 2fb445e6edc43eb8e3e169cca3fc3b46ced94202..059a122ef7038f7c4e269b476eb6e013b3eb4531 100644 index aa544f8be7d1db6fc6618d38efc40221afe85618..b98d442a8c749c59aff43189c3904ff4fb4cb353 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
@@ -10,15 +10,26 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> extends Craft @@ -10,15 +10,26 @@ public abstract class CraftBlockEntityState<T extends BlockEntity> extends Craft

Datei anzeigen

@ -14,10 +14,10 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cf42d59254f2786bfe8785249ad270d35996417a..8c2242d7e443bee26741608c65d314d8902f5765 100644 index 7e80a929bc0ddcf94f27f4febedf10ad07a531ff..f97125ad82bc1ec850af9bdd92973942fc470bc1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -702,10 +702,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -701,10 +701,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override @Override
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
@ -30,7 +30,7 @@ index cf42d59254f2786bfe8785249ad270d35996417a..8c2242d7e443bee26741608c65d314d8
return; return;
} }
// CraftBukkit end // CraftBukkit end
@@ -715,12 +715,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser @@ -714,12 +714,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
stringreader.skip(); stringreader.skip();
} }
@ -72,10 +72,10 @@ index cf42d59254f2786bfe8785249ad270d35996417a..8c2242d7e443bee26741608c65d314d8
@Override @Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a337967295f61f4892a2ae7dd65aeaba75a06172..435a68e6c99bffdc8d6ded9deda68d4e970a2d49 100644 index a48067a7cc48c375854d443e483398c0c1f65e05..283038f0e8e78ba869eead3dabc51bff7b0ba77a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2015,7 +2015,7 @@ public final class CraftServer implements Server { @@ -2026,7 +2026,7 @@ public final class CraftServer implements Server {
offers = this.tabCompleteChat(player, message); offers = this.tabCompleteChat(player, message);
} }

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb 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 diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index 5220e3ee9fab4c4cbc95e0cf1928392316a35e34..1fdfeaa7758497e93fc13b44996e11d74a812546 100644 index 90692df7e02346d4ba785d2eaf724d06b98b4438..8a3f2d2c9087b1a5f4dbde8e58af825e334f2432 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -300,7 +300,7 @@ public class ExperienceOrb extends Entity { @@ -300,7 +300,7 @@ public class ExperienceOrb extends Entity {

Datei anzeigen

@ -10,7 +10,7 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added. Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
index 6f25e9f41d93a225acaa6575954967438a6cabbf..d439e8ce87bf7da03683a336941c7673b8b166e4 100644 index 3a09ce6d0ea51436adcae4719d3f28d1868c283c..7bc5aa35b52de0027cf58a6127a9903464ccaf47 100644
--- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java
@@ -270,8 +270,11 @@ public class EnchantmentHelper { @@ -270,8 +270,11 @@ public class EnchantmentHelper {
@ -28,25 +28,10 @@ index 6f25e9f41d93a225acaa6575954967438a6cabbf..d439e8ce87bf7da03683a336941c7673
return true; return true;
}); });
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6b8ee829306ad22f52844ba29bf2a549558048bd..4c8617fbd2cd8e34c87634fe448d204ee7fb8a0f 100644 index 5afc4c55c9ec8ed70b36a805b553613e18747c1f..d6f9fe4ebc034263169f3333922ad90fe4fcee69 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -61,11 +61,14 @@ import net.minecraft.server.level.ServerPlayer; @@ -1223,8 +1223,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.server.players.UserWhiteListEntry;
import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.ExperienceOrb;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
import net.minecraft.world.entity.ai.attributes.AttributeMap;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.inventory.AbstractContainerMenu;
+import net.minecraft.world.item.enchantment.EnchantmentHelper;
+import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.SignBlockEntity;
@@ -1216,8 +1219,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return GameMode.getByValue(this.getHandle().gameMode.getGameModeForPlayer().getId()); return GameMode.getByValue(this.getHandle().gameMode.getGameModeForPlayer().getId());
} }
@ -55,10 +40,10 @@ index 6b8ee829306ad22f52844ba29bf2a549558048bd..4c8617fbd2cd8e34c87634fe448d204e
+ public int applyMending(int amount) { + public int applyMending(int amount) {
+ ServerPlayer handle = getHandle(); + ServerPlayer handle = getHandle();
+ // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties + // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties
+ net.minecraft.world.item.ItemStack itemstack = EnchantmentHelper.getRandomEquippedItemWithEnchant(Enchantments.MENDING, handle); + net.minecraft.world.item.ItemStack itemstack = net.minecraft.world.item.enchantment.EnchantmentHelper
+ .getRandomEquippedItemWithEnchant(net.minecraft.world.item.enchantment.Enchantments.MENDING, handle);
+ if (!itemstack.isEmpty() && itemstack.getItem().canBeDepleted()) { + if (!itemstack.isEmpty() && itemstack.getItem().canBeDepleted()) {
+ + net.minecraft.world.entity.ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level);
+ ExperienceOrb orb = net.minecraft.world.entity.EntityType.EXPERIENCE_ORB.create(handle.level);
+ orb.value = amount; + orb.value = amount;
+ orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM;
+ orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ()); + orb.setPosRaw(handle.getX(), handle.getY(), handle.getZ());

Datei anzeigen

@ -9,40 +9,44 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world 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 diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 4a2739edb01c97c99524dc96decbdcb12e0b7d4f..5e53ef4b71969737f900063ab631f4a1ce74cb90 100644 index 9dd0279f9d33fabd1dc4ff029f0ad76a9cc8cb21..1a62a21d40c583f9cbf2b8fbb63b691fffb71ae0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1024,11 +1024,21 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1077,7 +1077,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange;
- double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D; - double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D;
+ final int finalChunkRange = chunkRange; // Paper for lambda below + final int finalChunkRange = chunkRange; // Paper for lambda below
+ //double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D; // Paper - use from event + //double blockRange = (reducedRange) ? Math.pow(chunkRange << 4, 2) : 16384.0D; // Paper - use from event
+ double blockRange = 16384.0D; // Paper
// Spigot end // Spigot end
long i = chunkcoordintpair.toLong(); long i = chunkcoordintpair.toLong();
return !this.distanceManager.hasPlayersNearby(i) ? true : this.playerMap.getPlayers(i).noneMatch((entityplayer) -> { @@ -1094,6 +1096,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
+ // Paper start - add PlayerNaturallySpawnCreaturesEvent + // Paper start - add PlayerNaturallySpawnCreaturesEvent
+ com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event; + com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event;
+ double blockRange = 16384.0D; + blockRange = 16384.0D;
+ if (reducedRange) { + if (reducedRange) {
+ event = entityplayer.playerNaturallySpawnedEvent; + event = entityplayer.playerNaturallySpawnedEvent;
+ if (event == null || event.isCancelled()) return false; + if (event == null || event.isCancelled()) return false;
+ blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4)); + blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4));
+ } + }
+ // Paper end + // Paper end
return !entityplayer.isSpectator() && ChunkMap.euclideanDistanceSquared(chunkcoordintpair, (Entity) entityplayer) < blockRange; // Spigot } while (!this.playerIsCloseEnoughForSpawning(entityplayer, chunkcoordintpair, blockRange)); // Spigot
});
} return true;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 3e2a5f83afcc3b9c9fe62748895d489135af03bf..1f3fe980e71c13b5e7852349cba1cb0e4aa42dcd 100644 index c79521ab00a1c258bbeae56a687636e34932ac6f..212261651fd650cc895f817ccca37699d1cade8f 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -791,6 +791,15 @@ public class ServerChunkCache extends ChunkSource { @@ -825,6 +825,15 @@ public class ServerChunkCache extends ChunkSource {
List<ChunkHolder> list = Lists.newArrayList(this.chunkMap.getChunks()); boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
Collections.shuffle(list); //Collections.shuffle(list); // Paper - no... just no...
+ // Paper start - call player naturally spawn event + // Paper start - call player naturally spawn event
+ int chunkRange = level.spigotConfig.mobSpawnRange; + int chunkRange = level.spigotConfig.mobSpawnRange;
+ chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange; + chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
@ -52,11 +56,11 @@ index 3e2a5f83afcc3b9c9fe62748895d489135af03bf..1f3fe980e71c13b5e7852349cba1cb0e
+ entityPlayer.playerNaturallySpawnedEvent.callEvent(); + entityPlayer.playerNaturallySpawnedEvent.callEvent();
+ }; + };
+ // Paper end + // Paper end
this.level.timings.chunkTicks.startTiming(); // Paper Iterator iterator1 = list.iterator();
list.forEach((playerchunk) -> {
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left(); 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 diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index d4614faa22485dce226f3dc17ef984212ac8fcb9..66434418fae67ff63450bc246796c7f3d4d09ae6 100644 index ab73818893b00551f8137704a727e33046d43a6a..90bff0dd400a67bcb84f8576bd8326793420919a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -66,7 +70,7 @@ index d4614faa22485dce226f3dc17ef984212ac8fcb9..66434418fae67ff63450bc246796c7f3
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.datafixers.util.Either; import com.mojang.datafixers.util.Either;
@@ -233,6 +234,7 @@ public class ServerPlayer extends Player { @@ -236,6 +237,7 @@ public class ServerPlayer extends Player {
public boolean sentListPacket = false; public boolean sentListPacket = false;
public Integer clientViewDistance; public Integer clientViewDistance;
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -15,13 +15,13 @@ instead and save a lot of server resources.
See: https://github.com/PaperMC/Paper/issues/917 See: https://github.com/PaperMC/Paper/issues/917
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 28f1a53a2b9ebe9948509dabbf1a4ae84d8e147c..345ecbc7fc080e8581d285b638db1ee6e684010a 100644 index 20cfdba68c200e87d00995a6a4e25a5fa8171f6c..05ca012854100013714e3d6e8803a2959938cba4 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java --- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -335,6 +335,20 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> { @@ -334,6 +334,20 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
@Nullable @Nullable
public T spawnCreature(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Component ichatbasecomponent, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) { public T spawn(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Component ichatbasecomponent, @Nullable Player entityhuman, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
+ // Paper start - Call PreCreatureSpawnEvent + // Paper start - Call PreCreatureSpawnEvent
+ org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityType.getKey(this).getPath()); + org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityType.getKey(this).getPath());
+ if (type != null) { + if (type != null) {
@ -40,10 +40,10 @@ index 28f1a53a2b9ebe9948509dabbf1a4ae84d8e147c..345ecbc7fc080e8581d285b638db1ee6
if (t0 != null) { 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 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 3839bacbd5f4d06eb13d0e604651232d9fbd7b6a..206aee8bf14ffc4ddbb8a7001bc3baae6a2ea849 100644 index 8d76fe0154f31445a889dfe4cca716cb658053f6..55e4e7fcefc60e66239035e72ad44e0c796bf300 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -987,6 +987,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -990,6 +990,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
BlockPos blockposition1 = this.findSpawnPositionForGolemInColumn(blockposition, d0, d1); BlockPos blockposition1 = this.findSpawnPositionForGolemInColumn(blockposition, d0, d1);
if (blockposition1 != null) { if (blockposition1 != null) {
@ -66,13 +66,13 @@ index 3839bacbd5f4d06eb13d0e604651232d9fbd7b6a..206aee8bf14ffc4ddbb8a7001bc3baae
if (entityirongolem != null) { if (entityirongolem != null) {
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 14188ac6f158b36755abe23c0a967763cf7367d8..572328fafb2347886900352983fd5b6490b0dd68 100644 index 802ff419ae74a16bcd570b996be2dd85e21ea3e8..ef0b18dba50916c4c717c2e6bd55a5e4d60f225f 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -133,6 +133,27 @@ public abstract class BaseSpawner { @@ -122,6 +122,27 @@ public abstract class BaseSpawner {
double d2 = j >= 3 ? nbttaglist.getDouble(2) : (double) pos.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; } else if (!SpawnPlacements.checkSpawnRules((EntityType) optional.get(), world, MobSpawnType.SPAWNER, blockposition1, world.getRandom())) {
continue;
if (world.noCollision(((EntityType) optional.get()).getAABB(d0, d1, d2)) && SpawnPlacements.checkSpawnRules((EntityType) optional.get(), world, MobSpawnType.SPAWNER, new BlockPos(d0, d1, d2), world.getRandom())) { }
+ // Paper start + // Paper start
+ EntityType<?> entityType = optional.get(); + EntityType<?> entityType = optional.get();
+ String key = EntityType.getKey(entityType).getPath(); + String key = EntityType.getKey(entityType).getPath();
@ -94,14 +94,14 @@ index 14188ac6f158b36755abe23c0a967763cf7367d8..572328fafb2347886900352983fd5b64
+ } + }
+ } + }
+ // Paper end + // Paper end
Entity entity = EntityType.loadEntityRecursive(nbttagcompound, world, (entity1) -> { Entity entity = EntityType.loadEntityRecursive(nbttagcompound, world, (entity1) -> {
entity1.moveTo(d0, d1, d2, entity1.getYRot(), entity1.getXRot()); entity1.moveTo(d0, d1, d2, entity1.getYRot(), entity1.getXRot());
return entity1;
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 0432ad7ab00c336e7c566f24c3ec92b399cb6e9d..ca0fcf46e67deb07a3fdb071b771a7603e0fc3d0 100644 index 28a7c53d98450cc79bee953411a18f50cfed26c2..831799937d4e1f31dbf7caaf0c6b38762ccec127 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -236,7 +236,13 @@ public final class NaturalSpawner { @@ -239,7 +239,13 @@ public final class NaturalSpawner {
j1 = biomesettingsmobs_c.minCount + world.random.nextInt(1 + biomesettingsmobs_c.maxCount - biomesettingsmobs_c.minCount); j1 = biomesettingsmobs_c.minCount + world.random.nextInt(1 + biomesettingsmobs_c.maxCount - biomesettingsmobs_c.minCount);
} }
@ -116,7 +116,7 @@ index 0432ad7ab00c336e7c566f24c3ec92b399cb6e9d..ca0fcf46e67deb07a3fdb071b771a760
Mob entityinsentient = NaturalSpawner.getMobForSpawn(world, biomesettingsmobs_c.type); Mob entityinsentient = NaturalSpawner.getMobForSpawn(world, biomesettingsmobs_c.type);
if (entityinsentient == null) { if (entityinsentient == null) {
@@ -283,9 +289,25 @@ public final class NaturalSpawner { @@ -286,9 +292,25 @@ public final class NaturalSpawner {
return squaredDistance <= 576.0D ? false : (world.getSharedSpawnPos().closerThan((Position) (new Vec3((double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D)), 24.0D) ? false : Objects.equals(new ChunkPos(pos), chunk.getPos()) || world.isPositionEntityTicking((BlockPos) pos)); return squaredDistance <= 576.0D ? false : (world.getSharedSpawnPos().closerThan((Position) (new Vec3((double) pos.getX() + 0.5D, (double) pos.getY(), (double) pos.getZ() + 0.5D)), 24.0D) ? false : Objects.equals(new ChunkPos(pos), chunk.getPos()) || world.isPositionEntityTicking((BlockPos) pos));
} }

Datei anzeigen

@ -256,7 +256,7 @@ index aee796567f11c8b93ac9ec0b8cb8f3a8412b23ce..39b98305632271e7375afe6c7001f241
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 05d54f0eff89b721f01e90e79d2571baab297799..71320d9484842be3a694117de25159f3581bd2a3 100644 index 0baca5f3c3f73323b6f5b283fc00be39477ccf59..ec26116dcaa2b1ba71498323d3b7624aad49dbbf 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1444,6 +1444,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1444,6 +1444,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {

Datei anzeigen

@ -13,10 +13,10 @@ Update adjacent blocks of doors, double plants, pistons and beds
when cancelling interaction. 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 diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index ecfb88b4d9727ad20a2c33475cc6b1ec88821a19..315dad4789f5f2582ee9b4fc176affd1f57537ef 100644 index 2869d9bb0d374c26f9569eef3ecf0480cbaa85a6..1d1f355a49e2324902feee10c1717fd772e359c6 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -187,6 +187,11 @@ public class ServerPlayerGameMode { @@ -186,6 +186,11 @@ public class ServerPlayerGameMode {
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, pos, direction, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND); PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, pos, direction, this.player.getInventory().getSelected(), InteractionHand.MAIN_HAND);
if (event.isCancelled()) { if (event.isCancelled()) {
// Let the client know the block still exists // Let the client know the block still exists
@ -28,7 +28,7 @@ index ecfb88b4d9727ad20a2c33475cc6b1ec88821a19..315dad4789f5f2582ee9b4fc176affd1
this.player.connection.send(new ClientboundBlockUpdatePacket(this.level, pos)); this.player.connection.send(new ClientboundBlockUpdatePacket(this.level, pos));
// Update any tile entity data for this block // Update any tile entity data for this block
BlockEntity tileentity = this.level.getBlockEntity(pos); BlockEntity tileentity = this.level.getBlockEntity(pos);
@@ -502,7 +507,13 @@ public class ServerPlayerGameMode { @@ -501,7 +506,13 @@ public class ServerPlayerGameMode {
// send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc) // send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc)
player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above())); player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above()));

Datei anzeigen

@ -7,7 +7,7 @@ This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk. an OfflinePlayer to be loaded from disk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
index 27a1ca43792644fc239af81dea5510f25d3328e9..69c95644b2531c1fe1c4a6cf7fee12e997dd67f4 100644 index 6151df2086d92fd5f428e2efe0df8d1c154ff891..32c7dc33ac0a41902bc841692a8b64b18e4355b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
@@ -89,6 +89,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac @@ -89,6 +89,10 @@ public abstract class CraftAbstractHorse extends CraftAnimals implements Abstrac
@ -22,7 +22,7 @@ index 27a1ca43792644fc239af81dea5510f25d3328e9..69c95644b2531c1fe1c4a6cf7fee12e9
return this.getHandle().getOwnerUUID(); return this.getHandle().getOwnerUUID();
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
index cc90c09c26b04689e4fffa890baf0e89c38665a3..0b152d8d20924fc1ce7f5bafb050216d250f6536 100644 index f225da459d0c9b5b5322ba3256e63880a7b4ad5d..428437970cac144be53cd0e30af7af0cd1ce603b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTameableAnimal.java
@@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat @@ -17,6 +17,10 @@ public class CraftTameableAnimal extends CraftAnimals implements Tameable, Creat

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 5892823425055efb92bf635b035d62981942b966..0e08f6e566d1c93cc89a179583d0b0939127de8b 100644 index e2894138d3efb32161087ad2a1093b8c15c56a65..9d7d9c800710fff5cf41c973463b9c2d72a3e32a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -233,6 +233,11 @@ public class PaperWorldConfig { @@ -233,6 +233,11 @@ public class PaperWorldConfig {
@ -21,10 +21,10 @@ index 5892823425055efb92bf635b035d62981942b966..0e08f6e566d1c93cc89a179583d0b093
private void allChunksAreSlimeChunks() { private void allChunksAreSlimeChunks() {
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 8c20af91c9298cb36fdb2700d042b1e2fccf5f54..dbab4d28c49d22807dfc582fb83353232396555b 100644 index f6a55bb449bcb06821f5b83d3d4d493df277721e..a182c78c3718a6b8f56578c5e6b35ce5742046fe 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1189,6 +1189,7 @@ public abstract class Player extends LivingEntity { @@ -1187,6 +1187,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;

Datei anzeigen

@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread.
Renable flushing by passing -Dpaper.explicit-flush=true Renable flushing by passing -Dpaper.explicit-flush=true
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 06e965996a5c50bce617847e594ae0dd83403484..636ac646bec67dbd933f00614693af03481b6173 100644 index 84fe0f6cfc928d95d0967ad368a38afb71543af7..0aacf2e0155a9a7c9dfe9b368a251aee25ed24fc 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -86,6 +86,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -86,6 +86,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {

Datei anzeigen

@ -190,7 +190,7 @@ index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4
public ClientboundStatusResponsePacket(ServerStatus metadata) { public ClientboundStatusResponsePacket(ServerStatus metadata) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 031bd2ed5c6fd2a859e8a69c48db3938cf71d61b..d9fab29a066367a5cf4a3486989fa7f35451801e 100644 index 543acb52698deb890a2624112e63be275a52c008..e9333b85100d7670b2be7df6e847dfca3084ff55 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,6 +2,9 @@ package net.minecraft.server; @@ -2,6 +2,9 @@ package net.minecraft.server;
@ -203,17 +203,17 @@ index 031bd2ed5c6fd2a859e8a69c48db3938cf71d61b..d9fab29a066367a5cf4a3486989fa7f3
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -1331,7 +1334,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1320,7 +1323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (i - this.lastServerStatus >= 5000000000L) {
this.lastServerStatus = i; this.lastServerStatus = i;
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount())); this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));
if (!this.hidesOnlinePlayers()) {
- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)]; - GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)];
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
int j = Mth.nextInt(this.random, 0, this.getPlayerCount() - agameprofile.length); int j = Mth.nextInt(this.random, 0, this.getPlayerCount() - agameprofile.length);
for (int k = 0; k < agameprofile.length; ++k) { for (int k = 0; k < agameprofile.length; ++k) {
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
index 9baa56d6da9c24706f1dbc8851fd68ca752cab26..d65191a50349ec86fe35df4ac1070f94fbb77b4c 100644 index dff7b1005f60c762ed81de5eb77e1575f07f5ce9..4edbdc7379714609053606b492942cfc768245e1 100644
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
@@ -47,6 +47,8 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene @@ -47,6 +47,8 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
@ -225,16 +225,16 @@ index 9baa56d6da9c24706f1dbc8851fd68ca752cab26..d65191a50349ec86fe35df4ac1070f94
// CraftBukkit start // CraftBukkit start
// this.networkManager.sendPacket(new PacketStatusOutServerInfo(this.minecraftServer.getServerPing())); // this.networkManager.sendPacket(new PacketStatusOutServerInfo(this.minecraftServer.getServerPing()));
final Object[] players = this.server.getPlayerList().players.toArray(); final Object[] players = this.server.getPlayerList().players.toArray();
@@ -142,6 +144,9 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene @@ -143,6 +145,9 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
ping.setVersion(new ServerStatus.Version(this.server.getServerModName() + " " + this.server.getServerVersion(), version));
this.connection.send(new ClientboundStatusResponsePacket(ping)); this.connection.send(new ClientboundStatusResponsePacket(ping));
// CraftBukkit end
+ */ + */
+ com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection); + com.destroystokyo.paper.network.StandardPaperServerListPingEventImpl.processRequest(this.server, this.connection);
+ // Paper end + // Paper end
} }
// CraftBukkit end
} }
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index d73dfe72a54b621c0f944c90904df3e3bc709445..8e7630de11637a75a4a54a22283cbb2d0c7e6438 100644 index d73dfe72a54b621c0f944c90904df3e3bc709445..8e7630de11637a75a4a54a22283cbb2d0c7e6438 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login. This will allow you to change the players name or skin on login.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 109d7f1bf37e442ff80f7f63d50e27e6e30e0b5e..261ebb134a5ff40406e74237f730aad1c78a8215 100644 index 40feb2fbbe3c73b73124cae62f4661f000fad6cb..d2cf2db45c6df9bb188c329bc4f6f4e74285cb3e 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
@ -25,7 +25,7 @@ index 109d7f1bf37e442ff80f7f63d50e27e6e30e0b5e..261ebb134a5ff40406e74237f730aad1
import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent; import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.event.player.PlayerPreLoginEvent; import org.bukkit.event.player.PlayerPreLoginEvent;
@@ -336,8 +339,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -337,8 +340,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in. This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 261ebb134a5ff40406e74237f730aad1c78a8215..39bdda56aaa5503efc15207261634127b462c3e7 100644 index d2cf2db45c6df9bb188c329bc4f6f4e74285cb3e..90ce56c5b7937e8fd28da6d68448679094308c6e 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -340,12 +340,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener @@ -341,12 +341,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
// Paper start // Paper start
@ -26,10 +26,10 @@ index 261ebb134a5ff40406e74237f730aad1c78a8215..39bdda56aaa5503efc15207261634127
uniqueId = gameProfile.getId(); uniqueId = gameProfile.getId();
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index dbab4d28c49d22807dfc582fb83353232396555b..0ef9c95d40cd0cdff0d150121511e6f9efd65f4d 100644 index a182c78c3718a6b8f56578c5e6b35ce5742046fe..85b50297d92c45872942effb770d0e85d864681e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -173,7 +173,7 @@ public abstract class Player extends LivingEntity { @@ -171,7 +171,7 @@ public abstract class Player extends LivingEntity {
protected int enchantmentSeed; protected int enchantmentSeed;
protected final float defaultFlySpeed = 0.02F; protected final float defaultFlySpeed = 0.02F;
private int lastLevelUpTime; private int lastLevelUpTime;
@ -39,18 +39,18 @@ index dbab4d28c49d22807dfc582fb83353232396555b..0ef9c95d40cd0cdff0d150121511e6f9
private ItemStack lastItemInMainHand; private ItemStack lastItemInMainHand;
private final ItemCooldowns cooldowns; private final ItemCooldowns cooldowns;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4c8617fbd2cd8e34c87634fe448d204ee7fb8a0f..95a1d83fb7cb9947beb56b951b0081e4db2de6c9 100644 index d6f9fe4ebc034263169f3333922ad90fe4fcee69..a9bd48e4670aa44a964891c25cd147c006081b60 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -71,6 +71,7 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper; @@ -70,6 +70,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.GameType; import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
+import net.minecraft.world.level.biome.BiomeManager; +import net.minecraft.world.level.biome.BiomeManager;
import net.minecraft.world.level.block.entity.SignBlockEntity; import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.saveddata.maps.MapDecoration; import net.minecraft.world.level.saveddata.maps.MapDecoration;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData; import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
@@ -1347,8 +1348,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1351,8 +1352,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.hiddenPlayers.put(player.getUniqueId(), hidingPlugins); this.hiddenPlayers.put(player.getUniqueId(), hidingPlugins);
// Remove this player from the hidden player's EntityTrackerEntry // Remove this player from the hidden player's EntityTrackerEntry
@ -65,7 +65,7 @@ index 4c8617fbd2cd8e34c87634fe448d204ee7fb8a0f..95a1d83fb7cb9947beb56b951b0081e4
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) { if (entry != null) {
entry.removePlayer(this.getHandle()); entry.removePlayer(this.getHandle());
@@ -1389,8 +1395,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1393,8 +1399,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
this.hiddenPlayers.remove(player.getUniqueId()); this.hiddenPlayers.remove(player.getUniqueId());
@ -80,7 +80,7 @@ index 4c8617fbd2cd8e34c87634fe448d204ee7fb8a0f..95a1d83fb7cb9947beb56b951b0081e4
this.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, other)); this.getHandle().connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, other));
@@ -1399,6 +1410,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1403,6 +1414,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entry.updatePlayer(this.getHandle()); entry.updatePlayer(this.getHandle());
} }
} }

Datei anzeigen

@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 435a68e6c99bffdc8d6ded9deda68d4e970a2d49..d10da7acb03a2e4a67cee41a6f6fc6357eb8efd6 100644 index 283038f0e8e78ba869eead3dabc51bff7b0ba77a..464b3b25c1099de85e817f15858d4be9ed7b8dfb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1668,6 +1668,25 @@ public final class CraftServer implements Server { @@ -1679,6 +1679,25 @@ public final class CraftServer implements Server {
return recipients.size(); return recipients.size();
} }

Datei anzeigen

@ -3,6 +3,8 @@ From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 7 Feb 2017 16:55:35 -0600 Date: Tue, 7 Feb 2017 16:55:35 -0600
Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue
#NOTE: Vanilla now does incremental chunk saves
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index fb3b0693abb6f2f044d39508b727fb3a2ad16823..4a2739edb01c97c99524dc96decbdcb12e0b7d4f 100644 index fb3b0693abb6f2f044d39508b727fb3a2ad16823..4a2739edb01c97c99524dc96decbdcb12e0b7d4f 100644

Datei anzeigen

@ -3,6 +3,7 @@ From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 11 Jan 2018 16:47:28 -0600 Date: Thu, 11 Jan 2018 16:47:28 -0600
Subject: [PATCH] Make max squid spawn height configurable Subject: [PATCH] Make max squid spawn height configurable
#NOTE: Spigot removed the min option, Vanilla now has the same spawn rule for all ambient water animals
I don't know why upstream made only the minimum height configurable but I don't know why upstream made only the minimum height configurable but
whatever whatever
@ -21,16 +22,15 @@ index e2894138d3efb32161087ad2a1093b8c15c56a65..5892823425055efb92bf635b035d6298
+ } + }
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java 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 3ffc1ee8a9ae63c8678c12736fab5d6ba0a21a5b..4da560f6e4da0750bda78b900b2d916d58adfccb 100644 index 370513fbc39f178f903ce140ced1a97029dd39db..b195617c39c4b382a196a709c318904cd0598e0e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
@@ -211,7 +211,8 @@ public class Squid extends WaterAnimal { @@ -206,7 +206,7 @@ public class Squid extends WaterAnimal {
public void travel(Vec3 movementInput) {
this.move(MoverType.SELF, this.getDeltaMovement());
} }
-
public static boolean checkSquidSpawnRules(EntityType<Squid> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { +// AAA
- return pos.getY() > world.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && pos.getY() < world.getSeaLevel(); // Spigot
+ final double maxHeight = world.getMinecraftWorld().paperConfig.squidMaxSpawnHeight > 0 ? world.getMinecraftWorld().paperConfig.squidMaxSpawnHeight : world.getSeaLevel(); // Paper
+ return pos.getY() > world.getMinecraftWorld().spigotConfig.squidSpawnRangeMin && pos.getY() < maxHeight; // Spigot // Paper
}
@Override @Override
public void handleEntityEvent(byte status) {
if (status == 19) {

Datei anzeigen

@ -1,2 +1,3 @@
Add Timings to LevelTicks and EntityTickList Add Timings to LevelTicks and EntityTickList
Check IBlockDataList#GLOBAL_PALETTE Check IBlockDataList#GLOBAL_PALETTE
Check if PlayerNaturallySpawnedEvent is called correctly