FastAsyncWorldEdit

FastAsyncWorldEdit

152k Downloads

Off by one error for negative coordinates when using -r with //deform

eztaK-red opened this issue ยท 1 comments

commented

Server Implementation

Paper

Server Version

1.19.2

Describe the bug

When using //deform -r negative coordinates are off by one.

To Reproduce

Select a region around 0,0
Do //deform -r 0
Observe how parts of the region that are in the negatives within the game's coordinate system move around.

Expected behaviour

Nothing should change as we do not modify the x,y,z variables.

Screenshots / Videos

Input and also expected output
2023-02-07_15 11 14

Current output
2023-02-07_15 11 20

Error log (if applicable)

No response

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/4e4bf7430f1b4ac6847ad782e6904782

Fawe Version

FastAsyncWorldEdit version 2.5.2-SNAPSHOT-349

Checklist

Anything else?

When I do //deform -r x=0 it fetches block at x=0.
When I do //deform -r x=-1 it fetches block at x=0.
When I do //deform -r x=-2 it fetches block at x=-1.
When I do //deform -r x=-3 it fetches block at x=-2.
The same thing happens an all three axes.

commented

I think I found the responsible lines of code. It comes from rounding negative doubles using casting (int) instead of using Math.floor.
I've never contributed to an open-source project yet, but I'll try to make a proper Pull Request now.