2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
2021-11-21 23:00:00 +01:00
|
|
|
@@ -13,6 +13,8 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
|
|
|
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
|
|
|
|
+
|
2019-04-23 04:00:00 +02:00
|
|
|
public class EntitySmallFireball extends EntityFireballFireball {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
public EntitySmallFireball(EntityTypes<? extends EntitySmallFireball> entitytypes, World world) {
|
2021-11-21 23:00:00 +01:00
|
|
|
@@ -21,6 +23,11 @@
|
2018-07-15 02:00:00 +02:00
|
|
|
|
2017-03-15 05:26:36 +01:00
|
|
|
public EntitySmallFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
2019-04-23 04:00:00 +02:00
|
|
|
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world);
|
2017-03-15 05:26:36 +01:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ if (this.getOwner() != null && this.getOwner() instanceof EntityInsentient) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ isIncendiary = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
2017-03-15 05:26:36 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
|
|
|
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
2022-06-07 18:00:00 +02:00
|
|
|
@@ -35,7 +42,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);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2022-06-07 18:00:00 +02:00
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ entity.setSecondsOnFire(event.getDuration(), false);
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2023-03-14 17:30:00 +01:00
|
|
|
if (!entity.hurt(this.damageSources().fireball(this, entity1), 5.0F)) {
|
2022-06-07 18:00:00 +02:00
|
|
|
entity.setRemainingFireTicks(i);
|
|
|
|
} else if (entity1 instanceof EntityLiving) {
|
|
|
|
@@ -51,10 +65,10 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
if (!this.level.isClientSide) {
|
2021-11-21 23:00:00 +01:00
|
|
|
Entity entity = this.getOwner();
|
2020-06-25 02:00:00 +02:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
- if (!(entity instanceof EntityInsentient) || this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) {
|
2020-06-25 02:00:00 +02:00
|
|
|
+ if (isIncendiary) { // CraftBukkit
|
2021-11-21 23:00:00 +01:00
|
|
|
BlockPosition blockposition = movingobjectpositionblock.getBlockPos().relative(movingobjectpositionblock.getDirection());
|
2017-03-15 05:26:36 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- if (this.level.isEmptyBlock(blockposition)) {
|
|
|
|
+ if (this.level.isEmptyBlock(blockposition) && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(level, blockposition, this).isCancelled()) { // CraftBukkit
|
|
|
|
this.level.setBlockAndUpdate(blockposition, BlockFireAbstract.getState(this.level, blockposition));
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
}
|