Normalizes CraftEntity#toString/getHandle (#12170)

This commit is contained in:
Lulu13022002
2025-05-01 03:21:04 +02:00
committed by GitHub
parent 567f63ae34
commit bc3d946fdf
172 changed files with 413 additions and 1174 deletions

View File

@@ -18,27 +18,27 @@ public class LingeringPotionSplashEvent extends ProjectileHitEvent implements Ca
private static final HandlerList HANDLER_LIST = new HandlerList();
private final AreaEffectCloud entity;
private final AreaEffectCloud effectCloud;
private boolean allowEmptyAreaEffectCreation;
private boolean cancelled;
@ApiStatus.Internal
@Deprecated(since = "1.20.2", forRemoval = true)
public LingeringPotionSplashEvent(@NotNull final ThrownPotion potion, @NotNull final AreaEffectCloud entity) {
this(potion, null, null, null, entity);
public LingeringPotionSplashEvent(@NotNull final ThrownPotion potion, @NotNull final AreaEffectCloud effectCloud) {
this(potion, null, null, null, effectCloud);
}
@ApiStatus.Internal
public LingeringPotionSplashEvent(@NotNull final ThrownPotion potion, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace, @NotNull final AreaEffectCloud entity) {
public LingeringPotionSplashEvent(@NotNull final ThrownPotion potion, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace, @NotNull final AreaEffectCloud effectCloud) {
super(potion, hitEntity, hitBlock, hitFace);
this.entity = entity;
this.effectCloud = effectCloud;
}
@NotNull
@Override
public ThrownPotion getEntity() {
return (ThrownPotion) super.getEntity();
return (ThrownPotion) this.entity;
}
/**
@@ -48,10 +48,9 @@ public class LingeringPotionSplashEvent extends ProjectileHitEvent implements Ca
*/
@NotNull
public AreaEffectCloud getAreaEffectCloud() {
return entity;
return effectCloud;
}
// Paper start
/**
* Sets if an Empty AreaEffectCloud may be created
*
@@ -69,7 +68,6 @@ public class LingeringPotionSplashEvent extends ProjectileHitEvent implements Ca
public boolean allowsEmptyCreation() {
return allowEmptyAreaEffectCreation;
}
// Paper end
@Override
public boolean isCancelled() {