mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 05:45:03 +00:00
Merge branch 'master' into dev
# Conflicts: # src/main/java/noppes/npcs/scripted/ScriptFaction.java # src/main/java/noppes/npcs/scripted/ScriptWorld.java # src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java # src/main/java/noppes/npcs/scripted/entity/ScriptPlayer.java # src/main/java/noppes/npcs/scripted/interfaces/IEntity.java # src/main/java/noppes/npcs/scripted/interfaces/IWorld.java # src/main/java/noppes/npcs/scripted/interfaces/entity/ICustomNpc.java # src/main/java/noppes/npcs/scripted/interfaces/entity/IPlayer.java
This commit is contained in:
commit
ec5fc71413
300 files changed
+9920
-2959
No files matched your search
@@ -4,15 +4,20 @@ import noppes.npcs.controllers.Faction;
|
||||
import noppes.npcs.controllers.FactionController;
|
||||
import noppes.npcs.scripted.entity.ScriptNpc;
|
||||
import noppes.npcs.scripted.entity.ScriptPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
|
||||
public class ScriptFaction {
|
||||
|
||||
|
||||
private Faction faction;
|
||||
|
||||
public void saveFaction() {
|
||||
FactionController.getInstance().saveFaction(faction);
|
||||
}
|
||||
|
||||
|
||||
public ScriptFaction(Faction faction){
|
||||
this.faction = faction;
|
||||
}
|
||||
@@ -34,76 +39,76 @@ public class ScriptFaction {
|
||||
public void setName(String name) {
|
||||
faction.name = name;
|
||||
}
|
||||
|
||||
|
||||
public int getDefaultPoints(){
|
||||
return faction.defaultPoints;
|
||||
}
|
||||
|
||||
|
||||
public void setDefaultPoints(int p) {
|
||||
faction.defaultPoints = p;
|
||||
}
|
||||
|
||||
|
||||
public int getFriendlyPoints() {
|
||||
return faction.friendlyPoints;
|
||||
}
|
||||
|
||||
|
||||
public void setFriendlyPoints(int p) {
|
||||
faction.friendlyPoints = p;
|
||||
}
|
||||
|
||||
|
||||
public int getNeutralPoints() {
|
||||
return faction.neutralPoints;
|
||||
}
|
||||
|
||||
|
||||
public void setNeutralPoints(int p) {
|
||||
faction.neutralPoints = p;
|
||||
}
|
||||
|
||||
|
||||
public boolean getHideFaction() {
|
||||
return faction.hideFaction;
|
||||
}
|
||||
|
||||
|
||||
public void setHideFaction(boolean b) {
|
||||
faction.hideFaction = b;
|
||||
}
|
||||
|
||||
|
||||
public boolean getGetsAttacked() {
|
||||
return faction.getsAttacked;
|
||||
}
|
||||
|
||||
|
||||
public void setGetsAttacked(boolean b) {
|
||||
faction.getsAttacked = b;
|
||||
}
|
||||
|
||||
|
||||
public int getColor(){
|
||||
return faction.color;
|
||||
}
|
||||
|
||||
|
||||
public void setColor(int c) {
|
||||
faction.color = c;
|
||||
}
|
||||
|
||||
public boolean isFriendlyToPlayer(ScriptPlayer player){
|
||||
return faction.isFriendlyToPlayer(player.player);
|
||||
public boolean isFriendlyToPlayer(IPlayer player){
|
||||
return faction.isFriendlyToPlayer((EntityPlayer) player.getMCEntity());
|
||||
}
|
||||
|
||||
public boolean isNeutralToPlayer(ScriptPlayer player){
|
||||
return faction.isNeutralToPlayer(player.player);
|
||||
public boolean isNeutralToPlayer(IPlayer player){
|
||||
return faction.isNeutralToPlayer((EntityPlayer) player.getMCEntity());
|
||||
}
|
||||
|
||||
public boolean isAggressiveToPlayer(ScriptPlayer player){
|
||||
return faction.isAggressiveToPlayer(player.player);
|
||||
public boolean isAggressiveToPlayer(IPlayer player){
|
||||
return faction.isAggressiveToPlayer((EntityPlayer) player.getMCEntity());
|
||||
}
|
||||
|
||||
public boolean isAggressiveToNpc(ScriptNpc npc){
|
||||
return faction.isAggressiveToNpc(npc.npc);
|
||||
public boolean isAggressiveToNpc(ICustomNpc npc){
|
||||
return faction.isAggressiveToNpc((EntityNPCInterface) npc.getMCEntity());
|
||||
}
|
||||
|
||||
|
||||
public Integer[] getEnemyFactionIds() {
|
||||
if (faction.attackFactions == null) return new Integer[0];
|
||||
return faction.attackFactions.toArray(new Integer[faction.attackFactions.size()]);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEnemyFaction(int id) {
|
||||
if (faction.attackFactions == null) return false;
|
||||
Integer[] enemies = getEnemyFactionIds();
|
||||
@@ -112,13 +117,13 @@ public class ScriptFaction {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public void addFactionEnemy(int id) {
|
||||
if (!faction.attackFactions.contains(id)) faction.attackFactions.add(id);
|
||||
}
|
||||
|
||||
|
||||
public void removeFactionEnemy(int id) {
|
||||
faction.attackFactions.remove(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user