Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11102)
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
This commit is contained in:
@ -219,6 +219,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
* Custom boss bars.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see Cat.Type
|
||||
*/
|
||||
- Registry<Cat.Type> CAT_VARIANT = Objects.requireNonNull(Bukkit.getRegistry(Cat.Type.class), "No registry present for Cat Type. This is a bug.");
|
||||
+ Registry<Cat.Type> CAT_VARIANT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.CAT_VARIANT); // Paper
|
||||
/**
|
||||
* Server enchantments.
|
||||
*
|
||||
* @see Enchantment
|
||||
@ -317,7 +323,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
/**
|
||||
* Villager profession.
|
||||
*
|
||||
* @see Villager.Profession
|
||||
*/
|
||||
- Registry<Villager.Profession> VILLAGER_PROFESSION = Objects.requireNonNull(Bukkit.getRegistry(Villager.Profession.class), "No registry present for Villager Profession. This is a bug.");
|
||||
+ Registry<Villager.Profession> VILLAGER_PROFESSION = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.VILLAGER_PROFESSION); // Paper
|
||||
/**
|
||||
* Villager type.
|
||||
*
|
||||
* @see Villager.Type
|
||||
*/
|
||||
- Registry<Villager.Type> VILLAGER_TYPE = Objects.requireNonNull(Bukkit.getRegistry(Villager.Type.class), "No registry present for Villager Type. This is a bug.");
|
||||
+ Registry<Villager.Type> VILLAGER_TYPE = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.VILLAGER_TYPE); // Paper
|
||||
/**
|
||||
* Memory Keys.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @see Frog.Variant
|
||||
*/
|
||||
- Registry<Frog.Variant> FROG_VARIANT = Objects.requireNonNull(Bukkit.getRegistry(Frog.Variant.class), "No registry present for Frog Variant. This is a bug.");
|
||||
+ Registry<Frog.Variant> FROG_VARIANT = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.FROG_VARIANT); // Paper
|
||||
/**
|
||||
* Wolf variants.
|
||||
*
|
||||
* @see Wolf.Variant
|
||||
@ -329,7 +355,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
/**
|
||||
* Map cursor types.
|
||||
*
|
||||
@@ -0,0 +0,0 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
* @see MapCursor.Type
|
||||
*/
|
||||
- Registry<MapCursor.Type> MAP_DECORATION_TYPE = Objects.requireNonNull(Bukkit.getRegistry(MapCursor.Type.class), "No registry present for MapCursor Type. This is a bug.");
|
||||
+ Registry<MapCursor.Type> MAP_DECORATION_TYPE = io.papermc.paper.registry.RegistryAccess.registryAccess().getRegistry(io.papermc.paper.registry.RegistryKey.MAP_DECORATION_TYPE); // Paper
|
||||
/**
|
||||
* Game events.
|
||||
*
|
||||
* @see GameEvent
|
||||
*/
|
||||
|
||||
@ -427,20 +427,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
* 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
|
||||
@@ -0,0 +0,0 @@ public interface Villager extends AbstractVillager {
|
||||
public NamespacedKey getKey() {
|
||||
return key;
|
||||
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
|
||||
}
|
||||
|
||||
@ -113,9 +113,9 @@ diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/b
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Villager.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@ -123,7 +123,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -0,0 +0,0 @@ public interface Villager extends AbstractVillager {
|
||||
return key;
|
||||
return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]);
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
@ -200,29 +200,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/map/MapCursor.java
|
||||
+++ b/src/main/java/org/bukkit/map/MapCursor.java
|
||||
@@ -0,0 +0,0 @@ public final class MapCursor {
|
||||
BANNER_RED(24, "banner_red"),
|
||||
BANNER_BLACK(25, "banner_black"),
|
||||
RED_X(26, "red_x"),
|
||||
Type BANNER_RED = getType("banner_red");
|
||||
Type BANNER_BLACK = getType("banner_black");
|
||||
Type RED_X = getType("red_x");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
VILLAGE_DESERT(27, "village_desert"),
|
||||
Type VILLAGE_DESERT = getType("village_desert");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
VILLAGE_PLAINS(28, "village_plains"),
|
||||
Type VILLAGE_PLAINS = getType("village_plains");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
VILLAGE_SAVANNA(29, "village_savanna"),
|
||||
Type VILLAGE_SAVANNA = getType("village_savanna");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
VILLAGE_SNOWY(30, "village_snowy"),
|
||||
Type VILLAGE_SNOWY = getType("village_snowy");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
VILLAGE_TAIGA(31, "village_taiga"),
|
||||
Type VILLAGE_TAIGA = getType("village_taiga");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
JUNGLE_TEMPLE(32, "jungle_temple"),
|
||||
Type JUNGLE_TEMPLE = getType("jungle_temple");
|
||||
+ @org.bukkit.MinecraftExperimental(org.bukkit.MinecraftExperimental.Requires.TRADE_REBALANCE) // Paper - add missing annotation
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
|
||||
SWAMP_HUT(33, "swamp_hut"),
|
||||
TRIAL_CHAMBERS(34, "trial_chambers")
|
||||
;
|
||||
Type SWAMP_HUT = getType("swamp_hut");
|
||||
Type TRIAL_CHAMBERS = getType("trial_chambers");
|
||||
|
||||
|
||||
@ -1836,7 +1836,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- @Deprecated
|
||||
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
|
||||
public byte getRawType() {
|
||||
return type.value;
|
||||
return type.getValue();
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public final class MapCursor {
|
||||
* Set the type of this cursor.
|
||||
@ -1859,9 +1859,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
*/
|
||||
- @Deprecated
|
||||
+ @org.jetbrains.annotations.ApiStatus.Internal // Paper
|
||||
public byte getValue() {
|
||||
return value;
|
||||
}
|
||||
byte getValue();
|
||||
|
||||
/**
|
||||
@@ -0,0 +0,0 @@ public final class MapCursor {
|
||||
*
|
||||
* @param value the value
|
||||
@ -1872,7 +1872,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- @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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
||||
@ -612,13 +612,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/src/main/java/org/bukkit/entity/Villager.java
|
||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockDropItemEvent.java
|
||||
@ -660,14 +660,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
*/
|
||||
public class BlockExplodeEvent extends BlockEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java
|
||||
|
||||
@ -44,5 +44,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ 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}
|
||||
|
||||
@ -87,10 +87,18 @@ diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java b/src/
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPortalEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
|
||||
public class EntityPortalEvent extends EntityTeleportEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@@ -0,0 +0,0 @@ package org.bukkit.event.entity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.HandlerList;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class EntityPortalEvent extends EntityTeleportEvent {
|
||||
private int searchRadius = 128;
|
||||
private boolean canCreatePortal = true;
|
||||
private int creationRadius = 16;
|
||||
+ private final org.bukkit.PortalType type; // Paper
|
||||
|
||||
public EntityPortalEvent(@NotNull final Entity entity, @NotNull final Location from, @Nullable final Location to) {
|
||||
@ -102,15 +110,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
super(entity, from, to);
|
||||
this.searchRadius = searchRadius;
|
||||
+ this.type = org.bukkit.PortalType.CUSTOM; // Paper
|
||||
}
|
||||
|
||||
public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius) {
|
||||
+ // Paper start
|
||||
+ this(entity, from, to, searchRadius, canCreatePortal, creationRadius, org.bukkit.PortalType.CUSTOM);
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, final @NotNull org.bukkit.PortalType portalType) {
|
||||
+ super(entity, from, to);
|
||||
+ this.searchRadius = searchRadius;
|
||||
+ @ApiStatus.Internal
|
||||
+ public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius, final @NotNull org.bukkit.PortalType portalType) {
|
||||
super(entity, from, to);
|
||||
+ this.type = portalType;
|
||||
+ }
|
||||
+
|
||||
+ // Paper end
|
||||
this.searchRadius = searchRadius;
|
||||
this.canCreatePortal = canCreatePortal;
|
||||
this.creationRadius = creationRadius;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Get the portal type relating to this event.
|
||||
+ *
|
||||
@ -142,11 +159,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ @Override
|
||||
+ public void setTo(@Nullable final Location to) {
|
||||
+ super.setTo(to);
|
||||
}
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
+
|
||||
/**
|
||||
* Set the Block radius to search in for available portals.
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java
|
||||
|
||||
@ -262,7 +262,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/entity/Cat.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Cat.java
|
||||
@@ -0,0 +0,0 @@ public interface Cat extends Tameable, Sittable {
|
||||
return key;
|
||||
return Lists.newArrayList(Registry.CAT_VARIANT).toArray(new Type[0]);
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user