use of org.spongepowered.common.event.damage.MinecraftFallingBlockDamageSource in project SpongeCommon by SpongePowered.
the class MixinEntityFallingBlock method beforeFall.
@Inject(method = "fall(FF)V", at = @At(value = "JUMP", opcode = Opcodes.IFEQ, ordinal = 1))
public void beforeFall(float distance, float damageMultipleier, CallbackInfo callbackInfo) {
this.isAnvil = this.fallTile.getBlock() == Blocks.ANVIL;
this.original = this.isAnvil ? DamageSource.ANVIL : DamageSource.FALLING_BLOCK;
if (this.isAnvil) {
DamageSource.ANVIL = new MinecraftFallingBlockDamageSource("anvil", (EntityFallingBlock) (Object) this);
} else {
DamageSource.FALLING_BLOCK = new MinecraftFallingBlockDamageSource("fallingblock", (EntityFallingBlock) (Object) this);
}
}
Aggregations