-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Migrate WorldBorder API to use ticks #13223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate WorldBorder API to use ticks #13223
Conversation
|
A few test i make... WorldBorder worldBorder = Bukkit.createWorldBorder();
worldBorder.setSize(50);
player.setWorldBorder(worldBorder);WorldBorder worldBorder = player.getWorldBorder();
if (worldBorder != null) {
worldBorder.setSize(10, TimeUnit.SECONDS, 10);
}WorldBorder worldBorder = player.getWorld().getWorldBorder();
worldBorder.setSize(20, TimeUnit.SECONDS, 30);the border change in the time expected. same for WorldBorderBoundsChangeEvent where the getDuration and Ticks show the value expected. |
a9f7f65 to
df6d372
Compare
paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/event/world/border/WorldBorderBoundsChangeEvent.java
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/event/world/border/WorldBorderBoundsChangeEvent.java
Outdated
Show resolved
Hide resolved
paper-server/patches/sources/net/minecraft/world/level/border/WorldBorder.java.patch
Show resolved
Hide resolved
paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/event/world/border/WorldBorderBoundsChangeEvent.java
Show resolved
Hide resolved
d9ff2a4 to
e716f68
Compare
paper-server/patches/sources/net/minecraft/world/level/border/WorldBorder.java.patch
Outdated
Show resolved
Hide resolved
|
Do you think there's a need to handle WorldBorderBoundsChangeFinishEvent#getDuration now returning ticks instead of milliseconds or not? |
hmm not sure.. the method even not mention what duration its suposed to be.... |
paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorldBorder.java
Outdated
Show resolved
Hide resolved
|
Just add this for reference.. if they not fix i can make another PR o add to this (what happen first..) https://mojira.dev/MC-304061 |
PS: Mojang still set the default value in 15 what is a braking change.. but well... nothing use the warning time not?
2971ea4 to
af2349c
Compare
|
Rebased with 25w46a, https://mojira.dev/MC-304061 was fixed then not need consider that now :) |
|
Sadly MC-304061 is not completely fixed since they forgot to change the initial value of the field which affect the virtual border atm i believe. |
Yeah i notice that too but the virtual worldborder just call the default constructor and that use the i dont find in what case that 15 in the WorldBorder class can be used because in all cases that value is overriden by default or the constructor with Settings passed. |
|
Yes but in that case the settings are never applied, you can see it by just calling getWarningTimeTicks after creating your border. Also why changeSize's ticks is not clamped like in the event? |
|
Okay i see now... not make sense in NMS how work.... then still need override that... about the changeSize i think forget that when make that new one... if is new maybe can be good just check? if not then not make sense have a Precondition for check time > 0 if we clamp the value |
|
Created #13308 meanwhile for handle the two things.... |
This PR try to manage the breaking change in the last snapshot where worldborder time for reduce now works with ticks and not seconds/milis
https://www.minecraft.net/en-us/article/minecraft-snapshot-25w43a
PD: Need test this with the virtual worldborder feature