2015-11-15 14:25:12 +01:00
|
|
|
/*
|
2016-05-16 22:52:27 +02:00
|
|
|
* This file ("DamageSources.java") is part of the Actually Additions mod for Minecraft.
|
2015-11-15 14:25:12 +01:00
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
2016-05-16 22:52:27 +02:00
|
|
|
* http://ellpeck.de/actaddlicense
|
2015-11-15 14:25:12 +01:00
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2017-01-01 16:23:26 +01:00
|
|
|
* © 2015-2017 Ellpeck
|
2015-11-15 14:25:12 +01:00
|
|
|
*/
|
|
|
|
|
2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.mod.misc;
|
2015-11-15 14:25:12 +01:00
|
|
|
|
2018-05-10 11:38:58 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
2015-11-15 14:25:12 +01:00
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
import net.minecraft.util.DamageSource;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.util.text.ITextComponent;
|
2016-05-27 18:54:17 +02:00
|
|
|
import net.minecraft.util.text.TextComponentTranslation;
|
2015-11-15 14:25:12 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public class DamageSources extends DamageSource {
|
2015-11-15 14:25:12 +01:00
|
|
|
|
2015-11-19 15:26:54 +01:00
|
|
|
public static final DamageSource DAMAGE_ATOMIC_RECONSTRUCTOR = new DamageSources("atomicReconstructor", 5).setDamageBypassesArmor();
|
2015-11-15 14:25:12 +01:00
|
|
|
|
2016-05-19 20:05:12 +02:00
|
|
|
private final int messageCount;
|
2015-11-15 14:25:12 +01:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public DamageSources(String name, int messageCount) {
|
2015-11-15 14:25:12 +01:00
|
|
|
super(name);
|
|
|
|
this.messageCount = messageCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-02 09:10:29 +02:00
|
|
|
public ITextComponent getDeathMessage(EntityLivingBase entity) {
|
|
|
|
String locTag = "death." + ActuallyAdditions.MODID + "." + this.damageType + "." + (entity.world.rand.nextInt(this.messageCount) + 1);
|
2016-06-08 19:11:06 +02:00
|
|
|
return new TextComponentTranslation(locTag, entity.getName());
|
2015-11-15 14:25:12 +01:00
|
|
|
}
|
|
|
|
}
|