icons
|
Before Width: | Height: | Size: 642 B After Width: | Height: | Size: 590 B |
|
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 734 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 1.4 KiB |
@@ -1,8 +1,11 @@
|
|||||||
package com.kitsu.medievalcraft.entityAI;
|
package com.kitsu.medievalcraft.entityAI;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.SharedMonsterAttributes;
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||||
import net.minecraft.entity.monster.IMob;
|
import net.minecraft.entity.monster.IMob;
|
||||||
@@ -10,9 +13,13 @@ import net.minecraft.entity.passive.EntitySquid;
|
|||||||
import net.minecraft.entity.passive.EntityWaterMob;
|
import net.minecraft.entity.passive.EntityWaterMob;
|
||||||
import net.minecraft.entity.passive.IAnimals;
|
import net.minecraft.entity.passive.IAnimals;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.pathfinding.PathEntity;
|
||||||
|
import net.minecraft.pathfinding.PathFinder;
|
||||||
|
import net.minecraft.profiler.Profiler;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.ChunkCache;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class EntityAIWaterMob extends EntityWaterMob implements IAnimals{
|
public class EntityAIWaterMob extends EntityWaterMob implements IAnimals{
|
||||||
@@ -30,6 +37,7 @@ public class EntityAIWaterMob extends EntityWaterMob implements IAnimals{
|
|||||||
protected boolean Agrooed = false;
|
protected boolean Agrooed = false;
|
||||||
protected boolean landBounce = true;
|
protected boolean landBounce = true;
|
||||||
protected float moreDamage = 0.5F;
|
protected float moreDamage = 0.5F;
|
||||||
|
public Profiler theProfiler;
|
||||||
|
|
||||||
|
|
||||||
public EntityAIWaterMob(World world)
|
public EntityAIWaterMob(World world)
|
||||||
@@ -88,15 +96,6 @@ public class EntityAIWaterMob extends EntityWaterMob implements IAnimals{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Entity findPreySquid()
|
|
||||||
{
|
|
||||||
//EntitySquid squid = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
|
|
||||||
//AxisAlignedBB ab = new AxisAlignedBB(-16d, -16d, -16d, 16d, 16d, 16d);
|
|
||||||
EntitySquid squid = (EntitySquid) this.worldObj.getEntitiesWithinAABB(EntitySquid.class, AxisAlignedBB.getBoundingBox(-106d, -106d, -106d, 106d, 106d, 106d));
|
|
||||||
System.out.println("Finding Squid");
|
|
||||||
return (squid != null) && (canEntityBeSeen(squid)) ? squid : null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean attackEntityAsMob(Entity entity)
|
public boolean attackEntityAsMob(Entity entity)
|
||||||
{
|
{
|
||||||
@@ -172,14 +171,7 @@ public class EntityAIWaterMob extends EntityWaterMob implements IAnimals{
|
|||||||
this.targetZ = this.targetedEntity.posZ;
|
this.targetZ = this.targetedEntity.posZ;
|
||||||
this.isAttacking = true;
|
this.isAttacking = true;
|
||||||
}
|
}
|
||||||
this.targetedEntity = findPreySquid();
|
|
||||||
if ((this.targetedEntity != null) && (this.targetedEntity.isInWater()))
|
|
||||||
{
|
|
||||||
this.targetX = this.targetedEntity.posX;
|
|
||||||
this.targetY = this.targetedEntity.posY;
|
|
||||||
this.targetZ = this.targetedEntity.posZ;
|
|
||||||
this.isAttacking = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.renderYawOffset += (-(float)Math.atan2(this.motionX, this.motionZ) * 180.0F / 3.141593F - this.renderYawOffset) * 0.5F;
|
this.renderYawOffset += (-(float)Math.atan2(this.motionX, this.motionZ) * 180.0F / 3.141593F - this.renderYawOffset) * 0.5F;
|
||||||
this.rotationYaw = this.renderYawOffset;
|
this.rotationYaw = this.renderYawOffset;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 642 B After Width: | Height: | Size: 590 B |
|
Before Width: | Height: | Size: 795 B After Width: | Height: | Size: 734 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 1.4 KiB |