Snap death messages

This commit is contained in:
tilera 2019-05-08 21:09:55 +02:00
parent 19bd9cb0ec
commit 3428f467d4
4 changed files with 10 additions and 3 deletions

View file

@ -2,8 +2,10 @@ package anvil.infinity.effects;
import anvil.infinity.Infinity;
import anvil.infinity.SoundHelper;
import anvil.infinity.helpers.SnapMessageHelper;
import anvil.infinity.registry.Effects;
import anvil.infinity.registry.Sounds;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
@ -27,11 +29,15 @@ public class EffectSnap extends Potion {
if (e.getEntityLiving().getActivePotionEffect(Effects.snapEffect) != null) {
if (e.getEntityLiving().getActivePotionEffect(Effects.snapEffect).getDuration() == 1) {
e.getEntityLiving().playSound(Sounds.snap, 5, 0);
if (e.getEntityLiving().hasCustomName() || e.getEntityLiving() instanceof EntityPlayer) {
SnapMessageHelper.deathMessage(e.getEntityLiving());
}
e.getEntityLiving().setHealth(0);
}
}
}

View file

@ -11,7 +11,7 @@ public class SnapMessageHelper {
public static MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
public static void deathMessage(EntityLivingBase entity) {
TextComponentString msg = new TextComponentString(entity.getName());
TextComponentString msg = new TextComponentString(entity.getName() + " ");
msg.appendSibling(new TextComponentTranslation("infinity.snap.death"));
server.getPlayerList().sendMessage(msg);

View file

@ -3,4 +3,5 @@ item.reality_stone.name=Realitätsstein
item.soul_stone.name=Seelenstein
item.time_stone.name=Zeitstein
item.mind_stone.name=Gedankenstein
infinity.snap.text=Du hättest auf den Kopf zielen sollen.
infinity.snap.text=Du hättest auf den Kopf zielen sollen.
infinity.snap.death=zerfiel zu Staub

View file

@ -4,4 +4,4 @@ item.soul_stone.name=Soul Stone
item.time_stone.name=Time Stone
item.mind_stone.name=Mind Stone
infinity.snap.text=You should have gone for the head.
infinity.snap.death= died by the Snap
infinity.snap.death=was dusted away