Fixed it so that if the Sentient Specters hit each other and they have the same owner they will not attack each other
This commit is contained in:
parent
939e1c3946
commit
5592e8661b
9 changed files with 298 additions and 27 deletions
|
@ -13,6 +13,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumHand;
|
||||
|
@ -23,6 +24,7 @@ import net.minecraft.util.math.Vec3d;
|
|||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
|
@ -41,6 +43,7 @@ import WayofTime.bloodmagic.api.event.ItemBindEvent;
|
|||
import WayofTime.bloodmagic.api.event.SacrificeKnifeUsedEvent;
|
||||
import WayofTime.bloodmagic.api.event.TeleposeEvent;
|
||||
import WayofTime.bloodmagic.api.iface.IBindable;
|
||||
import WayofTime.bloodmagic.api.iface.ISentientTool;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.saving.SoulNetwork;
|
||||
|
@ -87,6 +90,24 @@ public class GenericHandler
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerDropItem(ItemTossEvent event)
|
||||
{
|
||||
EntityItem itemEntity = event.getEntityItem();
|
||||
if (itemEntity != null)
|
||||
{
|
||||
ItemStack stack = itemEntity.getEntityItem();
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof ISentientTool)
|
||||
{
|
||||
if (((ISentientTool) item).spawnSentientEntityOnDrop(stack, event.getPlayer()))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onExplosion(ExplosionEvent.Start event)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue