Re-implement Soul Fray on death (#1118)
This should be all that's needed
(cherry picked from commit bffd191
)
This commit is contained in:
parent
0b0ec65ece
commit
5ea7177bdb
|
@ -1,15 +1,18 @@
|
|||
package WayofTime.bloodmagic.potion;
|
||||
|
||||
import WayofTime.bloodmagic.api.event.SacrificeKnifeUsedEvent;
|
||||
import WayofTime.bloodmagic.registry.ModPotions;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
|
@ -111,6 +114,20 @@ public class PotionEventHandlers
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRespawn(PlayerEvent.Clone event)
|
||||
{
|
||||
if (event.isWasDeath())
|
||||
event.getEntityPlayer().addPotionEffect(new PotionEffect(ModPotions.soulFray, 400));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSacrificeKnifeUsed(SacrificeKnifeUsedEvent event)
|
||||
{
|
||||
if (event.player.isPotionActive(ModPotions.soulFray))
|
||||
event.lpAdded = (int) (event.lpAdded * 0.1D);
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPlayerDamageEvent(LivingAttackEvent event)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue