aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/SmallFireball.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/SmallFireball.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/SmallFireball.java.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/SmallFireball.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/SmallFireball.java.patch
new file mode 100644
index 0000000000..9ce39e4476
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/SmallFireball.java.patch
@@ -0,0 +1,58 @@
+--- a/net/minecraft/world/entity/projectile/SmallFireball.java
++++ b/net/minecraft/world/entity/projectile/SmallFireball.java
+@@ -12,6 +12,7 @@
+ import net.minecraft.world.phys.BlockHitResult;
+ import net.minecraft.world.phys.EntityHitResult;
+ import net.minecraft.world.phys.HitResult;
++import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
+
+ public class SmallFireball extends Fireball {
+
+@@ -19,8 +20,13 @@
+ super(entitytype, level);
+ }
+
+- public SmallFireball(Level level, LivingEntity livingentity, double d0, double d1, double d2) {
+- super(EntityType.SMALL_FIREBALL, livingentity, d0, d1, d2, level);
++ public SmallFireball(Level level, LivingEntity shooter, double offsetX, double d1, double offsetY) {
++ super(EntityType.SMALL_FIREBALL, shooter, offsetX, d1, offsetY, level);
++ // CraftBukkit start
++ if (this.getOwner() != null && this.getOwner() instanceof Mob) {
++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
++ }
++ // CraftBukkit end
+ }
+
+ public SmallFireball(Level level, double d0, double d1, double d2, double d3, double d4, double d5) {
+@@ -36,7 +41,14 @@
+ Entity entity1 = this.getOwner();
+ int i = entity.getRemainingFireTicks();
+
+- entity.setSecondsOnFire(5);
++ // CraftBukkit start - Entity damage by entity event + combust event
++ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5);
++ entity.level().getCraftServer().getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ entity.setSecondsOnFire(event.getDuration(), false);
++ }
++ // CraftBukkit end
+ if (!entity.hurt(this.damageSources().fireball(this, entity1), 5.0F)) {
+ entity.setRemainingFireTicks(i);
+ } else if (entity1 instanceof LivingEntity) {
+@@ -53,11 +64,11 @@
+ if (!this.level().isClientSide) {
+ Entity entity = this.getOwner();
+
+- if (!(entity instanceof Mob) || this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
+- BlockPos blockpos = blockhitresult.getBlockPos().relative(blockhitresult.getDirection());
++ if (isIncendiary) { // CraftBukkit
++ BlockPos blockposition = result.getBlockPos().relative(result.getDirection());
+
+- if (this.level().isEmptyBlock(blockpos)) {
+- this.level().setBlockAndUpdate(blockpos, BaseFireBlock.getState(this.level(), blockpos));
++ if (this.level().isEmptyBlock(blockposition) && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(this.level(), blockposition, this).isCancelled()) { // CraftBukkit
++ this.level().setBlockAndUpdate(blockposition, BaseFireBlock.getState(this.level(), blockposition));
+ }
+ }
+