mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 05:15:11 +00:00
ScriptParticle:
-The spawnInWorld() function now requires a ScriptWorld object to be passed in as the first parameter. -New spawnInWorld() function with its only parameter being a ScriptWorld object. Spawns in the world with the particle's x,y,z variables.
This commit is contained in:
1 parent
a825d885f5
commit
d49a31a4fe
5 files changed
+47
-15
No files matched your search
@@ -322,7 +322,7 @@ public class NoppesUtilServer {
|
||||
float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart,
|
||||
boolean facePlayer, int width, int height, int offsetX, int offsetY,
|
||||
int animRate, boolean animLoop, int animStart, int animEnd,
|
||||
int entityID
|
||||
int entityID, int dimensionID
|
||||
){
|
||||
Server.sendToAll(EnumPacketClient.SCRIPTED_PARTICLE,
|
||||
directory, HEXcolor, amount, maxAge,
|
||||
@@ -335,7 +335,7 @@ public class NoppesUtilServer {
|
||||
rotationZ1, rotationZ2, rotationZRate, rotationZRateStart,
|
||||
facePlayer, width, height, offsetX, offsetY,
|
||||
animRate, animLoop, animStart, animEnd,
|
||||
entityID
|
||||
entityID, dimensionID
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.Server;
|
||||
@@ -125,9 +126,13 @@ public class NoppesUtil {
|
||||
int animEnd = buffer.readInt();
|
||||
|
||||
int entityID = buffer.readInt();
|
||||
int dimensionID = buffer.readInt();
|
||||
|
||||
World worldObj = DimensionManager.getWorld(dimensionID);
|
||||
|
||||
World worldObj = Minecraft.getMinecraft().theWorld;
|
||||
Entity entity = worldObj.getEntityByID(entityID);
|
||||
if(entity != null)
|
||||
worldObj = entity.worldObj;
|
||||
|
||||
CustomFX fx = new CustomFX(
|
||||
worldObj, entity,
|
||||
|
||||
@@ -58,11 +58,11 @@ public class ScriptParticle {
|
||||
rotationZ1, rotationZ2, rotationZRate, rotationZRateStart,
|
||||
facePlayer, width, height, offsetX, offsetY,
|
||||
animRate, animLoop, animStart, animEnd,
|
||||
entityID
|
||||
entityID, entity.getWorld().getDimensionID()
|
||||
);
|
||||
}
|
||||
|
||||
public void spawnInWorld(double x, double y, double z){
|
||||
public void spawnInWorld(ScriptWorld world){
|
||||
NoppesUtilServer.spawnScriptedParticle(directory, HEXcolor, amount, maxAge,
|
||||
x, y, z,
|
||||
motionX, motionY, motionZ, gravity,
|
||||
@@ -73,7 +73,22 @@ public class ScriptParticle {
|
||||
rotationZ1, rotationZ2, rotationZRate, rotationZRateStart,
|
||||
facePlayer, width, height, offsetX, offsetY,
|
||||
animRate, animLoop, animStart, animEnd,
|
||||
-1
|
||||
-1, world.getDimensionID()
|
||||
);
|
||||
}
|
||||
|
||||
public void spawnInWorld(ScriptWorld world, double x, double y, double z){
|
||||
NoppesUtilServer.spawnScriptedParticle(directory, HEXcolor, amount, maxAge,
|
||||
x, y, z,
|
||||
motionX, motionY, motionZ, gravity,
|
||||
scale1, scale2, scaleRate, scaleRateStart,
|
||||
alpha1, alpha2, alphaRate, alphaRateStart,
|
||||
rotationX1, rotationX2, rotationXRate, rotationXRateStart,
|
||||
rotationY1, rotationY2, rotationYRate, rotationYRateStart,
|
||||
rotationZ1, rotationZ2, rotationZRate, rotationZRateStart,
|
||||
facePlayer, width, height, offsetX, offsetY,
|
||||
animRate, animLoop, animStart, animEnd,
|
||||
-1, world.getDimensionID()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -330,13 +330,25 @@ public class ScriptWorld implements IWorld {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param directory The particle's texture directory. Use only forward slashes when writing a directory. Example: "customnpcs:textures/particle/tail.png"
|
||||
* @return Returns ScriptEntityParticle object
|
||||
* @param directory The particle's texture directory. Use only forward slashes when writing a directory. Example: "customnpcs:textures/particle/bubble.png"
|
||||
* @return Returns ScriptParticle object
|
||||
*/
|
||||
public ScriptParticle createEntityParticle(String directory){
|
||||
return new ScriptParticle(directory);
|
||||
}
|
||||
|
||||
|
||||
public ScriptParticle createParticle(String directory){
|
||||
return new ScriptParticle(directory);
|
||||
}
|
||||
|
||||
public void spawnParticle(ScriptParticle particle){
|
||||
particle.spawnInWorld(this);
|
||||
}
|
||||
|
||||
public void spawnParticle(ScriptParticle particle, double x, double y, double z){
|
||||
particle.spawnInWorld(this,x,y,z);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key Get temp data for this key
|
||||
* @return Returns the stored temp data
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
rotationZ1, rotationZ2, rotationZRate, rotationZRateStart,
|
||||
true, -1, -1, 0,0,
|
||||
0, true, 0, 0,
|
||||
entityID
|
||||
entityID, entity.dimension
|
||||
);
|
||||
}
|
||||
public void spawnParticle(String directory, int HEXcolor, int amount, int maxAge,
|
||||
@@ -103,7 +103,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
0, 0, 0, 0,
|
||||
true, -1, -1, 0,0,
|
||||
0, true, 0, 0,
|
||||
entityID
|
||||
entityID, entity.dimension
|
||||
);
|
||||
}
|
||||
public void spawnParticle(String directory, int HEXcolor, int amount, int maxAge,
|
||||
@@ -122,7 +122,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
0, 0, 0, 0,
|
||||
true, -1, -1, 0,0,
|
||||
0, true, 0, 0,
|
||||
entityID
|
||||
entityID, entity.dimension
|
||||
);
|
||||
}
|
||||
public void spawnParticle(String directory, int HEXcolor, int amount, int maxAge,
|
||||
@@ -140,7 +140,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
0, 0, 0, 0,
|
||||
true, -1, -1, 0,0,
|
||||
0, true, 0, 0,
|
||||
entityID
|
||||
entityID, entity.dimension
|
||||
);
|
||||
}
|
||||
public void spawnParticle(String directory, int HEXcolor, int amount, int maxAge,
|
||||
@@ -157,7 +157,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
0, 0, 0, 0,
|
||||
true, -1, -1, 0,0,
|
||||
0, true, 0, 0,
|
||||
entityID
|
||||
entityID, entity.dimension
|
||||
);
|
||||
}
|
||||
public void spawnParticle(String directory, int HEXcolor, int amount, int maxAge
|
||||
@@ -173,7 +173,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
0, 0, 0, 0,
|
||||
true, -1, -1, 0,0,
|
||||
0, true, 0, 0,
|
||||
entityID
|
||||
entityID, entity.dimension
|
||||
);
|
||||
}
|
||||
public void spawnParticle(ScriptParticle entityParticle) { entityParticle.spawnOnEntity(this); }
|
||||
|
||||
Reference in new issue
Block a user