Search in sources :

Example 1 with FallingBlockDamageSource

use of org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource in project SpongeCommon by SpongePowered.

the class MixinEntityLivingBase method damageEntityHook.

@Override
public boolean damageEntityHook(DamageSource damageSource, float damage) {
    if (!this.isEntityInvulnerable(damageSource)) {
        final boolean human = (Object) this instanceof EntityPlayer;
        // apply forge damage hook
        damage = applyModDamage((EntityLivingBase) (Object) this, damageSource, damage);
        // set after forge hook.
        float originalDamage = damage;
        if (damage <= 0) {
            damage = 0;
        }
        List<DamageFunction> originalFunctions = new ArrayList<>();
        Optional<DamageFunction> hardHatFunction = DamageEventHandler.createHardHatModifier((EntityLivingBase) (Object) this, damageSource);
        Optional<List<DamageFunction>> armorFunction = provideArmorModifiers((EntityLivingBase) (Object) this, damageSource, damage);
        Optional<DamageFunction> resistanceFunction = DamageEventHandler.createResistanceModifier((EntityLivingBase) (Object) this, damageSource);
        Optional<List<DamageFunction>> armorEnchantments = DamageEventHandler.createEnchantmentModifiers((EntityLivingBase) (Object) this, damageSource);
        Optional<DamageFunction> absorptionFunction = DamageEventHandler.createAbsorptionModifier((EntityLivingBase) (Object) this, damageSource);
        Optional<DamageFunction> shieldFunction = DamageEventHandler.createShieldFunction((EntityLivingBase) (Object) this, damageSource, damage);
        if (hardHatFunction.isPresent()) {
            originalFunctions.add(hardHatFunction.get());
        }
        if (shieldFunction.isPresent()) {
            originalFunctions.add(shieldFunction.get());
        }
        if (armorFunction.isPresent()) {
            originalFunctions.addAll(armorFunction.get());
        }
        if (resistanceFunction.isPresent()) {
            originalFunctions.add(resistanceFunction.get());
        }
        if (armorEnchantments.isPresent()) {
            originalFunctions.addAll(armorEnchantments.get());
        }
        if (absorptionFunction.isPresent()) {
            originalFunctions.add(absorptionFunction.get());
        }
        try (CauseStackManager.StackFrame frame = Sponge.getCauseStackManager().pushCauseFrame()) {
            DamageEventHandler.generateCauseFor(damageSource);
            DamageEntityEvent event = SpongeEventFactory.createDamageEntityEvent(Sponge.getCauseStackManager().getCurrentCause(), originalFunctions, this, originalDamage);
            if (damageSource != DamageSourceRegistryModule.IGNORED_DAMAGE_SOURCE) {
                // Basically, don't throw an event if it's our own damage source
                Sponge.getEventManager().post(event);
            }
            if (event.isCancelled()) {
                return false;
            }
            damage = (float) event.getFinalDamage();
            // Helmet
            final ItemStack mainHandItem = this.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND);
            if ((damageSource instanceof FallingBlockDamageSource) && mainHandItem != null) {
                mainHandItem.damageItem((int) (event.getBaseDamage() * 4.0F + this.rand.nextFloat() * event.getBaseDamage() * 2.0F), (EntityLivingBase) (Object) this);
            }
            // Shield
            if (shieldFunction.isPresent()) {
                // TODO gabizou: Should this be in the API?
                this.damageShield((float) event.getBaseDamage());
                if (!damageSource.isProjectile()) {
                    Entity entity = damageSource.getImmediateSource();
                    if (entity instanceof EntityLivingBase) {
                        this.blockUsingShield((EntityLivingBase) entity);
                    }
                }
            }
            // Armor
            if (!damageSource.isUnblockable()) {
                for (DamageFunction modifier : event.getModifiers()) {
                    applyArmorDamage((EntityLivingBase) (Object) this, damageSource, event, modifier.getModifier());
                }
            }
            double absorptionModifier = absorptionFunction.map(function -> event.getDamage(function.getModifier())).orElse(0d);
            if (absorptionFunction.isPresent()) {
                absorptionModifier = event.getDamage(absorptionFunction.get().getModifier());
            }
            this.setAbsorptionAmount(Math.max(this.getAbsorptionAmount() + (float) absorptionModifier, 0.0F));
            if (damage != 0.0F) {
                if (human) {
                    ((EntityPlayer) (Object) this).addExhaustion(damageSource.getHungerDamage());
                }
                float f2 = this.getHealth();
                this.setHealth(f2 - damage);
                this.getCombatTracker().trackDamage(damageSource, f2, damage);
                if (human) {
                    return true;
                }
                this.setAbsorptionAmount(this.getAbsorptionAmount() - damage);
            }
            return true;
        }
    }
    return false;
}
Also used : DamageEntityEvent(org.spongepowered.api.event.entity.DamageEntityEvent) Inject(org.spongepowered.asm.mixin.injection.Inject) EnumHand(net.minecraft.util.EnumHand) Random(java.util.Random) SpongeCommonEventFactory(org.spongepowered.common.event.SpongeCommonEventFactory) EntitySnapshot(org.spongepowered.api.entity.EntitySnapshot) CallbackInfo(org.spongepowered.asm.mixin.injection.callback.CallbackInfo) Mixin(org.spongepowered.asm.mixin.Mixin) SpongeOptionalValue(org.spongepowered.common.data.value.mutable.SpongeOptionalValue) PhaseData(org.spongepowered.common.event.tracking.PhaseData) DamageEntityEvent(org.spongepowered.api.event.entity.DamageEntityEvent) IAttributeInstance(net.minecraft.entity.ai.attributes.IAttributeInstance) Living(org.spongepowered.api.entity.living.Living) DamageSourceRegistryModule(org.spongepowered.common.registry.type.event.DamageSourceRegistryModule) At(org.spongepowered.asm.mixin.injection.At) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) IPhaseState(org.spongepowered.common.event.tracking.IPhaseState) AbstractAttributeMap(net.minecraft.entity.ai.attributes.AbstractAttributeMap) MutableBoundedValue(org.spongepowered.api.data.value.mutable.MutableBoundedValue) StackFrame(org.spongepowered.api.event.CauseStackManager.StackFrame) Collection(java.util.Collection) Sponge(org.spongepowered.api.Sponge) SpongeHealthData(org.spongepowered.common.data.manipulator.mutable.entity.SpongeHealthData) EnchantmentHelper(net.minecraft.enchantment.EnchantmentHelper) EntityUtil(org.spongepowered.common.entity.EntityUtil) HealthData(org.spongepowered.api.data.manipulator.mutable.entity.HealthData) List(java.util.List) PhaseContext(org.spongepowered.common.event.tracking.PhaseContext) EntityPlayer(net.minecraft.entity.player.EntityPlayer) Transform(org.spongepowered.api.entity.Transform) DataManipulator(org.spongepowered.api.data.manipulator.DataManipulator) Shadow(org.spongepowered.asm.mixin.Shadow) Optional(java.util.Optional) EnumParticleTypes(net.minecraft.util.EnumParticleTypes) IMixinEntityLivingBase(org.spongepowered.common.interfaces.entity.IMixinEntityLivingBase) Potion(net.minecraft.potion.Potion) MobEffects(net.minecraft.init.MobEffects) MoveEntityEvent(org.spongepowered.api.event.entity.MoveEntityEvent) SpongeDamageableData(org.spongepowered.common.data.manipulator.mutable.entity.SpongeDamageableData) Keys(org.spongepowered.api.data.key.Keys) EntityWolf(net.minecraft.entity.passive.EntityWolf) NonnullByDefault(org.spongepowered.api.util.annotation.NonnullByDefault) Vector3d(com.flowpowered.math.vector.Vector3d) EntityEquipmentSlot(net.minecraft.inventory.EntityEquipmentSlot) Overwrite(org.spongepowered.asm.mixin.Overwrite) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) OptionalValue(org.spongepowered.api.data.value.mutable.OptionalValue) IMixinEntityPlayerMP(org.spongepowered.common.interfaces.entity.player.IMixinEntityPlayerMP) Text(org.spongepowered.api.text.Text) EntityPhase(org.spongepowered.common.event.tracking.phase.entity.EntityPhase) ProjectileLauncher(org.spongepowered.common.entity.projectile.ProjectileLauncher) EntityHuman(org.spongepowered.common.entity.living.human.EntityHuman) CauseStackManager(org.spongepowered.api.event.CauseStackManager) IAttribute(net.minecraft.entity.ai.attributes.IAttribute) WorldServer(net.minecraft.world.WorldServer) Nullable(javax.annotation.Nullable) DamageableData(org.spongepowered.api.data.manipulator.mutable.entity.DamageableData) Entity(net.minecraft.entity.Entity) FallingBlockDamageSource(org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource) World(net.minecraft.world.World) Redirect(org.spongepowered.asm.mixin.injection.Redirect) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) BlockPos(net.minecraft.util.math.BlockPos) PhaseTracker(org.spongepowered.common.event.tracking.PhaseTracker) DamageSource(net.minecraft.util.DamageSource) IBlockState(net.minecraft.block.state.IBlockState) SpongeValueFactory(org.spongepowered.common.data.value.SpongeValueFactory) DamageEventHandler(org.spongepowered.common.event.damage.DamageEventHandler) DamageFunction(org.spongepowered.api.event.cause.entity.damage.DamageFunction) DamageModifier(org.spongepowered.api.event.cause.entity.damage.DamageModifier) CombatTracker(net.minecraft.util.CombatTracker) EntityLivingBase(net.minecraft.entity.EntityLivingBase) DamageObject(org.spongepowered.common.event.damage.DamageObject) MathHelper(net.minecraft.util.math.MathHelper) EntityCreature(net.minecraft.entity.EntityCreature) Projectile(org.spongepowered.api.entity.projectile.Projectile) SoundEvent(net.minecraft.util.SoundEvent) Entity(net.minecraft.entity.Entity) StackFrame(org.spongepowered.api.event.CauseStackManager.StackFrame) ArrayList(java.util.ArrayList) FallingBlockDamageSource(org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource) CauseStackManager(org.spongepowered.api.event.CauseStackManager) DamageFunction(org.spongepowered.api.event.cause.entity.damage.DamageFunction) IMixinEntityLivingBase(org.spongepowered.common.interfaces.entity.IMixinEntityLivingBase) EntityLivingBase(net.minecraft.entity.EntityLivingBase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) DamageObject(org.spongepowered.common.event.damage.DamageObject) List(java.util.List) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack)

Example 2 with FallingBlockDamageSource

use of org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource in project SpongeCommon by SpongePowered.

the class LivingEntityMixin method bridge$damageEntity.

@Override
public boolean bridge$damageEntity(final DamageSource damageSource, float damage) {
    if (this.shadow$isInvulnerableTo(damageSource)) {
        return false;
    }
    final boolean isHuman = (LivingEntity) (Object) this instanceof Player;
    // Sponge Start - Call platform hook for adjusting damage
    damage = this.bridge$applyModDamage((LivingEntity) (Object) this, damageSource, damage);
    // Sponge End
    final float originalDamage = damage;
    if (damage <= 0) {
        return false;
    }
    final List<DamageFunction> originalFunctions = new ArrayList<>();
    final Optional<DamageFunction> hardHatFunction = DamageEventUtil.createHardHatModifier((LivingEntity) (Object) this, damageSource);
    final Optional<DamageFunction> armorFunction = DamageEventUtil.createArmorModifiers((LivingEntity) (Object) this, damageSource);
    final Optional<DamageFunction> resistanceFunction = DamageEventUtil.createResistanceModifier((LivingEntity) (Object) this, damageSource);
    final Optional<List<DamageFunction>> armorEnchantments = DamageEventUtil.createEnchantmentModifiers((LivingEntity) (Object) this, damageSource);
    final Optional<DamageFunction> absorptionFunction = DamageEventUtil.createAbsorptionModifier((LivingEntity) (Object) this);
    final Optional<DamageFunction> shieldFunction = DamageEventUtil.createShieldFunction((LivingEntity) (Object) this, damageSource, damage);
    hardHatFunction.ifPresent(originalFunctions::add);
    shieldFunction.ifPresent(originalFunctions::add);
    armorFunction.ifPresent(originalFunctions::add);
    resistanceFunction.ifPresent(originalFunctions::add);
    armorEnchantments.ifPresent(originalFunctions::addAll);
    absorptionFunction.ifPresent(originalFunctions::add);
    try (final CauseStackManager.StackFrame frame = PhaseTracker.getCauseStackManager().pushCauseFrame()) {
        DamageEventUtil.generateCauseFor(damageSource, frame);
        final DamageEntityEvent event = SpongeEventFactory.createDamageEntityEvent(frame.currentCause(), (org.spongepowered.api.entity.Entity) this, originalFunctions, originalDamage);
        if (damageSource != SpongeDamageSources.IGNORED) {
            // Basically, don't throw an event if it's our own damage source
            SpongeCommon.post(event);
        }
        if (event.isCancelled()) {
            return false;
        }
        damage = (float) event.finalDamage();
        // Sponge Start - Allow the platform to adjust damage before applying armor/etc
        damage = this.bridge$applyModDamageBeforeFunctions((LivingEntity) (Object) this, damageSource, damage);
        // Sponge End
        // Helmet
        final ItemStack helmet = this.shadow$getItemBySlot(EquipmentSlot.HEAD);
        // without using our mixin redirects in EntityFallingBlockMixin.
        if ((damageSource instanceof FallingBlockDamageSource) || damageSource == DamageSource.ANVIL || damageSource == DamageSource.FALLING_BLOCK && !helmet.isEmpty()) {
            helmet.hurtAndBreak((int) (event.baseDamage() * 4.0F + this.random.nextFloat() * event.baseDamage() * 2.0F), (LivingEntity) (Object) this, (entity) -> entity.broadcastBreakEvent(EquipmentSlot.HEAD));
        }
        boolean hurtStack = false;
        // Shield
        if (shieldFunction.isPresent()) {
            this.shadow$hurtCurrentlyUsedShield((float) event.baseDamage());
            hurtStack = true;
            if (!damageSource.isProjectile()) {
                final Entity entity = damageSource.getDirectEntity();
                if (entity instanceof LivingEntity) {
                    this.shadow$blockUsingShield((LivingEntity) entity);
                }
            }
        }
        // Armor
        if (!damageSource.isBypassArmor() && armorFunction.isPresent()) {
            this.shadow$hurtArmor(damageSource, (float) event.baseDamage());
            hurtStack = true;
        }
        // Sponge start - log inventory change due to taking damage
        if (hurtStack && isHuman) {
            PhaseTracker.SERVER.getPhaseContext().getTransactor().logPlayerInventoryChange((Player) (Object) this, PlayerInventoryTransaction.EventCreator.STANDARD);
            // capture
            ((Player) (Object) this).inventoryMenu.broadcastChanges();
        }
        // Resistance modifier post calculation
        if (resistanceFunction.isPresent()) {
            final float f2 = (float) event.damage(resistanceFunction.get().modifier()) - damage;
            if (f2 > 0.0F && f2 < 3.4028235E37F) {
                if (((LivingEntity) (Object) this) instanceof net.minecraft.server.level.ServerPlayer) {
                    ((net.minecraft.server.level.ServerPlayer) ((LivingEntity) (Object) this)).awardStat(Stats.DAMAGE_RESISTED, Math.round(f2 * 10.0F));
                } else if (damageSource.getEntity() instanceof net.minecraft.server.level.ServerPlayer) {
                    ((net.minecraft.server.level.ServerPlayer) damageSource.getEntity()).awardStat(Stats.DAMAGE_DEALT_RESISTED, Math.round(f2 * 10.0F));
                }
            }
        }
        double absorptionModifier = absorptionFunction.map(function -> event.damage(function.modifier())).orElse(0d);
        if (absorptionFunction.isPresent()) {
            absorptionModifier = event.damage(absorptionFunction.get().modifier());
        }
        final float f = (float) event.finalDamage() - (float) absorptionModifier;
        this.shadow$setAbsorptionAmount(Math.max(this.shadow$getAbsorptionAmount() + (float) absorptionModifier, 0.0F));
        if (f > 0.0F && f < 3.4028235E37F && ((LivingEntity) (Object) this) instanceof net.minecraft.server.level.ServerPlayer) {
            ((Player) (Object) this).awardStat(Stats.DAMAGE_DEALT_ABSORBED, Math.round(f * 10.0F));
        }
        if (damage != 0.0F) {
            if (isHuman) {
                ((Player) (Object) this).causeFoodExhaustion(damageSource.getFoodExhaustion());
            }
            final float f2 = this.shadow$getHealth();
            this.shadow$setHealth(f2 - damage);
            this.shadow$getCombatTracker().recordDamage(damageSource, f2, damage);
            if (isHuman) {
                if (damage < 3.4028235E37F) {
                    ((Player) (Object) this).awardStat(Stats.DAMAGE_TAKEN, Math.round(damage * 10.0F));
                }
                return true;
            }
            this.shadow$setAbsorptionAmount(this.shadow$getAbsorptionAmount() - damage);
        }
        return true;
    }
}
Also used : LivingEntity(net.minecraft.world.entity.LivingEntity) Inject(org.spongepowered.asm.mixin.injection.Inject) SpongeDamageSources(org.spongepowered.common.event.cause.entity.damage.SpongeDamageSources) ParticleOptions(net.minecraft.core.particles.ParticleOptions) ItemStackSnapshot(org.spongepowered.api.item.inventory.ItemStackSnapshot) HandType(org.spongepowered.api.data.type.HandType) PlayerBridge(org.spongepowered.common.bridge.world.entity.player.PlayerBridge) SpongeCommonEventFactory(org.spongepowered.common.event.SpongeCommonEventFactory) CallbackInfoReturnable(org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable) CallbackInfo(org.spongepowered.asm.mixin.injection.callback.CallbackInfo) Mixin(org.spongepowered.asm.mixin.Mixin) DamageEntityEvent(org.spongepowered.api.event.entity.DamageEntityEvent) PlayerInventoryTransaction(org.spongepowered.common.event.tracking.context.transaction.inventory.PlayerInventoryTransaction) Living(org.spongepowered.api.entity.living.Living) AttributeMap(net.minecraft.world.entity.ai.attributes.AttributeMap) Transaction(org.spongepowered.api.data.Transaction) At(org.spongepowered.asm.mixin.injection.At) CombatTracker(net.minecraft.world.damagesource.CombatTracker) Collection(java.util.Collection) Sponge(org.spongepowered.api.Sponge) Player(net.minecraft.world.entity.player.Player) DamageEventUtil(org.spongepowered.common.util.DamageEventUtil) List(java.util.List) BlockPos(net.minecraft.core.BlockPos) SoundEvent(net.minecraft.sounds.SoundEvent) Shadow(org.spongepowered.asm.mixin.Shadow) Optional(java.util.Optional) LivingEntityBridge(org.spongepowered.common.bridge.world.entity.LivingEntityBridge) ItemStack(net.minecraft.world.item.ItemStack) BlockSnapshot(org.spongepowered.api.block.BlockSnapshot) MoveEntityEvent(org.spongepowered.api.event.entity.MoveEntityEvent) ServerLocation(org.spongepowered.api.world.server.ServerLocation) HumanEntity(org.spongepowered.common.entity.living.human.HumanEntity) SoundSource(net.minecraft.sounds.SoundSource) EventContextKeys(org.spongepowered.api.event.EventContextKeys) ServerWorld(org.spongepowered.api.world.server.ServerWorld) Constants(org.spongepowered.common.util.Constants) Overwrite(org.spongepowered.asm.mixin.Overwrite) ServerLevel(net.minecraft.server.level.ServerLevel) SleepingEvent(org.spongepowered.api.event.action.SleepingEvent) ArrayList(java.util.ArrayList) AttributeInstance(net.minecraft.world.entity.ai.attributes.AttributeInstance) ItemStackUtil(org.spongepowered.common.item.util.ItemStackUtil) DamageSource(net.minecraft.world.damagesource.DamageSource) Stats(net.minecraft.stats.Stats) CauseStackManager(org.spongepowered.api.event.CauseStackManager) LocalCapture(org.spongepowered.asm.mixin.injection.callback.LocalCapture) Nullable(javax.annotation.Nullable) UseItemStackEvent(org.spongepowered.api.event.item.inventory.UseItemStackEvent) Ticks(org.spongepowered.api.util.Ticks) LevelBridge(org.spongepowered.common.bridge.world.level.LevelBridge) FallingBlockDamageSource(org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource) Redirect(org.spongepowered.asm.mixin.injection.Redirect) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) MobEffectInstance(net.minecraft.world.effect.MobEffectInstance) ShouldFire(org.spongepowered.common.event.ShouldFire) SpongeCommon(org.spongepowered.common.SpongeCommon) PhaseTracker(org.spongepowered.common.event.tracking.PhaseTracker) Attribute(net.minecraft.world.entity.ai.attributes.Attribute) Cause(org.spongepowered.api.event.Cause) MovementTypes(org.spongepowered.api.event.cause.entity.MovementTypes) Entity(net.minecraft.world.entity.Entity) DamageFunction(org.spongepowered.api.event.cause.entity.damage.DamageFunction) Vector3d(org.spongepowered.math.vector.Vector3d) PlatformLivingEntityBridge(org.spongepowered.common.bridge.world.entity.PlatformLivingEntityBridge) EquipmentSlot(net.minecraft.world.entity.EquipmentSlot) VecHelper(org.spongepowered.common.util.VecHelper) InteractionHand(net.minecraft.world.InteractionHand) MobEffect(net.minecraft.world.effect.MobEffect) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) LivingEntity(net.minecraft.world.entity.LivingEntity) HumanEntity(org.spongepowered.common.entity.living.human.HumanEntity) Entity(net.minecraft.world.entity.Entity) ArrayList(java.util.ArrayList) LivingEntity(net.minecraft.world.entity.LivingEntity) FallingBlockDamageSource(org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource) CauseStackManager(org.spongepowered.api.event.CauseStackManager) DamageFunction(org.spongepowered.api.event.cause.entity.damage.DamageFunction) List(java.util.List) ArrayList(java.util.ArrayList) DamageEntityEvent(org.spongepowered.api.event.entity.DamageEntityEvent) Player(net.minecraft.world.entity.player.Player) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) ItemStack(net.minecraft.world.item.ItemStack)

Example 3 with FallingBlockDamageSource

use of org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource in project SpongeCommon by SpongePowered.

the class SpongeFallingBlockDamgeSourceBuilder method build.

@SuppressWarnings("ConstantConditions")
@Override
public FallingBlockDamageSource build() throws IllegalStateException {
    checkState(this.reference.get() != null);
    checkState(this.damageType != null);
    final MinecraftFallingBlockDamageSource damageSource = new MinecraftFallingBlockDamageSource(this.damageType.name(), (FallingBlockEntity) this.reference.get());
    final DamageSourceAccessor accessor = (DamageSourceAccessor) (Object) damageSource;
    if (this.creative) {
        accessor.invoker$bypassInvul();
    }
    if (this.scales) {
        damageSource.setScalesWithDifficulty();
    }
    if (this.magical) {
        damageSource.setMagic();
    }
    if (this.bypasses) {
        accessor.invoker$bypassArmor();
    }
    if (this.absolute) {
        accessor.invoker$bypassMagic();
    }
    if (this.explosion) {
        damageSource.setExplosion();
    }
    if (this.exhaustion != null) {
        accessor.accessor$exhaustion(this.exhaustion.floatValue());
    }
    return (FallingBlockDamageSource) (Object) damageSource;
}
Also used : FallingBlockDamageSource(org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource) MinecraftFallingBlockDamageSource(org.spongepowered.common.util.MinecraftFallingBlockDamageSource) DamageSourceAccessor(org.spongepowered.common.accessor.world.damagesource.DamageSourceAccessor) MinecraftFallingBlockDamageSource(org.spongepowered.common.util.MinecraftFallingBlockDamageSource)

Aggregations

FallingBlockDamageSource (org.spongepowered.api.event.cause.entity.damage.source.FallingBlockDamageSource)3 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 List (java.util.List)2 Optional (java.util.Optional)2 Nullable (javax.annotation.Nullable)2 Sponge (org.spongepowered.api.Sponge)2 Living (org.spongepowered.api.entity.living.Living)2 CauseStackManager (org.spongepowered.api.event.CauseStackManager)2 SpongeEventFactory (org.spongepowered.api.event.SpongeEventFactory)2 DamageFunction (org.spongepowered.api.event.cause.entity.damage.DamageFunction)2 DamageEntityEvent (org.spongepowered.api.event.entity.DamageEntityEvent)2 MoveEntityEvent (org.spongepowered.api.event.entity.MoveEntityEvent)2 Mixin (org.spongepowered.asm.mixin.Mixin)2 Overwrite (org.spongepowered.asm.mixin.Overwrite)2 Shadow (org.spongepowered.asm.mixin.Shadow)2 At (org.spongepowered.asm.mixin.injection.At)2 Inject (org.spongepowered.asm.mixin.injection.Inject)2 Redirect (org.spongepowered.asm.mixin.injection.Redirect)2 CallbackInfo (org.spongepowered.asm.mixin.injection.callback.CallbackInfo)2