2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs.scripted;
|
|
|
|
|
|
2022-05-11 22:08:31 -05:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2018-09-13 12:03:28 -04:00
|
|
|
import noppes.npcs.controllers.Faction;
|
2022-05-11 22:08:31 -05:00
|
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
|
|
|
|
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
|
|
|
|
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
|
|
|
|
public class ScriptFaction {
|
|
|
|
|
private Faction faction;
|
|
|
|
|
|
|
|
|
|
public ScriptFaction(Faction faction){
|
|
|
|
|
this.faction = faction;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Returns the factions id
|
|
|
|
|
*/
|
|
|
|
|
public int getId(){
|
|
|
|
|
return faction.id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Return the factions name
|
|
|
|
|
*/
|
|
|
|
|
public String getName(){
|
|
|
|
|
return faction.name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getDefaultPoints(){
|
|
|
|
|
return faction.defaultPoints;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getColor(){
|
|
|
|
|
return faction.color;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-11 22:08:31 -05:00
|
|
|
public boolean isFriendlyToPlayer(IPlayer player){
|
|
|
|
|
return faction.isFriendlyToPlayer((EntityPlayer) player.getMCEntity());
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
2022-05-11 22:08:31 -05:00
|
|
|
public boolean isNeutralToPlayer(IPlayer player){
|
|
|
|
|
return faction.isNeutralToPlayer((EntityPlayer) player.getMCEntity());
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
2022-05-11 22:08:31 -05:00
|
|
|
public boolean isAggressiveToPlayer(IPlayer player){
|
|
|
|
|
return faction.isAggressiveToPlayer((EntityPlayer) player.getMCEntity());
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
2022-05-11 22:08:31 -05:00
|
|
|
public boolean isAggressiveToNpc(ICustomNpc npc){
|
|
|
|
|
return faction.isAggressiveToNpc((EntityNPCInterface) npc.getMCEntity());
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
}
|