Updates for worldborders#8659
Conversation
This comment has been minimized.
This comment has been minimized.
…s/expressions/ExprWorldBorderWarningTime.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/expressions/ExprWorldBorder.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/WorldBorderModule.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/WorldBorderModule.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…s/WorldBorderModule.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
… add/set/remove NaN/infinity/-infinity
APickledWalrus
left a comment
There was a problem hiding this comment.
Looking good so far. Indentation is cooked for a lot of the register methods - I covered some but there are more, so I recommend going back through those files.
…s/expressions/ExprSecCreateWorldBorder.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/WorldBorderModule.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorderWarningTime.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorderWarningTime.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…rldBorder # Conflicts: # src/main/java/org/skriptlang/skript/bukkit/worldborder/elements/WorldBorderModule.java
APickledWalrus
left a comment
There was a problem hiding this comment.
Formatting is still cooked on a bunch of the register methods - specifically the signature lines and closing curly brace lines. Also double check spacing on your methodExists calls - there is missing spacing between parameters throughout those.
|
god damn why did it revert I did all of those changes ;-; |
…s/effects/EffWorldBorderExpand.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprSecCreateWorldBorder.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorder.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorderSize.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
…s/expressions/ExprWorldBorder.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
|
Okay I think I fixed everything @APickledWalrus ^ |
sovdeeth
left a comment
There was a problem hiding this comment.
looks good, just some weird formatting issues
| infoBuilder(ExprWorldBorderCenter.class, Location.class, "world[ ]border (center|middle)", "worldborders", true) | ||
| .supplier(ExprWorldBorderCenter::new) | ||
| .build()); | ||
| } |
| static { | ||
| registerDefault(ExprWorldBorderDamageAmount.class, Double.class, "world[ ]border damage amount", "worldborders"); | ||
| } | ||
| public static void register(SyntaxRegistry syntaxRegistry) { |
…s/expressions/ExprWorldBorderDamageBuffer.java Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
…s/expressions/ExprWorldBorderDamageAmount.java Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
…s/expressions/ExprWorldBorderWarningTime.java Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
It didn't fix the ones pickle commented on (ExprWorldBorderDamageAmount for example) and there's still a few with the closing |
|
okay I fixed all extra tab for } for register methods |
| private Expression<Number> numberExpr; | ||
| private @Nullable Expression<Timespan> timespan; | ||
| private static final double MAX_WORLDBORDER_SIZE = 59999968; | ||
| private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class, "changeSize"); |
There was a problem hiding this comment.
| private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class, "changeSize"); | |
| private static final boolean USE_DEPRECATED = !Skript.methodExists(org.bukkit.WorldBorder.class, "changeSize"); |
| .build()); | ||
| } | ||
|
|
||
| private final static boolean useDeprecated = !Skript.methodExists(WorldBorder.class, "getWarningTimeTicks"); |
There was a problem hiding this comment.
| private final static boolean useDeprecated = !Skript.methodExists(WorldBorder.class, "getWarningTimeTicks"); | |
| private static final boolean USE_DEPRECATED = !Skript.methodExists(WorldBorder.class, "getWarningTimeTicks"); |
| .build()); | ||
| } | ||
|
|
||
| private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class,"getWarningTimeTicks"); |
There was a problem hiding this comment.
| private final static boolean useDeprecated = !Skript.methodExists(org.bukkit.WorldBorder.class,"getWarningTimeTicks"); | |
| private static final boolean USE_DEPRECATED = !Skript.methodExists(org.bukkit.WorldBorder.class,"getWarningTimeTicks"); |
| ) | ||
| .addExample(""" | ||
| on worldborder bounds change: | ||
| "broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%" |
There was a problem hiding this comment.
| "broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%" | |
| broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan% |
| .addDescription(""" | ||
| Called when a moving world border has finished its move. | ||
| This event does not get called for virtual borders. | ||
| """ | ||
| ) |
There was a problem hiding this comment.
| .addDescription(""" | |
| Called when a moving world border has finished its move. | |
| This event does not get called for virtual borders. | |
| """ | |
| ) | |
| .addDescription(""" | |
| Called when a moving world border has finished its move. | |
| This event does not get called for virtual borders. | |
| """) |
| .addExample(""" | ||
| on worldborder bounds finish change: | ||
| broadcast "Over the past %event-timespan%, the diameter of %event-worldborder% went from %past event-number% to %event-number%" | ||
| """) |
There was a problem hiding this comment.
| .addExample(""" | |
| on worldborder bounds finish change: | |
| broadcast "Over the past %event-timespan%, the diameter of %event-worldborder% went from %past event-number% to %event-number%" | |
| """) | |
| .addExample(""" | |
| on worldborder bounds finish change: | |
| broadcast "Over the past %event-timespan%, the diameter of %event-worldborder% went from %past event-number% to %event-number%" | |
| """) |
| .addExample(""" | ||
| on worldborder bounds change: | ||
| "broadcast "The diameter of %event-worldborder% is changing from %past event-number% to %event-number% over the next %event-timespan%" | ||
| """) |
There was a problem hiding this comment.
| """) | |
| """) |
| """ | ||
| ) |
There was a problem hiding this comment.
| """ | |
| ) | |
| """) |
| .addExample(""" | ||
| on worldborder center change: | ||
| "broadcast "The center of %event-worldborder% has moved from %past event-location% to %event-location%" | ||
| """) |
There was a problem hiding this comment.
| .addExample(""" | |
| on worldborder center change: | |
| "broadcast "The center of %event-worldborder% has moved from %past event-location% to %event-location%" | |
| """) | |
| .addExample(""" | |
| on worldborder center change: | |
| broadcast "The center of %event-worldborder% has moved from %past event-location% to %event-location% | |
| """) |

Problem
All worldborder elements were running on deprecated registration methods as well as worldborder events being in the god awful simpleevents while also using deprecated registration methods
additionally worldborderwarningtime was using deprecated methods to set/get duration (old method used seconds via long newer method simply uses ticks)
Solution
Deletes all worldborder elements including events
Creates a worldbordermodule
Re adds all worldborder elements including events to use new registry & event-value registry system
Makes versions >= 1.21.11 use the newer method for get/setting warningtime for worldborders older versions fallback to the older method
Changes to tests:
changed test for warningtime when using >= 1.21.11
changed all worldborder tests to use 'catch runtime errors' when getting/setting/removing NaN/infinity/-infinity
Testing Completed
Manual testing completed everything works (though additional testing should be done on lower versions as I only tested on 1.21.11)
Supporting Information
I think registering all the worldborder events & event-values should each be their old file inside elements -> events though I would like confirmation on this before doing (right now its all registered in worldbordermodule)
Completes: none
Related: replaces #8504
AI assistance: next to none
overall this is mostly an internal PR nothing for the user really changes (for the most part there are some things)