Backport some stuff from the generators branch (#10365)

This commit is contained in:
Lulu13022002
2024-04-06 23:51:47 +02:00
parent 613a19f70d
commit d06c0b4571
7 changed files with 74 additions and 24 deletions

View File

@@ -21,6 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@
+package io.papermc.paper.potion;
+
+import org.bukkit.potion.PotionEffect;
+import org.bukkit.potion.PotionEffectType;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.NotNull;
@@ -31,24 +32,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+public sealed interface SuspiciousEffectEntry permits SuspiciousEffectEntryImpl {
+
+ /**
+ * Gets the effect type.
+ * Gets the effect type.
+ *
+ * @return type
+ */
+ * @return effect type
+ */
+ @NotNull PotionEffectType effect();
+
+ /**
+ * Gets the duration for this effect instance.
+ *
+ * @return duration (in ticks)
+ */
+ * Gets the duration for this effect instance.
+ *
+ * @return duration (in ticks) or {@link PotionEffect#INFINITE_DURATION}
+ */
+ int duration();
+
+ /**
+ * Creates a new instance of SuspiciousEffectEntry.
+ *
+ * @param effectType effect type
+ * @param duration duration (in ticks)
+ * @param duration duration (in ticks) or {@link PotionEffect#INFINITE_DURATION}
+ * @return new instance of an entry
+ */
+ @Contract(value = "_, _ -> new", pure = true)