this doesn't compile yet, but have something to peek at

This commit is contained in:
Nicholas Ignoffo 2017-08-14 20:53:42 -07:00
parent 973f1019a5
commit 5fcdd978d7
329 changed files with 3247 additions and 2953 deletions

View file

@ -1,36 +1,33 @@
package WayofTime.bloodmagic.potion;
import WayofTime.bloodmagic.api.event.SacrificeKnifeUsedEvent;
import WayofTime.bloodmagic.registry.ModPotions;
import WayofTime.bloodmagic.registry.RegistrarBloodMagic;
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.Mod;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.util.List;
@Mod.EventBusSubscriber
public class PotionEventHandlers
{
public PotionEventHandlers()
{
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void onLivingJumpEvent(LivingEvent.LivingJumpEvent event)
public static void onLivingJumpEvent(LivingEvent.LivingJumpEvent event)
{
if (event.getEntityLiving().isPotionActive(ModPotions.boost))
if (event.getEntityLiving().isPotionActive(RegistrarBloodMagic.BOOST))
{
int i = event.getEntityLiving().getActivePotionEffect(ModPotions.boost).getAmplifier();
int i = event.getEntityLiving().getActivePotionEffect(RegistrarBloodMagic.BOOST).getAmplifier();
event.getEntityLiving().motionY += (0.1f) * (2 + i);
}
@ -40,7 +37,7 @@ public class PotionEventHandlers
}
@SubscribeEvent
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event)
public static void onEntityUpdate(LivingEvent.LivingUpdateEvent event)
{
// if (event.getEntityLiving().isPotionActive(ModPotions.boost))
// {
@ -58,7 +55,7 @@ public class PotionEventHandlers
// }
// }
if (event.getEntityLiving().isPotionActive(ModPotions.whirlwind))
if (event.getEntityLiving().isPotionActive(RegistrarBloodMagic.WHIRLWIND))
{
int d0 = 3;
AxisAlignedBB axisAlignedBB = new AxisAlignedBB(event.getEntityLiving().posX - 0.5, event.getEntityLiving().posY - 0.5, event.getEntityLiving().posZ - 0.5, event.getEntityLiving().posX + 0.5, event.getEntityLiving().posY + 0.5, event.getEntityLiving().posZ + 0.5).expand(d0, d0, d0);
@ -113,30 +110,30 @@ public class PotionEventHandlers
}
@SubscribeEvent
public void onPlayerRespawn(PlayerEvent.Clone event)
public static void onPlayerRespawn(PlayerEvent.Clone event)
{
if (event.isWasDeath())
event.getEntityPlayer().addPotionEffect(new PotionEffect(ModPotions.soulFray, 400));
event.getEntityPlayer().addPotionEffect(new PotionEffect(RegistrarBloodMagic.SOUL_FRAY, 400));
}
@SubscribeEvent
public void onSacrificeKnifeUsed(SacrificeKnifeUsedEvent event)
public static void onSacrificeKnifeUsed(SacrificeKnifeUsedEvent event)
{
if (event.player.isPotionActive(ModPotions.soulFray))
if (event.player.isPotionActive(RegistrarBloodMagic.SOUL_FRAY))
event.lpAdded = (int) (event.lpAdded * 0.1D);
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerDamageEvent(LivingAttackEvent event)
public static void onPlayerDamageEvent(LivingAttackEvent event)
{
if (event.getEntityLiving().isPotionActive(ModPotions.whirlwind) && event.isCancelable() && event.getSource().isProjectile())
if (event.getEntityLiving().isPotionActive(RegistrarBloodMagic.WHIRLWIND) && event.isCancelable() && event.getSource().isProjectile())
event.setCanceled(true);
}
@SubscribeEvent
public void onEndermanTeleportEvent(EnderTeleportEvent event)
public static void onEndermanTeleportEvent(EnderTeleportEvent event)
{
if (event.getEntityLiving().isPotionActive(ModPotions.planarBinding) && event.isCancelable())
if (event.getEntityLiving().isPotionActive(RegistrarBloodMagic.PLANAR_BINDING) && event.isCancelable())
{
event.setCanceled(true);
}