mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 01:05:12 +00:00
IParticle:
-Replaced spawnOnEntity and spawnInWorld with a single function name "spawn". Deprecated the others.
This commit is contained in:
1 parent
1110748504
commit
e048496e4d
3 files changed
+29
-8
No files matched your search
@@ -3,6 +3,7 @@ package noppes.npcs.scripted;
|
||||
import net.minecraft.nbt.*;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.scripted.interfaces.IParticle;
|
||||
import noppes.npcs.scripted.interfaces.IWorld;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntity;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@@ -128,7 +129,7 @@ public class ScriptParticle implements IParticle {
|
||||
return particle;
|
||||
}
|
||||
|
||||
public void spawnOnEntity(IEntity entity){
|
||||
public void spawn(IEntity entity){
|
||||
int entityID = entity.getMCEntity().getEntityId();
|
||||
|
||||
NBTTagCompound compound = this.writeToNBT();
|
||||
@@ -137,16 +138,28 @@ public class ScriptParticle implements IParticle {
|
||||
NoppesUtilServer.spawnScriptedParticle(compound, entity.getWorld().getDimensionID());
|
||||
}
|
||||
|
||||
public void spawnInWorld(ScriptWorld world){
|
||||
public void spawn(IWorld world){
|
||||
NBTTagCompound compound = this.writeToNBT();
|
||||
NoppesUtilServer.spawnScriptedParticle(compound, world.getDimensionID());
|
||||
}
|
||||
|
||||
public void spawnInWorld(ScriptWorld world, double x, double y, double z){
|
||||
public void spawn(IWorld world, double x, double y, double z){
|
||||
NBTTagCompound compound = this.writeToNBT();
|
||||
NoppesUtilServer.spawnScriptedParticle(compound, world.getDimensionID());
|
||||
}
|
||||
|
||||
public void spawnOnEntity(IEntity entity) {
|
||||
spawn(entity);
|
||||
}
|
||||
|
||||
public void spawnInWorld(IWorld world) {
|
||||
spawn(world);
|
||||
}
|
||||
|
||||
public void spawnInWorld(IWorld world, double x, double y, double z){
|
||||
spawn(world, x, y, z);
|
||||
}
|
||||
|
||||
public void setGlows(boolean glows) { this.glows = glows; }
|
||||
public boolean getGlows() { return this.glows; }
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
NoppesUtilServer.spawnScriptedParticle(compound, this.getWorld().getDimensionID());
|
||||
}
|
||||
|
||||
public void spawnParticle(IParticle entityParticle) { entityParticle.spawnOnEntity(this); }
|
||||
public void spawnParticle(IParticle entityParticle) { entityParticle.spawn(this); }
|
||||
|
||||
public int getEntityId(){
|
||||
return entity.getEntityId();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package noppes.npcs.scripted.interfaces;
|
||||
|
||||
import noppes.npcs.scripted.ScriptWorld;
|
||||
import noppes.npcs.scripted.interfaces.entity.IEntity;
|
||||
|
||||
/**
|
||||
@@ -24,13 +23,13 @@ public interface IParticle {
|
||||
*
|
||||
* @param entity Spawns this particle object on the given entity. When spawned this way, the particle will always have its origin at the entity.
|
||||
*/
|
||||
void spawnOnEntity(IEntity entity);
|
||||
void spawn(IEntity entity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world Spawns the particle in the given world, at a position corresponding to this particle's position variables.
|
||||
*/
|
||||
void spawnInWorld(ScriptWorld world);
|
||||
void spawn(IWorld world);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -39,7 +38,16 @@ public interface IParticle {
|
||||
* @param y The Y position the particle will spawn in the world.
|
||||
* @param z The Z position the particle will spawn in the world.
|
||||
*/
|
||||
void spawnInWorld(ScriptWorld world, double x, double y, double z);
|
||||
void spawn(IWorld world, double x, double y, double z);
|
||||
|
||||
@Deprecated
|
||||
void spawnOnEntity(IEntity entity);
|
||||
|
||||
@Deprecated
|
||||
void spawnInWorld(IWorld world);
|
||||
|
||||
@Deprecated
|
||||
void spawnInWorld(IWorld world, double x, double y, double z);
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user