Skip to content

Commit

Permalink
fix clinit
Browse files Browse the repository at this point in the history
  • Loading branch information
RacoonDog committed Jan 18, 2024
1 parent a94ba9c commit cbbd5ff
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@
import net.minecraft.entity.*;
import net.minecraft.entity.attribute.*;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.damage.DamageTypes;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.*;
import net.minecraft.registry.DynamicRegistryManager;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.*;
Expand All @@ -34,8 +30,6 @@
import static meteordevelopment.meteorclient.MeteorClient.mc;

public class DamageUtils {
private static final DamageSource explosion = new DamageSource(DynamicRegistryManager.of(Registries.REGISTRIES).get(RegistryKeys.DAMAGE_TYPE).entryOf(DamageTypes.EXPLOSION));

// Explosion damage

public static float explosionDamage(LivingEntity target, Vec3d origin, float power, boolean predictMovement, BlockPos override, BlockState overrideState) {
Expand All @@ -54,7 +48,7 @@ public static float explosionDamage(LivingEntity target, Vec3d origin, float pow
double impact = (1 - (modDistance / power)) * exposure;
float damage = (int) ((impact * impact + impact) / 2 * 7 * 12 + 1);

return calculateReductions(damage, target, explosion);
return calculateReductions(damage, target, mc.world.getDamageSources().explosion(null));
}

public static float crystalDamage(LivingEntity target, Vec3d crystal, boolean predictMovement, BlockPos obsidianPos) {
Expand Down

0 comments on commit cbbd5ff

Please sign in to comment.