mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-10-07 12:07:38 +02:00
Fix touch position on items being offset
This commit is contained in:
parent
f358483d23
commit
ba6d18306e
@ -69,8 +69,8 @@ public class CraftItemLine extends CraftTouchableLine implements ItemLine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTouchHandler(TouchHandler touchHandler) {
|
public void setTouchHandler(TouchHandler touchHandler) {
|
||||||
if (nmsItem != null) {
|
if (nmsVehicle != null) {
|
||||||
Location loc = nmsItem.getBukkitEntityNMS().getLocation();
|
Location loc = nmsVehicle.getBukkitEntityNMS().getLocation();
|
||||||
super.setTouchHandler(touchHandler, loc.getWorld(), loc.getX(), loc.getY() - getItemOffset(), loc.getZ());
|
super.setTouchHandler(touchHandler, loc.getWorld(), loc.getX(), loc.getY() - getItemOffset(), loc.getZ());
|
||||||
} else {
|
} else {
|
||||||
super.setTouchHandler(touchHandler, null, 0, 0, 0);
|
super.setTouchHandler(touchHandler, null, 0, 0, 0);
|
||||||
|
@ -86,12 +86,9 @@ public class CraftTextLine extends CraftTouchableLine implements TextLine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTouchHandler(TouchHandler touchHandler) {
|
public void setTouchHandler(TouchHandler touchHandler) {
|
||||||
|
|
||||||
if (nmsNameble != null) {
|
if (nmsNameble != null) {
|
||||||
|
|
||||||
Location loc = nmsNameble.getBukkitEntityNMS().getLocation();
|
Location loc = nmsNameble.getBukkitEntityNMS().getLocation();
|
||||||
super.setTouchHandler(touchHandler, loc.getWorld(), loc.getX(), loc.getY() - getTextOffset(), loc.getZ());
|
super.setTouchHandler(touchHandler, loc.getWorld(), loc.getX(), loc.getY() - getTextOffset(), loc.getZ());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
super.setTouchHandler(touchHandler, null, 0, 0, 0);
|
super.setTouchHandler(touchHandler, null, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user