diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/WindCharge.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/WindCharge.java.patch | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/WindCharge.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/WindCharge.java.patch new file mode 100644 index 0000000000..38a6ddfa83 --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/WindCharge.java.patch @@ -0,0 +1,134 @@ +--- a/net/minecraft/world/entity/projectile/WindCharge.java ++++ b/net/minecraft/world/entity/projectile/WindCharge.java +@@ -4,11 +4,13 @@ + import net.minecraft.core.particles.ParticleOptions; + import net.minecraft.core.particles.ParticleTypes; + import net.minecraft.sounds.SoundEvents; ++import net.minecraft.world.damagesource.DamageSource; ++import net.minecraft.world.damagesource.DamageSources; + import net.minecraft.world.entity.Entity; + import net.minecraft.world.entity.EntityDimensions; ++import net.minecraft.world.entity.EntityPose; + import net.minecraft.world.entity.EntityType; + import net.minecraft.world.entity.LivingEntity; +-import net.minecraft.world.entity.Pose; + import net.minecraft.world.entity.monster.breeze.Breeze; + import net.minecraft.world.item.ItemStack; + import net.minecraft.world.level.ClipContext; +@@ -21,14 +23,15 @@ + import net.minecraft.world.phys.HitResult; + + public class WindCharge extends AbstractHurtingProjectile implements ItemSupplier { +- public static final WindCharge.WindChargeExplosionDamageCalculator EXPLOSION_DAMAGE_CALCULATOR = new WindCharge.WindChargeExplosionDamageCalculator(); + ++ public static final WindCharge.a EXPLOSION_DAMAGE_CALCULATOR = new WindCharge.a(); ++ + public WindCharge(EntityType<? extends WindCharge> entityType, Level level) { + super(entityType, level); + } + +- public WindCharge(EntityType<? extends WindCharge> entityType, Breeze breeze, Level level) { +- super(entityType, breeze.getX(), breeze.getSnoutYPosition(), breeze.getZ(), level); ++ public WindCharge(EntityType<? extends WindCharge> entitytypes, Breeze breeze, Level world) { ++ super(entitytypes, breeze.getX(), breeze.getSnoutYPosition(), breeze.getZ(), world); + this.setOwner(breeze); + } + +@@ -37,56 +40,49 @@ + float f = this.getType().getDimensions().width / 2.0F; + float f1 = this.getType().getDimensions().height; + float f2 = 0.15F; +- return new AABB( +- this.position().x - (double)f, +- this.position().y - 0.15F, +- this.position().z - (double)f, +- this.position().x + (double)f, +- this.position().y - 0.15F + (double)f1, +- this.position().z + (double)f +- ); ++ ++ return new AABB(this.position().x - (double) f, this.position().y - 0.15000000596046448D, this.position().z - (double) f, this.position().x + (double) f, this.position().y - 0.15000000596046448D + (double) f1, this.position().z + (double) f); + } + + @Override +- protected float getEyeHeight(Pose pose, EntityDimensions dimensions) { ++ protected float getEyeHeight(EntityPose pose, EntityDimensions dimensions) { + return 0.0F; + } + + @Override + public boolean canCollideWith(Entity entity) { +- return !(entity instanceof WindCharge) && super.canCollideWith(entity); ++ return entity instanceof WindCharge ? false : super.canCollideWith(entity); + } + + @Override + protected boolean canHitEntity(Entity target) { +- return !(target instanceof WindCharge) && super.canHitEntity(target); ++ return target instanceof WindCharge ? false : super.canHitEntity(target); + } + + @Override + protected void onHitEntity(EntityHitResult result) { + super.onHitEntity(result); + if (!this.level().isClientSide) { +- result.getEntity().hurt(this.damageSources().mobProjectile(this, this.getOwner() instanceof LivingEntity livingEntity ? livingEntity : null), 1.0F); ++ Entity entity = result.getEntity(); ++ DamageSources damagesources = this.damageSources(); ++ Entity entity1 = this.getOwner(); ++ LivingEntity entityliving; ++ ++ if (entity1 instanceof LivingEntity) { ++ LivingEntity entityliving1 = (LivingEntity) entity1; ++ ++ entityliving = entityliving1; ++ } else { ++ entityliving = null; ++ } ++ ++ entity.hurt(damagesources.mobProjectile(this, entityliving), 1.0F); + this.explode(); + } + } + +- private void explode() { +- this.level() +- .explode( +- this, +- null, +- EXPLOSION_DAMAGE_CALCULATOR, +- this.getX(), +- this.getY(), +- this.getZ(), +- (float)(3.0 + this.random.nextDouble()), +- false, +- Level.ExplosionInteraction.BLOW, +- ParticleTypes.GUST, +- ParticleTypes.GUST_EMITTER, +- SoundEvents.WIND_BURST +- ); ++ public void explode() { // PAIL private -> public ++ this.level().explode(this, (DamageSource) null, WindCharge.EXPLOSION_DAMAGE_CALCULATOR, this.getX(), this.getY(), this.getZ(), (float) (3.0D + this.random.nextDouble()), false, Level.a.BLOW, ParticleTypes.GUST, ParticleTypes.GUST_EMITTER, SoundEvents.WIND_BURST); + } + + @Override +@@ -102,6 +98,7 @@ + if (!this.level().isClientSide) { + this.discard(); + } ++ + } + + @Override +@@ -135,7 +132,10 @@ + return ClipContext.Block.OUTLINE; + } + +- public static final class WindChargeExplosionDamageCalculator extends ExplosionDamageCalculator { ++ public static final class a extends ExplosionDamageCalculator { ++ ++ public a() {} ++ + @Override + public boolean shouldDamageEntity(Explosion explosion, Entity entity) { + return false; |