Skip to content

Commit

Permalink
Teehee :3
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Sep 20, 2024
1 parent bab8f81 commit aed0eef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/dev/enjarai/trickster/spell/Fragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ default SerializedSpellInstruction asSerialized() {
return new SerializedSpellInstruction(SpellInstructionType.FRAGMENT, this);
}

default boolean isEphemeral() {
return false;
default Fragment applyEphemeral() {
return this;
}

default Optional<BiFunction<SpellContext, List<Fragment>, Fragment>> getActivator() {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/dev/enjarai/trickster/spell/SpellPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ public void brutallyMurderEphemerals() {
if (glyph instanceof SpellPart spellPart) {
spellPart.brutallyMurderEphemerals();
} else {
if (glyph.isEphemeral()) {
glyph = new ZalgoFragment();
}
glyph = glyph.applyEphemeral();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public BooleanFragment asBoolean() {
}

@Override
public boolean isEphemeral() {
return true;
public Fragment applyEphemeral() {
return new ZalgoFragment();
}

public static EntityFragment from(Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public Text asText() {
return result.append("]");
}

@Override
public Fragment applyEphemeral() {
return new ListFragment(fragments.stream().map(Fragment::applyEphemeral).toList());
}

@Override
public BooleanFragment asBoolean() {
return new BooleanFragment(!fragments.isEmpty());
Expand Down

0 comments on commit aed0eef

Please sign in to comment.