mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 01:45:07 +00:00
removed redundant faction functions
Luis C.M. will add API.getFactions() which returns the FactionController. All these functions use the faction controller anyway. Also Luis PR already has entity.getDimension and world.spawnEntity
This commit is contained in:
1 parent
b97d4eeeb2
commit
aba637be14
4 files changed
-53
No files matched your search
@@ -420,40 +420,6 @@ public class ScriptWorld implements IWorld {
|
||||
return ScriptController.Instance.getScriptForEntity(entity);
|
||||
}
|
||||
|
||||
public boolean spawnEntity(Entity e) {
|
||||
if (world.spawnEntityInWorld(e)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new default faction
|
||||
* @param name The name of the new faction. If the name already exists an '_' will be added at the end
|
||||
* @return The faction object which was created
|
||||
*/
|
||||
public ScriptFaction createFaction(String name) {
|
||||
//System.out.println("Attempting to create new faction "+name);
|
||||
int maxValue = 0xFFFFFF;
|
||||
Random r = new Random();
|
||||
int randomColor = r.nextInt(maxValue + 1);
|
||||
|
||||
Faction fac = new Faction(-1, name, randomColor, 1000);
|
||||
FactionController.getInstance().saveFaction(fac);
|
||||
|
||||
return new ScriptFaction(fac);
|
||||
}
|
||||
|
||||
public ScriptFaction getFactionFromName(String name) {
|
||||
Faction f = FactionController.getInstance().getFactionFromName(name);
|
||||
if (f == null) return null;
|
||||
return new ScriptFaction(f);
|
||||
}
|
||||
|
||||
public ScriptFaction getFactionFromId(int id) {
|
||||
Faction f = FactionController.getInstance().get(id);
|
||||
if (f == null) return null;
|
||||
return new ScriptFaction(f);
|
||||
}
|
||||
|
||||
public ScriptScoreboard getScoreboard(){
|
||||
return new ScriptScoreboard();
|
||||
}
|
||||
|
||||
@@ -318,10 +318,6 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
public void setPos(IPos pos) {
|
||||
this.entity.setPosition((double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F));
|
||||
}
|
||||
|
||||
public int getDimension() {
|
||||
return entity.dimension;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param range The search range for entities around this entity
|
||||
|
||||
@@ -129,8 +129,6 @@ public interface IEntity<T extends Entity> {
|
||||
* @param z The z position
|
||||
*/
|
||||
public void setPosition(double x, double y, double z);
|
||||
|
||||
public int getDimension();
|
||||
|
||||
/**
|
||||
* @param range The search range for entities around this entity
|
||||
|
||||
@@ -219,19 +219,6 @@ public interface IWorld {
|
||||
*/
|
||||
public ScriptEntity spawnClone(int x, int y, int z, int tab, String name);
|
||||
|
||||
public boolean spawnEntity(Entity e);
|
||||
|
||||
/**
|
||||
* Create a new default faction
|
||||
* @param name The name of the new faction. If the name already exists an '_' will be added at the end
|
||||
* @return The faction object which was created
|
||||
*/
|
||||
public ScriptFaction createFaction(String name);
|
||||
|
||||
public ScriptFaction getFactionFromName(String name);
|
||||
|
||||
public ScriptFaction getFactionFromId(int id);
|
||||
|
||||
public ScriptScoreboard getScoreboard();
|
||||
|
||||
BlockPos getMCBlockPos(int x, int y, int z);
|
||||
|
||||
Reference in new issue
Block a user