mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
IWorld:
-Implemented spawnClone() with a boolean parameter to check entity protection from mods & plugins correctly (for real this time). ICloneHandler: -Implemented ignoreProtection boolean value for the spawn() function.
This commit is contained in:
1 parent
a4585fdf4d
commit
a3b5f5993e
5 files changed
+51
-8
No files matched your search
@@ -588,14 +588,21 @@ public class ScriptWorld implements IWorld {
|
||||
* @param name Name of the cloned entity
|
||||
* @return Returns the entity which was spawned
|
||||
*/
|
||||
public IEntity spawnClone(int x, int y, int z, int tab, String name){
|
||||
public IEntity spawnClone(int x, int y, int z, int tab, String name, boolean ignoreProtection){
|
||||
NBTTagCompound compound = ServerCloneController.Instance.getCloneData(null, name, tab);
|
||||
if(compound == null)
|
||||
return null;
|
||||
Entity entity = NoppesUtilServer.spawnClone(compound, x, y, z, world);
|
||||
if(entity == null)
|
||||
return null;
|
||||
return NpcAPI.Instance().getIEntity(entity);
|
||||
Entity entity;
|
||||
if (!ignoreProtection) {
|
||||
entity = NoppesUtilServer.spawnCloneWithProtection(compound, x, y, z, world);
|
||||
} else {
|
||||
entity = NoppesUtilServer.spawnClone(compound, x, y, z, world);
|
||||
}
|
||||
return entity == null ? null : NpcAPI.Instance().getIEntity(entity);
|
||||
}
|
||||
|
||||
public IEntity spawnClone(int x, int y, int z, int tab, String name) {
|
||||
return this.spawnClone(x,y,z,tab,name,true);
|
||||
}
|
||||
|
||||
public ScriptScoreboard getScoreboard(){
|
||||
|
||||
Reference in new issue
Block a user