com.magistuarmory.util.ModDamageSources Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of 1.19.2-epic-knights-fabric Show documentation
Show all versions of 1.19.2-epic-knights-fabric Show documentation
mod that adds medieval stuff to the game
The newest version!
package com.magistuarmory.util;
import net.minecraft.class_1282;
import net.minecraft.class_1285;
import net.minecraft.class_1297;
import net.minecraft.class_5455;
public class ModDamageSources
{
private static class_1282 ADDITIONAL = new AdditionalDamageSource();
public static void setup(class_5455 registryAccess)
{
}
public static class_1282 additional()
{
return ADDITIONAL;
}
public static class_1282 additional(class_1297 attacker)
{
return attacker == null ? additional() : new AdditionalEntityDamageSource(attacker);
}
public static class_1282 silverAttack(class_1297 attacker)
{
return new SilverAttackDamageSource(attacker);
}
public static class_1282 armorPiercing(class_1297 attacker)
{
return new ArmorPiercingDamageSource(attacker);
}
public static boolean isAdditional(class_1282 source)
{
return source == class_1282.field_5869 || source == class_1282.field_5846 || source instanceof Additional;
}
interface Additional {}
static class AdditionalDamageSource extends class_1282 implements Additional
{
AdditionalDamageSource()
{
super("additional");
}
}
static class AdditionalEntityDamageSource extends class_1285 implements Additional
{
AdditionalEntityDamageSource(class_1297 attacker)
{
super("entityAdditional", attacker);
}
}
static class SilverAttackDamageSource extends class_1285 implements Additional
{
SilverAttackDamageSource(class_1297 attacker)
{
super("silver", attacker);
this.method_5508();
this.method_5515();
}
}
static class ArmorPiercingDamageSource extends class_1285 implements Additional
{
ArmorPiercingDamageSource(class_1297 attacker)
{
super("armorPiercing", attacker);
this.method_5508();
}
}
}