mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-27 19:02:58 +00:00
Scripted particles can now spawn anywhere in the world, not just attached to an entity.
ScriptEntityParticle renamed to ScriptParticle, and EntityCustomFX renamed to CustomFX. Re-enabled OpenGL blending for custom particles.
This commit is contained in:
1 parent
dbc9754b43
commit
c3b9096295
8 files changed
+50
-48
No files matched your search
@@ -10,11 +10,8 @@ import java.io.File;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.EventBus;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -91,7 +88,9 @@ public abstract class NpcAPI {
|
||||
|
||||
public abstract ScriptItemStack createItem(String id, int damage, int size);
|
||||
|
||||
public abstract ScriptEntityParticle createEntityParticle(String directory);
|
||||
public abstract ScriptParticle createParticle(String directory);
|
||||
|
||||
public abstract ScriptParticle createEntityParticle(String directory);
|
||||
|
||||
public abstract int getServerTime();
|
||||
}
|
||||
+17
-2
@@ -6,7 +6,7 @@ import noppes.npcs.scripted.entity.ScriptEntity;
|
||||
/**
|
||||
* Created by luisc on 9/8/2021.
|
||||
*/
|
||||
public class ScriptEntityParticle {
|
||||
public class ScriptParticle {
|
||||
private String directory;
|
||||
private int HEXcolor = 0xFFFFFF;
|
||||
private int amount = 1;
|
||||
@@ -42,7 +42,7 @@ public class ScriptEntityParticle {
|
||||
|
||||
public boolean facePlayer = true;
|
||||
|
||||
public ScriptEntityParticle(String directory){
|
||||
public ScriptParticle(String directory){
|
||||
this.directory = directory;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,21 @@ public class ScriptEntityParticle {
|
||||
);
|
||||
}
|
||||
|
||||
public void spawnInWorld(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
|
||||
);
|
||||
}
|
||||
|
||||
public void setSize(int width, int height){
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntitySign;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.blocks.tiles.TileBigSign;
|
||||
@@ -31,7 +30,6 @@ import noppes.npcs.scripted.entity.ScriptEntity;
|
||||
import noppes.npcs.scripted.entity.ScriptPlayer;
|
||||
import noppes.npcs.scripted.interfaces.IBlock;
|
||||
import noppes.npcs.scripted.interfaces.IWorld;
|
||||
import sun.font.Script;
|
||||
|
||||
public class ScriptWorld implements IWorld {
|
||||
private static Map<String,Object> tempData = new HashMap<String,Object>();
|
||||
@@ -335,8 +333,8 @@ 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
|
||||
*/
|
||||
public ScriptEntityParticle createEntityParticle(String directory){
|
||||
return new ScriptEntityParticle(directory);
|
||||
public ScriptParticle createEntityParticle(String directory){
|
||||
return new ScriptParticle(directory);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTBase.NBTPrimitive;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.WorldServer;
|
||||
@@ -177,7 +176,7 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
entityID
|
||||
);
|
||||
}
|
||||
public void spawnParticle(ScriptEntityParticle entityParticle) { entityParticle.spawnOnEntity(this); }
|
||||
public void spawnParticle(ScriptParticle entityParticle) { entityParticle.spawnOnEntity(this); }
|
||||
|
||||
public int getEntityId(){
|
||||
return entity.getEntityId();
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package noppes.npcs.scripted.interfaces;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.scripted.*;
|
||||
import noppes.npcs.scripted.entity.ScriptEntity;
|
||||
@@ -175,7 +172,7 @@ public interface 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
|
||||
*/
|
||||
public ScriptEntityParticle createEntityParticle(String directory);
|
||||
public ScriptParticle createEntityParticle(String directory);
|
||||
|
||||
/**
|
||||
* @param key Get temp data for this key
|
||||
|
||||
@@ -283,8 +283,12 @@ public class WrapperNpcAPI extends NpcAPI {
|
||||
MinecraftServer.getServer().setMOTD(motd);
|
||||
}
|
||||
|
||||
public ScriptEntityParticle createEntityParticle(String directory){
|
||||
return new ScriptEntityParticle(directory);
|
||||
public ScriptParticle createParticle(String directory){
|
||||
return new ScriptParticle(directory);
|
||||
}
|
||||
|
||||
public ScriptParticle createEntityParticle(String directory){
|
||||
return new ScriptParticle(directory);
|
||||
}
|
||||
|
||||
public int getServerTime() {
|
||||
|
||||
Reference in new issue
Block a user