Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11405)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
1fc1020a PR-1049: Add MenuType API
8ae2e3be PR-1055: Expand riptiding API
cac68bfb SPIGOT-7890: AttributeModifier#getUniqueId() doesn't match the UUID passed to its constructor
7004fcf2 SPIGOT-7886: Fix mistake in AttributeModifier UUID shim
1ac7f950 PR-1054: Add FireworkMeta#hasPower
4cfb565f SPIGOT-7873: Add powered state for skulls

CraftBukkit Changes:
bbb30e7a8 SPIGOT-7894: NPE when sending tile entity update
ba21e9472 SPIGOT-7895: PlayerItemBreakEvent not firing
0fb24bbe0 SPIGOT-7875: Fix PlayerItemConsumeEvent cancellation causing client-side desync
815066449 SPIGOT-7891: Can't remove second ingredient of MerchantRecipe
45c206f2c PR-1458: Add MenuType API
19c8ef9ae SPIGOT-7867: Merchant instanceof AbstractVillager always returns false
4e006d28f PR-1468: Expand riptiding API
bd8aded7d Ignore checks in CraftPlayerProfile for ResolvableProfile used in profile components
8679620b5 SPIGOT-7889: Fix tool component deserialisation without speed and/or correct-for-drops
8d5222691 SPIGOT-7882, PR-1467: Fix conversion of name in Profile Component to empty if it is missing
63f91669a SPIGOT-7887: Remove duplicate ProjectileHitEvent for fireballs
7070de8c8 SPIGOT-7878: Server#getLootTable does not return null on invalid loot table
060ee6cae SPIGOT-7876: Can't kick player or disconnect player in PlayerLoginEvent when checking for cookies
7ccb86cc0 PR-1465: Add FireworkMeta#hasPower
804ad6491 SPIGOT-7873: Add powered state for skulls
f9610cdcb Improve minecart movement

Spigot Changes:
a759b629 Rebuild patches

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
Bjarne Koll 2024-09-15 21:39:53 +02:00 committed by GitHub
parent 4ff58c4c48
commit d1a72eac31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
684 changed files with 864 additions and 837 deletions

View file

@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..2512dba27edfdccbc4430815b6cba048
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..76daccf4ea502e1747a6f9176dc16fd20c561286
index 0000000000000000000000000000000000000000..7763ea28a00c25ffd8ba8941cff29bae5ae117a2
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
@@ -0,0 +1,147 @@
@@ -0,0 +1,149 @@
+package io.papermc.paper.registry;
+
+import net.kyori.adventure.key.Keyed;
@ -114,6 +114,7 @@ index 0000000000000000000000000000000000000000..76daccf4ea502e1747a6f9176dc16fd2
+import org.bukkit.generator.structure.Structure;
+import org.bukkit.generator.structure.StructureType;
+import org.bukkit.inventory.ItemType;
+import org.bukkit.inventory.MenuType;
+import org.bukkit.inventory.meta.trim.TrimMaterial;
+import org.bukkit.inventory.meta.trim.TrimPattern;
+import org.bukkit.map.MapCursor;
@ -235,6 +236,7 @@ index 0000000000000000000000000000000000000000..76daccf4ea502e1747a6f9176dc16fd2
+ RegistryKey<Fluid> FLUID = create("fluid");
+ RegistryKey<Frog.Variant> FROG_VARIANT = create("frog_variant");
+ RegistryKey<MapCursor.Type> MAP_DECORATION_TYPE = create("map_decoration_type");
+ RegistryKey<MenuType> MENU = create("menu");
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java b/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java
new file mode 100644

View file

@ -3343,16 +3343,16 @@ index 133760be6c73436512ba684a3ac77a514b2d8765..9473303bd8ab1f6b63b6999a5f5ff3ec
* Gets how much EXP the Player should have at respawn.
* <p>
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index c5734d66686e68080f55034754d43ae55030c3eb..32cd8ee2e849df602a7e10aa5d0a218007faa0ac 100644
index 094963b16eccc303fb1a10b1e052feebe4a4d68b..3e6ac5beb137efd8ecd80e2e9b17015cb38e8a0a 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -161,6 +161,18 @@ public enum InventoryType {
@@ -163,7 +163,18 @@ public enum InventoryType {
private final String title;
private final MenuType menuType;
private final boolean isCreatable;
+ // Paper start
+ private final net.kyori.adventure.text.Component defaultTitleComponent;
+
+ /**
+ * Gets the inventory's default title.
+ *
@ -3362,18 +3362,18 @@ index c5734d66686e68080f55034754d43ae55030c3eb..32cd8ee2e849df602a7e10aa5d0a2180
+ return defaultTitleComponent;
+ }
+ // Paper end
private InventoryType(int defaultSize, /*@NotNull*/ String defaultTitle) {
this(defaultSize, defaultTitle, true);
private InventoryType(int defaultSize, /*@NotNull*/ String defaultTitle, @Nullable MenuType type) {
this(defaultSize, defaultTitle, type, true);
}
@@ -169,6 +181,7 @@ public enum InventoryType {
size = defaultSize;
@@ -173,6 +184,7 @@ public enum InventoryType {
title = defaultTitle;
this.menuType = type;
this.isCreatable = isCreatable;
+ this.defaultTitleComponent = net.kyori.adventure.text.Component.text(defaultTitle); // Paper - Adventure
}
public int getDefaultSize() {
@@ -176,6 +189,7 @@ public enum InventoryType {
@@ -180,6 +192,7 @@ public enum InventoryType {
}
@NotNull
@ -4421,6 +4421,56 @@ index eade62328895133c026e7e678e648e1fc846f5ee..730c42eddd38acec1cdbb19dfc8c6757
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/MenuType.java b/src/main/java/org/bukkit/inventory/MenuType.java
index ee39bf9019fa0377beb895a22db0b2a0934a4d84..29dfad691cbdd09d043f6171defc8a7fabbc2b75 100644
--- a/src/main/java/org/bukkit/inventory/MenuType.java
+++ b/src/main/java/org/bukkit/inventory/MenuType.java
@@ -146,11 +146,45 @@ public interface MenuType extends Keyed {
* @param player the player the view belongs to
* @param title the title of the view
* @return the created {@link InventoryView}
+ * @deprecated Use {@link #create(HumanEntity, net.kyori.adventure.text.Component)} instead.
*/
@NotNull
+ @Deprecated(since = "1.21") // Paper - adventure
V create(@NotNull HumanEntity player, @NotNull String title);
+
+ // Paper start - adventure
+ /**
+ * Creates a view of the specified menu type.
+ * <p>
+ * The player provided to create this view must be the player the view
+ * is opened for. See {@link HumanEntity#openInventory(InventoryView)}
+ * for more information.
+ *
+ * @param player the player the view belongs to
+ * @param title the title of the view
+ * @return the created {@link InventoryView}
+ */
+ @NotNull
+ V create(@NotNull HumanEntity player, @NotNull net.kyori.adventure.text.Component title);
+ // Paper end - adventure
}
+ // Paper start - adventure
+ /**
+ * Creates a view of the specified menu type.
+ * <p>
+ * The player provided to create this view must be the player the view
+ * is opened for. See {@link HumanEntity#openInventory(InventoryView)}
+ * for more information.
+ *
+ * @param player the player the view belongs to
+ * @param title the title of the view
+ * @return the created {@link InventoryView}
+ */
+ @NotNull
+ InventoryView create(@NotNull HumanEntity player, @NotNull net.kyori.adventure.text.Component title);
+ // Paper end - adventure
+
/**
* Yields this MenuType as a typed version of itself with a plain
* {@link InventoryView} representing it.
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 9bab73c3c2ca759b8e1c7d07d98cc593c961666a..f0c6943da3f783101ca647b75b3230fae3a310da 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java

View file

@ -7,7 +7,7 @@ Upstream added methods for this so the original methods
are now deprecated
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 67115810d5e837f154c3accd92dbb5e4192d264f..32e89741ffd895e31af0104a0126c2f72742a1bb 100644
index b5a302ba913d2de97f1bcd7c60fd5cd4f245d275..cafa79f80eec5ec6d8d31d40cc2b46acc06831f9 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -243,12 +243,44 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@ -56,7 +56,7 @@ index 67115810d5e837f154c3accd92dbb5e4192d264f..32e89741ffd895e31af0104a0126c2f7
/**
* Returns the living entity's current maximum no damage ticks.
@@ -777,4 +809,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -787,4 +819,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return Whether the entity is invisible
*/
public boolean isInvisible();

View file

@ -200,10 +200,10 @@ index 9885fd1adc1f93a80d650e6d42dfa3a0b084db9f..c4f2f03ec31998d486dad1d45ef83df3
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
index d66502c9df2592cd18694481e7e90a71a5c3a359..ee39c0b83e558681e8b006172d34c98e2c83cda2 100644
index 6ffc895138088162cab827b3ca6c68961b7bcc64..8c53ac6b4381f3cf8b5e989c8b2a3ba77bd4e475 100644
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
@@ -117,8 +117,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
@@ -129,8 +129,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
}
/**
@ -430,7 +430,7 @@ index 4e1fb0974d061d5bb64899cac576318d2e6f8bf6..539b3527d0c66611e21712f29b90fba9
public int getEntityId();
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 8fdfa1d79daf464f8e364fd9e19d1de3a2a6848c..195a7fa0ea8e056cbde7b9152cc014d2c94353ff 100644
index 40214a136894270695746ac83fb5f7bcc406f34a..2bb4d2da99d3f0f70e19381c13b43c147c34f944 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -22,6 +22,11 @@ import org.jetbrains.annotations.Nullable;
@ -459,7 +459,7 @@ index b688b3856cb3068a539fcecfbfa113f8ab4160a9..c275b881cbd11307a6dcc7190d7a7d40
* @return whether the item frame is visible or not
*/
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 32e89741ffd895e31af0104a0126c2f72742a1bb..bc17c86da49faf4b6e07d4fb4c53649da0384d69 100644
index cafa79f80eec5ec6d8d31d40cc2b46acc06831f9..b0fbad5de65c33710ec46734ad6c69ec9b2769d5 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -502,7 +502,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 195a7fa0ea8e056cbde7b9152cc014d2c94353ff..85eec2e57b03c11f4737addb0fa88b7bf29dc9e5 100644
index 2bb4d2da99d3f0f70e19381c13b43c147c34f944..b8431d9722ef9fce0ac9e18367abef22717997ca 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -337,6 +337,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -346,6 +346,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
public int getExpToLevel();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 85eec2e57b03c11f4737addb0fa88b7bf29dc9e5..58dbe34ab1b603c2cd53af1625c1f82f8890da01 100644
index b8431d9722ef9fce0ac9e18367abef22717997ca..0d01fe9c96a1b9076dbd6d031fa8cd41954ea8db 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -498,6 +498,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -507,6 +507,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Deprecated
public void setShoulderEntityRight(@Nullable Entity entity);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index f154c5607b1dc3585052d9f02cf8b28cf8a3c886..7b53064364e206bc1a0f4b7af4931f6c658b7c55 100644
index e6bdfd14bffa394cd717de7118de951a997f50b3..2d4d93a4fc3f712a21bd61e203407f3a84e16310 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -837,5 +837,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -847,5 +847,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@Deprecated
void setArrowsStuck(int arrows);

View file

@ -9,10 +9,10 @@ such as a bow or eating food.
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 58dbe34ab1b603c2cd53af1625c1f82f8890da01..9cbb9093e7d8cd21eef6a23c265d68d7d0ee97b8 100644
index 0d01fe9c96a1b9076dbd6d031fa8cd41954ea8db..b0cb4377e14da5ef1e155513046c2340ab6e525e 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -327,7 +327,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -336,7 +336,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
* blocking).
*
* @return Whether their hand is raised
@ -23,7 +23,7 @@ index 58dbe34ab1b603c2cd53af1625c1f82f8890da01..9cbb9093e7d8cd21eef6a23c265d68d7
/**
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 7b53064364e206bc1a0f4b7af4931f6c658b7c55..0ed64618b3f62ee984fe4f99dc6a52d5fad7b3cc 100644
index 2d4d93a4fc3f712a21bd61e203407f3a84e16310..434ad8b07b6ee0b0919de8044d14fe3c789e203f 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -202,15 +202,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@ -56,7 +56,7 @@ index 7b53064364e206bc1a0f4b7af4931f6c658b7c55..0ed64618b3f62ee984fe4f99dc6a52d5
public void setItemInUseTicks(int ticks);
/**
@@ -852,4 +858,130 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -862,4 +868,130 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setShieldBlockingDelay(int delay);
// Paper end

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Material API additions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 019cc6baf8c767d973feba55ddc99a8d222e00d8..6ffed5ef4331498ff318ffc5850f8b9a0b85eba7 100644
index 111c9a6be1f3d095cf8e82b118371986b6cc0fc7..c407bc264ab6c2e5aa7122d4caec63f9b482d76d 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -127,6 +127,7 @@ import org.jetbrains.annotations.Nullable;
@@ -129,6 +129,7 @@ import org.jetbrains.annotations.Nullable;
/**
* An enum of all material IDs accepted by the official server and client
*/
@ -16,7 +16,7 @@ index 019cc6baf8c767d973feba55ddc99a8d222e00d8..6ffed5ef4331498ff318ffc5850f8b9a
public enum Material implements Keyed, Translatable {
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
@@ -4660,6 +4661,22 @@ public enum Material implements Keyed, Translatable {
@@ -4662,6 +4663,22 @@ public enum Material implements Keyed, Translatable {
}
}

View file

@ -300,10 +300,10 @@ index c30600666e7b32b8b4ba1e20ede04fd5ebd5a692..eec6c9cd7da6938351905129bb5a66f4
if (this.world == null) {
return null;
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 6ffed5ef4331498ff318ffc5850f8b9a0b85eba7..444406eb7f0c3cd13039bf809254e480ee6fa24f 100644
index c407bc264ab6c2e5aa7122d4caec63f9b482d76d..a432e1c776cd5bda7ba9da8a1b608cb30495e647 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4681,20 +4681,20 @@ public enum Material implements Keyed, Translatable {
@@ -4683,20 +4683,20 @@ public enum Material implements Keyed, Translatable {
* Do not use for any reason.
*
* @return ID of this material
@ -328,7 +328,7 @@ index 6ffed5ef4331498ff318ffc5850f8b9a0b85eba7..444406eb7f0c3cd13039bf809254e480
public boolean isLegacy() {
return legacy;
}
@@ -4770,8 +4770,10 @@ public enum Material implements Keyed, Translatable {
@@ -4772,8 +4772,10 @@ public enum Material implements Keyed, Translatable {
* Gets the MaterialData class associated with this Material
*
* @return MaterialData associated with this Material
@ -339,7 +339,7 @@ index 6ffed5ef4331498ff318ffc5850f8b9a0b85eba7..444406eb7f0c3cd13039bf809254e480
public Class<? extends MaterialData> getData() {
Preconditions.checkArgument(legacy, "Cannot get data class of Modern Material");
return ctor.getDeclaringClass();
@@ -5227,7 +5229,11 @@ public enum Material implements Keyed, Translatable {
@@ -5229,7 +5231,11 @@ public enum Material implements Keyed, Translatable {
* material.
*
* @return true if this material can be interacted with.
@ -453,10 +453,10 @@ index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f
return note;
}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index d1906d150a7d4c4852e085d6fd480aec317c22e4..e9edc8c17cbd29cfdad31df13acb15bab2304735 100644
index 883338632b81f6eebc03c95d5883536a5d87fc59..fbede496b05c4b9b1ecd12e711a100586776d469 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -220,14 +220,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -228,14 +228,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see TrimMaterial
*/
@ -471,7 +471,7 @@ index d1906d150a7d4c4852e085d6fd480aec317c22e4..e9edc8c17cbd29cfdad31df13acb15ba
Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
/**
* Damage types.
@@ -335,8 +333,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -343,8 +341,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @param input non-null input
* @return registered object or null if does not exist
@ -890,7 +890,7 @@ index bafef53c1d449135f1300c8c8fbb06f482ba67e1..f50aaddf8582be55fd4860ad374d8f22
+@Deprecated(forRemoval = true) // Paper
public interface LingeringPotion extends ThrownPotion { }
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 3f1b74af137868e502792c65ccd7ca74f3c3cb8c..c89ffb0f98dccd015e80e299142252fed3ece4a8 100644
index 9e0137ea412ec8c65b2903a76499ba8222446ea3..db7dafba43b50146a32d749ec043c5d548b0d6e3 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -716,7 +716,9 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@ -903,7 +903,7 @@ index 3f1b74af137868e502792c65ccd7ca74f3c3cb8c..c89ffb0f98dccd015e80e299142252fe
public void setSwimming(boolean swimming);
/**
@@ -971,7 +973,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -981,7 +983,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @deprecated entity groupings are now managed by tags, not categories
*/
@NotNull
@ -1267,16 +1267,16 @@ index f2a2a2ad9930499c5bf624e73571a3294a90db14..c8540a42ab44647fdd112ce4f731f3dc
return getView().getCursor();
}
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index 32cd8ee2e849df602a7e10aa5d0a218007faa0ac..fbdbd2f4da5e09d4b111ddcf72e2d7dd59046bd7 100644
index 3e6ac5beb137efd8ecd80e2e9b17015cb38e8a0a..ae4ae1fa6d407665ef03edcdef683d741668acf1 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -153,7 +153,7 @@ public enum InventoryType {
@@ -155,7 +155,7 @@ public enum InventoryType {
*
* @deprecated use {@link #SMITHING}
*/
- @Deprecated
+ @Deprecated(forRemoval = true) // Paper
SMITHING_NEW(4, "Upgrade Gear"),
SMITHING_NEW(4, "Upgrade Gear", MenuType.SMITHING),
;
diff --git a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java

View file

@ -61,10 +61,10 @@ index 0000000000000000000000000000000000000000..a6306c957fcacdcbcc8037b4ee33a167
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index ec35111df4b38fd55cc34f4baedebcf39c7fc92b..fdb985763d0a7b0a31ad938616e11ef244f63062 100644
index db7dafba43b50146a32d749ec043c5d548b0d6e3..c2352d75e02f7be27fcf9ea69df1bd104a2449bd 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1149,4 +1149,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1159,4 +1159,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
return this.getActiveItemHand();
}
// Paper end - active item API

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index fdb985763d0a7b0a31ad938616e11ef244f63062..d87c49550e697ad545742baed40068623e83bf0b 100644
index c2352d75e02f7be27fcf9ea69df1bd104a2449bd..88d6a5aaf2a686186fab4916480a04f6503d887c 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1171,4 +1171,29 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1181,4 +1181,29 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setJumping(boolean jumping);
// Paper end - entity jump API

View file

@ -144,10 +144,10 @@ index dc66bd69646ac949d1386ce8f6ff913e9475439d..4482e8f2c617c2f51b2b53762e775d11
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 444406eb7f0c3cd13039bf809254e480ee6fa24f..c12bb07fcf29be1a284f5f272b35edf206633d4a 100644
index a432e1c776cd5bda7ba9da8a1b608cb30495e647..c2552d37295443f79abfe58f91c8261ce06661e8 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -128,7 +128,7 @@ import org.jetbrains.annotations.Nullable;
@@ -130,7 +130,7 @@ import org.jetbrains.annotations.Nullable;
* An enum of all material IDs accepted by the official server and client
*/
@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper
@ -156,7 +156,7 @@ index 444406eb7f0c3cd13039bf809254e480ee6fa24f..c12bb07fcf29be1a284f5f272b35edf2
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
STONE(22948),
@@ -4677,6 +4677,17 @@ public enum Material implements Keyed, Translatable {
@@ -4679,6 +4679,17 @@ public enum Material implements Keyed, Translatable {
}
// Paper end
@ -174,7 +174,7 @@ index 444406eb7f0c3cd13039bf809254e480ee6fa24f..c12bb07fcf29be1a284f5f272b35edf2
/**
* Do not use for any reason.
*
@@ -5426,9 +5437,11 @@ public enum Material implements Keyed, Translatable {
@@ -5428,9 +5439,11 @@ public enum Material implements Keyed, Translatable {
* material
* @see #getBlockTranslationKey()
* @see #getItemTranslationKey()
@ -312,10 +312,10 @@ index 745413357506fa7399f8ba44dfe222d1f0c919f1..25db31b2e9a6d75f0c59f75237842f9a
// Paper end
}
diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java
index 4288bebf690a9cee6ff9a712352d1dcbb035eb77..a08c52949af1d2416ecb089fc559db2e3b29105c 100644
index dfd8187ef941e8afe9cb28a26bf0d2cf2e4c4bc5..8d85d74605457724cc206a55dbb16679c3791ea1 100644
--- a/src/main/java/org/bukkit/block/BlockType.java
+++ b/src/main/java/org/bukkit/block/BlockType.java
@@ -123,7 +123,7 @@ import org.jetbrains.annotations.Nullable;
@@ -125,7 +125,7 @@ import org.jetbrains.annotations.Nullable;
* changes may occur. Do not use this API in plugins.
*/
@ApiStatus.Internal
@ -324,7 +324,7 @@ index 4288bebf690a9cee6ff9a712352d1dcbb035eb77..a08c52949af1d2416ecb089fc559db2e
/**
* Typed represents a subtype of {@link BlockType}s that have a known block
@@ -3491,4 +3491,13 @@ public interface BlockType extends Keyed, Translatable {
@@ -3493,4 +3493,13 @@ public interface BlockType extends Keyed, Translatable {
@Nullable
@Deprecated
Material asMaterial();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index d87c49550e697ad545742baed40068623e83bf0b..a2489932c07b1b56d3e340ecfeddd3df95cf4eb6 100644
index 88d6a5aaf2a686186fab4916480a04f6503d887c..784da48ffc63bc932caafe58cf56ad30e7a86be6 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1061,6 +1061,11 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1071,6 +1071,11 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
org.bukkit.inventory.@NotNull ItemStack getActiveItem();

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Expose LivingEntity hurt direction
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index f20b0a439c4d5cd2c6caa70a46b1b49f8ab23425..937c136f2499bd1660989d14c0f50a7ef9a1a2b6 100644
index d06539841d973030c0cd5bb06a085ed2f0f73af6..7759062ca34506c56d2d1340cf1d9c2d36151d48 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -356,6 +356,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@ -26,10 +26,10 @@ index f20b0a439c4d5cd2c6caa70a46b1b49f8ab23425..937c136f2499bd1660989d14c0f50a7e
* Get the sleep ticks of the player. This value may be capped.
*
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index a2489932c07b1b56d3e340ecfeddd3df95cf4eb6..4327045ec437c9c81bcd4c34c4959de6d5798132 100644
index 784da48ffc63bc932caafe58cf56ad30e7a86be6..49352ed3928163c6322634b8e6f1d3dd8caa5e74 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1201,4 +1201,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1211,4 +1211,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void playPickupItemAnimation(@NotNull Item item, int quantity);
// Paper end - pickup animation API

View file

@ -206,10 +206,10 @@ index e0f652117e585882693736de8165ae9c689e1d68..fbe14c327ee9c1ac07893853ca7c699e
return server.getRegistry(tClass);
}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a9434e718b2f 100644
index fbede496b05c4b9b1ecd12e711a100586776d469..3777f9c92d0c183d0ab5e28bbe73f2125babf61c 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -87,8 +87,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -88,8 +88,10 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Server banner patterns.
*
* @see PatternType
@ -221,7 +221,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Server biomes.
*
@@ -102,7 +104,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -103,7 +105,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @apiNote BlockType is not ready for public usage yet
*/
@ApiStatus.Internal
@ -230,7 +230,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Custom boss bars.
*
@@ -134,13 +136,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -135,13 +137,15 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see Cat.Type
*/
@ -248,7 +248,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Server entity types.
*
@@ -152,7 +156,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -153,7 +157,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see MusicInstrument
*/
@ -257,7 +257,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Server item types.
*
@@ -160,7 +164,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -161,7 +165,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @apiNote ItemType is not ready for public usage yet
*/
@ApiStatus.Internal
@ -266,7 +266,14 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Default server loot tables.
*
@@ -178,7 +182,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -180,13 +184,13 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see MenuType
*/
@ApiStatus.Experimental
- Registry<MenuType> MENU = Objects.requireNonNull(Bukkit.getRegistry(MenuType.class), "No registry present for MenuType. This is a bug.");
+ Registry<MenuType> MENU = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.MENU); // Paper
/**
* Server mob effects.
*
* @see PotionEffectType
*/
@ -275,7 +282,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Server particles.
*
@@ -201,14 +205,16 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -209,14 +213,16 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Server structures.
*
* @see Structure
@ -294,7 +301,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Sound keys.
*
@@ -219,40 +225,47 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -227,40 +233,47 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* Trim materials.
*
* @see TrimMaterial
@ -349,7 +356,7 @@ index e9edc8c17cbd29cfdad31df13acb15bab2304735..d855e703339e6f6e50fcb19e8954a943
/**
* Memory Keys.
*
@@ -289,25 +302,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -297,25 +310,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see Frog.Variant
*/

View file

@ -43,10 +43,10 @@ index 0000000000000000000000000000000000000000..f1cd5a4f37eee8975ac3d0421b524afc
+ }
+}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index c12bb07fcf29be1a284f5f272b35edf206633d4a..cc25734f3dcf6075eb44e39da01ed2f1b59b618e 100644
index c2552d37295443f79abfe58f91c8261ce06661e8..7f6cb6471c5f324e2bcdf47d6c7628c2231d7727 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4688,6 +4688,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -4690,6 +4690,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
// Paper end - add Translatable

View file

@ -101,10 +101,10 @@ index b558fa73dbcf3747690933e6aadf7061a0de2630..be68351555bde59a4e55bf1bad261e9f
@NotNull
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index cc25734f3dcf6075eb44e39da01ed2f1b59b618e..2721ad40d6ba025caad16455f74f2350dcb7a4ff 100644
index 7f6cb6471c5f324e2bcdf47d6c7628c2231d7727..d0aaf145cf34e0c02d5c7b842c203d0630b04b53 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -5497,6 +5497,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -5499,6 +5499,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
* @param world the world to check
* @return true if this material can be used in this World.
*/

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Improve item default attribute API
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index cc25734f3dcf6075eb44e39da01ed2f1b59b618e..8b04e0d81c56712057f1fee288b3609ef5718c60 100644
index d0aaf145cf34e0c02d5c7b842c203d0630b04b53..5c869feaecd95dbdd658e16f5739bb41540f18bd 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4703,6 +4703,23 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -4705,6 +4705,23 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
// Paper end - item rarity API
@ -32,7 +32,7 @@ index cc25734f3dcf6075eb44e39da01ed2f1b59b618e..8b04e0d81c56712057f1fee288b3609e
/**
* Do not use for any reason.
*
@@ -5410,13 +5427,34 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -5412,13 +5429,34 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
}
@ -72,7 +72,7 @@ index cc25734f3dcf6075eb44e39da01ed2f1b59b618e..8b04e0d81c56712057f1fee288b3609e
*
* @param slot the {@link EquipmentSlot} to check
diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java
index 5dd1c084e42ee93f3a358f58ed76b0a7d36f0713..94587a97fcea81a43b160b01d2c81cef2b7f4413 100644
index 2b5a18fe7e885fa9b581c0afb299e31f3db2690c..a6d1dde422de98f178c0c9add99e01203a35e5cb 100644
--- a/src/main/java/org/bukkit/inventory/ItemType.java
+++ b/src/main/java/org/bukkit/inventory/ItemType.java
@@ -2261,6 +2261,21 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans

View file

@ -609,10 +609,10 @@ index 6b3c9bef9a8a34ddc6ff42cf358541a2665bf5e3..9c618a27d590f186f29c5d9094fc565e
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 4ba92fe8979ed127c18cb78c2b8204daa2425ed7..73247ab2cd2cf0035cf88c98250736f9bc9ee517 100644
index 2eb6f650610ca1a9b9fca49e453f79e08944be75..c0772f72768846cffd065c53de7326f9fe6386a2 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -994,6 +994,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1004,6 +1004,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*
* @param invisible If the entity is invisible
*/
@ -620,7 +620,7 @@ index 4ba92fe8979ed127c18cb78c2b8204daa2425ed7..73247ab2cd2cf0035cf88c98250736f9
public void setInvisible(boolean invisible);
/**
@@ -1001,6 +1002,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1011,6 +1012,7 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*
* @return Whether the entity is invisible
*/
@ -628,7 +628,7 @@ index 4ba92fe8979ed127c18cb78c2b8204daa2425ed7..73247ab2cd2cf0035cf88c98250736f9
public boolean isInvisible();
// Paper start
@@ -1037,6 +1039,57 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1047,6 +1049,57 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
void setShieldBlockingDelay(int delay);
// Paper end

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add hasCollision methods to various places
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 8b04e0d81c56712057f1fee288b3609ef5718c60..c4f067598a40b0381bc9e601a3809e2683c10407 100644
index 5c869feaecd95dbdd658e16f5739bb41540f18bd..6959f36023b12ec2dece9b91a3b8a5d07b635430 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4720,6 +4720,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -4722,6 +4722,21 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
}
// Paper end - item default attributes API
@ -67,10 +67,10 @@ index f4a739d8022d19a7ae0ee9bf93eb5c4846b4bd40..94e1278340c0d9d2be9edc68f6454143
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java
index a08c52949af1d2416ecb089fc559db2e3b29105c..8f430a4067fc722ebfbca846cccded4fb0a3a4e5 100644
index 8d85d74605457724cc206a55dbb16679c3791ea1..3dc165265af4a9cb0e05018b9273b7dfdecf730a 100644
--- a/src/main/java/org/bukkit/block/BlockType.java
+++ b/src/main/java/org/bukkit/block/BlockType.java
@@ -3500,4 +3500,13 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
@@ -3502,4 +3502,13 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
@Override
@NotNull String getTranslationKey();
// Paper end - add Translatable

View file

@ -5,10 +5,10 @@ Subject: [PATCH] More PotionEffectType API
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 5dbbc4eb764650395c6ebaaf5fdf0466ca107439..0ee9a8728035217bb95c7fba917b45a5ef2ea533 100644
index c1f46c27f0571ce54f35ee0fab9b586ea62ee832..7870a796e719148a42d18f1497b56c0d8f651a43 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -323,6 +323,33 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -331,6 +331,33 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see GameEvent
*/
Registry<GameEvent> GAME_EVENT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.GAME_EVENT); // Paper

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#swingHand(EquipmentSlot) convenience method
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 0c7d96bc296b56dc9ff0ada89bb4d715716f8adc..fb62933d589ccbe4181a7b9633bb742ae35f68dd 100644
index f7a3dd62ae5e492a7bccf8167cec0fc560499fa2..4ed60d7eae1b1c8980f8844b33151fd7c53207c2 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1331,4 +1331,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1341,4 +1341,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@Deprecated
void setHurtDirection(float hurtDirection);
// Paper end - hurt direction API

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add entity knockback API
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index fb62933d589ccbe4181a7b9633bb742ae35f68dd..597a3b581cb6fa2605fd5916e5639c1020d688b7 100644
index 4ed60d7eae1b1c8980f8844b33151fd7c53207c2..86c5ceddc722d28261f8a6d8368400fe2731aaf0 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1351,4 +1351,18 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1361,4 +1361,18 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
}
}
// Paper end - swing hand API

View file

@ -8,10 +8,10 @@ to simulate damage done to an itemstack and all
the logic associated with damaging them
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 597a3b581cb6fa2605fd5916e5639c1020d688b7..c9c3b926c5bb408d964ed5acc9f95c8527837a25 100644
index 86c5ceddc722d28261f8a6d8368400fe2731aaf0..9f3e2903c955f2a5d1b25825c49188df62d20cef 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1365,4 +1365,53 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1375,4 +1375,53 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void knockback(double strength, double directionX, double directionZ);
// Paper end - knockback API

View file

@ -53,10 +53,10 @@ index 6dcaf7e9bc9afb708ab569e82f27c87833450ff1..a76e537c9b3b9519cd46894c90b750f0
// Paper start - Collision API
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 7c027d7bbd6b8a1543fa92d44e99674925f093b3..f5149d54d6cb5019f398718b9aa52bc3ab34a5ae 100644
index 016529563381a674db8050cb328f9e8f16e72e93..c610731928ac9b01b111a7ccf0340ad59fcfb867 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1414,4 +1414,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1424,4 +1424,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void damageItemStack(org.bukkit.inventory.@NotNull EquipmentSlot slot, int amount);
// Paper end - ItemStack damage API

View file

@ -70,34 +70,10 @@ index f08ee26cc4d479e1bfc5264b8cbe721315de91f2..f1fa86ddf1f50a357c9e94cc61261d8c
* Remove a modifier from this instance.
*
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
index ee39c0b83e558681e8b006172d34c98e2c83cda2..c57690798108e9f91f8c552f39dcc2b080fe1b61 100644
index 8c53ac6b4381f3cf8b5e989c8b2a3ba77bd4e475..def473b6424da1e81448bd492b7fef46691eaf8c 100644
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
@@ -25,26 +25,32 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
private final Operation operation;
private final EquipmentSlotGroup slot;
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.21")
public AttributeModifier(@NotNull String name, double amount, @NotNull Operation operation) {
this(UUID.randomUUID(), name, amount, operation);
}
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.21")
public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation) {
this(uuid, name, amount, operation, (EquipmentSlot) null);
}
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.21")
public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @Nullable EquipmentSlot slot) {
this(uuid, name, amount, operation, (slot) == null ? EquipmentSlotGroup.ANY : slot.getGroup());
}
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.21")
public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @NotNull EquipmentSlotGroup slot) {
@@ -48,6 +48,12 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
this(NamespacedKey.fromString(uuid.toString()), amount, operation, slot);
}
@ -110,12 +86,3 @@ index ee39c0b83e558681e8b006172d34c98e2c83cda2..c57690798108e9f91f8c552f39dcc2b0
public AttributeModifier(@NotNull NamespacedKey key, double amount, @NotNull Operation operation, @NotNull EquipmentSlotGroup slot) {
Preconditions.checkArgument(key != null, "Key cannot be null");
Preconditions.checkArgument(operation != null, "Operation cannot be null");
@@ -63,7 +69,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
* @deprecated attributes are now identified by keys
*/
@NotNull
- @Deprecated
+ @Deprecated(forRemoval = true, since = "1.21")
public UUID getUniqueId() {
return UUID.fromString(getKey().toString());
}

View file

@ -25,10 +25,10 @@ index 7522c611b5214dd09867c434d5f7cf161f5c04ca..026b1832bcd163ab89668c991bf002e6
/**
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index c4f067598a40b0381bc9e601a3809e2683c10407..54704da43cf9c429f3914f0580246dde99aa93c0 100644
index 6959f36023b12ec2dece9b91a3b8a5d07b635430..de469f32dd9a01e0e2fde016044a783dde0c5b98 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -2497,6 +2497,8 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
@@ -2499,6 +2499,8 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
EGG(21603, 16),
COMPASS(24139),
RECOVERY_COMPASS(12710),
@ -162,15 +162,15 @@ index 4adc91ba3dff00ab44303778e9d4499f7808ad00..beb62426490a361af793fb530106d854
}
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index fbdbd2f4da5e09d4b111ddcf72e2d7dd59046bd7..126d60a4d0b3b140b922fb24aa425e805892ad32 100644
index ae4ae1fa6d407665ef03edcdef683d741668acf1..b4fe8108e8b36b8ce859cdd4a5b557034f923c85 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -146,7 +146,6 @@ public enum InventoryType {
@@ -148,7 +148,6 @@ public enum InventoryType {
/**
* A crafter inventory, with 9 CRAFTING slots.
*/
- @ApiStatus.Experimental
CRAFTER(9, "Crafter"),
CRAFTER(9, "Crafter", MenuType.CRAFTER_3X3),
/**
* The new smithing inventory, with 3 CRAFTING slots and 1 RESULT slot.
diff --git a/src/main/java/org/bukkit/inventory/CrafterInventory.java b/src/main/java/org/bukkit/inventory/CrafterInventory.java

View file

@ -49,10 +49,10 @@ index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..98fdfc8978fea1937e31a7427433a192
@Override
public @NotNull String translationKey() {
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 1df2b8fcf90333d5981f16d9dddddd48289f94e4..5d21459e9128c515508a2b4b2265d9824e10d9d5 100644
index 7870a796e719148a42d18f1497b56c0d8f651a43..ff82bf3ea959c78e71ec7b0972a2d472f20aaf04 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -359,6 +359,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -367,6 +367,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@Nullable
T get(@NotNull NamespacedKey key);
@ -132,7 +132,7 @@ index 1df2b8fcf90333d5981f16d9dddddd48289f94e4..5d21459e9128c515508a2b4b2265d982
/**
* Returns a new stream, which contains all registry items, which are registered to the registry.
*
@@ -433,5 +506,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -441,5 +514,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
public Class<T> getType() {
return this.type;
}

View file

@ -6,18 +6,18 @@ Subject: [PATCH] Add missing InventoryType
Upstream did not add a DECORATED_POT inventory type
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index 126d60a4d0b3b140b922fb24aa425e805892ad32..398f74ba0d2e890fb556cd964f61da7c623a7c6d 100644
index b4fe8108e8b36b8ce859cdd4a5b557034f923c85..7184f80899206bedeac387e9f8a35482801efd4b 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -143,6 +143,12 @@ public enum InventoryType {
@@ -145,6 +145,12 @@ public enum InventoryType {
* Pseudo jukebox inventory with 1 slot of undefined type.
*/
JUKEBOX(1, "Jukebox", false),
JUKEBOX(1, "Jukebox", null, false),
+ // Paper start - add missing type
+ /**
+ * Pseudo decorated pot with 1 slot of undefined type.
+ */
+ DECORATED_POT(1, "Decorated Pot", false),
+ DECORATED_POT(1, "Decorated Pot", null, false),
+ // Paper end - add missing type
/**
* A crafter inventory, with 9 CRAFTING slots.

View file

@ -10,10 +10,10 @@ Adds the following:
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java
index c57690798108e9f91f8c552f39dcc2b080fe1b61..bfa378fe3d074bafbc0af2c4d858e2a34d3126bd 100644
index def473b6424da1e81448bd492b7fef46691eaf8c..027a7d3b6feb52f6c3424edc0820d29fdaf6ebae 100644
--- a/src/main/java/org/bukkit/attribute/AttributeModifier.java
+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java
@@ -118,6 +118,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
@@ -130,6 +130,7 @@ public class AttributeModifier implements ConfigurationSerializable, Keyed {
*/
@Nullable
@Deprecated
@ -22,10 +22,10 @@ index c57690798108e9f91f8c552f39dcc2b080fe1b61..bfa378fe3d074bafbc0af2c4d858e2a3
return slot == EquipmentSlotGroup.ANY ? null : slot.getExample();
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 8369da45206d2606f0715f3d803163dd8028251e..fcdc5fce88720cc926a3953d80b5045113d1516c 100644
index 51a428473e702be3ab79bd1e579d1114f747791b..68c08e7a212bc3e3885f9b5a4d9aef85fcb3b029 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1447,4 +1447,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -1457,4 +1457,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end - body yaw API

View file

@ -132,31 +132,6 @@ index ff6818b6d9e0207eafdd749928f33aeac3f27191..992f39da07bafe9769effaa7dc6adc01
/**
* Checks to see if this item has a maximum amount of damage.
*
diff --git a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
index 9bd15803cd3526da951ed197305a1b9385305927..5833c4c16b08a0f338a5cd7c0011e82eeda222c2 100644
--- a/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/FireworkMeta.java
@@ -75,10 +75,20 @@ public interface FireworkMeta extends ItemMeta {
*/
boolean hasEffects();
+ // Paper start - add hasPower
+ /**
+ * Checks if power is defined on this meta.
+ *
+ * @return true if there is a power specified
+ */
+ boolean hasPower();
+ // Paper end - add hasPower
+
/**
* Gets the approximate height the firework will fly.
*
* @return approximate flight height of the firework.
+ * @see #hasPower()
*/
int getPower();
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 1a4260b00b193b94ce4b1b2954644f4e41baff4c..5d5fcb2720b62e47d47f441032c4de02574b051a 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java

View file

@ -795,10 +795,10 @@ index 0000000000000000000000000000000000000000..5fde17e97eddcd1d01ee39694c9159d0
+ }
+}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 5d21459e9128c515508a2b4b2265d9824e10d9d5..20015393f91af405c99db2635a471fb6ff19e4bf 100644
index ff82bf3ea959c78e71ec7b0972a2d472f20aaf04..1392a1295349cfc43fbc115c912c1995779ffe62 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -358,6 +358,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -366,6 +366,27 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*/
@Nullable
T get(@NotNull NamespacedKey key);
@ -826,7 +826,7 @@ index 5d21459e9128c515508a2b4b2265d9824e10d9d5..20015393f91af405c99db2635a471fb6
// Paper start - improve Registry
/**
@@ -432,6 +453,34 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -440,6 +461,34 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
}
// Paper end - improve Registry
@ -861,7 +861,7 @@ index 5d21459e9128c515508a2b4b2265d9824e10d9d5..20015393f91af405c99db2635a471fb6
/**
* Returns a new stream, which contains all registry items, which are registered to the registry.
*
@@ -513,5 +562,23 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -521,5 +570,23 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
return value.getKey();
}
// Paper end - improve Registry

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Introduce registry entry and builders
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
index 76daccf4ea502e1747a6f9176dc16fd20c561286..2945dde566682f977e84fde5d473a6c69be24df1 100644
index 7763ea28a00c25ffd8ba8941cff29bae5ae117a2..ccbe3fa2e01a80abb801d14891dce34ed179b5ee 100644
--- a/src/main/java/io/papermc/paper/registry/RegistryKey.java
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
@@ -76,9 +76,10 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
@@ -77,9 +77,10 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
@ApiStatus.Internal
RegistryKey<BlockType> BLOCK = create("block");
/**

View file

@ -242,10 +242,10 @@ index 330e3013eda204aa9b33d5e1c3104e0b595abdbc..c80e0ef587a001ee6de3f5c182cc9696
/**
* Do not use, method will get removed, and the plugin won't run
diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java
index 8f430a4067fc722ebfbca846cccded4fb0a3a4e5..a98cc1bc25fcde49b525ae6f841ea2841111e028 100644
index 3dc165265af4a9cb0e05018b9273b7dfdecf730a..72aa7e4004afcaa132dc4dbbe2ff050b503928af 100644
--- a/src/main/java/org/bukkit/block/BlockType.java
+++ b/src/main/java/org/bukkit/block/BlockType.java
@@ -123,7 +123,7 @@ import org.jetbrains.annotations.Nullable;
@@ -125,7 +125,7 @@ import org.jetbrains.annotations.Nullable;
* changes may occur. Do not use this API in plugins.
*/
@ApiStatus.Internal
@ -254,7 +254,7 @@ index 8f430a4067fc722ebfbca846cccded4fb0a3a4e5..a98cc1bc25fcde49b525ae6f841ea284
/**
* Typed represents a subtype of {@link BlockType}s that have a known block
@@ -3479,7 +3479,9 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
@@ -3481,7 +3481,9 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
*
* @param world the world to check
* @return true if this BlockType can be used in this World.

View file

@ -82,27 +82,8 @@ index 85c7f3027978b1d7d6c31b7ad21b3377cdda5925..e34deaf398dc6722c3128bdd6b9bc16d
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 751900e0c2a946ba4291174c81b2bdbdbe994e94..f04c0f8b3905b488aac221fedde335a54ad1ff58 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2522,7 +2522,13 @@ public final class CraftServer implements Server {
Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null");
ReloadableServerRegistries.Holder registry = this.getServer().reloadableRegistries();
- return new CraftLootTable(key, registry.getLootTable(CraftLootTable.bukkitKeyToMinecraft(key)));
+ // Paper start - honor method contract
+ final ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTableKey = CraftLootTable.bukkitKeyToMinecraft(key);
+ final Optional<net.minecraft.world.level.storage.loot.LootTable> table = registry.get().lookup(Registries.LOOT_TABLE)
+ .flatMap(registryEntryLookup -> registryEntryLookup.get(lootTableKey))
+ .map(net.minecraft.core.Holder::value);
+ return table.map(lootTable -> new CraftLootTable(key, lootTable)).orElse(null);
+ // Paper end
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index dbcde37cfdeb6141c3f5c4f8b95d60fca91c7977..2122d7316f55ab5bec7058fe1b8ee3ceb42deea7 100644
index cf06abf508fab734f5945e1d292c01512a50749e..42a1a0588e2b506082499ac9791d039089a64631 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -123,6 +123,7 @@ public class Main {
@ -134,7 +115,7 @@ index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..c017ce2ca1bc535795c958a2e509af2a
public class CraftScheduler implements BukkitScheduler {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index cfb4cf66aa5f32a96a15886c6cf4a3946bd232ec..aa6a9dcd5528df38dddc0c661334c35658a19cee 100644
index b0cc506f1b3eb53e8e2299787071de707a036df0..eeffc4be4ae7168c9f69edbbff6642fd4c214b3d 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -240,7 +240,7 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -5052,7 +5052,7 @@ index 05a4056b242159b1c85aa6ebf43b69cf85c00021..06cbe7a7ea131a8bead857cbfbd27810
public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 12db4c5db3d7951df984db03d09d14d808e58699..44d4aee059d74676bffb8b6bc6f6ad4dd96fcb33 100644
index c1db114edd9e31273b76374cbd19710b01cada2b..26064174397dc95f9b117d901e22c55abebf3c39 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -282,6 +282,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -5064,7 +5064,7 @@ index 12db4c5db3d7951df984db03d09d14d808e58699..44d4aee059d74676bffb8b6bc6f6ad4d
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index d7a3f704cce228c50d26f1ecd98e819eca561bfc..3457e1c9791b294b5e4dab478d90cdd1a1cf7fef 100644
index 5fa5c6fa8c143e1aa1dacc7a6b63b11ad4b074ec..5025f7f5d66f2aedd57db137ae2dc69c723768b3 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -953,6 +953,25 @@ public final class ItemStack implements DataComponentHolder {
@ -5563,10 +5563,10 @@ index 34933c5324126f9afdc5cba9dea997ace8f01806..1cfc906317f07a44f06a4adf021c44e3
return false;
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a094eb1348509fea0c3d253cddfe409998dcbf23..2ea3ad9ab43dec0555d6716bebefbc3bb6553f1a 100644
index 4c5b6f8d63e4c60a1dc81e68117fa049b956819a..958925a980f50cc85b10d36bcc343947cec8f285 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2601,4 +2601,9 @@ public final class CraftServer implements Server {
@@ -2598,4 +2598,9 @@ public final class CraftServer implements Server {
return this.spigot;
}
// Spigot end
@ -5657,7 +5657,7 @@ index 508419378c88ba8688edbd5142d9d8ba52396507..69c62699e3412f2730e3db65f196099d
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e130d0aa64d0caaa7760d8de4b1f989523f9de20..9ca244b69995552df63fb5d4e3d6961b585bcc47 100644
index 4cbf0d797fc2d57c822877c111698b2077399d32..9cd22b09b295ecd95d17d1dd5edb96f916eb6c09 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2420,4 +2420,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -2786,10 +2786,10 @@ index cb136a30287a17947ed018cdc48e6f91ed904072..ee5188f3aa2ff71306f5af8046e8ddf9
this.chatVisibility = clientOptions.chatVisibility();
this.canChatColor = clientOptions.chatColors();
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95d5e0bdac 100644
index 16320a5fccc7faf7ceac95d471532104a61d27a5..b2bddc6183204b9f519549073e38741e1a9322c4 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -67,7 +67,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -72,7 +72,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private static final Component TIMEOUT_DISCONNECTION_MESSAGE = Component.translatable("disconnect.timeout");
static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response");
protected final MinecraftServer server;
@ -2798,7 +2798,7 @@ index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95
private final boolean transferred;
private long keepAliveTime;
private boolean keepAlivePending;
@@ -76,6 +76,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -81,6 +81,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private boolean closed = false;
private int latency;
private volatile boolean suspendFlushingOnServerThread = false;
@ -2806,7 +2806,7 @@ index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver;
@@ -189,6 +190,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -194,6 +195,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id());
this.disconnect((Component) Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
}
@ -2825,7 +2825,7 @@ index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95
this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packet.id(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit
}
@@ -275,6 +288,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -280,6 +293,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
}
@ -2838,7 +2838,7 @@ index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95
public void disconnect(Component reason) {
this.disconnect(new DisconnectionDetails(reason));
}
@@ -305,9 +324,9 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -310,9 +329,9 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
return;
}
@ -2850,7 +2850,7 @@ index 677ee8dfa0d2f5bcb23ee870a76bcee63e557813..678f12679985c6fa9effe8beec306d95
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
@@ -319,7 +338,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -324,7 +343,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent
// Send the possibly modified leave message
@ -2947,10 +2947,10 @@ index 2de70e3a3038b2d2bb47b58f0e14d937c35d55ba..4acee8121ff62413dbbf2294d17da3bd
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 8e715261b99bcc19b6f4b9787987c59aa19ba70e..851e4bdf1739736fd193786a6541ffb341525dcb 100644
index b53e3e5e02ed501d30c3fca4c3130263c32cd2f5..b2f7c76207f2dc0c62f608f21aba4b531f8f523f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -333,7 +333,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -338,7 +338,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);
if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) {
@ -2959,7 +2959,7 @@ index 8e715261b99bcc19b6f4b9787987c59aa19ba70e..851e4bdf1739736fd193786a6541ffb3
}
Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() {
@Override
@@ -345,12 +345,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -350,12 +350,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable);
if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) {
@ -3242,7 +3242,7 @@ index ed54c81a3269360acce674aa4e1d54ccb2461841..c9c849534c3998cfcab7ddcb12a71ccb
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 3457e1c9791b294b5e4dab478d90cdd1a1cf7fef..1138d238caa18171b6562cc748c92cec03bfbb97 100644
index 5025f7f5d66f2aedd57db137ae2dc69c723768b3..1cc9078fa63da4f39ef4a551cd6a5ff207f58306 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -183,7 +183,15 @@ public final class ItemStack implements DataComponentHolder {
@ -3327,7 +3327,7 @@ index 49c037e961c5ca5ba8d6a870cb32ffe8719adc91..2772c19f58a35713d61aab24f6f0d6f5
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2ea3ad9ab43dec0555d6716bebefbc3bb6553f1a..be068650a568fc1d0d3b9c5acd040adafb2344e1 100644
index 958925a980f50cc85b10d36bcc343947cec8f285..ee0fbba1ae29bb809303ccc09f64d48c54d426cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -644,8 +644,10 @@ public final class CraftServer implements Server {
@ -3346,13 +3346,13 @@ index 2ea3ad9ab43dec0555d6716bebefbc3bb6553f1a..be068650a568fc1d0d3b9c5acd040ada
}
+ // Paper start
+ @Override
@Override
+ public net.kyori.adventure.text.Component shutdownMessage() {
+ String msg = getShutdownMessage();
+ return msg != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(msg) : null;
+ }
+ // Paper end
@Override
+ @Override
+ @Deprecated // Paper
public String getShutdownMessage() {
return this.configuration.getString("settings.shutdown-message");
@ -3429,12 +3429,12 @@ index 2ea3ad9ab43dec0555d6716bebefbc3bb6553f1a..be068650a568fc1d0d3b9c5acd040ada
}
+ // Paper start
+ @Override
@Override
+ public Merchant createMerchant(net.kyori.adventure.text.Component title) {
+ return new org.bukkit.craftbukkit.inventory.CraftMerchantCustom(title == null ? InventoryType.MERCHANT.defaultTitle() : title);
+ }
+ // Paper end
@Override
+ @Override
+ @Deprecated // Paper
public Merchant createMerchant(String title) {
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
@ -3457,7 +3457,7 @@ index 2ea3ad9ab43dec0555d6716bebefbc3bb6553f1a..be068650a568fc1d0d3b9c5acd040ada
@Override
public String getMotd() {
return this.console.getMotd();
@@ -2606,4 +2663,57 @@ public final class CraftServer implements Server {
@@ -2603,4 +2660,57 @@ public final class CraftServer implements Server {
public double[] getTPS() {
return new double[]{0, 0, 0}; // TODO
}
@ -4096,10 +4096,10 @@ index d09102fe44dffa61dff883488f47715effaa8211..269326e7689eba91bcfd3475006e8cbf
@Override
public boolean isPermissionSet(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 59107e11f29e2c6dd213966b3000c79eabdbd39b..0c94a1094a3af0232bb2957708fa997933db621b 100644
index f77f14d549479a5e6d4ef823c137954de746a5ce..a93895a6e656c25e819354ecf5c73ff4bae83675 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -321,9 +321,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -329,9 +329,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
container = CraftEventFactory.callInventoryOpenEvent(player, container);
if (container == null) return;
@ -4114,7 +4114,7 @@ index 59107e11f29e2c6dd213966b3000c79eabdbd39b..0c94a1094a3af0232bb2957708fa9979
player.containerMenu = container;
player.initMenu(container);
}
@@ -393,8 +396,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -401,8 +404,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
// Now open the window
MenuType<?> windowType = CraftContainer.getNotchInventoryType(inventory.getTopInventory());
@ -4148,10 +4148,10 @@ index 55945b83a5426b352bad9507cc9e94afb1278032..9ea1537408ff2d790747b6e5a681d917
public boolean isOp() {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9ca244b69995552df63fb5d4e3d6961b585bcc47..807184636a99c17fe6ed8dd1cd07e1872d613657 100644
index 9cd22b09b295ecd95d17d1dd5edb96f916eb6c09..69b8d0f73ced69cd88029a5d7e11aca40d70f9d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -388,14 +388,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -390,14 +390,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public String getDisplayName() {
@ -4192,7 +4192,7 @@ index 9ca244b69995552df63fb5d4e3d6961b585bcc47..807184636a99c17fe6ed8dd1cd07e187
@Override
public String getPlayerListName() {
return this.getHandle().listName == null ? this.getName() : CraftChatMessage.fromComponent(this.getHandle().listName);
@@ -407,6 +433,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -409,6 +435,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
name = this.getName();
}
this.getHandle().listName = name.equals(this.getName()) ? null : CraftChatMessage.fromStringOrNull(name);
@ -4200,7 +4200,7 @@ index 9ca244b69995552df63fb5d4e3d6961b585bcc47..807184636a99c17fe6ed8dd1cd07e187
for (ServerPlayer player : (List<ServerPlayer>) this.server.getHandle().players) {
if (player.getBukkitEntity().canSee(this)) {
player.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_DISPLAY_NAME, this.getHandle()));
@@ -414,42 +441,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -416,42 +443,42 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}
@ -4253,7 +4253,7 @@ index 9ca244b69995552df63fb5d4e3d6961b585bcc47..807184636a99c17fe6ed8dd1cd07e187
}
@@ -481,6 +508,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.disconnect(CraftChatMessage.fromStringOrEmpty(message, true));
this.getHandle().transferCookieConnection.kickPlayer(CraftChatMessage.fromStringOrEmpty(message, true));
}
+ // Paper start
@ -4677,7 +4677,7 @@ index 5725b0281ac53a2354b233223259d6784353bc6e..9ef939b76d06874b856e0c850addb364
@Override
public int getLineWidth() {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 20eb63eeac7f5c9a1d98a9aa8f90a588cb036c70..8f468a3bfa8ef381eabb45ebb3dd9a4942e98dd5 100644
index 7719afbb1af4091f688a75c92ee8cae8669974ff..34636f7a05d868c4df86316a65c4e008f54db634 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -917,7 +917,7 @@ public class CraftEventFactory {
@ -4699,7 +4699,7 @@ index 20eb63eeac7f5c9a1d98a9aa8f90a588cb036c70..8f468a3bfa8ef381eabb45ebb3dd9a49
return event;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index 42c888af154a133e118a9ff9fef587e345c13e19..867091ff253541ec45b6ae7f1fb3acc83a5c4966 100644
index 45a8d918d9ecf459a4e66dca555a022ceb507222..1a2329021a6b29777c637ee4dc8cd69ed18001c9 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
@@ -72,6 +72,13 @@ public class CraftContainer extends AbstractContainerMenu {
@ -4846,29 +4846,55 @@ index 500bfe5dd745327f953a314e863f7318953bf3bc..e2daeeba1bacbb5c5ca2aa922fa67b02
+ }
+ // Paper end - Adventure
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
index b09f794abd68551058e5764749d76c9ce8d2b849..d658634ea4468c9dbfb29bc12282441c96358566 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMenuType.java
@@ -37,6 +37,12 @@ public class CraftMenuType<V extends InventoryView> implements MenuType.Typed<V>
@Override
public V create(final HumanEntity player, final String title) {
+ // Paper start - adventure
+ return create(player, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(title));
+ }
+ @Override
+ public V create(final HumanEntity player, final net.kyori.adventure.text.Component title) {
+ // Paper end - adventure
Preconditions.checkArgument(player != null, "The given player must not be null");
Preconditions.checkArgument(title != null, "The given title must not be null");
Preconditions.checkArgument(player instanceof CraftHumanEntity, "The given player must be a CraftHumanEntity");
@@ -45,7 +51,7 @@ public class CraftMenuType<V extends InventoryView> implements MenuType.Typed<V>
final ServerPlayer serverPlayer = (ServerPlayer) craftHuman.getHandle();
final AbstractContainerMenu container = this.typeData.get().menuBuilder().build(serverPlayer, this.handle);
- container.setTitle(CraftChatMessage.fromString(title)[0]);
+ container.setTitle(io.papermc.paper.adventure.PaperAdventure.asVanilla(title)); // Paper - adventure
container.checkReachable = false;
return (V) container.getBukkitView();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
index 9e05a8515c5f6f340182e91150fcad8bbf80a22b..adf22ce4f0bcd3bd57dc2030c6c92d3df96566e3 100644
index b9025adf652f22b0ba703b4e249a25b80ee6359d..ef47eb9a321a7b082413d3986d3d394afb899610 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java
@@ -13,10 +13,17 @@ import org.bukkit.craftbukkit.util.CraftChatMessage;
@@ -15,10 +15,17 @@ public class CraftMerchantCustom implements CraftMerchant {
public class CraftMerchantCustom extends CraftMerchant {
private MinecraftMerchant merchant;
+ @Deprecated // Paper - Adventure
public CraftMerchantCustom(String title) {
super(new MinecraftMerchant(title));
this.merchant = new MinecraftMerchant(title);
this.getMerchant().craftMerchant = this;
}
+ // Paper start
+ public CraftMerchantCustom(net.kyori.adventure.text.Component title) {
+ super(new MinecraftMerchant(title));
+ this.merchant = new MinecraftMerchant(title);
+ getMerchant().craftMerchant = this;
+ }
+ // Paper end
@Override
public String toString() {
@@ -35,10 +42,17 @@ public class CraftMerchantCustom extends CraftMerchant {
@@ -37,10 +44,17 @@ public class CraftMerchantCustom implements CraftMerchant {
private Player tradingPlayer;
protected CraftMerchant craftMerchant;

View file

@ -617,7 +617,7 @@ index bb59986c211f7d6ea50b1ad4bd5565227bec8a6c..9c950fc1de15b5039e34a9fdf893e97a
this.setPvpAllowed(dedicatedserverproperties.pvp);
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 17df1085e29429b202a6f9003343b15b15e2f8f7..29f94e574e39714caec95af5c176c9dba481728e 100644
index c6cc48c955f052d8f98e3b28c80910b299467480..3ef43c8d39f6012e0b8e98fd216b34a20449cca0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -986,6 +986,7 @@ public final class CraftServer implements Server {
@ -628,7 +628,7 @@ index 17df1085e29429b202a6f9003343b15b15e2f8f7..29f94e574e39714caec95af5c176c9db
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2711,6 +2712,34 @@ public final class CraftServer implements Server {
@@ -2708,6 +2709,34 @@ public final class CraftServer implements Server {
// Paper end
// Paper start

View file

@ -1229,7 +1229,7 @@ index 4c39d9e0466240b5cd459ee649a22fe3a72bf9f0..eb98bb1bd76869fd76b34885223c8e57
this.entityManager.saveAll();
} else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 556d8f23ee2de77cea71abcc0e56718e60b20b05..47e1640cafc8087d94d0b88b8b3117591f9f238e 100644
index 4acee8121ff62413dbbf2294d17da3bd2f974d5a..3a67b2b6a6d3204b2a7bbe8adbf2b0ecf7898551 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -330,7 +330,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -1378,7 +1378,7 @@ index e465aaa4fd29b4966ea8d88316c6d8f217da2e73..474f020371bb9e5fd2c5b22e44d79029
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 44d4aee059d74676bffb8b6bc6f6ad4dd96fcb33..97ad63aad3c559feb1e762af1e00fd550aa5b251 100644
index 26064174397dc95f9b117d901e22c55abebf3c39..d1e042ec0c1a818d713b31c3d81b48327c3578d5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -156,7 +156,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -1590,7 +1590,7 @@ index 46a090123e205394791cdbde2af84c58ce55f7e1..47f5f3d58bb3bf85cf35f9baae77df7f
};
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ee63b8134b8b3187a65d2b99962cfacbee18ff9f..29bb34e9207bd6c49cfbe58d4b598dcd35b7a65c 100644
index 25a03307a576368f417f1ec3f44213ed469dcd71..b3d4cb03f6d3951632fd15101aa68e130a43879b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -376,7 +376,7 @@ public final class CraftServer implements Server {
@ -1602,7 +1602,7 @@ index ee63b8134b8b3187a65d2b99962cfacbee18ff9f..29bb34e9207bd6c49cfbe58d4b598dcd
this.overrideSpawnLimits();
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
@@ -2620,12 +2620,31 @@ public final class CraftServer implements Server {
@@ -2617,12 +2617,31 @@ public final class CraftServer implements Server {
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{
@ -1804,7 +1804,7 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 807184636a99c17fe6ed8dd1cd07e1872d613657..68b9b4aba7dba31e4526165e6efb8c40f9e841bc 100644
index 69b8d0f73ced69cd88029a5d7e11aca40d70f9d1..e4ea877228102ccf93fe8c92b0cec8ebd89771a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2782,6 +2782,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -146,10 +146,10 @@ index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b286609
this.startMetricsRecordingTick();
this.profiler.push("tick");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f2355612b497079f1de84e953c36720794da51d8..1056badff06575ef13907afac60af734ffa2b863 100644
index b3d4cb03f6d3951632fd15101aa68e130a43879b..90da60f7cdfe809c2035c9cd242f748ec8bf5eb0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2673,7 +2673,11 @@ public final class CraftServer implements Server {
@@ -2670,7 +2670,11 @@ public final class CraftServer implements Server {
@Override
public double[] getTPS() {

View file

@ -5,20 +5,20 @@ Subject: [PATCH] Use UserCache for player heads
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index f6a53ac07ff2decf4bcd35d1a9d7352965f75e7f..a36fcd9bfcbd2b37d7cf40b32abc0aea2761ce15 100644
index 43609c99347c2e3e6ee9a1b8926b32b458781fba..7181d81c231908f208b48a29f918136cb143f476 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -177,7 +177,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -172,7 +172,13 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
if (name == null) {
this.setProfile(null);
} else {
- this.setProfile(new GameProfile(Util.NIL_UUID, name));
- this.setProfile(new ResolvableProfile(new GameProfile(Util.NIL_UUID, name)));
+ // Paper start - Use Online Players Skull
+ GameProfile newProfile = null;
+ net.minecraft.server.level.ServerPlayer player = net.minecraft.server.MinecraftServer.getServer().getPlayerList().getPlayerByName(name);
+ if (player != null) newProfile = player.getGameProfile();
+ if (newProfile == null) newProfile = new GameProfile(Util.NIL_UUID, name);
+ this.setProfile(newProfile);
+ this.setProfile(new ResolvableProfile(newProfile));
+ // Paper end
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 68df6270f7d08cde78235749950e05bf60c1641c..ef3f1d00a595fd1fb7297d7ab96e791acbcbbed6 100644
index 9751cace64d9ad2b8b55080b13834e8ccb056b42..951b89ced33b2a12dff90e32201643bee64962e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -386,6 +386,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -388,6 +388,98 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}

View file

@ -7,7 +7,7 @@ Upstream added methods for this, original methods are now
deprecated
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index e6c68fd9a5fcd374cd7feca081189c9ba9225743..c36e4c1802e304853320576e0521dbc53cd25425 100644
index 812a4db4a91b887ef61b3ead9fa781561e6039ce..238ec25cc3109659d524fcc1de48afcd5f59552b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -283,10 +283,29 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@ -41,7 +41,7 @@ index e6c68fd9a5fcd374cd7feca081189c9ba9225743..c36e4c1802e304853320576e0521dbc5
@Override
public void damage(double amount) {
@@ -802,4 +821,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -807,4 +826,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().persistentInvisibility = invisible;
this.getHandle().setSharedFlag(5, invisible);
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 678f12679985c6fa9effe8beec306d95d5e0bdac..8520f0f2b4b4e758b2e2fae206b7fd818a6fa14f 100644
index b2bddc6183204b9f519549073e38741e1a9322c4..9bfdcdf427f7c0689d346d17942b5902a9138a4e 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -202,7 +202,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -207,7 +207,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
callback.packEventReceived(packet.id(), net.kyori.adventure.resource.ResourcePackStatus.valueOf(packet.action().name()), this.getCraftPlayer());
}
// Paper end
@ -22,7 +22,7 @@ index 678f12679985c6fa9effe8beec306d95d5e0bdac..8520f0f2b4b4e758b2e2fae206b7fd81
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ef3f1d00a595fd1fb7297d7ab96e791acbcbbed6..174c86a7213ecf3c8dc03aeaf55c56a4c4ce55ad 100644
index 951b89ced33b2a12dff90e32201643bee64962e1..a19e1c7821c6abfa4288d8a16e30b2160be742f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -208,6 +208,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index da2e0bb591468e7940f057a583ce166abc79d399..99571e69aabbbfb0e439a42d113c206decb1377b 100644
index c8d8161bc8558be20583ca9e68611ea26e61deb0..ca2a17db0713fdb332549a76bee7e56502f96e56 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2793,5 +2793,23 @@ public final class CraftServer implements Server {
@@ -2790,5 +2790,23 @@ public final class CraftServer implements Server {
}
return this.adventure$audiences;
}

View file

@ -263,10 +263,10 @@ index 7ae3cdb80335cbeb0ff695eb719a170651586722..97c40582bca095532fff9a81515f38ea
+
}
diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
index 358af0121ce3d87a9f51da2bae0699034c1560b4..94cae8f3c13d0afcbe97478fba34ff4f12f8c7ee 100644
index e7deba518b8a3df9e642a1bcd7b6642c3dc7583b..26a7c2d37e6a8284ab444a9edad967bdcad1e5a3 100644
--- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
+++ b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
@@ -37,6 +37,17 @@ public final class CraftPlayerProfile implements PlayerProfile {
@@ -40,6 +40,17 @@ public final class CraftPlayerProfile implements PlayerProfile {
boolean isValidSkullProfile = (gameProfile.getName() != null)
|| gameProfile.getProperties().containsKey(CraftPlayerTextures.PROPERTY_NAME);
Preconditions.checkArgument(isValidSkullProfile, "The skull profile is missing a name or textures!");
@ -284,16 +284,16 @@ index 358af0121ce3d87a9f51da2bae0699034c1560b4..94cae8f3c13d0afcbe97478fba34ff4f
return gameProfile;
}
@@ -53,6 +64,8 @@ public final class CraftPlayerProfile implements PlayerProfile {
public CraftPlayerProfile(UUID uniqueId, String name) {
@@ -67,6 +78,8 @@ public final class CraftPlayerProfile implements PlayerProfile {
if (applyPreconditions) {
Preconditions.checkArgument((uniqueId != null) || !StringUtils.isBlank(name), "uniqueId is null or name is blank");
}
+ Preconditions.checkArgument(name == null || name.length() <= 16, "The name of the profile is longer than 16 characters"); // Paper - Validate
+ Preconditions.checkArgument(name == null || net.minecraft.util.StringUtil.isValidPlayerName(name), "The name of the profile contains invalid characters: %s", name); // Paper - Validate
this.uniqueId = (uniqueId == null) ? Util.NIL_UUID : uniqueId;
this.name = (name == null) ? "" : name;
this.uniqueId = uniqueId;
this.name = name;
}
@@ -89,6 +102,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
@@ -114,6 +127,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
// Assert: (property == null) || property.getName().equals(propertyName)
this.removeProperty(propertyName);
if (property != null) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ba194f42217f1176ac08123d3bb5cb24e1a6c119..e7b308ba4a253b270aebebd19e2671514c5357ca 100644
index a5f7289158623c8fb9fd02beecc2ce9f2057a00c..b8a69688bcc69dff11e4bceb06ab435bfc6b3fc9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3858,10 +3858,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -13,7 +13,7 @@ index ba194f42217f1176ac08123d3bb5cb24e1a6c119..e7b308ba4a253b270aebebd19e267151
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
+ PlayerItemConsumeEvent event = null; // Paper
if (this instanceof ServerPlayer) {
if (this instanceof ServerPlayer entityPlayer) {
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.useItem);
org.bukkit.inventory.EquipmentSlot hand = org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(enumhand);
- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem, hand);
@ -21,7 +21,7 @@ index ba194f42217f1176ac08123d3bb5cb24e1a6c119..e7b308ba4a253b270aebebd19e267151
this.level().getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -3875,6 +3876,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3878,6 +3879,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
} else {
itemstack = this.useItem.finishUsingItem(this.level(), this);
}
@ -34,7 +34,7 @@ index ba194f42217f1176ac08123d3bb5cb24e1a6c119..e7b308ba4a253b270aebebd19e267151
// CraftBukkit end
if (itemstack != this.useItem) {
@@ -3882,6 +3889,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3885,6 +3892,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.stopUsingItem();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Cache user authenticator threads
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 851e4bdf1739736fd193786a6541ffb341525dcb..6b490eb5b14cb2d3174aff79d1144c87665c7d38 100644
index b2f7c76207f2dc0c62f608f21aba4b531f8f523f..e65c582635317b9f8a1af4e6f6a5fb916f73cc35 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -71,6 +71,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -76,6 +76,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// CraftBukkit end
private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0);
static final Logger LOGGER = LogUtils.getLogger();
@ -16,7 +16,7 @@ index 851e4bdf1739736fd193786a6541ffb341525dcb..6b490eb5b14cb2d3174aff79d1144c87
private static final int MAX_TICKS_BEFORE_LOGIN = 600;
private final byte[] challenge;
final MinecraftServer server;
@@ -169,7 +170,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -174,7 +175,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge, true));
} else {
// CraftBukkit start
@ -26,7 +26,7 @@ index 851e4bdf1739736fd193786a6541ffb341525dcb..6b490eb5b14cb2d3174aff79d1144c87
@Override
public void run() {
@@ -184,10 +186,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -189,10 +191,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
ServerLoginPacketListenerImpl.this.server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.requestedUsername, ex);
}
}
@ -39,7 +39,7 @@ index 851e4bdf1739736fd193786a6541ffb341525dcb..6b490eb5b14cb2d3174aff79d1144c87
// CraftBukkit end
}
@@ -266,7 +266,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -271,7 +271,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
throw new IllegalStateException("Protocol error", cryptographyexception);
}
@ -49,7 +49,7 @@ index 851e4bdf1739736fd193786a6541ffb341525dcb..6b490eb5b14cb2d3174aff79d1144c87
public void run() {
String s1 = (String) Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized");
@@ -314,10 +315,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -319,10 +320,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
return ServerLoginPacketListenerImpl.this.server.getPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null;
}

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ff807bfe89708d9c680b84eda902b49f3167f3a4..eb12f17b58256489717a0462964b1cef5bc3624b 100644
index 20076b59ed7433cc280e2574a09e8db1d58eb027..67805fe23d91961b036089674e4f6202fad3c505 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2819,5 +2819,24 @@ public final class CraftServer implements Server {
@@ -2816,5 +2816,24 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] String based Action Bar API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c399264ccffe646be10b3f13ebe0c0103d97f62c..d471e9370fdbcbce5357e52e8ea2a10c196cd33d 100644
index cdcb2fb6229277872db36b6a4c439080f083f64c..258808bcb6f853c5679476305074823a7bb8b379 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -388,6 +388,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -390,6 +390,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper start

View file

@ -19,10 +19,10 @@ index 984dc7f7f7315b8a8cdb9744ef8454a330888ba7..f067b10e13f01e751fc4ebf088740c7d
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 8520f0f2b4b4e758b2e2fae206b7fd818a6fa14f..73d40f768b6882062656cba30acc5f86f26d1a96 100644
index 9bfdcdf427f7c0689d346d17942b5902a9138a4e..5f3b3f03936cfe23ed792c57d342a9932ea2e962 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -179,7 +179,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -184,7 +184,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
public final boolean isDisconnected() {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index eb12f17b58256489717a0462964b1cef5bc3624b..1fd2f6053e660674baa239f142a720d59e64c776 100644
index 67805fe23d91961b036089674e4f6202fad3c505..16110e41480ad4508e56c196c551debdf0e96811 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2838,5 +2838,10 @@ public final class CraftServer implements Server {
@@ -2835,5 +2835,10 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases();
return true;
}

View file

@ -63,10 +63,10 @@ index f720c5ef71edd65de76bcac9632173184576ea9e..c278caa030ceccec8e2721068848a34b
public static void clear() {
diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
index 94cae8f3c13d0afcbe97478fba34ff4f12f8c7ee..c49db689827b20ad211f06b9bad7062c8ef82c68 100644
index 56a71862eac5c45fde2e1d9e96e763d9dbf24cc4..0c250e5b0bd3232d829b0c028f237e6bf5fd334d 100644
--- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
+++ b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
@@ -136,7 +136,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
@@ -161,7 +161,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
@Override
public CompletableFuture<PlayerProfile> update() {

View file

@ -16,10 +16,10 @@ public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
new file mode 100644
index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980efd65eb9a1
index 0000000000000000000000000000000000000000..23181027bb077417655913c29377bed720c9e9c1
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
@@ -0,0 +1,422 @@
@@ -0,0 +1,449 @@
+package com.destroystokyo.paper.profile;
+
+import com.google.common.base.Preconditions;
@ -34,6 +34,7 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.players.GameProfileCache;
+import net.minecraft.util.StringUtil;
+import net.minecraft.world.item.component.ResolvableProfile;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.Validate;
+import org.bukkit.configuration.serialization.SerializableAs;
@ -52,6 +53,8 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+@SerializableAs("PlayerProfile")
+public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile {
+
+ private boolean emptyName;
+ private boolean emptyUUID;
+ private GameProfile profile;
+ private final PropertySet properties = new PropertySet();
+
@ -61,6 +64,8 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+
+ public CraftPlayerProfile(UUID id, String name) {
+ this.profile = createAuthLibProfile(id, name);
+ this.emptyName = name == null;
+ this.emptyUUID = id == null;
+ }
+
+ public CraftPlayerProfile(GameProfile profile) {
@ -68,6 +73,11 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ this.profile = profile;
+ }
+
+ public CraftPlayerProfile(ResolvableProfile resolvableProfile) {
+ this(resolvableProfile.id().orElse(null), resolvableProfile.name().orElse(null));
+ copyProfileProperties(resolvableProfile.gameProfile(), this.profile);
+ }
+
+ @Override
+ public boolean hasProperty(String property) {
+ return profile.getProperties().containsKey(property);
@ -106,7 +116,7 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ @Nullable
+ @Override
+ public UUID getId() {
+ return profile.getId().equals(Util.NIL_UUID) ? null : profile.getId();
+ return this.emptyUUID ? null : this.profile.getId();
+ }
+
+ @Override
@ -116,6 +126,7 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ final UUID previousId = this.getId();
+ this.profile = createAuthLibProfile(uuid, previousProfile.getName());
+ copyProfileProperties(previousProfile, this.profile);
+ this.emptyUUID = uuid == null;
+ return previousId;
+ }
+
@ -127,7 +138,7 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ @Nullable
+ @Override
+ public String getName() {
+ return profile.getName();
+ return this.emptyName ? null : this.profile.getName();
+ }
+
+ @Override
@ -136,6 +147,7 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ GameProfile prev = this.profile;
+ this.profile = createAuthLibProfile(prev.getId(), name);
+ copyProfileProperties(prev, this.profile);
+ this.emptyName = name == null;
+ return prev.getName();
+ }
+
@ -184,6 +196,15 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ }
+
+ @Override
+ public @NotNull ResolvableProfile buildResolvableProfile() {
+ if (this.emptyName || this.emptyUUID) {
+ return new ResolvableProfile(this.emptyName ? Optional.empty() : Optional.of(this.profile.getName()), this.emptyUUID ? Optional.empty() : Optional.of(this.profile.getId()), this.profile.getProperties());
+ } else {
+ return new ResolvableProfile(this.buildGameProfile());
+ }
+ }
+
+ @Override
+ public CraftPlayerProfile clone() {
+ CraftPlayerProfile clone = new CraftPlayerProfile(this.getId(), this.getName());
+ clone.setProperties(getProperties());
@ -251,6 +272,7 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ public boolean complete(boolean textures) {
+ return complete(textures, GlobalConfiguration.get().proxies.isProxyOnlineMode());
+ }
+
+ public boolean complete(boolean textures, boolean onlineMode) {
+ if (this.isComplete() && (!textures || hasTextures())) { // Don't do lookup if we already have everything
+ return true;
@ -328,6 +350,10 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ return craft.getGameProfile();
+ }
+
+ public static ResolvableProfile asResolvableProfileCopy(PlayerProfile profile) {
+ return ((SharedPlayerProfile) profile).buildResolvableProfile();
+ }
+
+ @Override
+ public @NotNull Map<String, Object> serialize() {
+ Map<String, Object> map = new LinkedHashMap<>();
@ -368,10 +394,16 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) return true;
+ if (!(obj instanceof CraftPlayerProfile otherProfile)) return false;
+ return Objects.equals(this.profile, otherProfile.profile);
+ public boolean equals(final Object o) {
+ if (this == o) return true;
+ if (o == null || this.getClass() != o.getClass()) return false;
+ final CraftPlayerProfile that = (CraftPlayerProfile) o;
+ return this.emptyName == that.emptyName && this.emptyUUID == that.emptyUUID && Objects.equals(this.profile, that.profile);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(this.emptyName, this.emptyUUID, this.profile);
+ }
+
+ @Override
@ -382,11 +414,6 @@ index 0000000000000000000000000000000000000000..cbe2789f8a055550dd7840a7bed980ef
+ "]";
+ }
+
+ @Override
+ public int hashCode() {
+ return this.profile.hashCode();
+ }
+
+ private class PropertySet extends AbstractSet<ProfileProperty> {
+
+ @Override
@ -531,14 +558,15 @@ index 0000000000000000000000000000000000000000..985e6fc43a0946943847e0c283426242
+}
diff --git a/src/main/java/com/destroystokyo/paper/profile/SharedPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/SharedPlayerProfile.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ac27392a8647ef7d0dc78efe78703e993885017
index 0000000000000000000000000000000000000000..332700f84c5587e47a4d2056bfbb5413de97e9f2
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/SharedPlayerProfile.java
@@ -0,0 +1,23 @@
@@ -0,0 +1,26 @@
+package com.destroystokyo.paper.profile;
+
+import com.mojang.authlib.GameProfile;
+import com.mojang.authlib.properties.Property;
+import net.minecraft.world.item.component.ResolvableProfile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@ -557,6 +585,8 @@ index 0000000000000000000000000000000000000000..7ac27392a8647ef7d0dc78efe78703e9
+ @Nullable void setProperty(@NotNull String propertyName, @Nullable Property property);
+
+ @NotNull GameProfile buildGameProfile();
+
+ @NotNull ResolvableProfile buildResolvableProfile();
+}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 6afede80c10503a261d0f735c351d943597be9ff..993296f9c2457809bd6b844c309895f417eb42a5 100644
@ -594,7 +624,7 @@ index 416b26c2ab62b29d640169166980e398d5824b14..774d81c702edb76a2f6184d4dc53687d
String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1fd2f6053e660674baa239f142a720d59e64c776..5ab2836f14e1a7482e7136004507d66c4abb4bdd 100644
index 16110e41480ad4508e56c196c551debdf0e96811..c5618c1a773442c9c016b67ea64d83f8efcb3b89 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -262,6 +262,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
@ -615,7 +645,7 @@ index 1fd2f6053e660674baa239f142a720d59e64c776..5ab2836f14e1a7482e7136004507d66c
CraftItemFactory.instance();
CraftEntityFactory.instance();
}
@@ -2843,5 +2847,39 @@ public final class CraftServer implements Server {
@@ -2840,5 +2844,39 @@ public final class CraftServer implements Server {
public boolean suggestPlayerNamesWhenNullTabCompletions() {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}
@ -656,11 +686,11 @@ index 1fd2f6053e660674baa239f142a720d59e64c776..5ab2836f14e1a7482e7136004507d66c
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
index c49db689827b20ad211f06b9bad7062c8ef82c68..ce30a8853d5095ce5bf1ec902b41d27db9e35b4f 100644
index 210fdad5f2041368fc359b275f1cbf05b70b6989..d9cc76d7e60001957c0f59fdc32d016f3589aa08 100644
--- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
+++ b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
@@ -28,7 +28,7 @@ import org.bukkit.profile.PlayerProfile;
import org.bukkit.profile.PlayerTextures;
@@ -31,7 +31,7 @@ import org.bukkit.profile.PlayerTextures;
import org.jetbrains.annotations.ApiStatus;
@SerializableAs("PlayerProfile")
-public final class CraftPlayerProfile implements PlayerProfile {
@ -668,7 +698,7 @@ index c49db689827b20ad211f06b9bad7062c8ef82c68..ce30a8853d5095ce5bf1ec902b41d27d
@Nonnull
public static GameProfile validateSkullProfile(@Nonnull GameProfile gameProfile) {
@@ -107,8 +107,10 @@ public final class CraftPlayerProfile implements PlayerProfile {
@@ -132,8 +132,10 @@ public final class CraftPlayerProfile implements PlayerProfile {
}
}
@ -681,16 +711,16 @@ index c49db689827b20ad211f06b9bad7062c8ef82c68..ce30a8853d5095ce5bf1ec902b41d27d
}
void rebuildDirtyProperties() {
@@ -251,6 +253,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
@@ -283,6 +285,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
@Override
public Map<String, Object> serialize() {
+ // Paper - diff on change
Map<String, Object> map = new LinkedHashMap<>();
if (this.getUniqueId() != null) {
map.put("uniqueId", this.getUniqueId().toString());
@@ -266,10 +269,12 @@ public final class CraftPlayerProfile implements PlayerProfile {
});
if (this.uniqueId != null) {
map.put("uniqueId", this.uniqueId.toString());
@@ -296,10 +299,12 @@ public final class CraftPlayerProfile implements PlayerProfile {
this.properties.forEach((propertyName, property) -> propertiesData.add(CraftProfileProperty.serialize(property)));
map.put("properties", propertiesData);
}
+ // Paper - diff on change
@ -702,7 +732,7 @@ index c49db689827b20ad211f06b9bad7062c8ef82c68..ce30a8853d5095ce5bf1ec902b41d27d
UUID uniqueId = ConfigSerializationUtil.getUuid(map, "uniqueId", true);
String name = ConfigSerializationUtil.getString(map, "name", true);
@@ -283,7 +288,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
@@ -313,7 +318,7 @@ public final class CraftPlayerProfile implements PlayerProfile {
profile.properties.put(property.name(), property);
}
}

View file

@ -59,10 +59,10 @@ index 7995a4626b3ed68234d468418408b9a8e179b6f6..362d75522aaa721e9fb1d12a149d0efe
@Override
public abstract boolean isSpectator();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 0c94a1094a3af0232bb2957708fa997933db621b..9574d5e0ee9109155f16861d0c46e45ef4c1d1a8 100644
index a93895a6e656c25e819354ecf5c73ff4bae83675..f0efea03165039525a98dc30c34d876972d9fe71 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -512,6 +512,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -520,6 +520,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
this.getHandle().getCooldowns().addCooldown(CraftItemType.bukkitToMinecraft(material), ticks);
}

View file

@ -5,10 +5,10 @@ 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
index 6b490eb5b14cb2d3174aff79d1144c87665c7d38..556a7d082f0c33606a0231aa1b52d0c12d57035c 100644
index e65c582635317b9f8a1af4e6f6a5fb916f73cc35..0c2137dda44f2341bffe0928dc77be8ca6371bc9 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -97,6 +97,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -102,6 +102,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void tick() {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 556a7d082f0c33606a0231aa1b52d0c12d57035c..d1a05c93ba7b9d1cb3427a4a90346b4364784846 100644
index 0c2137dda44f2341bffe0928dc77be8ca6371bc9..0d995abe33f41b96823d3e5a51e33f3dcb11d564 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -303,7 +303,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -308,7 +308,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
ServerLoginPacketListenerImpl.LOGGER.warn("Authentication servers are down but will let them in anyway!");
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(s1)); // Spigot
} else {

View file

@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 73d40f768b6882062656cba30acc5f86f26d1a96..07d2e60bcd7d1f3ba2f8005ec496561b3648ae86 100644
index 5f3b3f03936cfe23ed792c57d342a9932ea2e962..5e5e669f564c6130d1dea004ae8810939954da98 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -117,14 +117,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -122,14 +122,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

View file

@ -90,10 +90,10 @@ index 7ae4279768b70a4fdc8f4438898871a17c8fe402..582bbb376c75ab5bf737f3015ce8ad45
private void beginLogin(ClientIntentionPacket packet, boolean transfer) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d471e9370fdbcbce5357e52e8ea2a10c196cd33d..f53504221e660bfe86220a8cc1ae28750794f0cf 100644
index 258808bcb6f853c5679476305074823a7bb8b379..d099b898208392f380eb9ccd49bf84d54c194e67 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -334,6 +334,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -336,6 +336,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().transferCookieConnection.sendPacket(new ClientboundTransferPacket(host, port));
}

View file

@ -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.
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 07d2e60bcd7d1f3ba2f8005ec496561b3648ae86..382920335337c8d0abd8b1f600fddd391249fe21 100644
index 5e5e669f564c6130d1dea004ae8810939954da98..9b1df397e1d2d8ca04b34012808be2110526f401 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -69,7 +69,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -74,7 +74,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
protected final MinecraftServer server;
public final Connection connection; // Paper
private final boolean transferred;
@ -29,7 +29,7 @@ index 07d2e60bcd7d1f3ba2f8005ec496561b3648ae86..382920335337c8d0abd8b1f600fddd39
private boolean keepAlivePending;
private long keepAliveChallenge;
private long closedListenerTime;
@@ -77,6 +77,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -82,6 +82,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private int latency;
private volatile boolean suspendFlushingOnServerThread = false;
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
@ -37,7 +37,7 @@ index 07d2e60bcd7d1f3ba2f8005ec496561b3648ae86..382920335337c8d0abd8b1f600fddd39
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver;
@@ -227,18 +228,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -232,18 +233,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
protected void keepConnectionAlive() {
this.server.getProfiler().push("keepAlive");

View file

@ -6,10 +6,10 @@ 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
index d1a05c93ba7b9d1cb3427a4a90346b4364784846..3bcce44fd8f7964a2f9b0d9c778b995975a8c049 100644
index 0d995abe33f41b96823d3e5a51e33f3dcb11d564..bfda68254b39f301ba2d3d70beeb35317d262c43 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -104,7 +104,9 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -109,7 +109,9 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
}
// Paper end - Do not allow logins while the server is shutting down
if (this.state == ServerLoginPacketListenerImpl.State.VERIFYING) {

View file

@ -69,7 +69,7 @@ index a1c1a101aa424e74309f6f4c0a53a6a8db5df441..013298c424025cd88f15d61e50d196f7
public Biome getBiome() {
return this.getWorld().getBiome(this.getX(), this.getY(), this.getZ());
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
index f8b5595dc92036cc1889c0835f69389c93501fa7..a7bb7d263cb981fcf6dd35a3b32270e89e96945a 100644
index 9df2da091082071e3461b8900af4879e80cd4d93..1ca25dfdb9ec5c3a4d26b71484e1326e1f50b40d 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
@@ -24,15 +24,26 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
@ -101,7 +101,7 @@ index f8b5595dc92036cc1889c0835f69389c93501fa7..a7bb7d263cb981fcf6dd35a3b32270e8
}
protected CraftBlockEntityState(CraftBlockEntityState<T> state, Location location) {
@@ -169,4 +180,11 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
@@ -176,4 +187,11 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
public CraftBlockEntityState<T> copy(Location location) {
return new CraftBlockEntityState<>(this, location);
}

View file

@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
index 08838e17979b59555adc242ccdd7af7cbf11f9d6..23374a104510025fd8f882361a29825d0bec6ee0 100644
index 95045d09a3581816770a195db87086c616b843a7..bae6f6132189fc82ec56f0fedee3518a143ed883 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java
@@ -98,7 +98,22 @@ public class CraftSkull extends CraftBlockEntityState<SkullBlockEntity> implemen
@ -18,13 +18,13 @@ index 08838e17979b59555adc242ccdd7af7cbf11f9d6..23374a104510025fd8f882361a29825d
@Override
+ public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) {
+ Preconditions.checkNotNull(profile, "profile");
+ this.profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile);
+ this.profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asResolvableProfileCopy(profile);
+ }
+
+ @javax.annotation.Nullable
+ @Override
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return profile != null ? com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile) : null;
+ return profile != null ? new com.destroystokyo.paper.profile.CraftPlayerProfile(profile) : null;
+ }
+ // Paper end
+
@ -42,36 +42,36 @@ index 08838e17979b59555adc242ccdd7af7cbf11f9d6..23374a104510025fd8f882361a29825d
if (profile == null) {
this.profile = null;
} else {
- this.profile = CraftPlayerProfile.validateSkullProfile(((CraftPlayerProfile) profile).buildGameProfile());
+ this.profile = CraftPlayerProfile.validateSkullProfile(((com.destroystokyo.paper.profile.SharedPlayerProfile) profile).buildGameProfile()); // Paper
- this.profile = new ResolvableProfile(CraftPlayerProfile.validateSkullProfile(((CraftPlayerProfile) profile).buildGameProfile()));
+ this.profile = CraftPlayerProfile.validateSkullProfile(((com.destroystokyo.paper.profile.SharedPlayerProfile) profile).buildResolvableProfile()); // Paper
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
index a36fcd9bfcbd2b37d7cf40b32abc0aea2761ce15..d6e161374e0235031128a6ee86d1ffa875ea48aa 100644
index 7181d81c231908f208b48a29f918136cb143f476..ca714e165e453d1072d083441d8b985290ada75a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
@@ -153,6 +153,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
return this.hasOwner() ? this.profile.getName() : null;
@@ -148,6 +148,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
return this.hasOwner() ? this.profile.name().orElse(null) : null;
}
+ // Paper start
+ @Override
+ public void setPlayerProfile(@org.jetbrains.annotations.Nullable com.destroystokyo.paper.profile.PlayerProfile profile) {
+ setProfile((profile == null) ? null : com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile));
+ setProfile((profile == null) ? null : com.destroystokyo.paper.profile.CraftPlayerProfile.asResolvableProfileCopy(profile));
+ }
+
+ @org.jetbrains.annotations.Nullable
+ @Override
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return profile != null ? com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(profile) : null;
+ return profile != null ? new com.destroystokyo.paper.profile.CraftPlayerProfile(profile) : null;
+ }
+ // Paper end
+
@Override
public OfflinePlayer getOwningPlayer() {
if (this.hasOwner()) {
@@ -203,6 +216,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -198,6 +211,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
}
@Override
@ -79,24 +79,23 @@ index a36fcd9bfcbd2b37d7cf40b32abc0aea2761ce15..d6e161374e0235031128a6ee86d1ffa8
public PlayerProfile getOwnerProfile() {
if (!this.hasOwner()) {
return null;
@@ -212,11 +226,12 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -207,9 +221,10 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
}
@Override
+ @Deprecated // Paper
public void setOwnerProfile(PlayerProfile profile) {
if (profile == null) {
this.setProfile(null);
- if (profile instanceof CraftPlayerProfile craftPlayerProfile) {
- this.setProfile(CraftPlayerProfile.validateSkullProfile(craftPlayerProfile.buildResolvableProfile()));
+ if (profile instanceof final com.destroystokyo.paper.profile.SharedPlayerProfile sharedProfile) {
+ this.setProfile(CraftPlayerProfile.validateSkullProfile(sharedProfile.buildResolvableProfile())); // Paper
} else {
- this.setProfile(CraftPlayerProfile.validateSkullProfile(((CraftPlayerProfile) profile).buildGameProfile()));
+ this.setProfile(CraftPlayerProfile.validateSkullProfile(((com.destroystokyo.paper.profile.SharedPlayerProfile) profile).buildGameProfile())); // Paper
this.setProfile(null);
}
}
@@ -271,7 +286,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
@@ -263,7 +278,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
super.serialize(builder);
if (this.profile != null) {
if (this.hasOwner()) {
- builder.put(CraftMetaSkull.SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
+ builder.put(CraftMetaSkull.SKULL_OWNER.BUKKIT, new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile)); // Paper
}

View file

@ -7,10 +7,10 @@ Co-authored-by: Connor Linfoot <connorlinfoot@me.com>
Co-authored-by: MCMDEV <john-m.1@gmx.de>
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 3bcce44fd8f7964a2f9b0d9c778b995975a8c049..2d9db1ac80216a509a7590254e422b3c4792e3ec 100644
index bfda68254b39f301ba2d3d70beeb35317d262c43..30e55f693b963496b85afa32da9c15cacb738836 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -186,7 +186,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -191,7 +191,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
try {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.createOfflineProfile(ServerLoginPacketListenerImpl.this.requestedUsername); // Spigot
@ -19,7 +19,7 @@ index 3bcce44fd8f7964a2f9b0d9c778b995975a8c049..2d9db1ac80216a509a7590254e422b3c
ServerLoginPacketListenerImpl.LOGGER.info("UUID of player {} is {}", gameprofile.getName(), gameprofile.getId());
ServerLoginPacketListenerImpl.this.startClientVerification(gameprofile);
} catch (Exception ex) {
@@ -289,7 +289,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -294,7 +294,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
if (!ServerLoginPacketListenerImpl.this.connection.isConnected()) {
return;
}
@ -28,7 +28,7 @@ index 3bcce44fd8f7964a2f9b0d9c778b995975a8c049..2d9db1ac80216a509a7590254e422b3c
// CraftBukkit end
ServerLoginPacketListenerImpl.LOGGER.info("UUID of player {} is {}", gameprofile.getName(), gameprofile.getId());
ServerLoginPacketListenerImpl.this.startClientVerification(gameprofile);
@@ -328,14 +328,23 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -333,14 +333,23 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
}
// CraftBukkit start
@ -54,7 +54,7 @@ index 3bcce44fd8f7964a2f9b0d9c778b995975a8c049..2d9db1ac80216a509a7590254e422b3c
if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);
@@ -353,14 +362,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -358,14 +367,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable);
if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) {
this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.kickMessage())); // Paper - Adventure

View file

@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in.
public-f net.minecraft.world.entity.player.Player gameProfile
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ec80a9138260497d0deccf3ade3f44fc849de1d5..72edfb965aca81c2d2442b794b42baa04ec713b3 100644
index 6cdbd0281e38d7107f239e6e052c08e4ab12b552..0073c6c5433be3193a01257a26c7035e544f37dd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1472,7 +1472,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@ -22,10 +22,10 @@ index ec80a9138260497d0deccf3ade3f44fc849de1d5..72edfb965aca81c2d2442b794b42baa0
if (Float.isNaN(f)) {
f = 0;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 2d9db1ac80216a509a7590254e422b3c4792e3ec..b31f00f2f0b7cec59301afe36c9dd7cdc120fc9d 100644
index 30e55f693b963496b85afa32da9c15cacb738836..636b8aef2348fa4cfe63a9b7d77a64b14dc7a42c 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -336,11 +336,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -341,11 +341,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// Paper start - Add more fields to AsyncPlayerPreLoginEvent
final InetAddress rawAddress = ((InetSocketAddress) this.connection.channel.remoteAddress()).getAddress();
@ -62,7 +62,7 @@ index 768a5c6ebc4466aae4108a79e1564b2bfc93463a..26cee48ea3650aaf87fd2ba9c70d4ca9
public void tick() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
index 818df09e9245b5d89b4180b1eaa51470b7539341..461656e1cb095243bfe7a9ee2906e5b00574ae78 100644
index 818df09e9245b5d89b4180b1eaa51470b7539341..f6b2ca92fd3510a76cbf56d0ea55aa6caaf12ba1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
@@ -82,8 +82,8 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
@ -72,12 +72,12 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..461656e1cb095243bfe7a9ee2906e5b0
- public PlayerProfile getPlayerProfile() {
- return new CraftPlayerProfile(this.profile);
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { // Paper
+ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this.profile); // Paper
+ return com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitCopy(this.profile); // Paper
}
public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4602c3d0be94f0146a2b205268f70aaf85410f20..422c25577a0d95b31b5528fad8fc9b3ae97fa7f0 100644
index 8521f728088d16ecbaa0119983a9f12a649ac847..9136feac48244dc68bff92b52643f2adefba5205 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -249,11 +249,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 9574d5e0ee9109155f16861d0c46e45ef4c1d1a8..2e02fc22a889c9c8010ae8bff1b59a13219ae014 100644
index f0efea03165039525a98dc30c34d876972d9fe71..e59fee587c2d90df5a6aa7a3df0eefc0cb5165ac 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -622,6 +622,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -630,6 +630,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
}
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 21d00a73ad8287d61eda1ab91b88ea3264aff021..cccc60602360f25f0aeddbd16dad2bb63a1728a8 100644
index 7a7c404778757e6778305c9f8334a4fba1f466a6..d58439f85f4d3a9b863ecadb3b42b2ee3270a772 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3966,12 +3966,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3969,12 +3969,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.isUsingItem() && !this.useItem.isEmpty()) {
Item item = this.useItem.getItem();
@ -35,10 +35,10 @@ index 21d00a73ad8287d61eda1ab91b88ea3264aff021..cccc60602360f25f0aeddbd16dad2bb6
return this.isShiftKeyDown();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index fe631496aa551a0029eff7b4d4a5daf16dddac50..bb81e0bfe0692e8f8421758cd21c003978853a08 100644
index 475fcc2d1d61a94b81dc839ba0240f317afcfe56..5ca07b2cdc30f23632a23249c615ac9a8c7c96c7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -842,5 +842,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -847,5 +847,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setArrowsStuck(final int arrows) {
this.getHandle().setArrowCount(arrows);
}

View file

@ -13,10 +13,10 @@ public net/minecraft/server/level/ServerPlayer completeUsingItem()V
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index bb81e0bfe0692e8f8421758cd21c003978853a08..e77380686b9f0c5695be36b3e16e11b2646ac00a 100644
index 5ca07b2cdc30f23632a23249c615ac9a8c7c96c7..4f0f21bb1f2d37a798065b7c5e0b2a77a8122823 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -853,4 +853,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -858,4 +858,53 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
getHandle().setShieldBlockingDelay(delay);
}
// Paper end

View file

@ -136,10 +136,10 @@ index 1b13096da1f0bc49efe25677ec24e6abe7ff2879..b70fbc1a93271bbf28402afbe9c6e538
this.containerMenu = this.inventoryMenu;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 2e02fc22a889c9c8010ae8bff1b59a13219ae014..703bb1bb42b1668c04824489fd2f349052025979 100644
index e59fee587c2d90df5a6aa7a3df0eefc0cb5165ac..ee7cf7f1d491ffdf26c3f156d299e2f517a05608 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -378,7 +378,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -386,7 +386,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (((ServerPlayer) this.getHandle()).connection == null) return;
if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) {
// fire INVENTORY_CLOSE if one already open
@ -148,7 +148,7 @@ index 2e02fc22a889c9c8010ae8bff1b59a13219ae014..703bb1bb42b1668c04824489fd2f3490
}
ServerPlayer player = (ServerPlayer) this.getHandle();
AbstractContainerMenu container;
@@ -448,8 +448,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -456,8 +456,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public void closeInventory() {
@ -165,7 +165,7 @@ index 2e02fc22a889c9c8010ae8bff1b59a13219ae014..703bb1bb42b1668c04824489fd2f3490
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4e5dba1da323f12d77a36635c9227b1239856254..12c61db6d4b1284765f9bed3ae26131a118b318e 100644
index 18bcc27d07d7ab4b57148521891670ab61d6432c..35addb8d7620eeeede31c4831983a2c8bfb23ef5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1273,7 +1273,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -178,7 +178,7 @@ index 4e5dba1da323f12d77a36635c9227b1239856254..12c61db6d4b1284765f9bed3ae26131a
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 3059a21b554db99af96c76f72dd08591c00e3e08..9b6607700ed23b97755a2171a49b22d498a60626 100644
index 7b1f55d02c2c1f3598b7b67c4c3d26c11c7450ae..889a2094850e6c5bda1efeac2e26bf77a007f4f3 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1283,7 +1283,7 @@ public class CraftEventFactory {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ada79af49d1cafe25ca6c1fb456e1c4c3a42cb73..39dff0a38b53624c935f27cc86ff036c831f407f 100644
index d90e74b7323a60e781d942baffe9b4bdb8ae2943..08f756b4fbb4732d73ca281b7006024b21504880 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3977,6 +3977,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3980,6 +3980,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
// Paper start - Make shield blocking delay configurable
@ -29,7 +29,7 @@ index ada79af49d1cafe25ca6c1fb456e1c4c3a42cb73..39dff0a38b53624c935f27cc86ff036c
public int getShieldBlockingDelay() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index e77380686b9f0c5695be36b3e16e11b2646ac00a..f58c9edd68b02bbca10897320fae63cee1562fe3 100644
index 4f0f21bb1f2d37a798065b7c5e0b2a77a8122823..aa5b67c704a1ae95f4b6e01696c1489c07625d16 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -201,6 +201,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index bdee5725029eda3a0e7bee407286480c0bb47db1..689aaf4ceedc598fe71db726215cceae6cc97296 100644
index 64aa52c2d1fe50d304d75ebb197e8a834016c3cf..7bc0a66602d77902d83d6ca515da48e3453de900 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -127,6 +127,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
@ -16,7 +16,7 @@ index bdee5725029eda3a0e7bee407286480c0bb47db1..689aaf4ceedc598fe71db726215cceae
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.PlayerTeam;
@@ -4041,6 +4042,38 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -4044,6 +4045,38 @@ public abstract class LivingEntity extends Entity implements Attackable {
return this.level().clip(raytrace);
}
@ -56,7 +56,7 @@ index bdee5725029eda3a0e7bee407286480c0bb47db1..689aaf4ceedc598fe71db726215cceae
public int getShieldBlockingDelay() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index f58c9edd68b02bbca10897320fae63cee1562fe3..9a159f0c7489d2924dabe3fd250d844899ae5761 100644
index aa5b67c704a1ae95f4b6e01696c1489c07625d16..97e76c3701c5e58ff5c8cd0f243efd7998f1c93d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1,5 +1,6 @@

View file

@ -161,7 +161,7 @@ index 0000000000000000000000000000000000000000..224d4b2cc45b0d02230a76caee9c8857
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index 867091ff253541ec45b6ae7f1fb3acc83a5c4966..10a5b1853d3984427209c87bdec1d471dddb1244 100644
index 1a2329021a6b29777c637ee4dc8cd69ed18001c9..674e3a827f8fb64e5c0beefb3c1874d6e8aee4e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
@@ -49,7 +49,7 @@ public class CraftContainer extends AbstractContainerMenu {
@ -182,7 +182,7 @@ index 867091ff253541ec45b6ae7f1fb3acc83a5c4966..10a5b1853d3984427209c87bdec1d471
}
// Paper end
@@ -252,6 +252,10 @@ public class CraftContainer extends AbstractContainerMenu {
@@ -214,6 +214,10 @@ public class CraftContainer extends AbstractContainerMenu {
this.lastSlots = this.delegate.lastSlots;
this.slots = this.delegate.slots;
this.remoteSlots = this.delegate.remoteSlots;

View file

@ -18,10 +18,10 @@ index 5b070d158760789bbcaa984426a55d20767abe4a..e1820a339452cd3388dd7cbb928c5f58
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a4e969a82eabc5ffdb776d1574f5b003fc19b177..f727b7882a86b1e3f736816634ab4b61f69d1dff 100644
index ffe53ca530da2b2a1b28c7ee59a7f5599949a0a1..6b63938514977f8fdfb019d55f8da28718f4cf1c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2875,6 +2875,16 @@ public final class CraftServer implements Server {
@@ -2872,6 +2872,16 @@ public final class CraftServer implements Server {
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
}

View file

@ -69,10 +69,10 @@ index c45b8b2c89ffec7bd6a6875963c61f11185d3ee1..38947f40864f3661df2eb4baa0aef574
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index b31f00f2f0b7cec59301afe36c9dd7cdc120fc9d..53b1fd2d1328bde3fe195964ce39ff5c0f5a7c05 100644
index 636b8aef2348fa4cfe63a9b7d77a64b14dc7a42c..de25b9ea8aa4b7d6fd3fed12cdd16be9ddfcbfff 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -81,7 +81,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -86,7 +86,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Nullable
String requestedUsername;
@Nullable

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 382920335337c8d0abd8b1f600fddd391249fe21..2d1fad00ee084841618f0da8113c7aac8c0e2b0d 100644
index 9b1df397e1d2d8ca04b34012808be2110526f401..4f62abfe62c951b7a1df36ece34747100d6a4ff7 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -366,7 +366,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -371,7 +371,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
Objects.requireNonNull(this.connection);
// CraftBukkit - Don't wait

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f727b7882a86b1e3f736816634ab4b61f69d1dff..285bdabc7cb231d95e2a55684fbcfc81ed794117 100644
index 6b63938514977f8fdfb019d55f8da28718f4cf1c..ae4e3c137498ff390c8cae7315c7ebfe125efc35 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2918,5 +2918,10 @@ public final class CraftServer implements Server {
@@ -2915,5 +2915,10 @@ public final class CraftServer implements Server {
profile.getGameProfile().getProperties().putAll(((CraftPlayer) player).getHandle().getGameProfile().getProperties());
return profile;
}

View file

@ -25,18 +25,15 @@ P3) Solutions for 1) and especially 2) might not be future-proof, while this
server-internal fix makes this change future-proof.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 30eb86b52f00cfa61af4f93aca50ffc3547c95e8..19452d1e591afc06675d57bbebae963517ab7217 100644
index 30eb86b52f00cfa61af4f93aca50ffc3547c95e8..d27e17ebf25cd842a943cf82bde05b2248c74414 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -182,8 +182,14 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@@ -182,8 +182,11 @@ public abstract class Projectile extends Entity implements TraceableEntity {
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
Vec3 vec3d = shooter.getKnownMovement();
-
+ // Paper start - allow disabling relative velocity
+ if (vec3d.lengthSqr() > 4D * 4D) {
+ vec3d = vec3d.normalize().scale(2D);
+ }
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) {
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z));
+ }

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent consuming the wrong itemstack
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index fad0445628499ac14cd9d8ab7f618c490885e798..6bec55f685dddc4d6e541f1edf3b5c4f756f8b33 100644
index a23baa42fd3bb09f619fd6528a8a4f97d189cde6..8ee6d25c3860fe7f2e5039c74c736d82eefda237 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3855,9 +3855,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -32,7 +32,7 @@ index fad0445628499ac14cd9d8ab7f618c490885e798..6bec55f685dddc4d6e541f1edf3b5c4f
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@@ -3976,8 +3982,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3979,8 +3985,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.stopUsingItem();

View file

@ -7,7 +7,7 @@ Subject: [PATCH] Entity Jump API
public net.minecraft.world.entity.LivingEntity jumping
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6bec55f685dddc4d6e541f1edf3b5c4f756f8b33..bfa914857ff36d6c2f5f96a1ddbc4ca96c3ee7ac 100644
index 8ee6d25c3860fe7f2e5039c74c736d82eefda237..4c32b26e29ca3db0a2f62052e14bcc3e4c1cdea5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3433,8 +3433,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
@ -50,10 +50,10 @@ index 4d91bc4b90a208fec789325dbcec8cc56d1a2a8b..aa4111eef22546f8aa630228c51ef576
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 9a159f0c7489d2924dabe3fd250d844899ae5761..94f2b0fa94ebc2572c33623fa5883dd7ed56c55a 100644
index 97e76c3701c5e58ff5c8cd0f243efd7998f1c93d..b6238c327e91a52b77135290762feb8b1085fc7e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -963,4 +963,20 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -968,4 +968,20 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(this.getHandle().getUsedItemHand());
}
// Paper end - active item API

View file

@ -184,10 +184,10 @@ index 3ffb330a16797c04694f73b0cd9f5b38a07641b4..ff73167bfe210305491e35f18adc2755
+ // Paper end - Add tick times API and /mspt command
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 285bdabc7cb231d95e2a55684fbcfc81ed794117..3f8076d077844e272e544a600f8f63611674ac62 100644
index ae4e3c137498ff390c8cae7315c7ebfe125efc35..55b11cb574d1fd634b4f445a0605249a296c6779 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2689,6 +2689,16 @@ public final class CraftServer implements Server {
@@ -2686,6 +2686,16 @@ public final class CraftServer implements Server {
return CraftMagicNumbers.INSTANCE;
}

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3f8076d077844e272e544a600f8f63611674ac62..7b0f0777dd20c5fd1813fabf8d34bc99659be9d2 100644
index 55b11cb574d1fd634b4f445a0605249a296c6779..01415a1523a783d8581e463dcea4f96ff8d0807e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2933,5 +2933,10 @@ public final class CraftServer implements Server {
@@ -2930,5 +2930,10 @@ public final class CraftServer implements Server {
public int getCurrentTick() {
return net.minecraft.server.MinecraftServer.currentTick;
}

View file

@ -27,10 +27,10 @@ index f8d4bd18f98ed914e116d0cc4a80140e4e8d759f..7daa310dd5d3eb1befb9983ce85e0354
this.initMenu(container);
return OptionalInt.of(this.containerCounter);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 703bb1bb42b1668c04824489fd2f349052025979..b55919a0e61a36697c95599dba17dbe2b788fd2a 100644
index ee7cf7f1d491ffdf26c3f156d299e2f517a05608..ba63c58d40cb3b8655fdb8177c423c67ac7cc3ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -326,7 +326,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -334,7 +334,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(container.getBukkitView().getTitle()); // Paper
//player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment
@ -39,7 +39,7 @@ index 703bb1bb42b1668c04824489fd2f349052025979..b55919a0e61a36697c95599dba17dbe2
player.containerMenu = container;
player.initMenu(container);
}
@@ -401,7 +401,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -409,7 +409,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
net.kyori.adventure.text.Component adventure$title = inventory.title(); // Paper
if (adventure$title == null) adventure$title = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(inventory.getTitle()); // Paper
//player.connection.send(new ClientboundOpenScreenPacket(container.containerId, windowType, CraftChatMessage.fromString(title)[0])); // Paper - comment

View file

@ -780,10 +780,10 @@ index 6667ecc4b7eded4e20a415cef1e1b1179e6710b8..16f9a98b8a939e5ca7e2dc04f87134a7
LOOK,
JUMP,
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9699d15f1194af7a565504cbae5aa9e3743665ec..0b87d9c3fb7e2442798faacdd49d3fd368e64b7d 100644
index 6ea6e3280015a31a1679a874ca63c90be8252a86..48c3d926682dd72ba476b4afc9e44e0113af0b46 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2939,5 +2939,11 @@ public final class CraftServer implements Server {
@@ -2936,5 +2936,11 @@ public final class CraftServer implements Server {
public boolean isStopping() {
return net.minecraft.server.MinecraftServer.getServer().hasStopped();
}

View file

@ -17,10 +17,10 @@ index e6e7dc17d1196a8211a565355f34b5dcfd478852..45181bc9c422507682d479e4d43177ec
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90b479e34f 100644
index 4f62abfe62c951b7a1df36ece34747100d6a4ff7..48085b2e7197dc44e76b812bdd514af729e21e83 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -78,6 +78,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -83,6 +83,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private volatile boolean suspendFlushingOnServerThread = false;
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
@ -28,7 +28,7 @@ index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90
public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver;
@@ -143,6 +144,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -148,6 +149,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
@ -40,7 +40,7 @@ index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90
if (!(packet.payload() instanceof DiscardedPayload)) {
return;
}
@@ -174,6 +180,15 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -179,6 +185,15 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
try {
byte[] data = new byte[payload.readableBytes()];
payload.readBytes(data);
@ -57,7 +57,7 @@ index 2d1fad00ee084841618f0da8113c7aac8c0e2b0d..a3c67bdc2c08b3550534f37d15b0db90
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b9487ce9391413c4c596cc5450ed5c396347ec1b..12e38fcbd3a3bcf102244a2b246c090c57ef327b 100644
index 068ff2c228308ec87fcc6d1352bd63b91bd34a93..854533854dfba24b59a15265ac759331e3ddfc74 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3139,6 +3139,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add playPickupItemAnimation to LivingEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 9cf3e1e20799caf4ba469ef6d5d86bfe176641f7..344ef786330d1247fdfb56ef04be130c9ffb7d8f 100644
index b1c4970920ca8972f637c846106ae37822e495cf..cf17328aef60e5c6a0d168d2ed4d181cf47ee0b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -979,4 +979,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -984,4 +984,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
}
// Paper end - entity jump API

View file

@ -29,10 +29,10 @@ index 946b423d2184f903dc29c923d7dbe05aaa469c09..0c1bdf2329936ce479a2cc53e8a46bd2
this.connection.disconnect((Component) ichatmutablecomponent);
} else {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 53b1fd2d1328bde3fe195964ce39ff5c0f5a7c05..baedae23865ea80c6546d1f6f439e1d7712258b9 100644
index de25b9ea8aa4b7d6fd3fed12cdd16be9ddfcbfff..d2d153e587e624025ef01fbe3dcfa4bf06f1a06b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -128,7 +128,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -133,7 +133,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// CraftBukkit start
@Deprecated
public void disconnect(String s) {

View file

@ -7,10 +7,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity
public net/minecraft/world/level/block/state/BlockBehaviour getMenuProvider(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/MenuProvider;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 084938fa2ffa7ee462766bf03f8e2b4c0fd4bf6b..8f4c4fed41676157b717c20a5ccbfe6ad4bdb3c4 100644
index c17dd4205983855615289cf0a5619056d237f325..6cda13df52ee4d56dd1d3c213307bfd38175584c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -463,6 +463,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -471,6 +471,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
return this.getHandle().containerMenu.getBukkitView();
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Villager#resetOffers
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
index 5ee34073e4bd5a4765d7954b6620c0d05d8c7bc9..80fe2e3e5b97e9b6af98b73f19f8c2f5fca279fe 100644
index 89e14bb2662fe03b4661aaa54fd65af41b1d438b..fcb3b66617150ad503bffe65de4900b1e3af8764 100644
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -116,6 +116,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
@@ -114,6 +114,13 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
return this.tradingPlayer != null;
}
@ -23,12 +23,12 @@ index 5ee34073e4bd5a4765d7954b6620c0d05d8c7bc9..80fe2e3e5b97e9b6af98b73f19f8c2f5
public MerchantOffers getOffers() {
if (this.level().isClientSide) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
index 19833c1fc6ee85e031e3c6aac3b00f44730c5e02..34e4c763c7ec971885147ab2509281fad56e1ca6 100644
index e5f733a765068b5640e811abf9fda945a9e91c7c..3199f04d00836a0a51547c679f3f3c80d00da502 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractVillager.java
@@ -70,4 +70,11 @@ public class CraftAbstractVillager extends CraftAgeable implements AbstractVilla
public HumanEntity getTrader() {
return this.getMerchant().getTrader();
@@ -34,4 +34,11 @@ public class CraftAbstractVillager extends CraftAgeable implements CraftMerchant
public Inventory getInventory() {
return new CraftInventory(this.getHandle().getInventory());
}
+
+ // Paper start - Villager#resetOffers

View file

@ -87,7 +87,7 @@ index 89982d25f60c8b60ba91e559ef88278f338fe215..0efc8d997b34302c3e0a5d7ec73a11a9
public ItemStack getBaseCostA() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
index 3bf9b5c016fa638fd0377d2a031a7359430b79ce..a18088125254178d362fdd283bff704a9ccdd0a7 100644
index 86c5bc01d5b87b4301fb83d55cf3046985c45d0f..c9e23a71a35214c363318c48d38c49b695d1ffd4 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java
@@ -22,11 +22,19 @@ public class CraftMerchantRecipe extends MerchantRecipe {
@ -139,7 +139,7 @@ index 3bf9b5c016fa638fd0377d2a031a7359430b79ce..a18088125254178d362fdd283bff704a
public net.minecraft.world.item.trading.MerchantOffer toMinecraft() {
List<ItemStack> ingredients = this.getIngredients();
Preconditions.checkState(!ingredients.isEmpty(), "No offered ingredients");
@@ -128,7 +149,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
@@ -130,7 +151,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
if (recipe instanceof CraftMerchantRecipe) {
return (CraftMerchantRecipe) recipe;
} else {

View file

@ -40,10 +40,10 @@ index 45181bc9c422507682d479e4d43177ecd3253971..2ea613f818403f8e8ece4b3689173813
public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) {
super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index a3c67bdc2c08b3550534f37d15b0db90b479e34f..24bf661e76fb421a8be565d9ea68edf7205254d2 100644
index 48085b2e7197dc44e76b812bdd514af729e21e83..a1124405412cdac673f34a63988e7be957506dba 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -371,6 +371,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -376,6 +376,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private void disconnect0(DisconnectionDetails disconnectiondetails) {
// CraftBukkit end
@ -52,7 +52,7 @@ index a3c67bdc2c08b3550534f37d15b0db90b479e34f..24bf661e76fb421a8be565d9ea68edf7
this.connection.disconnect(disconnectiondetails);
}));
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9044ed6cba10314c52c44a19be1fa88771c54be6..45e7b41f746ceb2ef295a81fa65795df062844ef 100644
index 6f587c4bb4704d93552ba61335d87b1852fc169c..98eb00a8ee23543714d424d3ff5ca19887d6db19 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -570,7 +570,7 @@ public abstract class PlayerList {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add LivingEntity#clearActiveItem
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index af5aab1755f80222a249b1cc7da595af78dccbbd..02160f138128cbb1f7391061128f8b6e74549f50 100644
index 3cd21778018db5e05ee26ba35c34a89619b3d1d8..5e8225a6ae004795b4d44c4f88f262664f632589 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -937,6 +937,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -942,6 +942,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return this.getHandle().getUseItem().asBukkitMirror();
}

View file

@ -18,7 +18,7 @@ index cb89b020d93ac838843ec2cbad562326a1e4257b..513e6505706e64f9410fa190014976dc
public Vec3 currentImpulseImpactPos;
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 8f4c4fed41676157b717c20a5ccbfe6ad4bdb3c4..87d067c3a83283931bc16dccf6a304142848cd6a 100644
index 6cda13df52ee4d56dd1d3c213307bfd38175584c..24aa891ffa9115c05439b06aece85df7a382b7c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -36,10 +36,10 @@ index 8f4c4fed41676157b717c20a5ccbfe6ad4bdb3c4..87d067c3a83283931bc16dccf6a30414
public int getSleepTicks() {
return this.getHandle().sleepCounter;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 02160f138128cbb1f7391061128f8b6e74549f50..498d5097597a35827f4293b303a956fcf63bb52d 100644
index 5e8225a6ae004795b4d44c4f88f262664f632589..0e0c65534a782ce8d73d38efd5e2c847f685fb89 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -994,4 +994,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -999,4 +999,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().take(((CraftItem) item).getHandle(), quantity);
}
// Paper end - pickup animation API

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash from invalid ingredient lists in
diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
index 80fe2e3e5b97e9b6af98b73f19f8c2f5fca279fe..6139361c0e733f981506abdd7101e5ca20eeb88f 100644
index fcb3b66617150ad503bffe65de4900b1e3af8764..2a155d3611ca2370830ca763d40074df6641958f 100644
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
@@ -275,7 +275,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
@@ -273,7 +273,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
Bukkit.getPluginManager().callEvent(event);
}
if (!event.isCancelled()) {

View file

@ -12,10 +12,10 @@ public net.minecraft.server.RegistryLayer STATIC_ACCESS
diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
new file mode 100644
index 0000000000000000000000000000000000000000..675f5d03478907e3d8284cbea191f01c1eb15769
index 0000000000000000000000000000000000000000..70e2c3b5cac9a0dfb043de218df20dc1ab2cc070
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
@@ -0,0 +1,143 @@
@@ -0,0 +1,146 @@
+package io.papermc.paper.registry;
+
+import io.papermc.paper.adventure.PaperAdventure;
@ -50,6 +50,7 @@ index 0000000000000000000000000000000000000000..675f5d03478907e3d8284cbea191f01c
+import org.bukkit.craftbukkit.generator.structure.CraftStructure;
+import org.bukkit.craftbukkit.generator.structure.CraftStructureType;
+import org.bukkit.craftbukkit.inventory.CraftItemType;
+import org.bukkit.craftbukkit.inventory.CraftMenuType;
+import org.bukkit.craftbukkit.inventory.trim.CraftTrimMaterial;
+import org.bukkit.craftbukkit.inventory.trim.CraftTrimPattern;
+import org.bukkit.craftbukkit.legacy.FieldRename;
@ -64,6 +65,7 @@ index 0000000000000000000000000000000000000000..675f5d03478907e3d8284cbea191f01c
+import org.bukkit.entity.memory.MemoryKey;
+import org.bukkit.generator.structure.StructureType;
+import org.bukkit.inventory.ItemType;
+import org.bukkit.inventory.MenuType;
+import org.bukkit.inventory.meta.trim.TrimMaterial;
+import org.bukkit.inventory.meta.trim.TrimPattern;
+import org.bukkit.map.MapCursor;
@ -95,6 +97,7 @@ index 0000000000000000000000000000000000000000..675f5d03478907e3d8284cbea191f01c
+ entry(Registries.VILLAGER_PROFESSION, RegistryKey.VILLAGER_PROFESSION, Villager.Profession.class, CraftVillager.CraftProfession::new),
+ entry(Registries.VILLAGER_TYPE, RegistryKey.VILLAGER_TYPE, Villager.Type.class, CraftVillager.CraftType::new),
+ entry(Registries.MAP_DECORATION_TYPE, RegistryKey.MAP_DECORATION_TYPE, MapCursor.Type.class, CraftMapCursor.CraftType::new),
+ entry(Registries.MENU, RegistryKey.MENU, MenuType.class, CraftMenuType::new),
+
+ // data-drivens
+ entry(Registries.STRUCTURE, RegistryKey.STRUCTURE, Structure.class, CraftStructure::new).delayed(),
@ -729,10 +732,10 @@ index 1dd22f11b7e2983a3069dea94c0f02b43ff1f736..397bdacab9517354875ebc0bc68d3505
String string = Registries.elementsDirPath(type.registryKey());
SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, GSON, map);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
index a9832482500f08df30568ecbc65e4496ee01b414..154733684a53ff84ca8c2a994b96b68733e9fba5 100644
index 06c6342fad78d9c845e9987c460f5990505f5059..d1db491027a5e2d22a6c956b26a974a284d44c57 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
@@ -120,78 +120,12 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
@@ -122,81 +122,12 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
+ ", this can happen if a plugin creates its own registry entry with out properly registering it.");
}
@ -753,6 +756,9 @@ index a9832482500f08df30568ecbc65e4496ee01b414..154733684a53ff84ca8c2a994b96b687
- if (bukkitClass == MusicInstrument.class) {
- return new CraftRegistry<>(MusicInstrument.class, registryHolder.registryOrThrow(Registries.INSTRUMENT), CraftMusicInstrument::new, FieldRename.NONE);
- }
- if (bukkitClass == MenuType.class) {
- return new CraftRegistry<>(MenuType.class, registryHolder.registryOrThrow(Registries.MENU), CraftMenuType::new, FieldRename.NONE);
- }
- if (bukkitClass == PotionEffectType.class) {
- return new CraftRegistry<>(PotionEffectType.class, registryHolder.registryOrThrow(Registries.MOB_EFFECT), CraftPotionEffectType::new, FieldRename.NONE);
- }
@ -814,7 +820,7 @@ index a9832482500f08df30568ecbc65e4496ee01b414..154733684a53ff84ca8c2a994b96b687
}
if (bukkit instanceof Registry.SimpleRegistry<?> simple) {
@@ -217,23 +151,21 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
@@ -222,23 +153,21 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
return bukkit.get(namespacedKey);
}
@ -844,7 +850,7 @@ index a9832482500f08df30568ecbc65e4496ee01b414..154733684a53ff84ca8c2a994b96b687
@Override
public B get(NamespacedKey namespacedKey) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 75fe99d8ec74435cf62b427d6bed89c76c0cf6d9..f79af6910c4c83f1c56bc73434846f3e5270509f 100644
index ae594610d1c5665aa142522a9cbb97cf6e4d10f2..e4fab101b2d10759b9bd65d35715e377236a5989 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -281,7 +281,7 @@ public final class CraftServer implements Server {
@ -864,7 +870,7 @@ index 75fe99d8ec74435cf62b427d6bed89c76c0cf6d9..f79af6910c4c83f1c56bc73434846f3e
ConfigurationSection compatibilities = this.configuration.getConfigurationSection("settings.compatibility");
if (compatibilities == null) {
this.activeCompatibilities = Collections.emptySet();
@@ -2729,7 +2730,7 @@ public final class CraftServer implements Server {
@@ -2726,7 +2727,7 @@ public final class CraftServer implements Server {
@Override
public <T extends Keyed> Registry<T> getRegistry(Class<T> aClass) {
@ -1162,7 +1168,7 @@ index bfbd80b60ac5df500d03c80de57e38aa7548dd46..cce9e2226ef554c10e1df1dbaa179165
when(instance.getTag(any(), any(), any())).then(mock -> {
String registry = mock.getArgument(0);
diff --git a/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java b/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java
index 9d6c3d91b505a683b353577bf39f869173243459..c1f886c906a9f9313d97a223f719095fa2624c57 100644
index 185f219b23ac57e15f8d0167b0077b7103a2f3f9..f4ba15a1b4b43822bd81b513af56c6667237c327 100644
--- a/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java
+++ b/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java
@@ -1,6 +1,7 @@
@ -1173,7 +1179,7 @@ index 9d6c3d91b505a683b353577bf39f869173243459..c1f886c906a9f9313d97a223f719095f
import java.util.List;
import java.util.stream.Stream;
import net.minecraft.core.registries.Registries;
@@ -59,35 +60,34 @@ public class RegistriesArgumentProvider implements ArgumentsProvider {
@@ -61,36 +62,35 @@ public class RegistriesArgumentProvider implements ArgumentsProvider {
private static final List<Arguments> DATA = Lists.newArrayList();
static {
@ -1181,6 +1187,7 @@ index 9d6c3d91b505a683b353577bf39f869173243459..c1f886c906a9f9313d97a223f719095f
- register(Enchantment.class, Registries.ENCHANTMENT, CraftEnchantment.class, net.minecraft.world.item.enchantment.Enchantment.class);
- register(GameEvent.class, Registries.GAME_EVENT, CraftGameEvent.class, net.minecraft.world.level.gameevent.GameEvent.class);
- register(MusicInstrument.class, Registries.INSTRUMENT, CraftMusicInstrument.class, Instrument.class);
- register(MenuType.class, Registries.MENU, CraftMenuType.class, net.minecraft.world.inventory.MenuType.class);
- register(PotionEffectType.class, Registries.MOB_EFFECT, CraftPotionEffectType.class, MobEffect.class);
- register(Structure.class, Registries.STRUCTURE, CraftStructure.class, net.minecraft.world.level.levelgen.structure.Structure.class);
- register(StructureType.class, Registries.STRUCTURE_TYPE, CraftStructureType.class, net.minecraft.world.level.levelgen.structure.StructureType.class);
@ -1218,6 +1225,7 @@ index 9d6c3d91b505a683b353577bf39f869173243459..c1f886c906a9f9313d97a223f719095f
+ register(RegistryKey.CAT_VARIANT, Cat.Type.class, Registries.CAT_VARIANT, CraftCat.CraftType.class, CatVariant.class);
+ register(RegistryKey.MAP_DECORATION_TYPE, MapCursor.Type.class, Registries.MAP_DECORATION_TYPE, CraftMapCursor.CraftType.class, MapDecorationType.class);
+ register(RegistryKey.BANNER_PATTERN, PatternType.class, Registries.BANNER_PATTERN, CraftPatternType.class, BannerPattern.class);
+ register(RegistryKey.MENU, MenuType.class, Registries.MENU, CraftMenuType.class, net.minecraft.world.inventory.MenuType.class);
}
- private static void register(Class bukkit, ResourceKey registry, Class craft, Class minecraft) {

View file

@ -17,10 +17,10 @@ index bed376337035545e7ec677f2f7fe3372a3c9ea25..7d131f3b3f5739468aa3115e97ed28b6
double d1 = entity.getZ() - this.getZ();
double d2 = Mth.absMax(d0, d1);
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
index 119d6f4ec8ca6867f75f9fd2f1dc46962f16afee..2bd3ba073843b1680eeb81f7dede5973bb4f446d 100644
index 4d8c14d3a42f3e4b963cf5f8fa764df79813912b..93634fb01962ca7a35026e3c365f2a7f6b258a39 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -789,6 +789,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
@@ -799,6 +799,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
public void push(Entity entity) {
if (!this.level().isClientSide) {
if (!entity.noPhysics && !this.noPhysics) {

View file

@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 16 Jan 2021 14:30:12 -0500
Subject: [PATCH] Remove ProjectileHitEvent call when fireballs dead
The duplicate ProjectileHitEvent in EntityFireball was removed. The
event was always called before the duplicate call.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
index beff021b589b0e34f1111b6fae92bcdd6f059de6..3107ad04dda9f43976a385976d6952e2f2af3939 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractHurtingProjectile.java
@@ -91,7 +91,7 @@ public abstract class AbstractHurtingProjectile extends Projectile {
// CraftBukkit start - Fire ProjectileHitEvent
if (this.isRemoved()) {
- CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
+ // CraftEventFactory.callProjectileHitEvent(this, movingobjectposition); // Paper - this is an undesired duplicate event
}
// CraftBukkit end
}

Some files were not shown because too many files have changed in this diff Show more