Skip to content

Commit

Permalink
add deprecation for hurt source_once
Browse files Browse the repository at this point in the history
also better flag error
  • Loading branch information
mcmonkey4eva committed May 2, 2021
1 parent 0253d01 commit 2404731
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -7,6 +7,7 @@
import com.denizenscript.denizencore.objects.Argument;
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.objects.core.DurationTag;
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.core.ListTag;
import com.denizenscript.denizencore.objects.core.TimeTag;
import com.denizenscript.denizencore.scripts.ScriptEntry;
Expand Down Expand Up @@ -218,7 +219,12 @@ else if (object instanceof FlaggableObject) {
tracker = obj.getFlagTracker();
}
else {
Debug.echoError("Cannot flag '" + object + "': that object type is not flaggable!");
if (object instanceof ElementTag && !object.toString().contains("@")) {
Debug.echoError("Cannot flag '" + object + "': that does not appear to be an object! Only objects (like an EntityTag) and special keyword 'server' are flaggable!");
}
else {
Debug.echoError("Cannot flag '" + object + "': that object type is not flaggable!");
}
continue;
}
}
Expand Down
Expand Up @@ -195,6 +195,9 @@ public class Deprecations {
// In Bukkit impl, Added 2020/04/16.
public static Warning entityStandingOn = new SlowWarning(pointlessSubtagPrefix + "entity.location.standing_on is now just entity.standing_on.");

// In Bukkit impl, Added 2021/05/02.
public static Warning hurtSourceOne = new SlowWarning("The 'hurt' command's 'source_once' argument is deprecated due to being now irrelevant thanks to the new NMS backing for the hurt command.");

// ==================== FUTURE deprecations ====================

// In Bukkit impl, Added 2019/11/11, deprecate officially by 2021.
Expand Down

0 comments on commit 2404731

Please sign in to comment.