13
0

Fix Seat problem #7

Manuell gemergt
Lixfel hat 3 Commits von seat nach master 2020-11-15 10:48:00 +01:00 zusammengeführt
Nur Änderungen aus Commit a3d7376d54 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -50,12 +50,11 @@ public class PlayerSeatListener extends BasicListener {
if(event.getPlayer().isInsideVehicle())
event.getPlayer().getVehicle().remove();
Location location = event.getClickedBlock().getLocation();
if (location.getWorld().getBlockAt(location.getBlockX(), location.getBlockY() + 1, location.getBlockZ()).getType() != Material.AIR)
if (event.getClickedBlock().getRelative(0, 1, 0).getType() != Material.AIR)
return;
Arrow arrow = (Arrow) event.getPlayer().getWorld().spawnEntity(location.add(0.5, 0, 0.5), EntityType.ARROW);
Arrow arrow = (Arrow) event.getPlayer().getWorld().spawnEntity(event.getClickedBlock().getLocation().add(0.5, 0, 0.5), EntityType.ARROW);
arrow.setGravity(false);
arrow.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
arrow.addPassenger(event.getPlayer());