Add Seat Change #2
@ -41,11 +41,13 @@ public class PlayerSeatListener extends BasicListener {
|
|||||||
if(event.getPlayer().getGameMode() != GameMode.ADVENTURE)
|
if(event.getPlayer().getGameMode() != GameMode.ADVENTURE)
|
||||||
return;
|
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 arrow = (Arrow) event.getPlayer().getWorld().spawnEntity(event.getClickedBlock().getLocation().add(0.5, 0, 0.5), EntityType.ARROW);
|
||||||
arrow.setGravity(false);
|
arrow.setGravity(false);
|
||||||
arrow.addScoreboardTag(event.getPlayer().getUniqueId().toString());
|
|
||||||
arrow.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
|
arrow.setPickupStatus(AbstractArrow.PickupStatus.DISALLOWED);
|
||||||
arrow.setPassenger(event.getPlayer());
|
arrow.addPassenger(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -56,9 +58,6 @@ public class PlayerSeatListener extends BasicListener {
|
|||||||
if(event.getEntityType() != EntityType.PLAYER)
|
if(event.getEntityType() != EntityType.PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.getEntity().getWorld().getEntitiesByClasses(Arrow.class).forEach(entity -> {
|
event.getDismounted().remove();
|
||||||
if(entity.getScoreboardTags().contains(event.getEntity().getUniqueId().toString()))
|
|
||||||
entity.remove();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren