mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 00:22:19 +00:00
Merge branch 'master' of https://github.com/KAMKEEL/CustomNPC-Plus
This commit is contained in:
commit
d867017871
26 files changed
+477
-342
No files matched your search
@@ -18,17 +18,35 @@ public class ScriptEntityParticle {
|
||||
private float alpha1 = 1.0f,alpha2 = 1.0f,alphaRate = 0.0f;
|
||||
private int scaleRateStart = 0, alphaRateStart = 0;
|
||||
|
||||
public float rotationX1 = 0;
|
||||
public float rotationX2 = 0;
|
||||
public float rotationXRate = 0.0F;
|
||||
public int rotationXRateStart = 0;
|
||||
|
||||
public float rotationY1 = 0;
|
||||
public float rotationY2 = 0;
|
||||
public float rotationYRate = 0.0F;
|
||||
public int rotationYRateStart = 0;
|
||||
|
||||
public float rotationZ1 = 0;
|
||||
public float rotationZ2 = 0;
|
||||
public float rotationZRate = 0.0F;
|
||||
public int rotationZRateStart = 0;
|
||||
|
||||
public ScriptEntityParticle(String directory){
|
||||
this.directory = directory;
|
||||
}
|
||||
|
||||
public void spawnOnEntity(ScriptEntity entity){
|
||||
int entityID = entity.getMCEntity().getEntityId();
|
||||
NoppesUtilServer.spawnScriptedParticle(entity.getMCEntity(), directory, HEXcolor, amount, maxAge,
|
||||
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,
|
||||
entityID
|
||||
);
|
||||
}
|
||||
@@ -52,11 +70,9 @@ public class ScriptEntityParticle {
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
@@ -64,50 +80,56 @@ public class ScriptEntityParticle {
|
||||
public double getMotionX() {
|
||||
return motionX;
|
||||
}
|
||||
|
||||
public double getMotionY() {
|
||||
return motionY;
|
||||
}
|
||||
|
||||
public double getMotionZ() {
|
||||
return motionZ;
|
||||
}
|
||||
|
||||
public float getGravity() {
|
||||
return gravity;
|
||||
}
|
||||
|
||||
public float getScale1() {
|
||||
return scale1;
|
||||
}
|
||||
|
||||
public float getScale2() {
|
||||
return scale2;
|
||||
}
|
||||
|
||||
public float getScaleRate() {
|
||||
return scaleRate;
|
||||
}
|
||||
|
||||
public float getAlpha1() {
|
||||
return alpha1;
|
||||
}
|
||||
|
||||
public float getAlpha2() {
|
||||
return alpha2;
|
||||
}
|
||||
|
||||
public float getAlphaRate() {
|
||||
return alphaRate;
|
||||
}
|
||||
public int getAlphaRateStart() {
|
||||
return alphaRateStart;
|
||||
}
|
||||
|
||||
public float getScale1() {
|
||||
return scale1;
|
||||
}
|
||||
public float getScale2() {
|
||||
return scale2;
|
||||
}
|
||||
public float getScaleRate() {
|
||||
return scaleRate;
|
||||
}
|
||||
public int getScaleRateStart() {
|
||||
return scaleRateStart;
|
||||
}
|
||||
|
||||
public int getAlphaRateStart() {
|
||||
return alphaRateStart;
|
||||
}
|
||||
public float getRotationX1() {return rotationX1;}
|
||||
public float getRotationX2() {return rotationX2;}
|
||||
public float getRotationXRate() {return rotationXRate;}
|
||||
public int getRotationXRateStart() {return rotationXRateStart;}
|
||||
|
||||
public float getRotationY1() {return rotationY1;}
|
||||
public float getRotationY2() {return rotationY2;}
|
||||
public float getRotationYRate() {return rotationYRate;}
|
||||
public int getRotationYRateStart() {return rotationYRateStart;}
|
||||
|
||||
public float getRotationZ1() {return rotationZ1;}
|
||||
public float getRotationZ2() {return rotationZ2;}
|
||||
public float getRotationZRate() {return rotationZRate;}
|
||||
public int getRotationZRateStart() {return rotationZRateStart;}
|
||||
|
||||
public void setDirectory(String directory) {
|
||||
this.directory = directory;
|
||||
@@ -130,15 +152,12 @@ public class ScriptEntityParticle {
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
@@ -149,19 +168,15 @@ public class ScriptEntityParticle {
|
||||
this.motionZ = motionZ;
|
||||
this.gravity = gravity;
|
||||
}
|
||||
|
||||
public void setMotionX(double motionX) {
|
||||
this.motionX = motionX;
|
||||
}
|
||||
|
||||
public void setMotionY(double motionY) {
|
||||
this.motionY = motionY;
|
||||
}
|
||||
|
||||
public void setMotionZ(double motionZ) {
|
||||
this.motionZ = motionZ;
|
||||
}
|
||||
|
||||
public void setGravity(float gravity) {
|
||||
this.gravity = gravity;
|
||||
}
|
||||
@@ -172,19 +187,15 @@ public class ScriptEntityParticle {
|
||||
this.scaleRate = scaleRate;
|
||||
this.scaleRateStart = scaleRateStart;
|
||||
}
|
||||
|
||||
public void setScale1(float scale1) {
|
||||
this.scale1 = scale1;
|
||||
}
|
||||
|
||||
public void setScale2(float scale2) {
|
||||
this.scale2 = scale2;
|
||||
}
|
||||
|
||||
public void setScaleRate(float scaleRate) {
|
||||
this.scaleRate = scaleRate;
|
||||
}
|
||||
|
||||
public void setScaleRateStart(int scaleRateStart) {
|
||||
this.scaleRateStart = scaleRateStart;
|
||||
}
|
||||
@@ -195,20 +206,49 @@ public class ScriptEntityParticle {
|
||||
this.alphaRate = alphaRate;
|
||||
this.alphaRateStart = alphaRateStart;
|
||||
}
|
||||
|
||||
public void setAlpha1(float alpha1) {
|
||||
this.alpha1 = alpha1;
|
||||
}
|
||||
|
||||
public void setAlpha2(float alpha2) {
|
||||
this.alpha2 = alpha2;
|
||||
}
|
||||
|
||||
public void setAlphaRate(float alphaRate) {
|
||||
this.alphaRate = alphaRate;
|
||||
}
|
||||
|
||||
public void setAlphaRateStart(int alphaRateStart) {
|
||||
this.alphaRateStart = alphaRateStart;
|
||||
}
|
||||
|
||||
public void setRotationX(float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart){
|
||||
this.rotationX1 = rotationX1;
|
||||
this.rotationX2 = rotationX2;
|
||||
this.rotationXRate = rotationXRate;
|
||||
this.rotationXRateStart = rotationXRateStart;
|
||||
}
|
||||
public void setRotationX1(float rotationX1) {this.rotationX1 = rotationX1;}
|
||||
public void setRotationX2(float rotationX2) {this.rotationX2 = rotationX2;}
|
||||
public void setRotationXRate(float rotationXRate) {this.rotationXRate = rotationXRate;}
|
||||
public void setRotationXRateStart(int rotationXRateStart) {this.rotationXRateStart = rotationXRateStart;}
|
||||
|
||||
public void setRotationY(float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart){
|
||||
this.rotationY1 = rotationY1;
|
||||
this.rotationY2 = rotationY2;
|
||||
this.rotationYRate = rotationYRate;
|
||||
this.rotationYRateStart = rotationYRateStart;
|
||||
}
|
||||
public void setRotationY1(float rotationY1) {this.rotationY1 = rotationY1;}
|
||||
public void setRotationY2(float rotationY2) {this.rotationY2 = rotationY2;}
|
||||
public void setRotationYRate(float rotationYRate) {this.rotationYRate = rotationYRate;}
|
||||
public void setRotationYRateStart(int rotationYRateStart) {this.rotationYRateStart = rotationYRateStart;}
|
||||
|
||||
public void setRotationZ(float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart){
|
||||
this.rotationZ1 = rotationZ1;
|
||||
this.rotationZ2 = rotationZ2;
|
||||
this.rotationZRate = rotationZRate;
|
||||
this.rotationZRateStart = rotationZRateStart;
|
||||
}
|
||||
public void setRotationZ1(float rotationZ1) {this.rotationZ1 = rotationZ1;}
|
||||
public void setRotationZ2(float rotationZ2) {this.rotationZ2 = rotationZ2;}
|
||||
public void setRotationZRate(float rotationZRate) {this.rotationZRate = rotationZRate;}
|
||||
public void setRotationZRateStart(int rotationZRateStart) {this.rotationZRateStart = rotationZRateStart;}
|
||||
}
|
||||
@@ -224,23 +224,33 @@ public class ScriptItemStack implements IItemStack {
|
||||
}
|
||||
|
||||
public String[] getLore() {
|
||||
NBTTagCompound compound = this.item.getTagCompound().getCompoundTag("display");
|
||||
if (compound != null && compound.func_150299_b("Lore") == 9) {
|
||||
NBTTagList nbttaglist = compound.getTagList("Lore", 8);
|
||||
if (nbttaglist.tagCount() < 1) {
|
||||
return new String[0];
|
||||
} else {
|
||||
List<String> lore = new ArrayList();
|
||||
if (this.item.getTagCompound() != null) {
|
||||
NBTTagCompound compound = this.item.getTagCompound().getCompoundTag("display");
|
||||
if(compound != null && compound.func_150299_b("Lore") == 9) {
|
||||
NBTTagList nbttaglist = compound.getTagList("Lore", 8);
|
||||
if (nbttaglist.tagCount() > 0) {
|
||||
List<String> lore = new ArrayList();
|
||||
|
||||
for(int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
lore.add(nbttaglist.getStringTagAt(i));
|
||||
for (int i = 0; i < nbttaglist.tagCount(); ++i) {
|
||||
lore.add(nbttaglist.getStringTagAt(i));
|
||||
}
|
||||
|
||||
return (String[]) ((String[]) lore.toArray(new String[lore.size()]));
|
||||
}
|
||||
|
||||
return (String[])((String[])lore.toArray(new String[lore.size()]));
|
||||
}
|
||||
} else {
|
||||
return new String[0];
|
||||
}
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
public boolean hasLore() {
|
||||
if (this.item.getTagCompound() != null) {
|
||||
NBTTagCompound compound = this.item.getTagCompound().getCompoundTag("display");
|
||||
if (compound != null && compound.func_150299_b("Lore") == 9) {
|
||||
NBTTagList nbttaglist = compound.getTagList("Lore", 8);
|
||||
return nbttaglist.tagCount() > 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setLore(String[] lore) {
|
||||
|
||||
@@ -445,6 +445,26 @@ public class ScriptDBCPlayer<T extends EntityPlayerMP> extends ScriptPlayer<T>{
|
||||
}
|
||||
|
||||
public void setForm(byte form){
|
||||
if(form < 0)
|
||||
return;
|
||||
|
||||
switch(getRace()){
|
||||
case 0:
|
||||
case 3:
|
||||
if(form > 3)
|
||||
return;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
if(form > 15)
|
||||
return;
|
||||
break;
|
||||
case 4:
|
||||
if(form > 7)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
player.getEntityData().getCompoundTag("PlayerPersisted").setByte("jrmcState",form);
|
||||
}
|
||||
public byte getForm(){
|
||||
|
||||
@@ -67,14 +67,21 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
double x, double y, double z,
|
||||
double motionX, double motionY, double motionZ, float gravity,
|
||||
float scale1, float scale2, float scaleRate, int scaleRateStart,
|
||||
float alpha1, float alpha2, float alphaRate, int alphaRateStart
|
||||
float alpha1, float alpha2, float alphaRate, int alphaRateStart,
|
||||
float rotation1, float rotation2, float rotationRate, int rotationRateStart,
|
||||
float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart,
|
||||
float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart,
|
||||
float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart
|
||||
) {
|
||||
int entityID = entity.getEntityId();
|
||||
NoppesUtilServer.spawnScriptedParticle(entity, directory, HEXcolor, amount, maxAge,
|
||||
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,
|
||||
entityID
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,4 +13,10 @@ public class CustomNPCsEvent extends Event{
|
||||
|
||||
public CustomNPCsEvent() {
|
||||
}
|
||||
|
||||
public void setCancelled(boolean bo){
|
||||
this.setCanceled(bo);
|
||||
}
|
||||
|
||||
public boolean isCancelled(){return this.isCanceled();}
|
||||
}
|
||||
@@ -11,4 +11,12 @@ class ScriptEvent{
|
||||
public boolean isCancelled(){
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
public void setCanceled(boolean bo){
|
||||
isCancelled = bo;
|
||||
}
|
||||
|
||||
public boolean isCanceled(){
|
||||
return isCancelled;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package noppes.npcs.scripted.gui;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.custom.GuiCustom;
|
||||
import noppes.npcs.scripted.interfaces.ITexturedRect;
|
||||
|
||||
public class ScriptGuiTexturedRect extends ScriptGuiComponent implements ITexturedRect {
|
||||
|
||||
@@ -34,12 +34,36 @@ public interface IEntity<T extends Entity> {
|
||||
* @param alpha2 The particle's ending transparency
|
||||
* @param scaleRate Multiplier for the particle's transparency growth rate
|
||||
* @param alphaRateStart The time at which the particle begins appearing/fading
|
||||
*
|
||||
* @param rotation1 The particle's starting rotation angle with respect to the player's vision
|
||||
* @param rotation2 The particle's final rotation angle with respect to the player's vision
|
||||
* @param rotationRate The rate at which the particle rotates with respect to the player's vision
|
||||
* @param rotationRateStart The time at which the particle begins rotating
|
||||
|
||||
* @param rotationX1 The particle's starting rotation angle with respect to the X-axis
|
||||
* @param rotationX2 The particle's final rotation angle with respect to the X-axis
|
||||
* @param rotationXRate The rate at which the particle rotates with respect to the X-axis
|
||||
* @param rotationXRateStart The time at which the particle begins rotating over the X-axis
|
||||
|
||||
* @param rotationY1 The particle's starting rotation angle with respect to the Y-axis
|
||||
* @param rotationY2 The particle's final rotation angle with respect to the Y-axis
|
||||
* @param rotationYRate The rate at which the particle rotates with respect to the Y-axis
|
||||
* @param rotationYRateStart The time at which the particle begins rotating over the Y-axis
|
||||
|
||||
* @param rotationZ1 The particle's starting rotation angle with respect to the Z-axis
|
||||
* @param rotationZ2 The particle's final rotation angle with respect to the Z-axis
|
||||
* @param rotationZRate The rate at which the particle rotates with respect to the Z-axis
|
||||
* @param rotationZRateStart The time at which the particle begins rotating over the Z-axis
|
||||
*/
|
||||
public void spawnParticle(String directory, int HEXcolor, int amount, int maxAge,
|
||||
double x, double y, double z,
|
||||
double motionX, double motionY, double motionZ, float gravity,
|
||||
float scale1, float scale2, float scaleRate, int scaleRateStart,
|
||||
float alpha1, float alpha2, float alphaRate, int alphaRateStart
|
||||
void spawnParticle(String directory, int HEXcolor, int amount, int maxAge,
|
||||
double x, double y, double z,
|
||||
double motionX, double motionY, double motionZ, float gravity,
|
||||
float scale1, float scale2, float scaleRate, int scaleRateStart,
|
||||
float alpha1, float alpha2, float alphaRate, int alphaRateStart,
|
||||
float rotation1, float rotation2, float rotationRate, int rotationRateStart,
|
||||
float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart,
|
||||
float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart,
|
||||
float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart
|
||||
);
|
||||
|
||||
public double getYOffset();
|
||||
|
||||
@@ -18,5 +18,17 @@ public interface ITimers {
|
||||
|
||||
void clear();
|
||||
|
||||
int ticks(int id);
|
||||
|
||||
void setTicks(int id, int ticks);
|
||||
|
||||
int maxTicks(int id);
|
||||
|
||||
void setMaxTicks(int id, int maxTicks);
|
||||
|
||||
boolean repeats(int id);
|
||||
|
||||
void setRepeats(int id, boolean repeat);
|
||||
|
||||
int size();
|
||||
}
|
||||
Reference in new issue
Block a user