Simplify PlayerSeatListener
Dieser Commit ist enthalten in:
Ursprung
be105ac770
Commit
a3d7376d54
@ -50,12 +50,11 @@ public class PlayerSeatListener extends BasicListener {
|
|||||||
|
|
||||||
if(event.getPlayer().isInsideVehicle())
|
if(event.getPlayer().isInsideVehicle())
|
||||||
event.getPlayer().getVehicle().remove();
|
event.getPlayer().getVehicle().remove();
|
||||||
|
|
||||||
Location location = event.getClickedBlock().getLocation();
|
if (event.getClickedBlock().getRelative(0, 1, 0).getType() != Material.AIR)
|
||||||
if (location.getWorld().getBlockAt(location.getBlockX(), location.getBlockY() + 1, location.getBlockZ()).getType() != Material.AIR)
|
|
||||||
return;
|
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.setGravity(false);
|
||||||
arrow.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
|
arrow.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
|
||||||
arrow.addPassenger(event.getPlayer());
|
arrow.addPassenger(event.getPlayer());
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren