Skip to content
Merged
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 @@ -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;
}

/**
Expand All @@ -48,10 +48,9 @@ public ThrownPotion getEntity() {
*/
@NotNull
public AreaEffectCloud getAreaEffectCloud() {
return entity;
return effectCloud;
}

// Paper start
/**
* Sets if an Empty AreaEffectCloud may be created
*
Expand All @@ -69,7 +68,6 @@ public void allowsEmptyCreation(boolean allowEmptyAreaEffectCreation) {
public boolean allowsEmptyCreation() {
return allowEmptyAreaEffectCreation;
}
// Paper end

@Override
public boolean isCancelled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public PaperSchoolableFish(CraftServer server, AbstractSchoolingFish entity) {

@Override
public AbstractSchoolingFish getHandle() {
return (AbstractSchoolingFish) super.getHandle();
return (AbstractSchoolingFish) this.entity;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public AbstractProjectile(CraftServer server, net.minecraft.world.entity.Entity
super(server, entity);
}

@Override
public net.minecraft.world.entity.projectile.Projectile getHandle() {
return (net.minecraft.world.entity.projectile.Projectile) this.entity;
}

@Override
public boolean doesBounce() {
return false;
Expand Down Expand Up @@ -53,11 +58,6 @@ public void hitEntity(org.bukkit.entity.Entity entity, org.bukkit.util.Vector ve
this.getHandle().preHitTargetOrDeflectSelf(new net.minecraft.world.phys.EntityHitResult(((CraftEntity) entity).getHandle(), new net.minecraft.world.phys.Vec3(vector.getX(), vector.getY(), vector.getZ())));
}

@Override
public net.minecraft.world.entity.projectile.Projectile getHandle() {
return (net.minecraft.world.entity.projectile.Projectile) entity;
}

@Override
public final org.bukkit.projectiles.ProjectileSource getShooter() {
this.getHandle().refreshProjectileSource(true); // Paper - Refresh ProjectileSource for projectiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import java.util.List;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.BlockCollisions;
Expand All @@ -13,14 +14,18 @@
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.inventory.ItemStack;
import java.util.List;

public abstract class CraftAbstractArrow extends AbstractProjectile implements AbstractArrow {

public CraftAbstractArrow(CraftServer server, net.minecraft.world.entity.projectile.AbstractArrow entity) {
super(server, entity);
}

@Override
public net.minecraft.world.entity.projectile.AbstractArrow getHandle() {
return (net.minecraft.world.entity.projectile.AbstractArrow) this.entity;
}

@Override
public void setKnockbackStrength(int knockbackStrength) {
}
Expand Down Expand Up @@ -63,8 +68,6 @@ public void setCritical(boolean critical) {
this.getHandle().setCritArrow(critical);
}

// Paper - moved to AbstractProjectile

@Override
public boolean isInBlock() {
return this.getHandle().isInGround();
Expand Down Expand Up @@ -139,16 +142,6 @@ public void setWeapon(ItemStack item) {
this.getHandle().firedFromWeapon = CraftItemStack.asNMSCopy(item);
}

@Override
public net.minecraft.world.entity.projectile.AbstractArrow getHandle() {
return (net.minecraft.world.entity.projectile.AbstractArrow) this.entity;
}

@Override
public String toString() {
return "CraftAbstractArrow";
}

// Paper start
@Override
public CraftItemStack getItemStack() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ public CraftAbstractCow(CraftServer server, net.minecraft.world.entity.animal.Ab
public net.minecraft.world.entity.animal.AbstractCow getHandle() {
return (net.minecraft.world.entity.animal.AbstractCow) this.entity;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ public CraftAbstractSkeleton(CraftServer server, net.minecraft.world.entity.mons
}

@Override
public void setSkeletonType(Skeleton.SkeletonType type) {
throw new UnsupportedOperationException("Not supported.");
public net.minecraft.world.entity.monster.AbstractSkeleton getHandle() {
return (net.minecraft.world.entity.monster.AbstractSkeleton) this.entity;
}

@Override
public net.minecraft.world.entity.monster.AbstractSkeleton getHandle() {
return (net.minecraft.world.entity.monster.AbstractSkeleton) super.getHandle();
public void setSkeletonType(Skeleton.SkeletonType type) {
throw new UnsupportedOperationException("Not supported.");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public Merchant getMerchant() {
return this.getHandle();
}

@Override
public String toString() {
return "CraftAbstractVillager";
}

@Override
public Inventory getInventory() {
return new CraftInventory(this.getHandle().getInventory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@ public CraftAbstractWindCharge(CraftServer server, net.minecraft.world.entity.pr
super(server, entity);
}

@Override
public void explode() {
this.getHandle().explode(this.getHandle().position());
this.getHandle().discard(EntityRemoveEvent.Cause.EXPLODE); // SPIGOT-7577 - explode doesn't discard the entity, this happens only in tick and onHitBlock
}

@Override
public net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge getHandle() {
return (net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge) this.entity;
}

@Override
public String toString() {
return "CraftAbstractWindCharge";
public void explode() {
this.getHandle().explode(this.getHandle().position());
this.getHandle().discard(EntityRemoveEvent.Cause.EXPLODE); // SPIGOT-7577 - explode doesn't discard the entity, this happens only in tick and onHitBlock
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public CraftAgeable(CraftServer server, AgeableMob entity) {
super(server, entity);
}

@Override
public AgeableMob getHandle() {
return (AgeableMob) this.entity;
}

@Override
public int getAge() {
return this.getHandle().getAge();
Expand Down Expand Up @@ -62,14 +67,4 @@ public void setBreed(boolean breed) {
this.setAge(6000);
}
}

@Override
public AgeableMob getHandle() {
return (AgeableMob) this.entity;
}

@Override
public String toString() {
return "CraftAgeable";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public Allay getHandle() {
return (Allay) this.entity;
}

@Override
public String toString() {
return "CraftAllay";
}

@Override
public Inventory getInventory() {
return new CraftInventory(this.getHandle().getInventory());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@ public CraftAmbient(CraftServer server, AmbientCreature entity) {
public AmbientCreature getHandle() {
return (AmbientCreature) this.entity;
}

@Override
public String toString() {
return "CraftAmbient";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ public Animal getHandle() {
return (Animal) this.entity;
}

@Override
public String toString() {
return "CraftAnimals";
}

@Override
public UUID getBreedCause() {
return this.getHandle().loveCause;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ public CraftAreaEffectCloud(CraftServer server, net.minecraft.world.entity.AreaE

@Override
public net.minecraft.world.entity.AreaEffectCloud getHandle() {
return (net.minecraft.world.entity.AreaEffectCloud) super.getHandle();
}

@Override
public String toString() {
return "CraftAreaEffectCloud";
return (net.minecraft.world.entity.AreaEffectCloud) this.entity;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public CraftArmadillo(CraftServer server, net.minecraft.world.entity.animal.arma

@Override
public net.minecraft.world.entity.animal.armadillo.Armadillo getHandle() {
return (net.minecraft.world.entity.animal.armadillo.Armadillo) super.getHandle();
return (net.minecraft.world.entity.animal.armadillo.Armadillo) this.entity;
}

@Override
Expand All @@ -38,11 +38,6 @@ public void rollOut() {
this.getHandle().getBrain().setMemoryWithExpiry(MemoryModuleType.DANGER_DETECTED_RECENTLY, true, ArmadilloState.UNROLLING.animationDuration());
}

@Override
public String toString() {
return "CraftArmadillo";
}

public static State stateToBukkit(ArmadilloState state) {
return switch (state) {
case IDLE -> State.IDLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ public CraftArmorStand(CraftServer server, net.minecraft.world.entity.decoration
super(server, entity);
}

@Override
public String toString() {
return "CraftArmorStand";
}

@Override
public net.minecraft.world.entity.decoration.ArmorStand getHandle() {
return (net.minecraft.world.entity.decoration.ArmorStand) super.getHandle();
return (net.minecraft.world.entity.decoration.ArmorStand) this.entity;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public net.minecraft.world.entity.projectile.Arrow getHandle() {
return (net.minecraft.world.entity.projectile.Arrow) this.entity;
}

@Override
public String toString() {
return "CraftArrow";
}

@Override
public boolean addCustomEffect(PotionEffect effect, boolean override) {
if (this.hasCustomEffect(effect.getType())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ public CraftAxolotl(CraftServer server, net.minecraft.world.entity.animal.axolot

@Override
public net.minecraft.world.entity.animal.axolotl.Axolotl getHandle() {
return (net.minecraft.world.entity.animal.axolotl.Axolotl) super.getHandle();
}

@Override
public String toString() {
return "CraftAxolotl";
return (net.minecraft.world.entity.animal.axolotl.Axolotl) this.entity;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public net.minecraft.world.entity.ambient.Bat getHandle() {
return (net.minecraft.world.entity.ambient.Bat) this.entity;
}

@Override
public String toString() {
return "CraftBat";
}

@Override
public boolean isAwake() {
return !this.getHandle().isResting();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public net.minecraft.world.entity.animal.Bee getHandle() {
return (net.minecraft.world.entity.animal.Bee) this.entity;
}

@Override
public String toString() {
return "CraftBee";
}

@Override
public Location getHive() {
BlockPos hive = this.getHandle().getHivePos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@ public CraftBlaze(CraftServer server, net.minecraft.world.entity.monster.Blaze e
public net.minecraft.world.entity.monster.Blaze getHandle() {
return (net.minecraft.world.entity.monster.Blaze) this.entity;
}

@Override
public String toString() {
return "CraftBlaze";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@ public CraftBlockAttachedEntity(CraftServer server, BlockAttachedEntity entity)
public BlockAttachedEntity getHandle() {
return (BlockAttachedEntity) this.entity;
}

@Override
public String toString() {
return "CraftBlockAttachedEntity";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ public CraftBlockDisplay(CraftServer server, net.minecraft.world.entity.Display.

@Override
public net.minecraft.world.entity.Display.BlockDisplay getHandle() {
return (net.minecraft.world.entity.Display.BlockDisplay) super.getHandle();
}

@Override
public String toString() {
return "CraftBlockDisplay";
return (net.minecraft.world.entity.Display.BlockDisplay) this.entity;
}

@Override
Expand Down
Loading
Loading