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 @@ -8,7 +8,7 @@
+ this.splash(result);
+ }
+
+ public void splash(HitResult result) {
+ public void splash(@org.jspecify.annotations.Nullable HitResult result) {
+ // Paper end - More projectile API
if (this.level() instanceof ServerLevel serverLevel) {
ItemStack item = this.getItem();
Expand Down Expand Up @@ -37,7 +37,7 @@
- private void onHitAsWater(ServerLevel level) {
+ private static final Predicate<LivingEntity> APPLY_WATER_GET_ENTITIES_PREDICATE = AbstractThrownPotion.WATER_SENSITIVE_OR_ON_FIRE.or(Axolotl.class::isInstance); // Paper - Fix potions splash events
+
+ private boolean onHitAsWater(ServerLevel level, HitResult result) { // Paper - Fix potions splash events
+ private boolean onHitAsWater(ServerLevel level, @org.jspecify.annotations.Nullable HitResult result) { // Paper - Fix potions splash events
AABB aabb = this.getBoundingBox().inflate(4.0, 2.0, 4.0);

- for (LivingEntity livingEntity : this.level().getEntitiesOfClass(LivingEntity.class, aabb, WATER_SENSITIVE_OR_ON_FIRE)) {
Expand Down Expand Up @@ -88,7 +88,7 @@
}

- protected abstract void onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult);
+ protected abstract boolean onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult); // Paper - Fix potions splash events & More Projectile API
+ protected abstract boolean onHitAsPotion(ServerLevel level, ItemStack stack, @org.jspecify.annotations.Nullable HitResult hitResult); // Paper - Fix potions splash events & More Projectile API

private void dowseFire(BlockPos pos) {
BlockState blockState = this.level().getBlockState(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@Override
- public void onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) {
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) { // Paper - More projectile API
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, @org.jspecify.annotations.Nullable HitResult hitResult) { // Paper - More projectile API
AreaEffectCloud areaEffectCloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
if (this.getOwner() instanceof LivingEntity livingEntity) {
areaEffectCloud.setOwner(livingEntity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

@Override
- public void onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) {
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, HitResult hitResult) { // Paper - More projectile API
+ public boolean onHitAsPotion(ServerLevel level, ItemStack stack, @org.jspecify.annotations.Nullable HitResult hitResult) { // Paper - More projectile API
PotionContents potionContents = stack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
float orDefault = stack.getOrDefault(DataComponents.POTION_DURATION_SCALE, 1.0F);
Iterable<MobEffectInstance> allEffects = potionContents.getAllEffects();
AABB aabb = this.getBoundingBox().move(hitResult.getLocation().subtract(this.position()));
- AABB aabb = this.getBoundingBox().move(hitResult.getLocation().subtract(this.position()));
+ AABB aabb = hitResult == null ? this.getBoundingBox() : this.getBoundingBox().move(hitResult.getLocation().subtract(this.position())); // Paper - More projectile API
AABB aabb1 = aabb.inflate(4.0, 2.0, 4.0);
List<LivingEntity> entitiesOfClass = this.level().getEntitiesOfClass(LivingEntity.class, aabb1);
+ java.util.Map<org.bukkit.entity.LivingEntity, Double> affected = new java.util.HashMap<>(); // CraftBukkit
Expand Down
Loading