mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-24 03:34:24 +00:00
Enabled fly button in movement, and extended max values for several NPC attributes, converting some to floats and doubles.
NPCs fly with speed based on their movement speed now.
This commit is contained in:
1 parent
44d4e74279
commit
23686dc3b8
35 files changed
+258
-189
No files matched your search
@@ -6,10 +6,13 @@ import java.util.List;
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITarget;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAIClosestTarget extends EntityAITarget
|
||||
{
|
||||
@@ -52,10 +55,11 @@ public class EntityAIClosestTarget extends EntityAITarget
|
||||
}
|
||||
else
|
||||
{
|
||||
taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(((EntityNPCInterface) taskOwner).stats.aggroRange);
|
||||
double d0 = this.getTargetDistance();
|
||||
List list = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand(d0, MathHelper.ceiling_double_int(d0 / 2.0D), d0), this.field_82643_g);
|
||||
Collections.sort(list, this.theNearestAttackableTargetSorter);
|
||||
|
||||
taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(CustomNpcs.NpcNavRange);
|
||||
if (list.isEmpty())
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user