Get rid of BlockVector, BlockVector2D, BlockWorldVector and BlockWorldVector2D
LadyCailinBot opened this issue ยท 7 comments
WORLDEDIT-2890 - Reported by Tomy.Lobo
They serve no actual purpose that cannot be achieved with just using pre-rounded vectors.
On the other hand, they do cause problems [1] and thus should be phased out.
I think that for the most part, we can just replace them 1:1 by regular Vectors and live happily ever after, since we only ever instantiate them with integral coordinates anyway.
To verify this, remove their hashcode and equals overrides, which makes them essentially Vectors with a fancy name.
[1] ca06489
Comment by sk89q
I've wanted to remove them for some time but I'm not sure we can because it'd break literally everything, including anything that compiles against WorldEdit.
Comment by Tomy.Lobo
to make the later a valid concern you'd have to assume that someone actually uses non-integer blockvectors in hashsets or otherwise where the equals method is required
Comment by Tomy.Lobo
about our own code using blockvectors the problematic way, that can be easily tested by putting if () System.out.println("BlockVector instantiated with non-integer parameter.") into the constructor. possibly add a stack trace.
Comment by Tomy.Lobo
In the end, we'll probably have to keep them in a very empty and very deprecated form, but that shouldn't cause any issues.
Comment by me4502
If this is actually implemented - please tell me so I can port CraftBook over.
Comment by Dark_Arc
This would probably be best done at the same time as the operations rework that way there is 1 API breaking update as apposed to several
Comment by Tomy.Lobo
@me4502 you can do that beforehand. Vector's behaviour won't be changed