Compare commits

...
Author SHA1 Message Date
Jason Penilla a136173f15 adjust delay to 5s 2024-09-13 15:04:18 -07:00
Jason Penilla fcf48a9c94 Add ticket on player join to avoid chunk load-unload-load cycle
Adding the entity will add and then immediately remove an entity load ticket, which would result in the chunk loading and then unloading before being loaded again once the player chunk loader reacts (delay can vary based on rate limit configs)

By adding a ticket with a short removal delay we attempt to keep the chunk loaded until the player chunk loader reacts, but this is not a guarantee due to the aforementioned rate limit configs. Plugins should still handle load/unload events as normal, however this will reduce redundant calls.

The delay is currently set to 2 seconds, however we may want to adjust this before merging
2024-09-13 14:38:01 -07:00
Nassim Jahnke 4ff58c4c48 Update spark 2024-09-12 19:54:34 +02:00
Jason Penilla e945cfe1c5 Fix PaperServerListPingEvent#getPlayerSample not being populated or used (#11387) 2024-09-10 19:52:30 +02:00
Jake Potrebic 61fe23cd08 deprecate isEnabledByFeature in Item/BlockType 2024-09-09 19:19:46 -07:00
Fabrizio La Rosa 971a7a5511 Add Decorated Pot Cracked API (#11365) 2024-09-08 22:12:36 +02:00
masmc05andBjarne Koll b09eaf2e8d Add Item serialization as json api (#11235)
* Item serialization as json

* Add ItemStackAdapter for Gson

* A javadoc note at #serialize() and #deserialize()

* Rebase

* Move serialize closer to deserialize

* Add explaining comment about SERIALIZE_CUSTOM_AS_SNBT usage

* Apply lynxplay requests

* Forgot `@NotNull`

* Very important diff was removed

* Rebase

* Javadocs

---------

Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2024-09-08 12:58:30 -07:00
Jake Potrebic 7632de5134 Tag Lifecycle Events (#10993)
* wip tags

* use generics in tag registrars

* comment out varargs methods for now

* split up patch

* cache loaded service provider

* finish renames

* use builderWithExpectedSize

* finalize
2024-09-08 11:56:09 -07:00
Nassim Jahnke 1ba1be7d26 Update Velocity natives again
If you segfault, update your jre/jdk™️
2024-09-08 20:39:00 +02:00
Jake Potrebic 426f9924a5 Enchantment is data-driven, so not FeatureDependant (#11377) 2024-09-08 10:42:44 -07:00
Jake Potrebic 925c3b9d2b Add FeatureFlag API (#8952)
* Add FeatureFlag API

* switch to index & move method

* fix test
2024-09-07 13:35:11 -07:00
Jake Potrebic a8e6a93aec Deprecate for removal all OldEnum-related methods (#11371) 2024-09-07 13:02:45 -07:00
Jake Potrebic 5d91bef46f Fix shulkerbox loot table replenish (#11366)
* Fix shulkerbox loot table replenish

* re-add loot table if cleared

* add config
2024-09-07 12:49:28 -07:00
Pedro 0e825274e5 Fix NPE while trying to respawn an already disconnected player (#11353) 2024-09-07 21:34:03 +02:00
Bjarne Koll 21f125f3c2 Revert velocity natives to 3.1.2 (#11368)
The updated velocity native compilation pipeline seems to emit binaries
that are not compatible with alpine.
The commit temporarily reverts the natives included until a proper
solution is found.
2024-09-07 11:00:57 +02:00
Newwind 3db475838f Check dead flag in isAlive() (#11330)
* Create 1055-Check-dead-flag-in-isAlive().patch

* Rebase
2024-09-06 15:06:32 -07:00
Lulu13022002 e0021b15b6 Fix allowSpiderWorldBorderClimbing world config (#11321) 2024-09-06 23:15:29 +02:00
Jake Potrebic 805a97444a Improve console completion with brig suggestions (#9251)
* Improve console completion with brig suggestions

* silence warning

* small fixes

* squashed
2024-09-06 13:37:09 -07:00
VelVeV 10f5879992 Change condition check order of entity tracking Y (#11348) 2024-09-06 22:14:20 +02:00
nathannm23 953e6e9918 Fire BlockExpEvent on grindstone use (#11346) 2024-09-06 22:14:10 +02:00
VelVeV 012c527671 Update Velocity natives (#11347) 2024-09-06 21:44:24 +02:00
lucko 691d452643 Fix bundled spark permission check (#11355) 2024-09-06 21:41:54 +02:00
Nassim Jahnke ff251e42b6 Use reference hash set in reference Holder (#11363) 2024-09-06 21:03:17 +02:00
Space Walker b483da4e02 Update Alternate Current to v1.9 (#11333) 2024-09-01 10:59:20 -07:00
TamionandJake Potrebic 227c94ae21 Fix inventory desync when placing blocks with spawn protection (#11090)
* fix

* mention mojira issue

* move to vanilla bug fixes patch

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2024-08-31 12:01:29 -07:00
TamionandJake Potrebic 2f0891ed81 Fix InventoryOpenEvent cancellation (#11304)
* fix

* other blocks

* add missing diff in ContainerEntity

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2024-08-31 11:50:24 -07:00
Newwind 509ea2fd17 Fix horse armor desync (#11341) 2024-08-31 20:29:50 +02:00
Jason Penilla e01ddf4627 Fixup porting issue in vanillaBiomeProvider impl (#11185) 2024-08-31 19:59:17 +02:00
982 changed files with 3896 additions and 772 deletions

No files matched your search

+32 -8
View File
@@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..58f78d5e91beacaf710f62461cf869f7
+
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index b558fa73dbcf3747690933e6aadf7061a0de2630..8a22c242a93b0e16e0bca583d0918bab695248b1 100644
index b558fa73dbcf3747690933e6aadf7061a0de2630..be68351555bde59a4e55bf1bad261e9f6bc9f704 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -328,9 +328,11 @@ public final class Bukkit {
@@ -81,7 +81,7 @@ index b558fa73dbcf3747690933e6aadf7061a0de2630..8a22c242a93b0e16e0bca583d0918bab
* @return the manager
*/
@NotNull
+ @Deprecated(forRemoval = true)
+ @Deprecated(forRemoval = true, since = "1.20")
public static DataPackManager getDataPackManager() {
return server.getDataPackManager();
}
@@ -100,8 +100,20 @@ index b558fa73dbcf3747690933e6aadf7061a0de2630..8a22c242a93b0e16e0bca583d0918bab
// Paper end
@NotNull
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index cc25734f3dcf6075eb44e39da01ed2f1b59b618e..2721ad40d6ba025caad16455f74f2350dcb7a4ff 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
* @param world the world to check
* @return true if this material can be used in this World.
*/
+ @Deprecated(forRemoval = true, since = "1.20") // Paper
public boolean isEnabledByFeature(@NotNull World world) {
if (isItem()) {
return Bukkit.getDataPackManager().isEnabledByFeature(asItemType(), world);
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 42930006b6425b5d82233e4ffe7025ce5397b277..67b5cb7635c4251c259b1fb1ef50f99a0b2647e5 100644
index 42930006b6425b5d82233e4ffe7025ce5397b277..45693e6c02eac37eb609cd3c59253a949a6ca4c0 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -267,9 +267,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -112,7 +124,7 @@ index 42930006b6425b5d82233e4ffe7025ce5397b277..67b5cb7635c4251c259b1fb1ef50f99a
* @return the manager
*/
@NotNull
+ @Deprecated(forRemoval = true) // Paper
+ @Deprecated(forRemoval = true, since = "1.20") // Paper
public DataPackManager getDataPackManager();
/**
@@ -128,8 +140,20 @@ index 42930006b6425b5d82233e4ffe7025ce5397b277..67b5cb7635c4251c259b1fb1ef50f99a
+ io.papermc.paper.datapack.DatapackManager getDatapackManager();
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
index 976f701ed9b9873945a5628173c580e2e6873864..eea0351559a2835280713f5d5d1d430c7cf857a0 100644
--- a/src/main/java/org/bukkit/entity/EntityType.java
+++ b/src/main/java/org/bukkit/entity/EntityType.java
@@ -449,6 +449,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
* @param world the world to check
* @return true if this EntityType can be used to spawn an Entity for this World.
*/
+ @Deprecated(forRemoval = true, since = "1.20") // Paper
public boolean isEnabledByFeature(@NotNull World world) {
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
}
diff --git a/src/main/java/org/bukkit/packs/DataPack.java b/src/main/java/org/bukkit/packs/DataPack.java
index ea03c51d51e015e69d3aaa795547033ceabff9e0..419f6bdbec5dc1c731fb0f93816a90f58a329021 100644
index ea03c51d51e015e69d3aaa795547033ceabff9e0..f51d59e6369c76e333fd9e58e711c2b6f245882d 100644
--- a/src/main/java/org/bukkit/packs/DataPack.java
+++ b/src/main/java/org/bukkit/packs/DataPack.java
@@ -9,7 +9,9 @@ import org.jetbrains.annotations.NotNull;
@@ -138,12 +162,12 @@ index ea03c51d51e015e69d3aaa795547033ceabff9e0..419f6bdbec5dc1c731fb0f93816a90f5
* @see <a href="https://minecraft.wiki/w/Data_pack">Minecraft wiki</a>
+ * @deprecated use {@link io.papermc.paper.datapack.Datapack}
*/
+@Deprecated(forRemoval = true) // Paper
+@Deprecated(forRemoval = true, since = "1.20") // Paper
public interface DataPack extends Keyed {
/**
diff --git a/src/main/java/org/bukkit/packs/DataPackManager.java b/src/main/java/org/bukkit/packs/DataPackManager.java
index aee6e828c6fac9b010356af1239a58b4579c1773..7d3694efc21c7bc3784207735bdd9fb27e69988a 100644
index aee6e828c6fac9b010356af1239a58b4579c1773..1b850e76a885f0da653d4b48db72e5f85ae72805 100644
--- a/src/main/java/org/bukkit/packs/DataPackManager.java
+++ b/src/main/java/org/bukkit/packs/DataPackManager.java
@@ -13,7 +13,9 @@ import org.jetbrains.annotations.Nullable;
@@ -152,7 +176,7 @@ index aee6e828c6fac9b010356af1239a58b4579c1773..7d3694efc21c7bc3784207735bdd9fb2
* Manager of data packs.
+ * @deprecated use {@link io.papermc.paper.datapack.DatapackManager}
*/
+@Deprecated(forRemoval = true) // Paper
+@Deprecated(forRemoval = true, since = "1.20") // Paper
public interface DataPackManager {
/**
@@ -1,8 +1,13 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Sat, 16 Oct 2021 22:57:10 -0700
Subject: [PATCH] Add missing block data mins and maxes
Subject: [PATCH] Add missing block data API
General purpose patch adding missing getters/setters to BlockData and
its child types.
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
Co-authored-by: Fabrizio La Rosa <lr.fabrizio@gmail.com>
diff --git a/src/main/java/org/bukkit/block/data/Levelled.java b/src/main/java/org/bukkit/block/data/Levelled.java
index 5255538fecae6da413546be3adacd2a99f6c74e9..860f072dee391b300cb1629058a3f9c23dfd95e2 100644
@@ -22,6 +27,26 @@ index 5255538fecae6da413546be3adacd2a99f6c74e9..860f072dee391b300cb1629058a3f9c2
+ int getMinimumLevel();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/block/data/type/Bed.java b/src/main/java/org/bukkit/block/data/type/Bed.java
index ed519bfebe5b921f60867a3900edfce9859058b6..6e7a456dc5e9bfc28a19029a3381e53fa6453d30 100644
--- a/src/main/java/org/bukkit/block/data/type/Bed.java
+++ b/src/main/java/org/bukkit/block/data/type/Bed.java
@@ -35,6 +35,15 @@ public interface Bed extends Directional {
*/
boolean isOccupied();
+ // Paper start
+ /**
+ * Sets the value of the 'occupied' property.
+ *
+ * @param occupied the new 'occupied' value
+ */
+ void setOccupied(boolean occupied);
+ // Paper end
+
/**
* Horizontal half of a bed.
*/
diff --git a/src/main/java/org/bukkit/block/data/type/Candle.java b/src/main/java/org/bukkit/block/data/type/Candle.java
index d4d08bd424f84523200d1a2012f4d37c07cc3497..7baccce27f2db2242f628ea92a9d040267caef75 100644
--- a/src/main/java/org/bukkit/block/data/type/Candle.java
@@ -40,6 +65,28 @@ index d4d08bd424f84523200d1a2012f4d37c07cc3497..7baccce27f2db2242f628ea92a9d0402
+ int getMinimumCandles();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/block/data/type/DecoratedPot.java b/src/main/java/org/bukkit/block/data/type/DecoratedPot.java
index eb0ffa977450ef0c79caa78302cfe75ee35b34b7..b3d290dbfdcbadcbadcb54e6b414e423eba80cc6 100644
--- a/src/main/java/org/bukkit/block/data/type/DecoratedPot.java
+++ b/src/main/java/org/bukkit/block/data/type/DecoratedPot.java
@@ -4,4 +4,17 @@ import org.bukkit.block.data.Directional;
import org.bukkit.block.data.Waterlogged;
public interface DecoratedPot extends Directional, Waterlogged {
+ // Paper start - add missing block data api
+ /**
+ * @return whether the pot is cracked
+ */
+ public boolean isCracked();
+
+ /**
+ * Set whether the pot is cracked.
+ *
+ * @param cracked whether the pot is cracked
+ */
+ public void setCracked(boolean cracked);
+ // Paper end - add missing block data api
}
diff --git a/src/main/java/org/bukkit/block/data/type/Leaves.java b/src/main/java/org/bukkit/block/data/type/Leaves.java
index 3ea21dfad26222ee70fbc627595f54de1a28aa96..cd013a7c42648d819d1e91c7cf9f97a8190c1fad 100644
--- a/src/main/java/org/bukkit/block/data/type/Leaves.java
@@ -1,26 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: SoSeDiK <mrsosedik@gmail.com>
Date: Wed, 12 Oct 2022 00:36:55 +0300
Subject: [PATCH] Allow changing bed's 'occupied' property
diff --git a/src/main/java/org/bukkit/block/data/type/Bed.java b/src/main/java/org/bukkit/block/data/type/Bed.java
index ed519bfebe5b921f60867a3900edfce9859058b6..6e7a456dc5e9bfc28a19029a3381e53fa6453d30 100644
--- a/src/main/java/org/bukkit/block/data/type/Bed.java
+++ b/src/main/java/org/bukkit/block/data/type/Bed.java
@@ -35,6 +35,15 @@ public interface Bed extends Directional {
*/
boolean isOccupied();
+ // Paper start
+ /**
+ * Sets the value of the 'occupied' property.
+ *
+ * @param occupied the new 'occupied' value
+ */
+ void setOccupied(boolean occupied);
+ // Paper end
+
/**
* Horizontal half of a bed.
*/
@@ -5,7 +5,7 @@ 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 22428de50580f7b70d14484ba229aa271bfd7069..fc96043f799cf5d521d51ad4c74f8f8067bed754 100644
index 0c7d96bc296b56dc9ff0ada89bb4d715716f8adc..fb62933d589ccbe4181a7b9633bb742ae35f68dd 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
@@ -5,7 +5,7 @@ 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 fc96043f799cf5d521d51ad4c74f8f8067bed754..8dd993ce32686431e1c759d446a3620cb52f7ec1 100644
index fb62933d589ccbe4181a7b9633bb742ae35f68dd..597a3b581cb6fa2605fd5916e5639c1020d688b7 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
@@ -8,7 +8,7 @@ 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 8dd993ce32686431e1c759d446a3620cb52f7ec1..0d665a31152c9a667576f2e9d91ffec5304ce944 100644
index 597a3b581cb6fa2605fd5916e5639c1020d688b7..c9c3b926c5bb408d964ed5acc9f95c8527837a25 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
@@ -59,7 +59,7 @@ index ced419f8655bff72f0257b639d5f7d73afe3c2e2..bcc6ba95bd21c7972865838c636a03f5
/**
* Gets the item stack associated with this item drop.
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 0d665a31152c9a667576f2e9d91ffec5304ce944..a2c1cc7462564411db71a1e00222ef55633b49c8 100644
index c9c3b926c5bb408d964ed5acc9f95c8527837a25..7c027d7bbd6b8a1543fa92d44e99674925f093b3 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable;
File renamed without changes.
@@ -53,7 +53,7 @@ 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 a2c1cc7462564411db71a1e00222ef55633b49c8..4974540e8277011e4eb00f691a5f6f96d3dde20c 100644
index 7c027d7bbd6b8a1543fa92d44e99674925f093b3..f5149d54d6cb5019f398718b9aa52bc3ab34a5ae 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
@@ -5,7 +5,7 @@ Subject: [PATCH] Add method to remove all active potion effects
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 4974540e8277011e4eb00f691a5f6f96d3dde20c..5de7651f673cba9782f88f46dc938274b37a38ec 100644
index f5149d54d6cb5019f398718b9aa52bc3ab34a5ae..ad3717d963f28751d410e6688ae64a4c1175871d 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -657,6 +657,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -70,7 +70,7 @@ 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 c6b8700d258b859d246118868167497397010292..3808f76d49e24c20156c013f68e00efa9351f1a3 100644
index ee39c0b83e558681e8b006172d34c98e2c83cda2..c57690798108e9f91f8c552f39dcc2b080fe1b61 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 {
@@ -5,7 +5,7 @@ Subject: [PATCH] Add HiddenPotionEffect API
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 5de7651f673cba9782f88f46dc938274b37a38ec..5c29956c6db53440322330ff723c7087193641f1 100644
index ad3717d963f28751d410e6688ae64a4c1175871d..8369da45206d2606f0715f3d803163dd8028251e 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -591,6 +591,9 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -8,7 +8,7 @@ meant for managing resources across reloads and from points in the
PluginBootstrap.
diff --git a/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java b/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java
index 08f2050356acaf74e3210416760e3873c2dafd2c..37dfdcfcbd14947e0550e7528aca68f452e53eb6 100644
index 70d5f9802f90605a5120ff2a000a2e9395f0aecc..c319f3bbfabdd39ee571c59d7bfc144c58232abc 100644
--- a/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java
+++ b/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java
@@ -1,6 +1,9 @@
@@ -447,23 +447,27 @@ index 0000000000000000000000000000000000000000..92ea0374079a228ccc59c00fcf58abff
+}
diff --git a/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEventTypeProvider.java b/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEventTypeProvider.java
new file mode 100644
index 0000000000000000000000000000000000000000..1588f6943a909bed053a952e650e043c44028c2d
index 0000000000000000000000000000000000000000..3b17f056d162dd42cae0d33cbbb22fece82fe525
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEventTypeProvider.java
@@ -0,0 +1,18 @@
@@ -0,0 +1,22 @@
+package io.papermc.paper.plugin.lifecycle.event.types;
+
+import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
+import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
+import java.util.Optional;
+import java.util.ServiceLoader;
+import org.jetbrains.annotations.ApiStatus;
+
+@ApiStatus.Internal
+interface LifecycleEventTypeProvider {
+
+ LifecycleEventTypeProvider PROVIDER = ServiceLoader.load(LifecycleEventTypeProvider.class)
+ .findFirst()
+ .orElseThrow();
+ Optional<LifecycleEventTypeProvider> INSTANCE = ServiceLoader.load(LifecycleEventTypeProvider.class)
+ .findFirst();
+
+ static LifecycleEventTypeProvider provider() {
+ return INSTANCE.orElseThrow();
+ }
+
+ <O extends LifecycleEventOwner, E extends LifecycleEvent> LifecycleEventType.Monitorable<O, E> monitor(String name, Class<? extends O> ownerType);
+
@@ -471,7 +475,7 @@ index 0000000000000000000000000000000000000000..1588f6943a909bed053a952e650e043c
+}
diff --git a/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEvents.java b/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEvents.java
new file mode 100644
index 0000000000000000000000000000000000000000..304f978e40e1759bb19704cc5cec399500905195
index 0000000000000000000000000000000000000000..29476a1a82b3526ac03f21011d297d01462d153e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/lifecycle/event/types/LifecycleEvents.java
@@ -0,0 +1,52 @@
@@ -494,33 +498,33 @@ index 0000000000000000000000000000000000000000..304f978e40e1759bb19704cc5cec3995
+
+ //<editor-fold desc="helper methods" defaultstate="collapsed">
+ @ApiStatus.Internal
+ private static <E extends LifecycleEvent> LifecycleEventType.Monitorable<Plugin, E> plugin(final String name) {
+ static <E extends LifecycleEvent> LifecycleEventType.Monitorable<Plugin, E> plugin(final String name) {
+ return monitor(name, Plugin.class);
+ }
+
+ @ApiStatus.Internal
+ private static <E extends LifecycleEvent> LifecycleEventType.Prioritizable<Plugin, E> pluginPrioritized(final String name) {
+ static <E extends LifecycleEvent> LifecycleEventType.Prioritizable<Plugin, E> pluginPrioritized(final String name) {
+ return prioritized(name, Plugin.class);
+ }
+
+ @ApiStatus.Internal
+ private static <E extends LifecycleEvent> LifecycleEventType.Monitorable<BootstrapContext, E> bootstrap(final String name) {
+ static <E extends LifecycleEvent> LifecycleEventType.Monitorable<BootstrapContext, E> bootstrap(final String name) {
+ return monitor(name, BootstrapContext.class);
+ }
+
+ @ApiStatus.Internal
+ private static <E extends LifecycleEvent> LifecycleEventType.Prioritizable<BootstrapContext, E> bootstrapPrioritized(final String name) {
+ static <E extends LifecycleEvent> LifecycleEventType.Prioritizable<BootstrapContext, E> bootstrapPrioritized(final String name) {
+ return prioritized(name, BootstrapContext.class);
+ }
+
+ @ApiStatus.Internal
+ private static <O extends LifecycleEventOwner, E extends LifecycleEvent, O2 extends O> LifecycleEventType.Monitorable<O, E> monitor(final String name, final Class<O2> ownerType) {
+ return LifecycleEventTypeProvider.PROVIDER.monitor(name, ownerType);
+ static <O extends LifecycleEventOwner, E extends LifecycleEvent, O2 extends O> LifecycleEventType.Monitorable<O, E> monitor(final String name, final Class<O2> ownerType) {
+ return LifecycleEventTypeProvider.provider().monitor(name, ownerType);
+ }
+
+ @ApiStatus.Internal
+ private static <O extends LifecycleEventOwner, E extends LifecycleEvent> LifecycleEventType.Prioritizable<O, E> prioritized(final String name, final Class<? extends O> ownerType) {
+ return LifecycleEventTypeProvider.PROVIDER.prioritized(name, ownerType);
+ static <O extends LifecycleEventOwner, E extends LifecycleEvent> LifecycleEventType.Prioritizable<O, E> prioritized(final String name, final Class<? extends O> ownerType) {
+ return LifecycleEventTypeProvider.provider().prioritized(name, ownerType);
+ }
+ //</editor-fold>
+
File renamed without changes.
File renamed without changes.
Loaded 100 of 982 files, more files were not shown because too many files have changed in this diff. Show more