Skip to content

Commit

Permalink
hologram_lines cleaning and paper 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 4, 2022
1 parent 050826b commit 2e07f5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion paper/pom.xml
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Expand Up @@ -1364,9 +1364,13 @@ public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("hologram_lines") && mechanism.requireObject(ListTag.class)) {
HologramTrait hologram = getCitizen().getOrAddTrait(HologramTrait.class);
hologram.clear();
for (String str : mechanism.valueAsType(ListTag.class)) {
hologram.addLine(str);
if (npc.isSpawned()) {
hologram.onDespawn();
}
hologram.getLines().clear();
hologram.getLines().addAll(mechanism.valueAsType(ListTag.class));
if (npc.isSpawned()) {
hologram.onSpawn();
}
}

Expand Down

0 comments on commit 2e07f5b

Please sign in to comment.