Skip to content

Commit

Permalink
Slight tweak, cleaner now
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarWitch7 committed Jul 6, 2024
1 parent 7b2eeb7 commit e63e716
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/main/java/dev/enjarai/trickster/spell/SpellPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ public SpellPart(Fragment glyph, List<Optional<SpellPart>> subParts) {
this.subParts = new ArrayList<>(subParts);
}

public SpellPart(Fragment glyph) {
this(glyph, new ArrayList<>());
}

public SpellPart() {
this(new PatternGlyph(), new ArrayList<>());
this(new PatternGlyph());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ public AddVelocityTrick() {
@Override
public Fragment activate(SpellContext ctx, List<Fragment> fragments) throws BlunderException {
var entity = expectInput(fragments, FragmentType.ENTITY, 0);
var velocity = expectInput(fragments, FragmentType.VECTOR, 1);

var target = entity.getEntity(ctx).orElseThrow(() -> new UnknownEntityBlunder(this));

if (target instanceof PlayerEntity player) {
fragments = ModEntityCumponents.WARD.get(player)
.run(ctx, this, new SpellPart(new PatternGlyph(4, 6, 0, 1, 2, 8, 4), new ArrayList<>()), fragments);
velocity = expectInput(fragments, FragmentType.VECTOR, 1);
.run(ctx, this, new SpellPart(new PatternGlyph(pattern)), fragments);
}

var velocity = expectInput(fragments, FragmentType.VECTOR, 1);
ctx.useMana(this, (float)velocity.vector().length() * 4);
target.addVelocity(velocity.vector().x(), velocity.vector().y(), velocity.vector().z());
target.velocityModified = true;
Expand Down

0 comments on commit e63e716

Please sign in to comment.