Fix touch position on items being offset

This commit is contained in:
filoghost 2019-06-03 10:43:49 +02:00
parent f358483d23
commit ba6d18306e
2 changed files with 2 additions and 5 deletions

View File

@ -69,8 +69,8 @@ public class CraftItemLine extends CraftTouchableLine implements ItemLine {
@Override
public void setTouchHandler(TouchHandler touchHandler) {
if (nmsItem != null) {
Location loc = nmsItem.getBukkitEntityNMS().getLocation();
if (nmsVehicle != null) {
Location loc = nmsVehicle.getBukkitEntityNMS().getLocation();
super.setTouchHandler(touchHandler, loc.getWorld(), loc.getX(), loc.getY() - getItemOffset(), loc.getZ());
} else {
super.setTouchHandler(touchHandler, null, 0, 0, 0);

View File

@ -86,12 +86,9 @@ public class CraftTextLine extends CraftTouchableLine implements TextLine {
@Override
public void setTouchHandler(TouchHandler touchHandler) {
if (nmsNameble != null) {
Location loc = nmsNameble.getBukkitEntityNMS().getLocation();
super.setTouchHandler(touchHandler, loc.getWorld(), loc.getX(), loc.getY() - getTextOffset(), loc.getZ());
} else {
super.setTouchHandler(touchHandler, null, 0, 0, 0);
}