Added more functions to IPlayer, IEntityLiving, IEntityLivingBase, and IAnimal.

This commit is contained in:
Luis C.M committed 2022-12-26 01:13:28 -06:00
1 parent 25dcc975df
commit 1ac0b3b0a3
4 files changed
+43 -3

No files matched your search

@@ -2,6 +2,7 @@ package noppes.npcs.scripted.entity;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.constants.EntityType;
import noppes.npcs.api.entity.IAnimal;
import noppes.npcs.api.entity.IPlayer;
@@ -35,6 +36,14 @@ public class ScriptAnimal<T extends EntityAnimal> extends ScriptLiving<T> implem
return this.entity.interact((EntityPlayer) player.getMCEntity());
}
public void setFollowPlayer(IPlayer player) {
this.entity.func_146082_f((EntityPlayer) player.getMCEntity());
}
public IPlayer followingPlayer() {
return (IPlayer) NpcAPI.Instance().getIEntity(this.entity.func_146083_cb());
}
public boolean isInLove() {
return this.entity.isInLove();
}
@@ -47,7 +56,6 @@ public class ScriptAnimal<T extends EntityAnimal> extends ScriptLiving<T> implem
return this.entity.canMateWith((EntityAnimal) animal.getMCEntity());
}
@Override
public boolean typeOf(int type){
return type == EntityType.ANIMAL || super.typeOf(type);
}
@@ -147,4 +147,8 @@ public class ScriptLiving<T extends EntityLiving> extends ScriptLivingBase<T> im
public void setLeashedTo(IEntity entity, boolean sendPacket) {
this.entity.setLeashedToEntity(entity.getMCEntity(), sendPacket);
}
public boolean canBeSteered() {
return this.entity.canBeSteered();
}
}
@@ -9,7 +9,6 @@ import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.Vec3;
import noppes.npcs.api.IDamageSource;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.ScriptDamageSource;
import noppes.npcs.scripted.constants.EntityType;
import noppes.npcs.api.IBlock;
import noppes.npcs.api.IPos;
@@ -117,7 +116,28 @@ public class ScriptLivingBase<T extends EntityLivingBase> extends ScriptEntity<T
public IEntityLivingBase getAttackTarget(){
return (IEntityLivingBase)NpcAPI.Instance().getIEntity(entity.getAITarget());
}
public int getAttackTargetTime() {
return this.entity.func_142015_aE();
}
public void setLastAttacker(IEntity p_130011_1_) {
this.entity.setLastAttacker(p_130011_1_.getMCEntity());
}
public IEntity getLastAttacker() {
return NpcAPI.Instance().getIEntity(this.entity.getLastAttacker());
}
public int getLastAttackerTime()
{
return this.entity.getLastAttackerTime();
}
public boolean canBreatheUnderwater() {
return this.entity.canBreatheUnderwater();
}
@Override
public int getType(){
return EntityType.LIVING;
@@ -780,4 +780,12 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
return (IQuest[])quests.toArray(new IQuest[quests.size()]);
}
public void setConqueredEnd(boolean conqueredEnd) {
this.player.playerConqueredTheEnd = conqueredEnd;
}
public boolean conqueredEnd() {
return this.player.playerConqueredTheEnd;
}
}