Skip to content

Commit dc8885b

Browse files
authored
Merge branch 'dev/feature' into feature/better-enchanted-condition
2 parents 0d13aa2 + 904640d commit dc8885b

110 files changed

Lines changed: 592 additions & 427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
shadow group: 'org.bstats', name: 'bstats-bukkit', version: '3.1.0'
3030
shadow group: 'net.kyori', name: 'adventure-text-serializer-bungeecord', version: '4.3.4'
3131

32-
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21.4-R0.1-SNAPSHOT'
32+
implementation group: 'io.papermc.paper', name: 'paper-api', version: '1.21.5-R0.1-SNAPSHOT'
3333
implementation group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
3434

3535
// bundled with Minecraft 1.19.4+ for display entity transforms
@@ -246,7 +246,7 @@ void createTestTask(String name, String desc, String environments, int javaVersi
246246
def java21 = 21
247247
def java17 = 17
248248

249-
def latestEnv = 'java21/paper-1.21.4.json'
249+
def latestEnv = 'java21/paper-1.21.5.json'
250250
def latestJava = java21
251251
def oldestJava = java17
252252

code-conventions.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,3 +314,14 @@ The exceptions are `Material.AIR`, which is a good way to represent "nothing"
314314
and `Material.STONE` which can be used to get a dummy `ItemMeta`.
315315

316316
Prefer to avoid referencing the Biome enum directly, since it has changed between versons in the past.
317+
318+
### Deprecating
319+
320+
When deprecating a Java element (such as a class, method, or constructor):
321+
322+
1. Replace all internal usages of the deprecated element within the Skript codebase.
323+
2. Add a Javadoc `@deprecated` tag that states the recommended alternative.
324+
3. Annotate the element with `@Deprecated(since = "INSERT VERSION", forRemoval = true)` to indicate it is scheduled for removal and what feature version it was deprecated.
325+
326+
Deprecation PRs are typically merged for a feature release, so the PR should target `dev/feature` branch.
327+
Deprecated elements may be removed three feature releases after the version they were deprecated in.

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ org.gradle.parallel=true
55

66
groupid=ch.njol
77
name=skript
8-
version=2.11.0
8+
version=2.11.1
99
jarName=Skript.jar
10-
testEnv=java21/paper-1.21.4
10+
testEnv=java21/paper-1.21.5
1111
testEnvJavaVersion=21

src/main/java/ch/njol/skript/Skript.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static void updateMinecraftVersion() {
210210

211211
@Nullable
212212
private static Version version = null;
213-
@Deprecated(forRemoval = true) // TODO this field will be replaced by a proper registry later
213+
@Deprecated(since = "2.9.0", forRemoval = true) // TODO this field will be replaced by a proper registry later
214214
private static @UnknownNullability ExperimentRegistry experimentRegistry;
215215

216216
public static Version getVersion() {
@@ -1077,18 +1077,6 @@ public static boolean isRunningMinecraft(final Version v) {
10771077
return minecraftVersion.compareTo(v) >= 0;
10781078
}
10791079

1080-
/**
1081-
* Used to test whether certain Bukkit features are supported.
1082-
*
1083-
* @param className
1084-
* @return Whether the given class exists.
1085-
* @deprecated use {@link #classExists(String)}
1086-
*/
1087-
@Deprecated
1088-
public static boolean supports(final String className) {
1089-
return classExists(className);
1090-
}
1091-
10921080
/**
10931081
* Tests whether a given class exists in the classpath.
10941082
*
@@ -1379,7 +1367,7 @@ private static void stopAcceptingRegistrations() {
13791367

13801368
// ================ ADDONS ================
13811369

1382-
@Deprecated
1370+
@Deprecated(since = "2.10.0", forRemoval = true)
13831371
private static final Set<SkriptAddon> addons = new HashSet<>();
13841372

13851373
/**
@@ -1429,7 +1417,7 @@ public static SkriptAddon registerAddon(JavaPlugin plugin) {
14291417
return Collections.unmodifiableCollection(addons);
14301418
}
14311419

1432-
@Deprecated
1420+
@Deprecated(since = "2.10.0", forRemoval = true)
14331421
private static @Nullable SkriptAddon addon;
14341422

14351423
/**

src/main/java/ch/njol/skript/SkriptCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,10 +514,10 @@ private static List<File> getSubFiles(File file) {
514514
}
515515

516516
/**
517-
* Moved to {@link ScriptLoader#getScriptFromName(String)}
517+
* @deprecated Use {@link ScriptLoader#getScriptFromName(String)} instead.
518518
*/
519519
@Nullable
520-
@Deprecated(forRemoval = true)
520+
@Deprecated(since = "2.10.0", forRemoval = true)
521521
public static File getScriptFromName(String script) {
522522
return ScriptLoader.getScriptFromName(script);
523523
}

src/main/java/ch/njol/skript/SkriptConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public static String formatDate(final long timestamp) {
203203
new Option<>("disable starting a variable's name with an expression warnings", false);
204204
public static final Option<Boolean> disableUnreachableCodeWarnings = new Option<>("disable unreachable code warnings", false);
205205

206-
@Deprecated
206+
@Deprecated(since = "2.3.0", forRemoval = true)
207207
public static final Option<Boolean> enableScriptCaching = new Option<>("enable script caching", false)
208208
.optional(true);
209209

src/main/java/ch/njol/skript/SkriptEventHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ public static void logTriggerEnd(Trigger t) {
251251
}
252252

253253
/**
254-
* @deprecated This method no longer does anything as self registered Triggers
254+
* @deprecated This method no longer does anything as self registered Triggers.
255255
* are unloaded when the {@link ch.njol.skript.lang.SkriptEvent} is unloaded (no need to keep tracking them here).
256256
*/
257-
@Deprecated
257+
@Deprecated(since = "2.7.0", forRemoval = true)
258258
public static void addSelfRegisteringTrigger(Trigger t) { }
259259

260260
/**
@@ -337,7 +337,7 @@ public static void unregisterBukkitEvents(Trigger trigger) {
337337
* Events which are listened even if they are cancelled. This should no longer be used.
338338
* @deprecated Users should specify the listening behavior in the event declaration. "on any %event%:", "on cancelled %event%:".
339339
*/
340-
@Deprecated
340+
@Deprecated(since = "2.9.0", forRemoval = true)
341341
public static final Set<Class<? extends Event>> listenCancelled = new HashSet<>();
342342

343343
/**

src/main/java/ch/njol/skript/aliases/Aliases.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public static void clear() {
381381
*
382382
* @deprecated Freezes server on call. Use {@link #loadAsync()} instead.
383383
*/
384-
@Deprecated
384+
@Deprecated(since = "2.10.0", forRemoval = true)
385385
public static void load() {
386386
try {
387387
long start = System.currentTimeMillis();
@@ -608,7 +608,7 @@ public static EntityData<?> getRelatedEntity(ItemData data) {
608608
* @return An item.
609609
* @throws IllegalArgumentException When item is not found.
610610
*/
611-
@Deprecated(forRemoval = true, since = "2.9.0")
611+
@Deprecated(since = "2.9.0", forRemoval = true)
612612
public static ItemType javaItemType(String name) {
613613
ItemType type = parseItemType(name);
614614
if (type == null) {

src/main/java/ch/njol/skript/aliases/ItemData.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public static class OldItemData {
6868
/**
6969
* Before 1.13, data values ("block states") are applicable to items.
7070
*
71-
* @deprecated before 1.13 is no longer supported
71+
* @deprecated before 1.13 is no longer supported.
7272
*/
73-
@Deprecated
73+
@Deprecated(since = "2.7.0", forRemoval = true)
7474
public static final boolean itemDataValues = false;
7575

7676
/**
@@ -179,9 +179,9 @@ public ItemData(ItemStack stack) {
179179
}
180180

181181
/**
182-
* @deprecated Use {@link ItemData#ItemData(BlockData)} instead
182+
* @deprecated Use {@link ItemData#ItemData(BlockData)} instead.
183183
*/
184-
@Deprecated
184+
@Deprecated(since = "2.8.4", forRemoval = true)
185185
public ItemData(BlockState blockState) {
186186
this(blockState.getBlockData());
187187
}

src/main/java/ch/njol/skript/aliases/ItemType.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ public ItemType(ItemStack i) {
174174
}
175175

176176
/**
177-
* @deprecated Use {@link #ItemType(BlockData)} instead
177+
* @deprecated Use {@link #ItemType(BlockData)} instead.
178178
*/
179-
@Deprecated
179+
@Deprecated(since = "2.8.4", forRemoval = true)
180180
public ItemType(BlockState blockState) {
181181
this(blockState.getBlockData());
182182
}
@@ -268,9 +268,9 @@ public boolean isOfType(@Nullable ItemStack item) {
268268
}
269269

270270
/**
271-
* @deprecated Use {@link #isOfType(BlockData)} instead
271+
* @deprecated Use {@link #isOfType(BlockData)} instead.
272272
*/
273-
@Deprecated
273+
@Deprecated(since = "2.8.4", forRemoval = true)
274274
public boolean isOfType(@Nullable BlockState blockState) {
275275
return blockState != null && isOfType(blockState.getBlockData());
276276
}
@@ -1239,9 +1239,9 @@ public List<String> getRawNames() {
12391239
/**
12401240
* Gets all enchantments of this item.
12411241
* @return Enchantments.
1242-
* @deprecated Use {@link ItemType#getEnchantmentTypes()}
1242+
* @deprecated Use {@link ItemType#getEnchantmentTypes()} instead.
12431243
*/
1244-
@Deprecated
1244+
@Deprecated(since = "2.3.0", forRemoval = true)
12451245
@Nullable
12461246
public Map<Enchantment,Integer> getEnchantments() {
12471247
if (globalMeta == null)
@@ -1256,9 +1256,9 @@ public Map<Enchantment,Integer> getEnchantments() {
12561256
/**
12571257
* Adds enchantments to this item type.
12581258
* @param enchantments Enchantments.
1259-
* @deprecated Use {@link ItemType#addEnchantments(EnchantmentType...)}
1259+
* @deprecated Use {@link ItemType#addEnchantments(EnchantmentType...)} instead.
12601260
*/
1261-
@Deprecated
1261+
@Deprecated(since = "2.3.0", forRemoval = true)
12621262
public void addEnchantments(Map<Enchantment,Integer> enchantments) {
12631263
if (globalMeta == null)
12641264
globalMeta = ItemData.itemFactory.getItemMeta(Material.STONE);

0 commit comments

Comments
 (0)