Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
unldenis committed Sep 3, 2022
2 parents 45cb04b + efaed21 commit d5fa335
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public class ExampleHolograms implements Listener {
* Appends a new Hologram to the pool.
*
* @param location The location the Hologram will be spawned at
* @param excludedPlayer A player which will not see the Hologram for 10 seconds
*/
public void appendHOLO(@NotNull Location location) {
public void appendHOLO(@NotNull Location location, Player excludedPlayer) {
// building the NPC
Hologram hologram = Hologram.builder()
.location(location)
Expand All @@ -75,6 +76,14 @@ public class ExampleHolograms implements Listener {
hologram.getLines().get(3).setAnimation(Animation.AnimationType.CIRCLE);
// simple changing animating block and text
timingBlock(hologram);

if (excludedPlayer != null) {
// adding the excluded player which will not see the Hologram
hologram.addExcludedPlayer(excludedPlayer);

// shows 10 seconds after theHologram
Bukkit.getScheduler().runTaskLater(plugin, () -> hologram.removeExcludedPlayer(excludedPlayer), 20L * 10);
}
}

private final static Queue<Material> materials = new ArrayDeque<>() {
Expand Down

0 comments on commit d5fa335

Please sign in to comment.