mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-07 19:30:48 +01:00
Allow for accurate teleport signs
This commit is contained in:
parent
eac37331d0
commit
d8791cc5a8
@ -105,9 +105,13 @@ public class TeleportSign extends Button implements LocationSign {
|
|||||||
double y = NumberUtil.parseDouble(loc[1]);
|
double y = NumberUtil.parseDouble(loc[1]);
|
||||||
double z = NumberUtil.parseDouble(loc[2]);
|
double z = NumberUtil.parseDouble(loc[2]);
|
||||||
|
|
||||||
// If round number, add 0.5 to tp to middle of block
|
// If number is even, add +0.5 to teleport to the middle of the block
|
||||||
x = NumberUtil.parseInt(loc[0]) + 0.5;
|
if (!loc[0].contains(".")) {
|
||||||
z = NumberUtil.parseInt(loc[2]) + 0.5;
|
x += 0.5;
|
||||||
|
}
|
||||||
|
if (!loc[2].contains(".")) {
|
||||||
|
z += 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
location.setX(x);
|
location.setX(x);
|
||||||
location.setY(y);
|
location.setY(y);
|
||||||
|
Loading…
Reference in New Issue
Block a user