Bound tools

Fix errors

Fix

Fix

Patch

Patch
This commit is contained in:
Arcaratus 2015-12-29 14:32:35 -05:00
parent 6c6d8067bf
commit aa0f7d81a0
33 changed files with 880 additions and 31 deletions

View file

@ -1,16 +1,18 @@
package WayofTime.bloodmagic.potion;
import WayofTime.bloodmagic.registry.ModItems;
import WayofTime.bloodmagic.registry.ModPotions;
import net.minecraft.entity.Entity;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.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.living.*;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@ -101,6 +103,22 @@ public class PotionEventHandlers {
}
}
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event) {
if (event.source.getDamageType().equals("player")) {
double rand = Math.random();
if (!(event.entityLiving instanceof EntityAnimal)) {
PotionEffect effect = event.entityLiving.getActivePotionEffect(Potion.weakness);
if (effect != null)
if (effect.getAmplifier() >= 2)
if (rand < 0.2)
event.entityLiving.dropItem(ModItems.bloodShard, 1);
}
}
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerDamageEvent(LivingAttackEvent event) {
if (event.entityLiving.isPotionActive(ModPotions.whirlwind) && event.isCancelable() && event.source.isProjectile())