Skip to content

Commit 9bb835d

Browse files
Merge branch 'dev/patch' into feature/prevent-crash-when-loading-bad-blockdata
2 parents 03bb8bb + 2a9f923 commit 9bb835d

89 files changed

Lines changed: 358 additions & 294 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-pre2
8+
version=2.11.0
99
jarName=Skript.jar
10-
testEnv=java21/paper-1.21.4
10+
testEnv=java21/paper-1.21.5
1111
testEnvJavaVersion=21

skript-aliases

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,14 +1002,15 @@ public static ArrayList<TriggerItem> loadItems(SectionNode node) {
10021002
break find_section;
10031003
Collection<LogEntry> errors = handler.getErrors();
10041004

1005-
// restore the failure log
1006-
if (errors.isEmpty()) {
1005+
// restore the failure log if:
1006+
// 1. there are no errors from the statement parse
1007+
// 2. the error message is the default one from the statement parse
1008+
// 3. the backup log contains a message about the section being claimed
1009+
if (errors.isEmpty()
1010+
|| errors.iterator().next().getMessage().contains("Can't understand this condition/effect:")
1011+
|| backup.getErrors().iterator().next().getMessage().contains("tried to claim the current section, but it was already claimed by")
1012+
) {
10071013
handler.restore(backup);
1008-
} else { // We specifically want these two errors in preference to the section error!
1009-
String firstError = errors.iterator().next().getMessage();
1010-
if (!firstError.contains("is a valid statement but cannot function as a section (:)")
1011-
&& !firstError.contains("You cannot have two section-starters in the same line"))
1012-
handler.restore(backup);
10131014
}
10141015
continue;
10151016
} finally {

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) {

0 commit comments

Comments
 (0)