Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ public ServerPlayer getCaster() {
@Nullable
public abstract LivingEntity getCastingEntity();

/**
* Gets the caster's position. Useful for compatibility.
*
* @return the position of the caster
*/
public abstract Vec3 getCastingPosition();

/**
* Get an interface used to do mishaps
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public CircleCastEnv(ServerLevel world, CircleExecutionState execState) {
return this.execState.getCaster(this.world);
}

@Override
public Vec3 getCastingPosition() {
return this.getImpetus() == null ? this.execState.impetusPos.getCenter() : this.getImpetus().getBlockPos().getCenter();
}

public @Nullable BlockEntityAbstractImpetus getImpetus() {
var entity = this.world.getBlockEntity(execState.impetusPos);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public ServerPlayer getCaster() {
return this.caster;
}

@Override
public Vec3 getCastingPosition() {
return this.caster.position();
}

@Override
public void postExecution(CastResult result) {
super.postExecution(result);
Expand Down
Loading