3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

Requested Changes for PR

Dieser Commit ist enthalten in:
Lurkrul 2024-06-24 21:31:50 +08:00
Ursprung b5f5663d47
Commit 83dddab0e5
2 geänderte Dateien mit 1 neuen und 56 gelöschten Zeilen

Datei anzeigen

@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..c9f821dd291c486c56597cc32135f481
+public class DragonPrepareDeathSoundTargetsEvent extends EntityEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+ private Set<Player> playerList;
+ public Set<Player> playerList;
+
+ public DragonPrepareDeathSoundTargetsEvent(final @NotNull EnderDragon enderDragon, Collection<? extends Player> players) {
+ super(enderDragon);
@ -35,60 +35,6 @@ index 0000000000000000000000000000000000000000..c9f821dd291c486c56597cc32135f481
+ }
+
+ /**
+ * Gets the list of {@link Player}s that are going to hear the sound.
+ *
+ * @return Collection of Players
+ */
+ public Set<Player> getPlayerList() {
+ return playerList;
+ }
+
+ /**
+ * Sets the player list to a Collection of defined {@link Player}s
+ *
+ * @param newPlayerList The new collection of players to hear the sound.
+ */
+ public void setPlayerList(Set<Player> newPlayerList) {
+ playerList = newPlayerList;
+ }
+
+ /**
+ * Add another {@link Player} to the list of that will hear the death sound if not already present.
+ *
+ * @param player The player to be added
+ */
+ public void addPlayer(Player player) {
+ playerList.add(player);
+ }
+
+ /**
+ * Will remove a {@link Player} from the list that will hear the death sound if present.
+ *
+ * @param player The player to be removed
+ */
+ public void removePlayer(Player player) {
+ playerList.remove(player);
+ }
+
+ /**
+ * Will add a collection of {@link Player}s to the list that will hear the death sound if not already present.
+ *
+ * @param playersToAdd Collection of players to be added
+ */
+ public void addPlayers(Set<Player> playersToAdd) {
+ playerList.addAll(playersToAdd);
+ }
+
+ /**
+ * Will remove a collection of {@link Player}s from the list that will hear the death sound if present.
+ *
+ * @param playersToRemove Collection of players to be removed.
+ */
+ public void removePlayers(Set<Player> playersToRemove) {
+ playerList.removeAll(playersToRemove);
+ }
+
+ /**
+ * The {@link EnderDragon} that fired this event when it died.
+ *
+ * @return the dragon

Datei anzeigen

@ -35,7 +35,6 @@ index bd6fee3e3ad9116802ff8bb57bfa741b881c4057..f225942db664b8ce6f97dd907f39daca
// Paper end - add EntityFertilizeEggEvent
+
+ // Paper start - add DragonPrepareDeathSoundTargetsEvent
+
+ /**
+ * Calls {@link io.papermc.paper.event.entity.DragonPrepareDeathSoundTargetsEvent}
+ * Listeners can add and remove players from the list of players that will hear the dragon death sound.