diff --git a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch index 69d4e6502d60..63fabcdfbeb7 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch @@ -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(); @@ -37,7 +37,7 @@ - private void onHitAsWater(ServerLevel level) { + private static final Predicate 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)) { @@ -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); diff --git a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownLingeringPotion.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownLingeringPotion.java.patch index e41c58a29c49..9c1434ddf823 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownLingeringPotion.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownLingeringPotion.java.patch @@ -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); diff --git a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownSplashPotion.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownSplashPotion.java.patch index 5a1801fc2f15..9a8ad8fd804f 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownSplashPotion.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownSplashPotion.java.patch @@ -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 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 entitiesOfClass = this.level().getEntitiesOfClass(LivingEntity.class, aabb1); + java.util.Map affected = new java.util.HashMap<>(); // CraftBukkit