Skip to content

Commit

Permalink
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11102)
Browse files Browse the repository at this point in the history
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:
3a3bea52 SPIGOT-7829: Increase maximum outgoing plugin message size to match Vanilla intention
5cd1c8cb SPIGOT-7831: Add CreatureSpawnEvent.SpawnReason#POTION_EFFECT
a8e278f0 SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals
53729d12 Remove spurious ApiStatus.Internal annotation
b9f57486 SPIGOT-7799, PR-1039: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent
7983b966 PR-1029: Trial changing a small number of inner enums to classes/interfaces to better support custom values

CraftBukkit Changes:
403accd56 SPIGOT-7831: Add CreatureSpawnEvent.SpawnReason#POTION_EFFECT
812761660 Increase outdated build delay
bed1e3ff6 SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals
2444c8b23 SPIGOT-7823: Suspicious sand and gravel material are not marked as having gravity correctly
aceddcd0b SPIGOT-7820: Enum changes - duplicate method name
a0d2d6a84 SPIGOT-7813: Material#isInteractable() always returns false
8fd64b091 SPIGOT-7806: Handle both loot and inventory item drop behaviour in PlayerDeathEvent
a4ee40b74 SPIGOT-7799, PR-1436: Expose explosion world interaction in EntityExplodeEvent and BlockExplodeEvent
082aa51c5 PR-1424: Trial changing a small number of inner enums to classes/interfaces to better support custom values
66e78a96b SPIGOT-7815: Consider EntityDamageEvent status for Wolf armor damage

Spigot Changes:
5bbef5ad SPIGOT-7834: Modify max value for generic.max_absorption
  • Loading branch information
kennytv authored Jul 18, 2024
1 parent 44c3dd0 commit dd11ef8
Show file tree
Hide file tree
Showing 188 changed files with 816 additions and 654 deletions.
16 changes: 8 additions & 8 deletions patches/api/0006-Adventure.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4880,10 +4880,10 @@ index bd512a7840d4686759097ee4cbd8b375c530956b..f2242ddc4085f7e7cdd748d860857822
+ // Paper end - adventure
}
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f100ea9467e 100644
index 8250821fe7be7987c92edbc36911f88875c470fc..2aadb995ab512086ac41b48df4c724722697e166 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -13,7 +13,7 @@ public final class MapCursor {
@@ -17,7 +17,7 @@ public final class MapCursor {
private byte x, y;
private byte direction;
private boolean visible;
Expand All @@ -4892,7 +4892,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10
private Type type;

/**
@@ -28,7 +28,7 @@ public final class MapCursor {
@@ -32,7 +32,7 @@ public final class MapCursor {
*/
@Deprecated
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible) {
Expand All @@ -4901,7 +4901,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10
}

/**
@@ -41,7 +41,7 @@ public final class MapCursor {
@@ -45,7 +45,7 @@ public final class MapCursor {
* @param visible Whether the cursor is visible by default.
*/
public MapCursor(byte x, byte y, byte direction, @NotNull Type type, boolean visible) {
Expand All @@ -4910,7 +4910,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10
}

/**
@@ -53,7 +53,7 @@ public final class MapCursor {
@@ -57,7 +57,7 @@ public final class MapCursor {
* @param type The type (color/style) of the map cursor.
* @param visible Whether the cursor is visible by default.
* @param caption cursor caption
Expand All @@ -4919,7 +4919,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10
*/
@Deprecated
public MapCursor(byte x, byte y, byte direction, byte type, boolean visible, @Nullable String caption) {
@@ -62,8 +62,42 @@ public final class MapCursor {
@@ -66,8 +66,42 @@ public final class MapCursor {
setDirection(direction);
setRawType(type);
this.visible = visible;
Expand Down Expand Up @@ -4963,7 +4963,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10

/**
* Initialize the map cursor.
@@ -81,7 +115,7 @@ public final class MapCursor {
@@ -85,7 +119,7 @@ public final class MapCursor {
setDirection(direction);
this.type = type;
this.visible = visible;
Expand All @@ -4972,7 +4972,7 @@ index e645a65dbd3340a86f5325dbfd515e0a99f31ab0..940066ec529acc4cb9c8136f15345f10
}

/**
@@ -200,23 +234,45 @@ public final class MapCursor {
@@ -204,23 +238,45 @@ public final class MapCursor {
this.visible = visible;
}

Expand Down
26 changes: 9 additions & 17 deletions patches/api/0053-Fix-upstream-javadocs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -607,18 +607,18 @@ index af5110b4160979c39cc1e5de6fa3bd7957b21403..15a0a733b0e5804655b5957cbf208312
* @param location the location to remove
* @see #getExploredLocations()
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 6bf3af3ed81b66f61e53105d3591165ea74dba0e..a91400cd8bb4c72d1f3200a17f6de025540fe09d 100644
index 45dd54afa6d6f3d9895ef52f13076d3351036e4b..cfa0d4809f9bb4ac150251efa85ba4d1808ab1b2 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -202,7 +202,7 @@ public interface Villager extends AbstractVillager {
@@ -228,7 +228,7 @@ public interface Villager extends AbstractVillager {
*/
NITWIT,
Profession NITWIT = getProfession("nitwit");
/**
- * Sheperd profession. Wears a brown robe. Shepherds primarily trade for
+ * Shepherd profession. Wears a brown robe. Shepherds primarily trade for
* wool items, and shears.
*/
SHEPHERD,
Profession SHEPHERD = getProfession("shepherd");
diff --git a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java b/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
index a0f6f1af304190b4c5db4b284d460f625eeb7801..7e21548cac8515c281ec86853e9272ab7695b24f 100644
--- a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
Expand Down Expand Up @@ -647,10 +647,10 @@ index a0f6f1af304190b4c5db4b284d460f625eeb7801..7e21548cac8515c281ec86853e9272ab
* The Block is already broken as this event is called, so #getBlock() will be
* AIR in most cases. Use #getBlockState() for more Information about the broken
diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
index e534954457a9961a26dbec7ac035bec07e1d6694..a7c297364805c58ae16895055d8eae0484384b7d 100644
index 1df172c0bb48de3b143179a3f0c63d6ecc30649e..254d549f956053af4264ca3a52d34a97ede4273d 100644
--- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
@@ -13,6 +13,9 @@ import org.jetbrains.annotations.NotNull;
@@ -14,6 +14,9 @@ import org.jetbrains.annotations.NotNull;
* Note that due to the nature of explosions, {@link #getBlock()} will always be
* an air block. {@link #getExplodedBlockState()} should be used to get
* information about the block state that exploded.
Expand All @@ -660,14 +660,6 @@ index e534954457a9961a26dbec7ac035bec07e1d6694..a7c297364805c58ae16895055d8eae04
*/
public class BlockExplodeEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -29,6 +32,7 @@ public class BlockExplodeEvent extends BlockEvent implements Cancellable {
this.cancel = false;
}

+ @io.papermc.paper.annotation.DoNotUse // Paper
@Deprecated(forRemoval = true)
public BlockExplodeEvent(@NotNull final Block what, @NotNull final List<Block> blocks, final float yield) {
this(what, what.getState(), blocks, yield);
diff --git a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java
index 340fa397e68c024df380a28db21545a0c83d9fa6..79ac8a5db689cf9f8e2ff4cb7c06df6989128d10 100644
--- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java
Expand Down Expand Up @@ -721,7 +713,7 @@ index a37febd0d4dd5b733e9ee72628fdf9395fec4367..9cee218b9ee14688356f16b1f5851218
*/
public class AreaEffectCloudApplyEvent extends EntityEvent implements Cancellable {
diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index 90b287cd2cc6f05bb0c588d8be397cf52a7822de..15cb5ea4b68eca070f73d2b899543274415ad240 100644
index d3f93163fb3108f42e542c22e437c9cb8289f0e8..1e2bb345d19ebe03589d85bdab13021b6fa2ed98 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -158,11 +158,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
Expand Down Expand Up @@ -765,10 +757,10 @@ index 573165ddf3368a96e1ffc6476eb27c9e29a6f86e..148c4aad384ae8e3b8b22d264a84bddf
* @return the block state
*/
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
index 10d0e18dfd423b108fe381e8142867eb10399359..099efafa14c10910e4ed04abb1823f0c1a96b6a6 100644
index fc2158793aec67310bc8d06ac1f0bac39d2a5c3d..50161d313cfcc9e61441589685c3d0e1f057dd86 100644
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
@@ -9,7 +9,9 @@ import org.bukkit.event.HandlerList;
@@ -10,7 +10,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ index 99e1f17fddf9cebe7057998d1635804c55f18312..c3387a88a16cfd9157ade5d8a06eae25
// Paper end
}
diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index 15cb5ea4b68eca070f73d2b899543274415ad240..2de81ee445824562aec7b52b7369b75280aab959 100644
index 1e2bb345d19ebe03589d85bdab13021b6fa2ed98..6ff1988092de06f9d751cd40da521c2ed6e2e4bd 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -206,6 +206,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
Expand All @@ -44,5 +44,5 @@ index 15cb5ea4b68eca070f73d2b899543274415ad240..2de81ee445824562aec7b52b7369b752
+ OMINOUS_ITEM_SPAWNER,
+ // Paper end - Fixes and additions to the SpawnReason API
/**
* When a creature is spawned by plugins
*/
* When a creature is spawned by a potion effect, for example:
* {@link org.bukkit.potion.PotionType#OOZING}, {@link org.bukkit.potion.PotionType#INFESTED}
24 changes: 12 additions & 12 deletions patches/api/0166-Fix-Spigot-annotation-mistakes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ index 48aecc9421c500137bbef1dfe3bec8de277c3ff9..aff858346776386f1288b648b221404f
return note;
}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index f1a7f3b3e20963fa9d97bcc0686a35863de2b60f..3effaea369d9c7a6a22979fbfc270f55f9f25cf2 100644
index 3bd96bbd35b657a6030d744e86622e616c2c3b08..5529e227781cd2411de9c6581a1cb1255ce9bb20 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> {
Expand All @@ -471,7 +471,7 @@ index f1a7f3b3e20963fa9d97bcc0686a35863de2b60f..3effaea369d9c7a6a22979fbfc270f55
Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
/**
* Damage types.
@@ -336,8 +334,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -335,8 +333,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @param input non-null input
* @return registered object or null if does not exist
Expand Down Expand Up @@ -1823,10 +1823,10 @@ index edef478786bb7456af29ca960009873095830050..e8ac449e6280827beb6d2699df75b1d5

/**
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711cc4d8e550 100644
index 2aadb995ab512086ac41b48df4c724722697e166..4d96cf385fa5c6d80097bdf6282be5f0eed73307 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -159,9 +159,9 @@ public final class MapCursor {
@@ -163,9 +163,9 @@ public final class MapCursor {
* Get the type of this cursor.
*
* @return The type (color/style) of the map cursor.
Expand All @@ -1836,9 +1836,9 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getRawType() {
return type.value;
return type.getValue();
}
@@ -216,9 +216,9 @@ public final class MapCursor {
@@ -220,9 +220,9 @@ public final class MapCursor {
* Set the type of this cursor.
*
* @param type The type (color/style) of the map cursor.
Expand All @@ -1850,7 +1850,7 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c
public void setRawType(byte type) {
Type enumType = Type.byValue(type);
Preconditions.checkArgument(enumType != null, "Unknown type by id %s", type);
@@ -337,9 +337,9 @@ public final class MapCursor {
@@ -336,9 +336,9 @@ public final class MapCursor {
* Gets the internal value of the cursor.
*
* @return the value
Expand All @@ -1859,10 +1859,10 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
public byte getValue() {
return value;
}
@@ -349,9 +349,9 @@ public final class MapCursor {
byte getValue();

/**
@@ -346,9 +346,9 @@ public final class MapCursor {
*
* @param value the value
* @return the matching type
Expand All @@ -1872,7 +1872,7 @@ index 940066ec529acc4cb9c8136f15345f100ea9467e..82993302cb3cf62ad4a94a0ebaa7711c
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
public static Type byValue(byte value) {
static Type byValue(byte value) {
for (Type t : values()) {
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index 3a9aaca2e76411a9c27f9f5e0f22d060d5a66d06..c80faa079eca1564847070f0338fc98024639829 100644
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0186-Villager-Restocks-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Villager Restocks API


diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index a91400cd8bb4c72d1f3200a17f6de025540fe09d..4128b848ec739308694d54d9e859c28185f42a63 100644
index cfa0d4809f9bb4ac150251efa85ba4d1808ab1b2..ecb0f32a4449f8000248c4bebf89a56df186899f 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -78,6 +78,20 @@ public interface Villager extends AbstractVillager {
@@ -82,6 +82,20 @@ public interface Villager extends AbstractVillager {
*/
public void setVillagerExperience(int experience);

Expand Down
12 changes: 6 additions & 6 deletions patches/api/0188-Add-villager-reputation-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ index 0000000000000000000000000000000000000000..5600fcdc9795a9f49091db48d73bbd49
+ TRADING,
+}
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 4128b848ec739308694d54d9e859c28185f42a63..49db82ceff5e2c5f6414045648d68bd384c857c8 100644
index ecb0f32a4449f8000248c4bebf89a56df186899f..d839630d7b2e51629e52edf24e7c6dd86b5f58f6 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -1,6 +1,8 @@
package org.bukkit.entity;

@@ -3,6 +3,8 @@ package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
+import java.util.Map; // Paper
+import java.util.UUID; // Paper
import org.bukkit.Keyed;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
@@ -242,4 +244,50 @@ public interface Villager extends AbstractVillager {
return key;
@@ -289,4 +291,50 @@ public interface Villager extends AbstractVillager {
return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]);
}
}
+
Expand Down
22 changes: 11 additions & 11 deletions patches/api/0202-Add-methods-to-get-translation-keys.patch
Original file line number Diff line number Diff line change
Expand Up @@ -420,27 +420,27 @@ index d248069adfc67eb840951f7ab4a1fa5d30214dec..976f701ed9b9873945a5628173c580e2
* Gets if this EntityType is enabled by feature in a world.
*
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 49db82ceff5e2c5f6414045648d68bd384c857c8..b3957b3ff64f35fdeb2daa2ed1fb34fd65e24693 100644
index d839630d7b2e51629e52edf24e7c6dd86b5f58f6..0759f66986cec2c7e3f765aaa5b1654b5ed9f4b5 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -160,7 +160,7 @@ public interface Villager extends AbstractVillager {
@@ -185,7 +185,7 @@ public interface Villager extends AbstractVillager {
* Represents the various different Villager professions there may be.
* Villagers have different trading options depending on their profession,
*/
- public enum Profession implements Keyed {
+ public enum Profession implements Keyed, net.kyori.adventure.translation.Translatable { // Paper
NONE,
- interface Profession extends OldEnum<Profession>, Keyed {
+ interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {

Profession NONE = getProfession("none");
/**
* Armorer profession. Wears a black apron. Armorers primarily trade for
@@ -243,6 +243,13 @@ public interface Villager extends AbstractVillager {
public NamespacedKey getKey() {
return key;
@@ -290,6 +290,13 @@ public interface Villager extends AbstractVillager {
static Profession[] values() {
return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]);
}
+
+ // Paper start
+ @Override
+ public @NotNull String translationKey() {
+ return "entity.minecraft.villager." + this.key.getKey();
+ default @NotNull String translationKey() {
+ return "entity.minecraft.villager." + this.getKey().getKey();
+ }
+ // Paper end
}
Expand Down
Loading

0 comments on commit dd11ef8

Please sign in to comment.