aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch
new file mode 100644
index 0000000000..badfa6564b
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch
@@ -0,0 +1,86 @@
+--- a/net/minecraft/world/entity/projectile/LargeFireball.java
++++ b/net/minecraft/world/entity/projectile/LargeFireball.java
+@@ -8,27 +8,41 @@
+ import net.minecraft.world.level.Level;
+ import net.minecraft.world.phys.EntityHitResult;
+ import net.minecraft.world.phys.HitResult;
++import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
+ public class LargeFireball extends Fireball {
+- private int explosionPower = 1;
+
++ public int explosionPower = 1;
++
+ public LargeFireball(EntityType<? extends LargeFireball> entityType, Level level) {
+ super(entityType, level);
++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
+ }
+
+- public LargeFireball(Level level, LivingEntity shooter, double offsetX, double offsetY, double offsetZ, int explosionPower) {
+- super(EntityType.FIREBALL, shooter, offsetX, offsetY, offsetZ, level);
+- this.explosionPower = explosionPower;
++ public LargeFireball(Level level, LivingEntity shooter, double offsetX, double d1, double offsetY, int i) {
++ super(EntityType.FIREBALL, shooter, offsetX, d1, offsetY, level);
++ this.explosionPower = i;
++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
+ }
+
+ @Override
+ protected void onHit(HitResult result) {
+ super.onHit(result);
+ if (!this.level().isClientSide) {
+- boolean _boolean = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
+- this.level().explode(this, this.getX(), this.getY(), this.getZ(), (float)this.explosionPower, _boolean, Level.ExplosionInteraction.MOB);
++ boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
++
++ // CraftBukkit start - fire ExplosionPrimeEvent
++ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
++ this.level().getCraftServer().getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ // give 'this' instead of (Entity) null so we know what causes the damage
++ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.a.MOB);
++ }
++ // CraftBukkit end
+ this.discard();
+ }
++
+ }
+
+ @Override
+@@ -36,25 +50,29 @@
+ super.onHitEntity(result);
+ if (!this.level().isClientSide) {
+ Entity entity = result.getEntity();
+- Entity owner = this.getOwner();
+- entity.hurt(this.damageSources().fireball(this, owner), 6.0F);
+- if (owner instanceof LivingEntity) {
+- this.doEnchantDamageEffects((LivingEntity)owner, entity);
++ Entity entity1 = this.getOwner();
++
++ entity.hurt(this.damageSources().fireball(this, entity1), 6.0F);
++ if (entity1 instanceof LivingEntity) {
++ this.doEnchantDamageEffects((LivingEntity) entity1, entity);
+ }
++
+ }
+ }
+
+ @Override
+ public void addAdditionalSaveData(CompoundTag compound) {
+ super.addAdditionalSaveData(compound);
+- compound.putByte("ExplosionPower", (byte)this.explosionPower);
++ compound.putByte("ExplosionPower", (byte) this.explosionPower);
+ }
+
+ @Override
+ public void readAdditionalSaveData(CompoundTag compound) {
+ super.readAdditionalSaveData(compound);
+ if (compound.contains("ExplosionPower", 99)) {
+- this.explosionPower = compound.getByte("ExplosionPower");
++ // CraftBukkit - set bukkitYield when setting explosionpower
++ bukkitYield = this.explosionPower = compound.getByte("ExplosionPower");
+ }
++
+ }
+ }