13
0

Simplify PlayerSeatListener

Dieser Commit ist enthalten in:
jojo 2020-11-15 08:41:29 +01:00
Ursprung be105ac770
Commit a3d7376d54

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());