diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:52:45 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:52:45 +0300 |
| commit | 0427ab89f1753a44b30cbc35ce021cbbdc845109 (patch) | |
| tree | abe418ff5ec174e712fe8dedd434548a945b15a3 /src/main/java/gregtech/api/damagesources | |
| parent | 877312184c472d9845e5ef1008bc538f4634059f (diff) | |
fix missing source folder
Diffstat (limited to 'src/main/java/gregtech/api/damagesources')
| -rw-r--r-- | src/main/java/gregtech/api/damagesources/GT_DamageSources.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/damagesources/GT_DamageSources.java b/src/main/java/gregtech/api/damagesources/GT_DamageSources.java new file mode 100644 index 0000000..9079fc5 --- /dev/null +++ b/src/main/java/gregtech/api/damagesources/GT_DamageSources.java @@ -0,0 +1,90 @@ +package gregtech.api.damagesources; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSource; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; + +public class GT_DamageSources { + public static DamageSource getElectricDamage() { + return ic2.api.info.Info.DMG_ELECTRIC; + } + + public static DamageSource getRadioactiveDamage() { + return ic2.api.info.Info.DMG_RADIATION; + } + + public static DamageSource getNukeExplosionDamage() { + return ic2.api.info.Info.DMG_NUKE_EXPLOSION; + } + + public static DamageSource getExplodingDamage() { + return new DamageSourceExploding(); + } + + public static DamageSource getCombatDamage(String aType, EntityLivingBase aPlayer, IChatComponent aDeathMessage) { + return new DamageSourceCombat(aType, aPlayer, aDeathMessage); + } + + public static DamageSource getHeatDamage() { + return new DamageSourceHeat(); + } + + public static DamageSource getFrostDamage() { + return new DamageSourceFrost(); + } + + private static class DamageSourceCombat extends EntityDamageSource { + private IChatComponent mDeathMessage; + + public DamageSourceCombat(String aType, EntityLivingBase aPlayer, IChatComponent aDeathMessage) { + super(aType, aPlayer); + mDeathMessage = aDeathMessage; + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return mDeathMessage == null ? super.func_151519_b(aTarget) : mDeathMessage; + } + } + + private static class DamageSourceFrost extends DamageSource { + public DamageSourceFrost() { + super("frost"); + setDifficultyScaled(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " got frozen"); + } + } + + private static class DamageSourceHeat extends DamageSource { + public DamageSourceHeat() { + super("steam"); + setDifficultyScaled(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " was boiled alive"); + } + } + + public static class DamageSourceExploding extends DamageSource { + public DamageSourceExploding() { + super("exploded"); + setDamageAllowedInCreativeMode(); + setDamageBypassesArmor(); + setDamageIsAbsolute(); + } + + @Override + public IChatComponent func_151519_b(EntityLivingBase aTarget) { + return new ChatComponentText(EnumChatFormatting.RED+aTarget.getCommandSenderName()+EnumChatFormatting.WHITE + " exploded"); + } + } +}
\ No newline at end of file |
