13
0

Merge remote-tracking branch 'origin/seat'

Dieser Commit ist enthalten in:
Lixfel 2020-11-02 16:23:10 +01:00
Commit ae75365dda

Datei anzeigen

@ -41,11 +41,13 @@ public class PlayerSeatListener extends BasicListener {
if(event.getPlayer().getGameMode() != GameMode.ADVENTURE)
return;
if(event.getPlayer().isInsideVehicle())
event.getPlayer().getVehicle().remove();
Arrow arrow = (Arrow) event.getPlayer().getWorld().spawnEntity(event.getClickedBlock().getLocation().add(0.5, 0, 0.5), EntityType.ARROW);
arrow.setGravity(false);
arrow.addScoreboardTag(event.getPlayer().getUniqueId().toString());
arrow.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
arrow.setPassenger(event.getPlayer());
arrow.addPassenger(event.getPlayer());
}
@EventHandler
@ -56,9 +58,6 @@ public class PlayerSeatListener extends BasicListener {
if(event.getEntityType() != EntityType.PLAYER)
return;
event.getEntity().getWorld().getEntitiesByClasses(Arrow.class).forEach(entity -> {
if(entity.getScoreboardTags().contains(event.getEntity().getUniqueId().toString()))
entity.remove();
});
event.getDismounted().remove();
}
}