mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 06:04:45 +00:00
Merge remote-tracking branch 'upstream/dev' into animation-easings
This commit is contained in:
commit
9ccdcb1233
88 files changed
+5166
-1909
No files matched your search
@@ -2,10 +2,11 @@ package net.minecraft.block.properties;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/** This code is owned by Minecraft */
|
||||
/**
|
||||
* This code is owned by Minecraft
|
||||
*/
|
||||
|
||||
public interface IProperty<T extends Comparable<T>>
|
||||
{
|
||||
public interface IProperty<T extends Comparable<T>> {
|
||||
String getName();
|
||||
|
||||
Collection<T> getAllowedValues();
|
||||
@@ -16,4 +17,4 @@ public interface IProperty<T extends Comparable<T>>
|
||||
* Get the name for the given value.
|
||||
*/
|
||||
String getName(T value);
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,11 @@ import net.minecraft.block.properties.IProperty;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/** This code is owned by Minecraft */
|
||||
/**
|
||||
* This code is owned by Minecraft
|
||||
*/
|
||||
|
||||
public interface IBlockState
|
||||
{
|
||||
public interface IBlockState {
|
||||
Collection<IProperty> getPropertyNames();
|
||||
|
||||
<T extends Comparable<T>> T getValue(IProperty<T> property);
|
||||
|
||||
@@ -2,31 +2,42 @@ package net.minecraft.util;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
|
||||
/** This code is owned by Minecraft */
|
||||
/**
|
||||
* This code is owned by Minecraft
|
||||
*/
|
||||
|
||||
public class Vec3i implements Comparable<Vec3i>
|
||||
{
|
||||
/** X coordinate */
|
||||
public class Vec3i implements Comparable<Vec3i> {
|
||||
/**
|
||||
* X coordinate
|
||||
*/
|
||||
private final int x;
|
||||
/** Y coordinate */
|
||||
/**
|
||||
* Y coordinate
|
||||
*/
|
||||
private final int y;
|
||||
/** Z coordinate */
|
||||
/**
|
||||
* Z coordinate
|
||||
*/
|
||||
private final int z;
|
||||
|
||||
/** Double X coordinate */
|
||||
/**
|
||||
* Double X coordinate
|
||||
*/
|
||||
private final double xd;
|
||||
/** Double Y coordinate */
|
||||
/**
|
||||
* Double Y coordinate
|
||||
*/
|
||||
private final double yd;
|
||||
/** Double Z coordinate */
|
||||
/**
|
||||
* Double Z coordinate
|
||||
*/
|
||||
private final double zd;
|
||||
|
||||
public Vec3i(int xIn, int yIn, int zIn)
|
||||
{
|
||||
this((double) xIn, (double) yIn, (double) zIn);
|
||||
public Vec3i(int xIn, int yIn, int zIn) {
|
||||
this(xIn, yIn, (double) zIn);
|
||||
}
|
||||
|
||||
public Vec3i(double xIn, double yIn, double zIn)
|
||||
{
|
||||
public Vec3i(double xIn, double yIn, double zIn) {
|
||||
this.x = MathHelper.floor_double(xIn);
|
||||
this.y = MathHelper.floor_double(yIn);
|
||||
this.z = MathHelper.floor_double(zIn);
|
||||
@@ -35,54 +46,43 @@ public class Vec3i implements Comparable<Vec3i>
|
||||
this.zd = zIn;
|
||||
}
|
||||
|
||||
public boolean equals(Object p_equals_1_)
|
||||
{
|
||||
if (this == p_equals_1_)
|
||||
{
|
||||
public boolean equals(Object p_equals_1_) {
|
||||
if (this == p_equals_1_) {
|
||||
return true;
|
||||
}
|
||||
else if (!(p_equals_1_ instanceof Vec3i))
|
||||
{
|
||||
} else if (!(p_equals_1_ instanceof Vec3i)) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Vec3i vec3I = (Vec3i)p_equals_1_;
|
||||
return this.getX() != vec3I.getX() ? false : (this.getY() != vec3I.getY() ? false : this.getZ() == vec3I.getZ());
|
||||
} else {
|
||||
Vec3i vec3I = (Vec3i) p_equals_1_;
|
||||
return this.getX() == vec3I.getX() && (this.getY() == vec3I.getY() && this.getZ() == vec3I.getZ());
|
||||
}
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
{
|
||||
public int hashCode() {
|
||||
return (this.getY() + this.getZ() * 31) * 31 + this.getX();
|
||||
}
|
||||
|
||||
public int compareTo(Vec3i p_compareTo_1_)
|
||||
{
|
||||
public int compareTo(Vec3i p_compareTo_1_) {
|
||||
return this.getY() == p_compareTo_1_.getY() ? (this.getZ() == p_compareTo_1_.getZ() ? this.getX() - p_compareTo_1_.getX() : this.getZ() - p_compareTo_1_.getZ()) : this.getY() - p_compareTo_1_.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the X coordinate
|
||||
*/
|
||||
public int getX()
|
||||
{
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Y coordinate
|
||||
*/
|
||||
public int getY()
|
||||
{
|
||||
public int getY() {
|
||||
return this.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Z coordinate
|
||||
*/
|
||||
public int getZ()
|
||||
{
|
||||
public int getZ() {
|
||||
return this.z;
|
||||
}
|
||||
|
||||
@@ -90,37 +90,32 @@ public class Vec3i implements Comparable<Vec3i>
|
||||
/**
|
||||
* Get the X coordinate as a double
|
||||
*/
|
||||
public double getXD()
|
||||
{
|
||||
public double getXD() {
|
||||
return this.xd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Y coordinate as a double
|
||||
*/
|
||||
public double getYD()
|
||||
{
|
||||
public double getYD() {
|
||||
return this.yd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Z coordinate as a double
|
||||
*/
|
||||
public double getZD()
|
||||
{
|
||||
public double getZD() {
|
||||
return this.zd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the cross product of this and the given Vector
|
||||
*/
|
||||
public Vec3i crossProduct(Vec3i vec)
|
||||
{
|
||||
public Vec3i crossProduct(Vec3i vec) {
|
||||
return new Vec3i(this.getYD() * vec.getZD() - this.getZD() * vec.getYD(), this.getZD() * vec.getXD() - this.getXD() * vec.getZD(), this.getXD() * vec.getYD() - this.getYD() * vec.getXD());
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
public String toString() {
|
||||
return Objects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,245 +17,208 @@ import java.util.List;
|
||||
* Pasted in from 1.9, with the Vec3d constructor removed
|
||||
*/
|
||||
@Immutable
|
||||
public class BlockPos extends Vec3i
|
||||
{
|
||||
public class BlockPos extends Vec3i {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
/** The BlockPos with all coordinates 0 */
|
||||
/**
|
||||
* The BlockPos with all coordinates 0
|
||||
*/
|
||||
public static final BlockPos ORIGIN = new BlockPos(0, 0, 0);
|
||||
private static final int NUM_X_BITS = 26; //1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000)); //Manually calculated because of crash
|
||||
private static final int NUM_Z_BITS = NUM_X_BITS;
|
||||
private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS;
|
||||
private static final int Y_SHIFT = 0 + NUM_Z_BITS;
|
||||
private static final int Y_SHIFT = NUM_Z_BITS;
|
||||
private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS;
|
||||
private static final long X_MASK = (1L << NUM_X_BITS) - 1L;
|
||||
private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L;
|
||||
private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L;
|
||||
|
||||
public BlockPos(int x, int y, int z)
|
||||
{
|
||||
public BlockPos(int x, int y, int z) {
|
||||
super(x, y, z);
|
||||
}
|
||||
|
||||
public BlockPos(double x, double y, double z)
|
||||
{
|
||||
public BlockPos(double x, double y, double z) {
|
||||
super(x, y, z);
|
||||
}
|
||||
|
||||
public BlockPos(Entity source)
|
||||
{
|
||||
public BlockPos(Entity source) {
|
||||
this(source.posX, source.posY, source.posZ);
|
||||
}
|
||||
|
||||
public BlockPos(Vec3i source)
|
||||
{
|
||||
public BlockPos(Vec3i source) {
|
||||
this(source.getXD(), source.getYD(), source.getZD());
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given coordinates to the coordinates of this BlockPos
|
||||
*/
|
||||
public BlockPos add(double x, double y, double z)
|
||||
{
|
||||
public BlockPos add(double x, double y, double z) {
|
||||
return x == 0.0D && y == 0.0D && z == 0.0D ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given coordinates to the coordinates of this BlockPos
|
||||
*/
|
||||
public BlockPos add(int x, int y, int z)
|
||||
{
|
||||
public BlockPos add(int x, int y, int z) {
|
||||
return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given Vector to this BlockPos
|
||||
*/
|
||||
public BlockPos add(Vec3i vec)
|
||||
{
|
||||
public BlockPos add(Vec3i vec) {
|
||||
return vec.getXD() == 0 && vec.getYD() == 0 && vec.getZD() == 0 ? this : new BlockPos(this.getXD() + vec.getXD(), this.getYD() + vec.getYD(), this.getZD() + vec.getZD());
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block up
|
||||
*/
|
||||
public BlockPos up()
|
||||
{
|
||||
public BlockPos up() {
|
||||
return this.up(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos n blocks up
|
||||
*/
|
||||
public BlockPos up(double n)
|
||||
{
|
||||
public BlockPos up(double n) {
|
||||
return this.offset(EnumFacing.UP, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block down
|
||||
*/
|
||||
public BlockPos down()
|
||||
{
|
||||
public BlockPos down() {
|
||||
return this.down(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos n blocks down
|
||||
*/
|
||||
public BlockPos down(double n)
|
||||
{
|
||||
public BlockPos down(double n) {
|
||||
return this.offset(EnumFacing.DOWN, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block in northern direction
|
||||
*/
|
||||
public BlockPos north()
|
||||
{
|
||||
public BlockPos north() {
|
||||
return this.north(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos n blocks in northern direction
|
||||
*/
|
||||
public BlockPos north(double n)
|
||||
{
|
||||
public BlockPos north(double n) {
|
||||
return this.offset(EnumFacing.NORTH, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block in southern direction
|
||||
*/
|
||||
public BlockPos south()
|
||||
{
|
||||
public BlockPos south() {
|
||||
return this.south(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos n blocks in southern direction
|
||||
*/
|
||||
public BlockPos south(double n)
|
||||
{
|
||||
public BlockPos south(double n) {
|
||||
return this.offset(EnumFacing.SOUTH, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block in western direction
|
||||
*/
|
||||
public BlockPos west()
|
||||
{
|
||||
public BlockPos west() {
|
||||
return this.west(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos n blocks in western direction
|
||||
*/
|
||||
public BlockPos west(double n)
|
||||
{
|
||||
public BlockPos west(double n) {
|
||||
return this.offset(EnumFacing.WEST, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block in eastern direction
|
||||
*/
|
||||
public BlockPos east()
|
||||
{
|
||||
public BlockPos east() {
|
||||
return this.east(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos n blocks in eastern direction
|
||||
*/
|
||||
public BlockPos east(double n)
|
||||
{
|
||||
public BlockPos east(double n) {
|
||||
return this.offset(EnumFacing.EAST, n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offset this BlockPos 1 block in the given direction
|
||||
*/
|
||||
public BlockPos offset(EnumFacing facing)
|
||||
{
|
||||
public BlockPos offset(EnumFacing facing) {
|
||||
return this.offset(facing, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offsets this BlockPos n blocks in the given direction
|
||||
*/
|
||||
public BlockPos offset(EnumFacing facing, double n)
|
||||
{
|
||||
public BlockPos offset(EnumFacing facing, double n) {
|
||||
return n == 0 ? this : new BlockPos(this.getXD() + facing.getFrontOffsetX() * n, this.getYD() + facing.getFrontOffsetY() * n, this.getZD() + facing.getFrontOffsetZ() * n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the cross product of this and the given Vector
|
||||
*/
|
||||
public BlockPos crossProduct(Vec3i vec)
|
||||
{
|
||||
public BlockPos crossProduct(Vec3i vec) {
|
||||
return new BlockPos(this.getYD() * vec.getZD() - this.getZD() * vec.getYD(), this.getZD() * vec.getXD() - this.getXD() * vec.getZD(), this.getXD() * vec.getYD() - this.getYD() * vec.getXD());
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize this BlockPos into a long value
|
||||
*/
|
||||
public long toLong()
|
||||
{
|
||||
return ((long)this.getX() & X_MASK) << X_SHIFT | ((long)this.getY() & Y_MASK) << Y_SHIFT | ((long)this.getZ() & Z_MASK) << 0;
|
||||
public long toLong() {
|
||||
return ((long) this.getX() & X_MASK) << X_SHIFT | ((long) this.getY() & Y_MASK) << Y_SHIFT | ((long) this.getZ() & Z_MASK) << 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a BlockPos from a serialized long value (created by toLong)
|
||||
*/
|
||||
public static BlockPos fromLong(long serialized)
|
||||
{
|
||||
int i = (int)(serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS);
|
||||
int j = (int)(serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS);
|
||||
int k = (int)(serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS);
|
||||
public static BlockPos fromLong(long serialized) {
|
||||
int i = (int) (serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS);
|
||||
int j = (int) (serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS);
|
||||
int k = (int) (serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS);
|
||||
return new BlockPos(i, j, k);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an Iterable that returns all positions in the box specified by the given corners
|
||||
*/
|
||||
public static Iterable<BlockPos> getAllInBox(BlockPos from, BlockPos to)
|
||||
{
|
||||
public static Iterable<BlockPos> getAllInBox(BlockPos from, BlockPos to) {
|
||||
final BlockPos blockpos = new BlockPos(Math.min(from.getX(), to.getX()), Math.min(from.getY(), to.getY()), Math.min(from.getZ(), to.getZ()));
|
||||
final BlockPos blockpos1 = new BlockPos(Math.max(from.getX(), to.getX()), Math.max(from.getY(), to.getY()), Math.max(from.getZ(), to.getZ()));
|
||||
return new Iterable<BlockPos>()
|
||||
{
|
||||
public Iterator<BlockPos> iterator()
|
||||
{
|
||||
return new AbstractIterator<BlockPos>()
|
||||
{
|
||||
return new Iterable<BlockPos>() {
|
||||
public Iterator<BlockPos> iterator() {
|
||||
return new AbstractIterator<BlockPos>() {
|
||||
private BlockPos lastReturned = null;
|
||||
protected BlockPos computeNext()
|
||||
{
|
||||
if (this.lastReturned == null)
|
||||
{
|
||||
|
||||
protected BlockPos computeNext() {
|
||||
if (this.lastReturned == null) {
|
||||
this.lastReturned = blockpos;
|
||||
return this.lastReturned;
|
||||
}
|
||||
else if (this.lastReturned.equals(blockpos1))
|
||||
{
|
||||
return (BlockPos)this.endOfData();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else if (this.lastReturned.equals(blockpos1)) {
|
||||
return this.endOfData();
|
||||
} else {
|
||||
int i = this.lastReturned.getX();
|
||||
int j = this.lastReturned.getY();
|
||||
int k = this.lastReturned.getZ();
|
||||
|
||||
if (i < blockpos1.getX())
|
||||
{
|
||||
if (i < blockpos1.getX()) {
|
||||
++i;
|
||||
}
|
||||
else if (j < blockpos1.getY())
|
||||
{
|
||||
} else if (j < blockpos1.getY()) {
|
||||
i = blockpos.getX();
|
||||
++j;
|
||||
}
|
||||
else if (k < blockpos1.getZ())
|
||||
{
|
||||
} else if (k < blockpos1.getZ()) {
|
||||
i = blockpos.getX();
|
||||
j = blockpos.getY();
|
||||
++k;
|
||||
@@ -270,27 +233,29 @@ public class BlockPos extends Vec3i
|
||||
};
|
||||
}
|
||||
|
||||
public static class MutableBlockPos extends BlockPos
|
||||
{
|
||||
/** Mutable X Coordinate */
|
||||
public static class MutableBlockPos extends BlockPos {
|
||||
/**
|
||||
* Mutable X Coordinate
|
||||
*/
|
||||
protected int x;
|
||||
/** Mutable Y Coordinate */
|
||||
/**
|
||||
* Mutable Y Coordinate
|
||||
*/
|
||||
protected int y;
|
||||
/** Mutable Z Coordinate */
|
||||
/**
|
||||
* Mutable Z Coordinate
|
||||
*/
|
||||
protected int z;
|
||||
|
||||
public MutableBlockPos()
|
||||
{
|
||||
public MutableBlockPos() {
|
||||
this(0, 0, 0);
|
||||
}
|
||||
|
||||
public MutableBlockPos(BlockPos pos)
|
||||
{
|
||||
public MutableBlockPos(BlockPos pos) {
|
||||
this(pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
public MutableBlockPos(int x_, int y_, int z_)
|
||||
{
|
||||
public MutableBlockPos(int x_, int y_, int z_) {
|
||||
super(0, 0, 0);
|
||||
this.x = x_;
|
||||
this.y = y_;
|
||||
@@ -300,60 +265,51 @@ public class BlockPos extends Vec3i
|
||||
/**
|
||||
* Gets the X coordinate.
|
||||
*/
|
||||
public int getX()
|
||||
{
|
||||
public int getX() {
|
||||
return this.x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Y coordinate.
|
||||
*/
|
||||
public int getY()
|
||||
{
|
||||
public int getY() {
|
||||
return this.y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Z coordinate.
|
||||
*/
|
||||
public int getZ()
|
||||
{
|
||||
public int getZ() {
|
||||
return this.z;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position, MUST not be name 'set' as that causes obfusication conflicts with func_185343_d
|
||||
*/
|
||||
public BlockPos.MutableBlockPos setPos(int xIn, int yIn, int zIn)
|
||||
{
|
||||
public BlockPos.MutableBlockPos setPos(int xIn, int yIn, int zIn) {
|
||||
this.x = xIn;
|
||||
this.y = yIn;
|
||||
this.z = zIn;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BlockPos.MutableBlockPos setPos(double p_189532_1_, double p_189532_3_, double p_189532_5_)
|
||||
{
|
||||
public BlockPos.MutableBlockPos setPos(double p_189532_1_, double p_189532_3_, double p_189532_5_) {
|
||||
return this.setPos(MathHelper.floor_double(p_189532_1_), MathHelper.floor_double(p_189532_3_), MathHelper.floor_double(p_189532_5_));
|
||||
}
|
||||
|
||||
public BlockPos.MutableBlockPos setPos(Vec3i p_189533_1_)
|
||||
{
|
||||
public BlockPos.MutableBlockPos setPos(Vec3i p_189533_1_) {
|
||||
return this.setPos(p_189533_1_.getX(), p_189533_1_.getY(), p_189533_1_.getZ());
|
||||
}
|
||||
|
||||
public BlockPos.MutableBlockPos move(EnumFacing p_189536_1_)
|
||||
{
|
||||
public BlockPos.MutableBlockPos move(EnumFacing p_189536_1_) {
|
||||
return this.move(p_189536_1_, 1);
|
||||
}
|
||||
|
||||
public BlockPos.MutableBlockPos move(EnumFacing p_189534_1_, int p_189534_2_)
|
||||
{
|
||||
public BlockPos.MutableBlockPos move(EnumFacing p_189534_1_, int p_189534_2_) {
|
||||
return this.setPos(this.x + p_189534_1_.getFrontOffsetX() * p_189534_2_, this.y + p_189534_1_.getFrontOffsetY() * p_189534_2_, this.z + p_189534_1_.getFrontOffsetZ() * p_189534_2_);
|
||||
}
|
||||
|
||||
public void setY(int yIn)
|
||||
{
|
||||
public void setY(int yIn) {
|
||||
this.y = yIn;
|
||||
}
|
||||
|
||||
@@ -363,42 +319,33 @@ public class BlockPos extends Vec3i
|
||||
* <p>When storing a BlockPos given to you for an extended period of time, make sure you
|
||||
* use this in case the value is changed internally.</p>
|
||||
*/
|
||||
public BlockPos toImmutable()
|
||||
{
|
||||
public BlockPos toImmutable() {
|
||||
return new BlockPos(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class PooledMutableBlockPos extends BlockPos.MutableBlockPos
|
||||
{
|
||||
public static final class PooledMutableBlockPos extends BlockPos.MutableBlockPos {
|
||||
private boolean released;
|
||||
private static final List<BlockPos.PooledMutableBlockPos> POOL = Lists.<BlockPos.PooledMutableBlockPos>newArrayList();
|
||||
private static final List<BlockPos.PooledMutableBlockPos> POOL = Lists.newArrayList();
|
||||
|
||||
private PooledMutableBlockPos(int xIn, int yIn, int zIn)
|
||||
{
|
||||
private PooledMutableBlockPos(int xIn, int yIn, int zIn) {
|
||||
super(xIn, yIn, zIn);
|
||||
}
|
||||
|
||||
public static BlockPos.PooledMutableBlockPos retain()
|
||||
{
|
||||
public static BlockPos.PooledMutableBlockPos retain() {
|
||||
return retain(0, 0, 0);
|
||||
}
|
||||
|
||||
public static BlockPos.PooledMutableBlockPos retain(double xIn, double yIn, double zIn)
|
||||
{
|
||||
public static BlockPos.PooledMutableBlockPos retain(double xIn, double yIn, double zIn) {
|
||||
return retain(MathHelper.floor_double(xIn), MathHelper.floor_double(yIn), MathHelper.floor_double(zIn));
|
||||
}
|
||||
|
||||
public static BlockPos.PooledMutableBlockPos retain(int xIn, int yIn, int zIn)
|
||||
{
|
||||
synchronized (POOL)
|
||||
{
|
||||
if (!POOL.isEmpty())
|
||||
{
|
||||
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = (BlockPos.PooledMutableBlockPos)POOL.remove(POOL.size() - 1);
|
||||
public static BlockPos.PooledMutableBlockPos retain(int xIn, int yIn, int zIn) {
|
||||
synchronized (POOL) {
|
||||
if (!POOL.isEmpty()) {
|
||||
BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = POOL.remove(POOL.size() - 1);
|
||||
|
||||
if (blockpos$pooledmutableblockpos != null && blockpos$pooledmutableblockpos.released)
|
||||
{
|
||||
if (blockpos$pooledmutableblockpos != null && blockpos$pooledmutableblockpos.released) {
|
||||
blockpos$pooledmutableblockpos.released = false;
|
||||
blockpos$pooledmutableblockpos.set(xIn, yIn, zIn);
|
||||
return blockpos$pooledmutableblockpos;
|
||||
@@ -409,12 +356,9 @@ public class BlockPos extends Vec3i
|
||||
return new BlockPos.PooledMutableBlockPos(xIn, yIn, zIn);
|
||||
}
|
||||
|
||||
public void release()
|
||||
{
|
||||
synchronized (POOL)
|
||||
{
|
||||
if (POOL.size() < 100)
|
||||
{
|
||||
public void release() {
|
||||
synchronized (POOL) {
|
||||
if (POOL.size() < 100) {
|
||||
POOL.add(this);
|
||||
}
|
||||
|
||||
@@ -422,35 +366,29 @@ public class BlockPos extends Vec3i
|
||||
}
|
||||
}
|
||||
|
||||
public BlockPos.PooledMutableBlockPos set(int xIn, int yIn, int zIn)
|
||||
{
|
||||
if (this.released)
|
||||
{
|
||||
public BlockPos.PooledMutableBlockPos set(int xIn, int yIn, int zIn) {
|
||||
if (this.released) {
|
||||
BlockPos.LOGGER.error("PooledMutableBlockPosition modified after it was released.", new Throwable());
|
||||
this.released = false;
|
||||
}
|
||||
|
||||
return (BlockPos.PooledMutableBlockPos)super.setPos(xIn, yIn, zIn);
|
||||
return (BlockPos.PooledMutableBlockPos) super.setPos(xIn, yIn, zIn);
|
||||
}
|
||||
|
||||
public BlockPos.PooledMutableBlockPos set(double xIn, double yIn, double zIn)
|
||||
{
|
||||
return (BlockPos.PooledMutableBlockPos)super.setPos(xIn, yIn, zIn);
|
||||
public BlockPos.PooledMutableBlockPos set(double xIn, double yIn, double zIn) {
|
||||
return (BlockPos.PooledMutableBlockPos) super.setPos(xIn, yIn, zIn);
|
||||
}
|
||||
|
||||
public BlockPos.PooledMutableBlockPos set(Vec3i vec)
|
||||
{
|
||||
return (BlockPos.PooledMutableBlockPos)super.setPos(vec);
|
||||
public BlockPos.PooledMutableBlockPos set(Vec3i vec) {
|
||||
return (BlockPos.PooledMutableBlockPos) super.setPos(vec);
|
||||
}
|
||||
|
||||
public BlockPos.PooledMutableBlockPos offsetMutable(EnumFacing facing)
|
||||
{
|
||||
return (BlockPos.PooledMutableBlockPos)super.move(facing);
|
||||
public BlockPos.PooledMutableBlockPos offsetMutable(EnumFacing facing) {
|
||||
return (BlockPos.PooledMutableBlockPos) super.move(facing);
|
||||
}
|
||||
|
||||
public BlockPos.PooledMutableBlockPos movePos(EnumFacing p_189538_1_, int p_189538_2_)
|
||||
{
|
||||
return (BlockPos.PooledMutableBlockPos)super.move(p_189538_1_, p_189538_2_);
|
||||
public BlockPos.PooledMutableBlockPos movePos(EnumFacing p_189538_1_, int p_189538_2_) {
|
||||
return (BlockPos.PooledMutableBlockPos) super.move(p_189538_1_, p_189538_2_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.util.math;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class IntHashMap<V> {
|
||||
private transient IntHashMap.Entry<V>[] slots = new IntHashMap.Entry[16];
|
||||
/**
|
||||
@@ -42,7 +44,7 @@ public class IntHashMap<V> {
|
||||
}
|
||||
}
|
||||
|
||||
return (V) null;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +133,7 @@ public class IntHashMap<V> {
|
||||
*/
|
||||
public V removeObject(int p_76049_1_) {
|
||||
IntHashMap.Entry<V> entry = this.removeEntry(p_76049_1_);
|
||||
return (V) (entry == null ? null : entry.valueEntry);
|
||||
return entry == null ? null : entry.valueEntry;
|
||||
}
|
||||
|
||||
final IntHashMap.Entry<V> removeEntry(int p_76036_1_) {
|
||||
@@ -231,13 +233,11 @@ public class IntHashMap<V> {
|
||||
Object object = Integer.valueOf(this.getHash());
|
||||
Object object1 = Integer.valueOf(entry.getHash());
|
||||
|
||||
if (object == object1 || object != null && object.equals(object1)) {
|
||||
if (Objects.equals(object, object1)) {
|
||||
Object object2 = this.getValue();
|
||||
Object object3 = entry.getValue();
|
||||
|
||||
if (object2 == object3 || object2 != null && object2.equals(object3)) {
|
||||
return true;
|
||||
}
|
||||
return Objects.equals(object2, object3);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -252,4 +252,4 @@ public class IntHashMap<V> {
|
||||
return this.getHash() + "=" + this.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* This object stores functions available to all scripting handlers through the "API" keyword.
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractNpcAPI {
|
||||
private static AbstractNpcAPI instance = null;
|
||||
@@ -45,7 +44,8 @@ public abstract class AbstractNpcAPI {
|
||||
|
||||
/**
|
||||
* Tempdata gets cleared when the server restarts. All worlds share the same temp data.
|
||||
* @param key The key for the data stored
|
||||
*
|
||||
* @param key The key for the data stored
|
||||
* @param value The data stored
|
||||
*/
|
||||
public abstract void setTempData(String key, Object value);
|
||||
@@ -76,7 +76,8 @@ public abstract class AbstractNpcAPI {
|
||||
|
||||
/**
|
||||
* Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved
|
||||
* @param key The key for the data stored
|
||||
*
|
||||
* @param key The key for the data stored
|
||||
* @param value The data stored. This data can be either a Number or a String. Other data is not stored
|
||||
*/
|
||||
public abstract void setStoredData(String key, Object value);
|
||||
@@ -109,7 +110,7 @@ public abstract class AbstractNpcAPI {
|
||||
|
||||
public abstract boolean hasGlobalObject(String key);
|
||||
|
||||
public abstract HashMap<String,Object> getEngineObjects();
|
||||
public abstract HashMap<String, Object> getEngineObjects();
|
||||
|
||||
public abstract long sizeOfObject(Object obj);
|
||||
|
||||
@@ -143,6 +144,8 @@ public abstract class AbstractNpcAPI {
|
||||
|
||||
public abstract ICustomEffectHandler getCustomEffectHandler();
|
||||
|
||||
public abstract IMagicHandler getMagicHandler();
|
||||
|
||||
public abstract IPartyHandler getPartyHandler();
|
||||
|
||||
public abstract ITransportHandler getLocations();
|
||||
@@ -154,7 +157,6 @@ public abstract class AbstractNpcAPI {
|
||||
public abstract ICustomNpc<?> createNPC(IWorld var1);
|
||||
|
||||
/**
|
||||
*
|
||||
* Spawns a new NPC in the world at the given coordinates and returns an ICustomNpc object of it.
|
||||
*/
|
||||
public abstract ICustomNpc<?> spawnNPC(IWorld var1, int var2, int var3, int var4);
|
||||
@@ -193,8 +195,8 @@ public abstract class AbstractNpcAPI {
|
||||
* Forms a box with corners as the input IPos parameters, and returns all
|
||||
* points inside the box as a list of IPos vectors.
|
||||
*
|
||||
* @param from The starting IPos vector, first corner of the box.
|
||||
* @param to The ending IPos vector, opposite corner of the box.
|
||||
* @param from The starting IPos vector, first corner of the box.
|
||||
* @param to The ending IPos vector, opposite corner of the box.
|
||||
* @param sortByDistance Sorts the list by distance from the "from" IPos parameter.
|
||||
* @return The list of all IPos vectors inside the box.
|
||||
*/
|
||||
@@ -254,7 +256,7 @@ public abstract class AbstractNpcAPI {
|
||||
} else {
|
||||
try {
|
||||
Class<?> c = Class.forName("noppes.npcs.scripted.NpcAPI");
|
||||
instance = (AbstractNpcAPI) c.getMethod("Instance").invoke((Object) null);
|
||||
instance = (AbstractNpcAPI) c.getMethod("Instance").invoke(null);
|
||||
} catch (Exception var1) {
|
||||
var1.printStackTrace();
|
||||
}
|
||||
@@ -279,7 +281,7 @@ public abstract class AbstractNpcAPI {
|
||||
* 7: Aztec
|
||||
* 8: CustomNPCs Classic
|
||||
* 9: Spanish
|
||||
* @param gender The gender of the name:
|
||||
* @param gender The gender of the name:
|
||||
* 0: Random
|
||||
* 1: Male
|
||||
* 2: Female
|
||||
@@ -303,7 +305,6 @@ public abstract class AbstractNpcAPI {
|
||||
public abstract void playSoundToNearExcept(IPlayer<?> player, String sound, float volume, float pitch);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Returns the server's Message of The Day.
|
||||
*/
|
||||
public abstract String getMOTD();
|
||||
@@ -314,7 +315,6 @@ public abstract class AbstractNpcAPI {
|
||||
public abstract void setMOTD(String motd);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A new IParticle object initialized with the given texture.
|
||||
*/
|
||||
public abstract IParticle createParticle(String directory);
|
||||
@@ -337,7 +337,6 @@ public abstract class AbstractNpcAPI {
|
||||
public abstract void stopSounds();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The uptime of the server in MC ticks.
|
||||
*/
|
||||
public abstract int getServerTime();
|
||||
@@ -355,23 +354,20 @@ public abstract class AbstractNpcAPI {
|
||||
public abstract void enableGlobalNPCScripts(boolean enable);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id The id of the custom GUI.
|
||||
* @param width The width of the GUI in pixels.
|
||||
* @param height The height of the GUI in pixels.
|
||||
* @param id The id of the custom GUI.
|
||||
* @param width The width of the GUI in pixels.
|
||||
* @param height The height of the GUI in pixels.
|
||||
* @param pauseGame Whether the GUI pauses the game or not.
|
||||
* @return A new ICustomGui object with the given attributes.
|
||||
*/
|
||||
public abstract ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A new ICustomOverlay overlay object with the given ID.
|
||||
* @return A new ICustomOverlay overlay object with the given ID.
|
||||
*/
|
||||
public abstract ICustomOverlay createCustomOverlay(int id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A new ISkinOverlay object initialized with the given texture.
|
||||
*/
|
||||
public abstract ISkinOverlay createSkinOverlay(String texture);
|
||||
|
||||
@@ -11,7 +11,6 @@ public interface IBlock {
|
||||
int getZ();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An IPos object with the block's XYZ position.
|
||||
*/
|
||||
IPos getPosition();
|
||||
@@ -19,7 +18,7 @@ public interface IBlock {
|
||||
/**
|
||||
* Moves the block to a new position in the given world. The old position is replaced with air.
|
||||
*
|
||||
* @param pos The new position of the block
|
||||
* @param pos The new position of the block
|
||||
* @param world The destination world of the block
|
||||
* @return Whether the block was successfully placed
|
||||
*/
|
||||
@@ -32,7 +31,6 @@ public interface IBlock {
|
||||
boolean setPosition(int x, int y, int z);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The block name as it appears in the block registry. Return example: "minecraft:stone"
|
||||
*/
|
||||
String getName();
|
||||
@@ -45,63 +43,53 @@ public interface IBlock {
|
||||
boolean isAir();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param blockName The name of the block to be set in place of this block.
|
||||
* @return The new block set in place of this block as an IBlock object.
|
||||
*/
|
||||
IBlock setBlock(String blockName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param block Input IBlock object to replace this block.
|
||||
* @return The new block set in place of the previous block.
|
||||
*/
|
||||
IBlock setBlock(IBlock block);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if the block can contain items like a chest does.
|
||||
*/
|
||||
boolean isContainer();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The container object of this block. If this block is not a container, an exception will be thrown.
|
||||
*/
|
||||
IContainer getContainer();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An IWorld object of the world this block is in.
|
||||
*/
|
||||
IWorld getWorld();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if this block has a tile entity. Blocks with custom data like signs, player skulls, chests, etc. will have tile entities.
|
||||
*/
|
||||
boolean hasTileEntity();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An ITileEntity object which can modify this block's tile entity.
|
||||
*/
|
||||
ITileEntity getTileEntity();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tileEntity Replaces this block's tile entity based on the data given by this parameter.
|
||||
*/
|
||||
void setTileEntity(ITileEntity tileEntity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC object for the block's tile entity.
|
||||
*/
|
||||
TileEntity getMCTileEntity();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC block object.
|
||||
*/
|
||||
Block getMCBlock();
|
||||
@@ -109,13 +97,11 @@ public interface IBlock {
|
||||
String getDisplayName();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An INbt object which can modify the block's tile entity's NBT data.
|
||||
*/
|
||||
INbt getTileEntityNBT();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param maxVolume The volume threshold to determine whether this block's bounding box collides, if it has one.
|
||||
* @return Whether this block can be collided with
|
||||
*/
|
||||
|
||||
@@ -11,41 +11,35 @@ public interface IContainer {
|
||||
IItemStack getSlot(int slot);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param slot The slot to be replaced
|
||||
* @param item The item replacing the previous item in that slot, as an IItemStack object
|
||||
*/
|
||||
void setSlot(int slot, IItemStack item);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC inventory object.
|
||||
*/
|
||||
IInventory getMCInventory();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC container object.
|
||||
*/
|
||||
Container getMCContainer();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param itemStack The item stack to be searched in the container
|
||||
* @param itemStack The item stack to be searched in the container
|
||||
* @param ignoreDamage Whether damage should be ignored when searching
|
||||
* @param ignoreNBT Whether NBT values should be ignored when searching
|
||||
* @param ignoreNBT Whether NBT values should be ignored when searching
|
||||
* @return The amount of the item stack found, based on the flags given above.
|
||||
*/
|
||||
int count(IItemStack itemStack, boolean ignoreDamage, boolean ignoreNBT);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A list of all item stacks in the container as a list of IItemStack objects.
|
||||
*/
|
||||
IItemStack[] getItems();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if this container belongs to a Custom GUI.
|
||||
*/
|
||||
boolean isCustomGUI();
|
||||
|
||||
@@ -5,7 +5,6 @@ import noppes.npcs.api.entity.IEntity;
|
||||
|
||||
public interface IDamageSource {
|
||||
/**
|
||||
*
|
||||
* @return The damage type of the damage source as a string. Ex: "lava", "explosion", "magic", "outOfWorld", etc.
|
||||
*/
|
||||
String getType();
|
||||
@@ -15,19 +14,16 @@ public interface IDamageSource {
|
||||
boolean isProjectile();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The entity source of where the damage source originated. If a player was shot by an arrow from a skeleton, this would return an IEntity object of the skeleton.
|
||||
*/
|
||||
IEntity getTrueSource();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The entity source of where the damage source originated. If a player was shot by an arrow from a skeleton, this would return an IEntity object of the arrow.
|
||||
*/
|
||||
IEntity getImmediateSource();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC damage source object.
|
||||
*/
|
||||
DamageSource getMCDamageSource();
|
||||
|
||||
@@ -6,13 +6,13 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
* A scripted data representation of an MC NBTTagCompound object. Using these functions modifies the compound tag
|
||||
* associated with this object. Any changes made to the compound tag are made directly to its "tagMap" attribute,
|
||||
* minimizing the impact of setting/getting NBT data with this object on performance.
|
||||
*
|
||||
* <p>
|
||||
* Compound tags, unlike list tags, can contain multiple types of NBT tag types. Compound tags can even
|
||||
* contain compound tags inside them, and if that compound tag is accessed, an object like this one will also be returned!
|
||||
*
|
||||
* <p>
|
||||
* Every tag inside a compound tag has a -unique- "key". If you try to put another tag of the same key inside the
|
||||
* compound tag, it will replace the previous tag.
|
||||
*
|
||||
* <p>
|
||||
* The types and their type as an integer are as follows:
|
||||
* 1: Byte
|
||||
* 2: Short
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
* 9: Tag list
|
||||
* 10: Compound
|
||||
* 11: Integer array
|
||||
*
|
||||
*/
|
||||
public interface INbt {
|
||||
/**
|
||||
@@ -94,7 +93,7 @@ public interface INbt {
|
||||
/**
|
||||
* Adds a new tag list to the compound tag with the given key.
|
||||
*
|
||||
* @param key The key for the list tag
|
||||
* @param key The key for the list tag
|
||||
* @param value The list of objects to be in the list. The type of the first element in this list becomes the tag
|
||||
* list's type, and if later objects are not of this type, they will not be added.
|
||||
*/
|
||||
@@ -105,25 +104,21 @@ public interface INbt {
|
||||
void setCompound(String key, INbt value);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A list of all the compound tag's keys.
|
||||
*/
|
||||
String[] getKeys();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The type of the tag with the input key as an integer.
|
||||
*/
|
||||
int getType(String key);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC NBTTagCompound object.
|
||||
*/
|
||||
NBTTagCompound getMCNBT();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return A curly-bracket formatted JSON string of all the compound tag.
|
||||
*/
|
||||
String toJsonString();
|
||||
|
||||
@@ -5,38 +5,34 @@ import noppes.npcs.api.entity.IEntity;
|
||||
/**
|
||||
* A particle that can be spawned in the world, complete with translation, scale, rotate, and color transformations.
|
||||
* (CNPC+ original!)
|
||||
*
|
||||
* <p>
|
||||
* To create a particle object:
|
||||
* API.createParticle(directory);
|
||||
* Then modify its attributes as you please, and call the particle's spawn functions to see it in the world.
|
||||
*
|
||||
* <p>
|
||||
* Spawning this particle in the world sends a hefty packet with all its data to the client. The particle is then
|
||||
* rendered with a custom renderer based on all the given attributes.
|
||||
*
|
||||
* <p>
|
||||
* If a particle appears to not appear at first, try increasing its scale or changing its position. The entity it's
|
||||
* being spawned on or a block in the world may be blocking it.
|
||||
*
|
||||
*/
|
||||
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 spawn(IEntity entity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world Spawns the particle in the given world, at a position corresponding to this particle's position variables.
|
||||
*/
|
||||
void spawn(IWorld world);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world Spawns the particle in the given world, at a position determined by the input parameters.
|
||||
* @param x The X position the particle will spawn in the world.
|
||||
* @param y The Y position the particle will spawn in the world.
|
||||
* @param z The Z position the particle will spawn in the world.
|
||||
* @param x The X position the particle will spawn in the world.
|
||||
* @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 spawn(IWorld world, double x, double y, double z);
|
||||
|
||||
@@ -50,177 +46,216 @@ public interface IParticle {
|
||||
void spawnInWorld(IWorld world, double x, double y, double z);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param glows If true, this particle ignores all lighting and always renders with full brightness.
|
||||
*/
|
||||
void setGlows(boolean glows);
|
||||
|
||||
boolean getGlows();
|
||||
|
||||
void setNoClip(boolean noClip);
|
||||
|
||||
boolean getNoClip();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param facePlayer Whether the particle is always facing the player's camera. If this is disabled, the particle will appear to be laying flat face down on the ground if its rotation is unchanged.
|
||||
*/
|
||||
void setFacePlayer(boolean facePlayer);
|
||||
|
||||
boolean getFacePlayer();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param directory The directory of this particle's texture. This can be any texture in a resource pack or mod, and even a URL!
|
||||
*/
|
||||
void setDirectory(String directory);
|
||||
|
||||
String getDirectory();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param amount The amount of multiples of this particle to spawn in the world. Not too good looking if used, but has some edge cases where it's alright.
|
||||
*/
|
||||
void setAmount(int amount);
|
||||
|
||||
int getAmount();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param maxAge The maximum age this particle will be around for, in MC ticks.
|
||||
*/
|
||||
void setMaxAge(int maxAge);
|
||||
|
||||
int getMaxAge();
|
||||
|
||||
/**
|
||||
* The width and height of the particle's texture you want to render in pixels. Anything more gets cut off.
|
||||
* @param width The width of the particle's texture, in pixels.
|
||||
*
|
||||
* @param width The width of the particle's texture, in pixels.
|
||||
* @param height The height of the particle's texture, in pixels.
|
||||
*/
|
||||
void setSize(int width, int height);
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point.
|
||||
* The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point.
|
||||
*
|
||||
* @param offsetX The horizontal offset, in pixels (u).
|
||||
* @param offsetY The vertical offset, in pixels (v).
|
||||
*/
|
||||
void setOffset(int offsetX, int offsetY);
|
||||
|
||||
int getOffsetX();
|
||||
|
||||
int getOffsetY();
|
||||
|
||||
/**
|
||||
* Enables animation on the particle. Must set a custom width and height first using the setSize(width,height) function.
|
||||
* Every frame of animation the particle goes through should be saved on a single image file.
|
||||
*
|
||||
* <p>
|
||||
* The renderer will read the frames of animation based on the given width and height of the particle, starting from the given X & Y offsets.
|
||||
* The renderer then goes rightwards (width) pixels for every frame. Once it can't go rightwards anymore,
|
||||
* the animation goes down (height) pixels, and once again keeps going rightwards if it has to.
|
||||
*
|
||||
* <p>
|
||||
* If the animation loops, once there is nowhere downward to go, the animation will start over at the X & Y offset.
|
||||
*
|
||||
* @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second)
|
||||
* @param animLoop Whether the animation loops or not.
|
||||
* @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second)
|
||||
* @param animLoop Whether the animation loops or not.
|
||||
* @param animStart The amount of ticks before the particle starts animating.
|
||||
* @param animEnd The amount of ticks the particle is around for before it stops animating.
|
||||
* @param animEnd The amount of ticks the particle is around for before it stops animating.
|
||||
*/
|
||||
void setAnim(int animRate, boolean animLoop, int animStart, int animEnd);
|
||||
|
||||
int getAnimRate();
|
||||
|
||||
boolean getAnimLoop();
|
||||
|
||||
int getAnimStart();
|
||||
|
||||
int getAnimEnd();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param x The X position from the particle's origin the particle will spawn at.
|
||||
* @param y The Y position from the particle's origin the particle will spawn at.
|
||||
* @param z The Z position from the particle's origin the particle will spawn at.
|
||||
*/
|
||||
void setPosition(double x, double y, double z);
|
||||
|
||||
double getX();
|
||||
|
||||
double getY();
|
||||
|
||||
double getZ();
|
||||
|
||||
void setPosition(IPos pos);
|
||||
|
||||
void getPos();
|
||||
|
||||
void setMotion(double motionX, double motionY, double motionZ, float gravity);
|
||||
|
||||
double getMotionX();
|
||||
|
||||
double getMotionY();
|
||||
|
||||
double getMotionZ();
|
||||
|
||||
float getGravity();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param HEXColor The starting HEX color of the particle.
|
||||
* @param HEXColor2 The ending HEX color of the particle.
|
||||
* @param HEXColorRate The rate of interpolation between the two HEX colors.
|
||||
* @param HEXColor The starting HEX color of the particle.
|
||||
* @param HEXColor2 The ending HEX color of the particle.
|
||||
* @param HEXColorRate The rate of interpolation between the two HEX colors.
|
||||
* @param HEXColorStart The amount of ticks the particle is around for before its colors begin interpolating between HEXColor and HEXColor2.
|
||||
*/
|
||||
void setHEXColor(int HEXColor, int HEXColor2, float HEXColorRate, int HEXColorStart);
|
||||
|
||||
int getHEXColor1();
|
||||
|
||||
int getHEXColor2();
|
||||
|
||||
float getHEXColorRate();
|
||||
|
||||
int getHEXColorStart();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param alpha1 The starting transparency of the particle.
|
||||
* @param alpha2 The ending transparency of the particle.
|
||||
* @param alphaRate The rate of interpolation between the two transparency values.
|
||||
* @param alpha1 The starting transparency of the particle.
|
||||
* @param alpha2 The ending transparency of the particle.
|
||||
* @param alphaRate The rate of interpolation between the two transparency values.
|
||||
* @param alphaRateStart The amount of ticks the particle is around for before its colors begin interpolating between alpha1 and alpha2.
|
||||
*/
|
||||
void setAlpha(float alpha1, float alpha2, float alphaRate, int alphaRateStart);
|
||||
|
||||
float getAlpha1();
|
||||
|
||||
float getAlpha2();
|
||||
|
||||
float getAlphaRate();
|
||||
|
||||
int getAlphaRateStart();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param scale1 The starting scale/size of the particle.
|
||||
* @param scale2 The ending scale/size of the particle.
|
||||
* @param scaleRate The rate of interpolation between the two scale values.
|
||||
* @param scale1 The starting scale/size of the particle.
|
||||
* @param scale2 The ending scale/size of the particle.
|
||||
* @param scaleRate The rate of interpolation between the two scale values.
|
||||
* @param scaleRateStart The amount of ticks the particle is around for before its colors begin interpolating between scale1 and scale2.
|
||||
*/
|
||||
void setScale(float scale1, float scale2, float scaleRate, int scaleRateStart);
|
||||
|
||||
void setScaleX(float scale1, float scale2, float scaleRate, int scaleRateStart);
|
||||
|
||||
float getScaleX1();
|
||||
|
||||
float getScaleX2();
|
||||
|
||||
float getScaleXRate();
|
||||
|
||||
int getScaleXRateStart();
|
||||
|
||||
void setScaleY(float scale1, float scale2, float scaleRate, int scaleRateStart);
|
||||
|
||||
float getScaleY1();
|
||||
|
||||
float getScaleY2();
|
||||
|
||||
float getScaleYRate();
|
||||
|
||||
int getScaleYRateStart();
|
||||
|
||||
/**
|
||||
* Enables rotation about the X axis.
|
||||
* If the particle is set to always face the player, this axis is a constant horizontal line on the player's camera.
|
||||
*
|
||||
* @param rotationX1 The starting X rotation of the particle.
|
||||
* @param rotationX2 The ending X rotation of the particle.
|
||||
* @param rotationXRate The rate of interpolation between the two X rotation values.
|
||||
* @param rotationX1 The starting X rotation of the particle.
|
||||
* @param rotationX2 The ending X rotation of the particle.
|
||||
* @param rotationXRate The rate of interpolation between the two X rotation values.
|
||||
* @param rotationXRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationX1 and rotationX2.
|
||||
*/
|
||||
void setRotationX(float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart);
|
||||
|
||||
float getRotationX1();
|
||||
|
||||
float getRotationX2();
|
||||
|
||||
float getRotationXRate();
|
||||
|
||||
int getRotationXRateStart();
|
||||
|
||||
/**
|
||||
* Enables rotation about the Y axis.
|
||||
* If the particle is set to always face the player, this axis is a constant vertical line on the player's camera.
|
||||
*
|
||||
* @param rotationY1 The starting Y rotation of the particle.
|
||||
* @param rotationY2 The ending Y rotation of the particle.
|
||||
* @param rotationYRate The rate of interpolation between the two Y rotation values.
|
||||
* @param rotationY1 The starting Y rotation of the particle.
|
||||
* @param rotationY2 The ending Y rotation of the particle.
|
||||
* @param rotationYRate The rate of interpolation between the two Y rotation values.
|
||||
* @param rotationYRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationY1 and rotationY2.
|
||||
*/
|
||||
void setRotationY(float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart);
|
||||
|
||||
float getRotationY1();
|
||||
|
||||
float getRotationY2();
|
||||
|
||||
float getRotationYRate();
|
||||
|
||||
int getRotationYRateStart();
|
||||
|
||||
/**
|
||||
@@ -228,15 +263,19 @@ public interface IParticle {
|
||||
* If the particle is set to always face the player, this axis is a constant line going into the player's camera.
|
||||
* You'll be using this one most often if the particle is set to face the player.
|
||||
*
|
||||
* @param rotationZ1 The starting Z rotation of the particle.
|
||||
* @param rotationZ2 The ending Z rotation of the particle.
|
||||
* @param rotationZRate The rate of interpolation between the two Z rotation values.
|
||||
* @param rotationZ1 The starting Z rotation of the particle.
|
||||
* @param rotationZ2 The ending Z rotation of the particle.
|
||||
* @param rotationZRate The rate of interpolation between the two Z rotation values.
|
||||
* @param rotationZRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationZ1 and rotationZ2.
|
||||
*/
|
||||
void setRotationZ(float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart);
|
||||
|
||||
float getRotationZ1();
|
||||
|
||||
float getRotationZ2();
|
||||
|
||||
float getRotationZRate();
|
||||
|
||||
int getRotationZRateStart();
|
||||
|
||||
|
||||
}
|
||||
@@ -18,12 +18,10 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Shifts the IPos up by 1 block and returns the new object.
|
||||
*
|
||||
*/
|
||||
IPos up();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param n The number of blocks to move the position up by.
|
||||
* @return The new IPos object.
|
||||
*/
|
||||
@@ -31,12 +29,10 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Shifts the IPos down by 1 block and returns the new object.
|
||||
*
|
||||
*/
|
||||
IPos down();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param n The number of blocks to move the position down by.
|
||||
* @return The new IPos object.
|
||||
*/
|
||||
@@ -44,12 +40,10 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Shifts the IPos north by 1 block and returns the new object.
|
||||
*
|
||||
*/
|
||||
IPos north();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param n The number of blocks to move the position north by.
|
||||
* @return The new IPos object.
|
||||
*/
|
||||
@@ -57,12 +51,10 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Shifts the IPos east by 1 block and returns the new object.
|
||||
*
|
||||
*/
|
||||
IPos east();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param n The number of blocks to move the position east by.
|
||||
* @return The new IPos object.
|
||||
*/
|
||||
@@ -70,12 +62,10 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Shifts the IPos south by 1 block and returns the new object.
|
||||
*
|
||||
*/
|
||||
IPos south();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param n The number of blocks to move the position south by.
|
||||
* @return The new IPos object.
|
||||
*/
|
||||
@@ -83,12 +73,10 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Shifts the IPos west by 1 block and returns the new object.
|
||||
*
|
||||
*/
|
||||
IPos west();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param n The number of blocks to move the position west by.
|
||||
* @return The new IPos object.
|
||||
*/
|
||||
@@ -137,7 +125,6 @@ public interface IPos {
|
||||
/**
|
||||
* Returns a normalized vector of this block's position, calculated by:
|
||||
*
|
||||
*
|
||||
* @return The normalized vector of this block position.
|
||||
*/
|
||||
IPos normalize();
|
||||
@@ -146,13 +133,11 @@ public interface IPos {
|
||||
|
||||
/**
|
||||
* Offsets the block by 1 block in the given direction and returns the resulting IPos object
|
||||
*
|
||||
*/
|
||||
IPos offset(int direction);
|
||||
|
||||
/**
|
||||
* Offsets the block by n blocks in the given direction and returns the resulting IPos object
|
||||
*
|
||||
*/
|
||||
IPos offset(int direction, double n);
|
||||
|
||||
@@ -167,7 +152,6 @@ public interface IPos {
|
||||
IPos fromLong(long serialized);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param pos The IPos object to calculate the distance to
|
||||
* @return The distance between this IPos object and the other.
|
||||
*/
|
||||
|
||||
@@ -2,11 +2,11 @@ package noppes.npcs.api;
|
||||
|
||||
public interface IScreenSize {
|
||||
|
||||
public int getWidth();
|
||||
int getWidth();
|
||||
|
||||
public int getHeight();
|
||||
int getHeight();
|
||||
|
||||
public int getWidthPercent(double percent);
|
||||
int getWidthPercent(double percent);
|
||||
|
||||
public int getHeightPercent(double percent);
|
||||
int getHeightPercent(double percent);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package noppes.npcs.api;
|
||||
/**
|
||||
* A skin overlay object for both NPCs and players. Several skin overlays at a time can be layered on top of each other.
|
||||
* In an NPC's case, the old overlay texture is now the skin overlay with ID 0.
|
||||
*
|
||||
* <p>
|
||||
* Modifying these attributes, an overlay can be made to look like a powered creeper effect, just a new skin, or both!
|
||||
*/
|
||||
public interface ISkinOverlay {
|
||||
@@ -11,24 +11,28 @@ public interface ISkinOverlay {
|
||||
* Sets the directory texture of the overlay. Does not support URLs.
|
||||
*/
|
||||
void setTexture(String texture);
|
||||
|
||||
String getTexture();
|
||||
|
||||
/**
|
||||
* Sets whether this overlay glows in the dark or not.
|
||||
*/
|
||||
void setGlow(boolean glow);
|
||||
|
||||
boolean getGlow();
|
||||
|
||||
/**
|
||||
* Sets whether this overlay blends on top of bottom textures at any alpha value.
|
||||
*/
|
||||
void setBlend(boolean blend);
|
||||
|
||||
boolean getBlend();
|
||||
|
||||
/**
|
||||
* Sets the transparency of the overlay, from 0 to 1.
|
||||
*/
|
||||
void setAlpha(float alpha);
|
||||
|
||||
float getAlpha();
|
||||
|
||||
/**
|
||||
@@ -36,13 +40,16 @@ public interface ISkinOverlay {
|
||||
* the entity's model.
|
||||
*/
|
||||
void setSize(float size);
|
||||
|
||||
float getSize();
|
||||
|
||||
/**
|
||||
* Sets the texture scale of the overlay. Higher values will "zoom in" to the texture more.
|
||||
*/
|
||||
void setTextureScale(float scaleX, float scaleY);
|
||||
|
||||
float getTextureScaleX();
|
||||
|
||||
float getTextureScaleY();
|
||||
|
||||
/**
|
||||
@@ -50,14 +57,19 @@ public interface ISkinOverlay {
|
||||
* This does not move the entire overlay, it just moves the position at which the texture begins rendering.
|
||||
*/
|
||||
void setSpeed(float speedX, float speedY);
|
||||
|
||||
float getSpeedX();
|
||||
|
||||
float getSpeedY();
|
||||
|
||||
/**
|
||||
* Sets the amount in each direction by which the overlay will be offset from the entity.
|
||||
*/
|
||||
void setOffset(float offsetX, float offsetY, float offsetZ);
|
||||
|
||||
float getOffsetX();
|
||||
|
||||
float getOffsetY();
|
||||
|
||||
float getOffsetZ();
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface ITileEntity {
|
||||
/**
|
||||
*
|
||||
* @return An integer representing the metadata of this block. Blocks with different states will
|
||||
* return different values. For example, each stage of growth for a wheat crop will return a different value, each
|
||||
* orientation of a stair block will return a different value, etc.
|
||||
@@ -12,7 +11,6 @@ public interface ITileEntity {
|
||||
int getBlockMetadata();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The world this tile entity is in.
|
||||
*/
|
||||
IWorld getWorld();
|
||||
@@ -20,7 +18,6 @@ public interface ITileEntity {
|
||||
void setWorld(IWorld world);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return An obfuscated MC tile entity object.
|
||||
*/
|
||||
TileEntity getMCTileEntity();
|
||||
@@ -36,6 +33,7 @@ public interface ITileEntity {
|
||||
* @return The distance of this tile entity from the point given by the x, y, and z parameters.
|
||||
*/
|
||||
double getDistanceFrom(double x, double y, double z);
|
||||
|
||||
double getDistanceFrom(IPos pos);
|
||||
|
||||
/**
|
||||
@@ -44,7 +42,6 @@ public interface ITileEntity {
|
||||
IBlock getBlockType();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if the tile entity is invalid, false otherwise.
|
||||
*/
|
||||
boolean isInvalid();
|
||||
|
||||
@@ -8,8 +8,8 @@ public interface ITimers {
|
||||
* Adds a timer to the NPC or player with the given attributes. If this function is used and there is already a
|
||||
* timer with the given ID, an exception will be thrown.
|
||||
*
|
||||
* @param id The id of the timer.
|
||||
* @param ticks The amount of ticks before the timer ends.
|
||||
* @param id The id of the timer.
|
||||
* @param ticks The amount of ticks before the timer ends.
|
||||
* @param repeat Whether this timer repeats when it reaches its maximum amount of ticks.
|
||||
*/
|
||||
void start(int id, int ticks, boolean repeat);
|
||||
@@ -18,14 +18,13 @@ public interface ITimers {
|
||||
* Adds a timer to the NPC or player with the given attributes. No exception will be thrown if there is already a
|
||||
* timer with the given ID when using this function.
|
||||
*
|
||||
* @param id The id of the timer.
|
||||
* @param ticks The amount of ticks before the timer ends.
|
||||
* @param id The id of the timer.
|
||||
* @param ticks The amount of ticks before the timer ends.
|
||||
* @param repeat Whether this timer repeats when it reaches its maximum amount of ticks.
|
||||
*/
|
||||
void forceStart(int id, int ticks, boolean repeat);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if the set of timers contains a timer with the given id, false otherwise.
|
||||
*/
|
||||
boolean has(int id);
|
||||
@@ -80,7 +79,6 @@ public interface ITimers {
|
||||
void setRepeats(int id, boolean repeat);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The amount of timers in the set of timers.
|
||||
*/
|
||||
int size();
|
||||
|
||||
@@ -26,58 +26,68 @@ public interface IWorld {
|
||||
* @param z World position z
|
||||
* @return The block at the given position. Returns null if there isn't a block
|
||||
*/
|
||||
public IBlock getBlock(int x, int y, int z);
|
||||
IBlock getBlock(int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @param pos
|
||||
* @return The block at the given position. Returns null if there isn't a block
|
||||
*/
|
||||
public IBlock getBlock(IPos pos);
|
||||
* @param pos
|
||||
* @return The block at the given position. Returns null if there isn't a block
|
||||
*/
|
||||
IBlock getBlock(IPos pos);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The top-most block in the world as an IBlock object.
|
||||
*/
|
||||
IBlock getTopBlock(int x, int z);
|
||||
|
||||
IBlock getTopBlock(IPos pos);
|
||||
|
||||
boolean isBlockFreezable(IPos pos);
|
||||
|
||||
boolean isBlockFreezable(int x, int y, int z);
|
||||
|
||||
boolean isBlockFreezableNaturally(IPos pos);
|
||||
|
||||
boolean isBlockFreezableNaturally(int x, int y, int z);
|
||||
|
||||
boolean canBlockFreeze(IPos pos, boolean adjacentToWater);
|
||||
|
||||
boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater);
|
||||
|
||||
boolean canBlockFreezeBody(IPos pos, boolean adjacentToWater);
|
||||
|
||||
boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater);
|
||||
|
||||
boolean canSnowAt(IPos pos, boolean checkLight);
|
||||
|
||||
boolean canSnowAt(int x, int y, int z, boolean checkLight);
|
||||
|
||||
boolean canSnowAtBody(IPos pos, boolean checkLight);
|
||||
|
||||
boolean canSnowAtBody(int x, int y, int z, boolean checkLight);
|
||||
|
||||
/**
|
||||
* @return The Y-value of the world at this x & z value based on the height map of the world.
|
||||
*/
|
||||
int getHeightValue(int x, int z);
|
||||
|
||||
int getHeightValue(IPos pos);
|
||||
|
||||
/**
|
||||
* @return The minimum Y-value of the world at this x & z value based on the height map of the world.
|
||||
*/
|
||||
int getChunkHeightMapMinimum(int x, int z);
|
||||
|
||||
int getChunkHeightMapMinimum(IPos pos);
|
||||
|
||||
/**
|
||||
* @return The metadata of the block at this position.
|
||||
*/
|
||||
int getBlockMetadata(int x, int y, int z);
|
||||
|
||||
int getBlockMetadata(IPos pos);
|
||||
|
||||
boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag);
|
||||
|
||||
boolean setBlockMetadataWithNotify(IPos pos, int metadata, int flag);
|
||||
|
||||
/**
|
||||
@@ -87,6 +97,7 @@ public interface IWorld {
|
||||
* @return can the block at this position see the sky or are there no blocks above this one
|
||||
*/
|
||||
boolean canSeeSky(int x, int y, int z);
|
||||
|
||||
/**
|
||||
* @param pos
|
||||
* @return can the block at this position see the sky or are there no blocks above this one
|
||||
@@ -94,9 +105,11 @@ public interface IWorld {
|
||||
boolean canSeeSky(IPos pos);
|
||||
|
||||
int getFullBlockLightValue(int x, int y, int z);
|
||||
|
||||
int getFullBlockLightValue(IPos pos);
|
||||
|
||||
int getBlockLightValue(int x, int y, int z);
|
||||
|
||||
int getBlockLightValue(IPos pos);
|
||||
|
||||
void playSoundAtEntity(IEntity entity, String sound, float volume, float pitch);
|
||||
@@ -120,15 +133,16 @@ public interface IWorld {
|
||||
IPlayer getClosestPlayerToEntity(IEntity entity, double range);
|
||||
|
||||
IPlayer getClosestPlayer(double x, double y, double z, double range);
|
||||
|
||||
IPlayer getClosestPlayer(IPos pos, double range);
|
||||
|
||||
IPlayer getClosestVulnerablePlayerToEntity(IEntity entity, double range);
|
||||
|
||||
IPlayer getClosestVulnerablePlayer(double x, double y, double z, double range);
|
||||
|
||||
IPlayer getClosestVulnerablePlayer(IPos pos, double range);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entity The entity whose type will be used as a parameter
|
||||
* @return The amount of entities of the given type in the world.
|
||||
*/
|
||||
@@ -144,30 +158,35 @@ public interface IWorld {
|
||||
* Sets the block's tile entity at the given position.
|
||||
*/
|
||||
void setTileEntity(int x, int y, int z, ITileEntity tileEntity);
|
||||
|
||||
void setTileEntity(IPos pos, ITileEntity tileEntity);
|
||||
|
||||
/**
|
||||
* Removes the block's tile entity at the given position.
|
||||
*/
|
||||
void removeTileEntity(int x, int y, int z);
|
||||
|
||||
void removeTileEntity(IPos pos);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if the block at this position is of cubic shape. (Not a stair, slab, etc.)
|
||||
*/
|
||||
boolean isBlockFullCube(int x, int y, int z);
|
||||
|
||||
boolean isBlockFullCube(IPos pos);
|
||||
|
||||
long getSeed();
|
||||
|
||||
void setSpawnLocation(int x, int y, int z);
|
||||
|
||||
void setSpawnLocation(IPos pos);
|
||||
|
||||
boolean canLightningStrikeAt(int x, int y, int z);
|
||||
|
||||
boolean canLightningStrikeAt(IPos pos);
|
||||
|
||||
boolean isBlockHighHumidity(int x, int y, int z);
|
||||
|
||||
boolean isBlockHighHumidity(IPos pos);
|
||||
|
||||
/**
|
||||
@@ -178,24 +197,27 @@ public interface IWorld {
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
String getSignText(int x, int y, int z);
|
||||
|
||||
String getSignText(IPos pos);
|
||||
|
||||
/**
|
||||
* @param x World position x
|
||||
* @param y World position y
|
||||
* @param z World position z
|
||||
* @param x World position x
|
||||
* @param y World position y
|
||||
* @param z World position z
|
||||
* @param item The block to be set
|
||||
*/
|
||||
boolean setBlock(int x, int y, int z, IItemStack item);
|
||||
|
||||
boolean setBlock(IPos pos, IItemStack item);
|
||||
|
||||
/**
|
||||
* @param x World position x
|
||||
* @param y World position y
|
||||
* @param z World position z
|
||||
* @param block The block to be set
|
||||
*/
|
||||
/**
|
||||
* @param x World position x
|
||||
* @param y World position y
|
||||
* @param z World position z
|
||||
* @param block The block to be set
|
||||
*/
|
||||
boolean setBlock(int x, int y, int z, IBlock block);
|
||||
|
||||
boolean setBlock(IPos pos, IBlock block);
|
||||
|
||||
/**
|
||||
@@ -204,6 +226,7 @@ public interface IWorld {
|
||||
* @param z World position z
|
||||
*/
|
||||
void removeBlock(int x, int y, int z);
|
||||
|
||||
void removeBlock(IPos pos);
|
||||
|
||||
boolean isPlaceCancelled(int posX, int posY, int posZ);
|
||||
@@ -224,8 +247,9 @@ public interface IWorld {
|
||||
|
||||
/**
|
||||
* starting at the start position, draw a line in the lookVector direction until a block is detected
|
||||
*
|
||||
* @param startPos
|
||||
* @param lookVector should be a normalized direction vector
|
||||
* @param lookVector should be a normalized direction vector
|
||||
* @param maxDistance
|
||||
* @return the first detected block but null if maxDistance is reached
|
||||
*/
|
||||
@@ -242,11 +266,11 @@ public interface IWorld {
|
||||
* @param maxHeight
|
||||
* @return the position of the closest block of air to startPos
|
||||
*/
|
||||
public IPos getNearestAir(IPos startPos, int maxHeight);
|
||||
IPos getNearestAir(IPos startPos, int maxHeight);
|
||||
|
||||
IEntity[] rayCastEntities(double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
public IEntity[] rayCastEntities(IEntity[] ignoreEntities, double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
IEntity[] rayCastEntities(IEntity[] ignoreEntities, double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
IEntity[] rayCastEntities(IPos startPos, IPos lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
@@ -288,27 +312,30 @@ public interface IWorld {
|
||||
* @param z The z position
|
||||
*/
|
||||
void thunderStrike(double x, double y, double z);
|
||||
|
||||
void thunderStrike(IPos pos);
|
||||
|
||||
/**
|
||||
* Sends a packet from the server to the client everytime its called. Probably should not use this too much.
|
||||
*
|
||||
* @param particle Particle name. Particle name list: http://minecraft.wiki/w/Particles
|
||||
* @param x The x position
|
||||
* @param y The y position
|
||||
* @param z The z position
|
||||
* @param dx Usually used for the x motion
|
||||
* @param dy Usually used for the y motion
|
||||
* @param dz Usually used for the z motion
|
||||
* @param speed Speed of the particles, usually between 0 and 1
|
||||
* @param count Particle count
|
||||
* @param x The x position
|
||||
* @param y The y position
|
||||
* @param z The z position
|
||||
* @param dx Usually used for the x motion
|
||||
* @param dy Usually used for the y motion
|
||||
* @param dz Usually used for the z motion
|
||||
* @param speed Speed of the particles, usually between 0 and 1
|
||||
* @param count Particle count
|
||||
*/
|
||||
void spawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count);
|
||||
|
||||
void spawnParticle(String particle, IPos pos, double dx, double dy, double dz, double speed, int count);
|
||||
|
||||
/**
|
||||
* @param id The items name
|
||||
* @param id The items name
|
||||
* @param damage The damage value
|
||||
* @param size The number of items in the item
|
||||
* @param size The number of items in the item
|
||||
* @return Returns the item
|
||||
*/
|
||||
IItemStack createItem(String id, int damage, int size);
|
||||
@@ -356,56 +383,60 @@ public interface IWorld {
|
||||
String[] getStoredDataKeys();
|
||||
|
||||
/**
|
||||
* @param x Position x
|
||||
* @param y Position y
|
||||
* @param z Position z
|
||||
* @param x Position x
|
||||
* @param y Position y
|
||||
* @param z Position z
|
||||
* @param range Range of the explosion
|
||||
* @param fire Whether or not the explosion does fire damage
|
||||
* @param fire Whether or not the explosion does fire damage
|
||||
* @param grief Whether or not the explosion does damage to blocks
|
||||
*/
|
||||
void explode(double x, double y, double z, float range, boolean fire, boolean grief);
|
||||
|
||||
void explode(IPos pos, float range, boolean fire, boolean grief);
|
||||
|
||||
IPlayer[] getAllServerPlayers();
|
||||
|
||||
public String[] getPlayerNames();
|
||||
String[] getPlayerNames();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param x Position x
|
||||
* @param z Position z
|
||||
* @return Returns the name of the biome
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
String getBiomeName(int x, int z);
|
||||
|
||||
String getBiomeName(IPos pos);
|
||||
|
||||
/**
|
||||
* Lets you spawn a server side cloned entity
|
||||
* @param x The x position the clone will be spawned at
|
||||
* @param y The y position the clone will be spawned at
|
||||
* @param z The z position the clone will be spawned at
|
||||
* @param tab The tab in which the clone is
|
||||
* @param name Name of the cloned entity
|
||||
*
|
||||
* @param x The x position the clone will be spawned at
|
||||
* @param y The y position the clone will be spawned at
|
||||
* @param z The z position the clone will be spawned at
|
||||
* @param tab The tab in which the clone is
|
||||
* @param name Name of the cloned entity
|
||||
* @param ignoreProtection Whether the spawning of this clone skips protection checks.
|
||||
* @return Returns the entity which was spawned
|
||||
*/
|
||||
IEntity spawnClone(int x, int y, int z, int tab, String name, boolean ignoreProtection);
|
||||
|
||||
IEntity spawnClone(IPos pos, int tab, String name, boolean ignoreProtection);
|
||||
|
||||
IEntity spawnClone(int x, int y, int z, int tab, String name);
|
||||
|
||||
IEntity spawnClone(IPos pos, int tab, String name);
|
||||
|
||||
IScoreboard getScoreboard();
|
||||
|
||||
/**
|
||||
* @return Returns minecraft world object
|
||||
* @since 1.7.10c
|
||||
* Expert use only
|
||||
* @return Returns minecraft world object
|
||||
*/
|
||||
WorldServer getMCWorld();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The ID of this world's dimension. 0 for overworld, 1 for End, -1 for Nether, etc.
|
||||
*/
|
||||
int getDimensionID();
|
||||
|
||||
@@ -72,6 +72,7 @@ public interface IBlockScripted extends IBlock {
|
||||
* Use /gamerule commandBlockOutput false/true to turn off/on command block feedback <br>
|
||||
* Setting NpcUseOpCommands to true in the CustomNPCs.cfg should allow the npc to run op commands, be warned this could be a major security risk, use at own risk <br>
|
||||
* For permission plugins the commands are run under uuid:c9c843f8-4cb1-4c82-aa61-e264291b7bd6 and name:[customnpcs]
|
||||
*
|
||||
* @param command The command to be executed
|
||||
*/
|
||||
void executeCommand(String command);
|
||||
|
||||
@@ -2,41 +2,41 @@ package noppes.npcs.api.block;
|
||||
|
||||
public interface ITextPlane {
|
||||
|
||||
public String getText();
|
||||
String getText();
|
||||
|
||||
public void setText(String text);
|
||||
void setText(String text);
|
||||
|
||||
public int getRotationX();
|
||||
int getRotationX();
|
||||
|
||||
public int getRotationY();
|
||||
int getRotationY();
|
||||
|
||||
public int getRotationZ();
|
||||
int getRotationZ();
|
||||
|
||||
public void setRotationX(int x);
|
||||
void setRotationX(int x);
|
||||
|
||||
public void setRotationY(int y);
|
||||
void setRotationY(int y);
|
||||
|
||||
/**
|
||||
* @param z Default: 0.5
|
||||
*/
|
||||
public void setRotationZ(int z);
|
||||
void setRotationZ(int z);
|
||||
|
||||
public float getOffsetX();
|
||||
float getOffsetX();
|
||||
|
||||
public float getOffsetY();
|
||||
float getOffsetY();
|
||||
|
||||
public float getOffsetZ();
|
||||
float getOffsetZ();
|
||||
|
||||
public void setOffsetX(float x);
|
||||
void setOffsetX(float x);
|
||||
|
||||
public void setOffsetY(float y);
|
||||
void setOffsetY(float y);
|
||||
|
||||
public void setOffsetZ(float z);
|
||||
void setOffsetZ(float z);
|
||||
|
||||
public float getScale();
|
||||
float getScale();
|
||||
|
||||
/**
|
||||
* @param scale Default: 1
|
||||
*/
|
||||
public void setScale(float scale);
|
||||
void setScale(float scale);
|
||||
}
|
||||
@@ -1,27 +1,66 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IAnimal<T extends EntityAnimal> extends IEntityLiving<T> {
|
||||
/**
|
||||
* Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
|
||||
* the animal type)
|
||||
*/
|
||||
boolean isBreedingItem(IItemStack itemStack);
|
||||
|
||||
/**
|
||||
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig
|
||||
*/
|
||||
boolean interact(IPlayer player);
|
||||
|
||||
void setFollowPlayer(IPlayer player);
|
||||
|
||||
IPlayer followingPlayer();
|
||||
|
||||
boolean isInLove();
|
||||
|
||||
void resetInLove();
|
||||
|
||||
boolean canMateWith(IAnimal animal);
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents an animal entity with additional behavior such as breeding,
|
||||
* following, and mating.
|
||||
*
|
||||
* @param <T> the underlying Minecraft EntityAnimal type.
|
||||
*/
|
||||
public interface IAnimal<T extends EntityAnimal> extends IEntityLiving<T> {
|
||||
|
||||
/**
|
||||
* Checks whether the specified item can be used to breed this animal.
|
||||
* (e.g. wheat, carrots or seeds depending on the animal type)
|
||||
*
|
||||
* @param itemStack the item to test.
|
||||
* @return true if the item is a breeding item; false otherwise.
|
||||
*/
|
||||
boolean isBreedingItem(IItemStack itemStack);
|
||||
|
||||
/**
|
||||
* Called when a player interacts with the animal.
|
||||
* For example, this might return true if the player milks a cow or saddles a pig.
|
||||
*
|
||||
* @param player the interacting player.
|
||||
* @return true if the interaction was handled; false otherwise.
|
||||
*/
|
||||
boolean interact(IPlayer player);
|
||||
|
||||
/**
|
||||
* Sets the specified player as the one to follow.
|
||||
*
|
||||
* @param player the player to follow.
|
||||
*/
|
||||
void setFollowPlayer(IPlayer player);
|
||||
|
||||
/**
|
||||
* Returns the player that this animal is currently following.
|
||||
*
|
||||
* @return the following player, or null if not following anyone.
|
||||
*/
|
||||
IPlayer followingPlayer();
|
||||
|
||||
/**
|
||||
* Checks if the animal is currently in a "love" state,
|
||||
* indicating readiness to mate.
|
||||
*
|
||||
* @return true if the animal is in love; false otherwise.
|
||||
*/
|
||||
boolean isInLove();
|
||||
|
||||
/**
|
||||
* Resets the animal's love state.
|
||||
*/
|
||||
void resetInLove();
|
||||
|
||||
/**
|
||||
* Checks if this animal can mate with another animal.
|
||||
*
|
||||
* @param animal the other animal.
|
||||
* @return true if mating is possible; false otherwise.
|
||||
*/
|
||||
boolean canMateWith(IAnimal animal);
|
||||
}
|
||||
@@ -2,7 +2,16 @@ package noppes.npcs.api.entity;
|
||||
|
||||
import noppes.npcs.api.handler.data.IAnimationData;
|
||||
|
||||
/**
|
||||
* Represents an entity capable of playing animations.
|
||||
* Provides access to its animation data.
|
||||
*/
|
||||
public interface IAnimatable {
|
||||
|
||||
/**
|
||||
* Returns the animation data associated with this entity.
|
||||
*
|
||||
* @return the animation data.
|
||||
*/
|
||||
IAnimationData getAnimationData();
|
||||
}
|
||||
@@ -6,10 +6,7 @@ import noppes.npcs.api.ITimers;
|
||||
import noppes.npcs.api.entity.data.IModelData;
|
||||
import noppes.npcs.api.handler.IActionManager;
|
||||
import noppes.npcs.api.handler.IOverlayHandler;
|
||||
import noppes.npcs.api.handler.data.IAnimationData;
|
||||
import noppes.npcs.api.handler.data.IDialog;
|
||||
import noppes.npcs.api.handler.data.IFaction;
|
||||
import noppes.npcs.api.handler.data.ILines;
|
||||
import noppes.npcs.api.handler.data.*;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.api.jobs.IJob;
|
||||
import noppes.npcs.api.roles.IRole;
|
||||
@@ -940,4 +937,11 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T>,
|
||||
* @return the action manager responsible for scheduling actions to the NPC's AI
|
||||
*/
|
||||
IActionManager getActionManager();
|
||||
|
||||
/**
|
||||
* Returns the Magic Data of an NPC
|
||||
*
|
||||
* @return Magic data
|
||||
*/
|
||||
IMagicData getMagicData();
|
||||
}
|
||||
@@ -1,110 +1,489 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IDBCPlayer extends IPlayer {
|
||||
|
||||
void setStat(String stat, int value);
|
||||
int getStat(String stat);
|
||||
|
||||
void addBonusAttribute(String stat, String bonusID, String operation, double attributeValue);
|
||||
void addBonusAttribute(String stat, String bonusID, String operation, double attributeValue, boolean endOfTheList);
|
||||
void addToBonusAttribute(String stat, String bonusID, String operation, double attributeValue);
|
||||
void setBonusAttribute(String stat, String bonusID, String operation, double attributeValue);
|
||||
void getBonusAttribute(String stat, String bonusID);
|
||||
void removeBonusAttribute(String stat, String bonusID);
|
||||
void clearBonusAttribute(String stat);
|
||||
|
||||
String bonusAttribute(String action, String stat, String bonusID);
|
||||
|
||||
String bonusAttribute(String action, String stat, String bonusID, String operation, double attributeValue, boolean endOfTheList);
|
||||
|
||||
void setRelease(byte release);
|
||||
byte getRelease();
|
||||
|
||||
void setBody(int body);
|
||||
int getBody();
|
||||
|
||||
void setHP(int hp);
|
||||
int getHP();
|
||||
|
||||
void setStamina(int stamina);
|
||||
int getStamina();
|
||||
|
||||
void setKi(int ki);
|
||||
int getKi();
|
||||
|
||||
void setTP(int tp);
|
||||
int getTP();
|
||||
|
||||
void setGravity(float gravity);
|
||||
float getGravity();
|
||||
|
||||
boolean isBlocking();
|
||||
|
||||
void setHairCode(String hairCode);
|
||||
String getHairCode();
|
||||
|
||||
void setExtraCode(String extraCode);
|
||||
String getExtraCode();
|
||||
|
||||
/**
|
||||
* @param slot The DBC extra inventory slot the item stack parameter will go into:
|
||||
* 0 - Weight
|
||||
* 1 - Body
|
||||
* 2 - Head
|
||||
* 3 - 4th Vanity Slot Down to the left
|
||||
* 4 - 3rd Vanity Slot Down to the left
|
||||
* 5 - 2nd Vanity Slot Down to the left
|
||||
* 6 - 1st Vanity Slot Down to the left
|
||||
* 7 - 4th Vanity Slot Down to the right
|
||||
* 8 - 3rd Vanity Slot Down to the right
|
||||
* 9 - 2nd Vanity Slot Down to the right
|
||||
* 10 - 1st Vanity Slot Down to the right
|
||||
* @param itemStack The item stack to be set into the slot. Set to null to remove the stack in that slot.
|
||||
*/
|
||||
void setItem(IItemStack itemStack, byte slot, boolean vanity);
|
||||
IItemStack getItem(byte slot, boolean vanity);
|
||||
IItemStack[] getInventory();
|
||||
|
||||
void setForm(byte form);
|
||||
byte getForm();
|
||||
void setForm2(byte form2);
|
||||
byte getForm2();
|
||||
|
||||
double getRacialFormMastery(byte form);
|
||||
void setRacialFormMastery(byte form, double value);
|
||||
void addRacialFormMastery(byte form, double value);
|
||||
|
||||
double getOtherFormMastery(String formName);
|
||||
void setOtherFormMastery(String formName, double value);
|
||||
void addOtherFormMastery(String formName, double value);
|
||||
|
||||
void setPowerPoints(int points);
|
||||
int getPowerPoints();
|
||||
|
||||
void setAuraColor(int color);
|
||||
int getAuraColor();
|
||||
|
||||
void setFormLevel(int level);
|
||||
int getFormLevel();
|
||||
|
||||
void setSkills(String skills);
|
||||
String getSkills();
|
||||
|
||||
void setJRMCSE(String statusEffects);
|
||||
String getJRMCSE();
|
||||
|
||||
void setRace(byte race);
|
||||
int getRace();
|
||||
|
||||
void setDBCClass(byte dbcClass);
|
||||
byte getDBCClass();
|
||||
|
||||
void setPowerType(byte powerType);
|
||||
int getPowerType();
|
||||
|
||||
int getKillCount(String type);
|
||||
|
||||
String getFusionString();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Extends IPlayer with additional methods specific to DBC (Dragon Ball C) players.
|
||||
* These methods manage stats, bonus attributes, form configurations, inventory, and more.
|
||||
*/
|
||||
public interface IDBCPlayer extends IPlayer {
|
||||
|
||||
/**
|
||||
* Sets the specified stat to the given value.
|
||||
*
|
||||
* @param stat the stat name (e.g. "str", "dex", "con", "wil", "mnd", "spi").
|
||||
* @param value the new value.
|
||||
*/
|
||||
void setStat(String stat, int value);
|
||||
|
||||
/**
|
||||
* Retrieves the value of the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @return the stat value.
|
||||
*/
|
||||
int getStat(String stat);
|
||||
|
||||
/**
|
||||
* Adds a bonus attribute for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the identifier for the bonus.
|
||||
* @param operation the arithmetic operation to apply.
|
||||
* @param attributeValue the attribute value.
|
||||
*/
|
||||
void addBonusAttribute(String stat, String bonusID, String operation, double attributeValue);
|
||||
|
||||
/**
|
||||
* Adds a bonus attribute for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the identifier for the bonus.
|
||||
* @param operation the arithmetic operation to apply.
|
||||
* @param attributeValue the attribute value.
|
||||
* @param endOfTheList whether to add the bonus at the end of the list.
|
||||
*/
|
||||
void addBonusAttribute(String stat, String bonusID, String operation, double attributeValue, boolean endOfTheList);
|
||||
|
||||
/**
|
||||
* Increases an existing bonus attribute for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the identifier for the bonus.
|
||||
* @param operation the arithmetic operation.
|
||||
* @param attributeValue the value to add.
|
||||
*/
|
||||
void addToBonusAttribute(String stat, String bonusID, String operation, double attributeValue);
|
||||
|
||||
/**
|
||||
* Sets a bonus attribute for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the identifier for the bonus.
|
||||
* @param operation the arithmetic operation.
|
||||
* @param attributeValue the value to set.
|
||||
*/
|
||||
void setBonusAttribute(String stat, String bonusID, String operation, double attributeValue);
|
||||
|
||||
/**
|
||||
* Retrieves a bonus attribute for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the identifier for the bonus.
|
||||
*/
|
||||
void getBonusAttribute(String stat, String bonusID);
|
||||
|
||||
/**
|
||||
* Removes the bonus attribute with the given identifier for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the bonus identifier.
|
||||
*/
|
||||
void removeBonusAttribute(String stat, String bonusID);
|
||||
|
||||
/**
|
||||
* Clears all bonus attributes for the specified stat.
|
||||
*
|
||||
* @param stat the stat name.
|
||||
*/
|
||||
void clearBonusAttribute(String stat);
|
||||
|
||||
/**
|
||||
* Retrieves a bonus attribute string based on an action.
|
||||
*
|
||||
* @param action the action (get, remove, or clear).
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the bonus identifier.
|
||||
* @return the bonus attribute string.
|
||||
*/
|
||||
String bonusAttribute(String action, String stat, String bonusID);
|
||||
|
||||
/**
|
||||
* Retrieves a bonus attribute string with full parameters.
|
||||
*
|
||||
* @param action the action (add, addto, set, get, remove, or clear).
|
||||
* @param stat the stat name.
|
||||
* @param bonusID the bonus identifier.
|
||||
* @param operation the arithmetic operation.
|
||||
* @param attributeValue the attribute value.
|
||||
* @param endOfTheList whether to add at the end of the list.
|
||||
* @return the bonus attribute string.
|
||||
*/
|
||||
String bonusAttribute(String action, String stat, String bonusID, String operation, double attributeValue, boolean endOfTheList);
|
||||
|
||||
/**
|
||||
* Sets the release state.
|
||||
*
|
||||
* @param release the release value.
|
||||
*/
|
||||
void setRelease(byte release);
|
||||
|
||||
/**
|
||||
* Returns the current release state.
|
||||
*
|
||||
* @return the release value.
|
||||
*/
|
||||
byte getRelease();
|
||||
|
||||
/**
|
||||
* Sets the body value. Also HP.
|
||||
*
|
||||
* @param body the body value.
|
||||
*/
|
||||
void setBody(int body);
|
||||
|
||||
/**
|
||||
* Returns the body value. Also HP.
|
||||
*
|
||||
* @return the body.
|
||||
*/
|
||||
int getBody();
|
||||
|
||||
/**
|
||||
* Sets the HP value.
|
||||
*
|
||||
* @param hp the HP value.
|
||||
*/
|
||||
void setHP(int hp);
|
||||
|
||||
/**
|
||||
* Returns the HP value.
|
||||
*
|
||||
* @return the HP.
|
||||
*/
|
||||
int getHP();
|
||||
|
||||
/**
|
||||
* Sets the stamina value.
|
||||
*
|
||||
* @param stamina the stamina value.
|
||||
*/
|
||||
void setStamina(int stamina);
|
||||
|
||||
/**
|
||||
* Returns the stamina value.
|
||||
*
|
||||
* @return the stamina.
|
||||
*/
|
||||
int getStamina();
|
||||
|
||||
/**
|
||||
* Sets the Ki value.
|
||||
*
|
||||
* @param ki Ki value.
|
||||
*/
|
||||
void setKi(int ki);
|
||||
|
||||
/**
|
||||
* Returns the Ki value.
|
||||
*
|
||||
* @return Ki of Player.
|
||||
*/
|
||||
int getKi();
|
||||
|
||||
/**
|
||||
* Sets the TP value.
|
||||
*
|
||||
* @param tp Set TP Amount
|
||||
*/
|
||||
void setTP(int tp);
|
||||
|
||||
/**
|
||||
* Returns the TP value.
|
||||
*
|
||||
* @return Player TP Amount
|
||||
*/
|
||||
int getTP();
|
||||
|
||||
/**
|
||||
* Sets the gravity for the player.
|
||||
*
|
||||
* @param gravity the gravity value.
|
||||
*/
|
||||
void setGravity(float gravity);
|
||||
|
||||
/**
|
||||
* Returns the current gravity value.
|
||||
*
|
||||
* @return the gravity.
|
||||
*/
|
||||
float getGravity();
|
||||
|
||||
/**
|
||||
* Checks if the player is blocking.
|
||||
*
|
||||
* @return true if blocking; false otherwise.
|
||||
*/
|
||||
boolean isBlocking();
|
||||
|
||||
/**
|
||||
* Sets the hair code used to define the player's hairstyle.
|
||||
*
|
||||
* @param hairCode the hair code string.
|
||||
*/
|
||||
void setHairCode(String hairCode);
|
||||
|
||||
/**
|
||||
* Returns the player's hair code.
|
||||
*
|
||||
* @return the hair code string.
|
||||
*/
|
||||
String getHairCode();
|
||||
|
||||
/**
|
||||
* Sets the extra code used for additional customization.
|
||||
*
|
||||
* @param extraCode the extra code string.
|
||||
*/
|
||||
void setExtraCode(String extraCode);
|
||||
|
||||
/**
|
||||
* Returns the player's extra code.
|
||||
*
|
||||
* @return the extra code string.
|
||||
*/
|
||||
String getExtraCode();
|
||||
|
||||
/**
|
||||
* Sets an item in the DBC extra inventory slot.
|
||||
* <p>
|
||||
* Slot definitions:
|
||||
* <ul>
|
||||
* <li>0 - Weight</li>
|
||||
* <li>1 - Body</li>
|
||||
* <li>2 - Head</li>
|
||||
* <li>3 - 4th Vanity Slot Down to the left</li>
|
||||
* <li>4 - 3rd Vanity Slot Down to the left</li>
|
||||
* <li>5 - 2nd Vanity Slot Down to the left</li>
|
||||
* <li>6 - 1st Vanity Slot Down to the left</li>
|
||||
* <li>7 - 4th Vanity Slot Down to the right</li>
|
||||
* <li>8 - 3rd Vanity Slot Down to the right</li>
|
||||
* <li>9 - 2nd Vanity Slot Down to the right</li>
|
||||
* <li>10 - 1st Vanity Slot Down to the right</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param itemStack the item to set (or null to remove).
|
||||
* @param slot the slot index.
|
||||
* @param vanity whether the slot is in the vanity inventory.
|
||||
*/
|
||||
void setItem(IItemStack itemStack, byte slot, boolean vanity);
|
||||
|
||||
/**
|
||||
* Retrieves the item from the specified DBC inventory slot.
|
||||
*
|
||||
* @param slot the slot index.
|
||||
* @param vanity whether the slot is in the vanity inventory.
|
||||
* @return the item stack, or null if empty.
|
||||
*/
|
||||
IItemStack getItem(byte slot, boolean vanity);
|
||||
|
||||
/**
|
||||
* Returns the entire DBC extra inventory.
|
||||
*
|
||||
* @return an array of item stacks.
|
||||
*/
|
||||
IItemStack[] getInventory();
|
||||
|
||||
/**
|
||||
* Sets the player's form.
|
||||
*
|
||||
* @param form the form value.
|
||||
*/
|
||||
void setForm(byte form);
|
||||
|
||||
/**
|
||||
* Returns the player's current form.
|
||||
*
|
||||
* @return the form value.
|
||||
*/
|
||||
byte getForm();
|
||||
|
||||
/**
|
||||
* Sets the player's secondary form.
|
||||
*
|
||||
* @param form2 the secondary form value.
|
||||
*/
|
||||
void setForm2(byte form2);
|
||||
|
||||
/**
|
||||
* Returns the player's secondary form.
|
||||
*
|
||||
* @return the secondary form value.
|
||||
*/
|
||||
byte getForm2();
|
||||
|
||||
/**
|
||||
* Returns the mastery value for a specific racial form.
|
||||
*
|
||||
* @param form the form index.
|
||||
* @return the mastery value.
|
||||
*/
|
||||
double getRacialFormMastery(byte form);
|
||||
|
||||
/**
|
||||
* Sets the mastery value for a specific racial form.
|
||||
*
|
||||
* @param form the form index.
|
||||
* @param value the new mastery value.
|
||||
*/
|
||||
void setRacialFormMastery(byte form, double value);
|
||||
|
||||
/**
|
||||
* Adds to the mastery value for a specific racial form.
|
||||
*
|
||||
* @param form the form index.
|
||||
* @param value the value to add.
|
||||
*/
|
||||
void addRacialFormMastery(byte form, double value);
|
||||
|
||||
/**
|
||||
* Returns the mastery value for a non-racial (other) form.
|
||||
*
|
||||
* @param formName the name of the form.
|
||||
* @return the mastery value.
|
||||
*/
|
||||
double getOtherFormMastery(String formName);
|
||||
|
||||
/**
|
||||
* Sets the mastery value for a non-racial (other) form.
|
||||
*
|
||||
* @param formName the name of the form.
|
||||
* @param value the new mastery value.
|
||||
*/
|
||||
void setOtherFormMastery(String formName, double value);
|
||||
|
||||
/**
|
||||
* Adds to the mastery value for a non-racial (other) form.
|
||||
*
|
||||
* @param formName the name of the form.
|
||||
* @param value the value to add.
|
||||
*/
|
||||
void addOtherFormMastery(String formName, double value);
|
||||
|
||||
/**
|
||||
* Sets the player's power points.
|
||||
*
|
||||
* @param points the power points.
|
||||
*/
|
||||
void setPowerPoints(int points);
|
||||
|
||||
/**
|
||||
* Returns the player's power points.
|
||||
*
|
||||
* @return the power points.
|
||||
*/
|
||||
int getPowerPoints();
|
||||
|
||||
/**
|
||||
* Sets the player's aura color.
|
||||
*
|
||||
* @param color the aura color.
|
||||
*/
|
||||
void setAuraColor(int color);
|
||||
|
||||
/**
|
||||
* Returns the player's aura color.
|
||||
*
|
||||
* @return the aura color.
|
||||
*/
|
||||
int getAuraColor();
|
||||
|
||||
/**
|
||||
* Sets the player's form level.
|
||||
*
|
||||
* @param level the form level.
|
||||
*/
|
||||
void setFormLevel(int level);
|
||||
|
||||
/**
|
||||
* Returns the player's form level.
|
||||
*
|
||||
* @return the form level.
|
||||
*/
|
||||
int getFormLevel();
|
||||
|
||||
/**
|
||||
* Sets the player's skills.
|
||||
*
|
||||
* @param skills a string representing the player's skills.
|
||||
*/
|
||||
void setSkills(String skills);
|
||||
|
||||
/**
|
||||
* Returns the player's skills.
|
||||
*
|
||||
* @return a string representing the player's skills.
|
||||
*/
|
||||
String getSkills();
|
||||
|
||||
/**
|
||||
* Sets the player's status effects.
|
||||
*
|
||||
* @param statusEffects a string representing status effects.
|
||||
*/
|
||||
void setJRMCSE(String statusEffects);
|
||||
|
||||
/**
|
||||
* Returns the player's status effects.
|
||||
*
|
||||
* @return a string representing the player's status effects.
|
||||
*/
|
||||
String getJRMCSE();
|
||||
|
||||
/**
|
||||
* Sets the player's race.
|
||||
*
|
||||
* @param race the race value.
|
||||
*/
|
||||
void setRace(byte race);
|
||||
|
||||
/**
|
||||
* Returns the player's race.
|
||||
*
|
||||
* @return the race value.
|
||||
*/
|
||||
int getRace();
|
||||
|
||||
/**
|
||||
* Sets the player's DBC class.
|
||||
*
|
||||
* @param dbcClass the DBC class value.
|
||||
*/
|
||||
void setDBCClass(byte dbcClass);
|
||||
|
||||
/**
|
||||
* Returns the player's DBC class.
|
||||
*
|
||||
* @return the DBC class.
|
||||
*/
|
||||
byte getDBCClass();
|
||||
|
||||
/**
|
||||
* Sets the player's power type.
|
||||
*
|
||||
* @param powerType the power type.
|
||||
*/
|
||||
void setPowerType(byte powerType);
|
||||
|
||||
/**
|
||||
* Returns the player's power type.
|
||||
*
|
||||
* @return the power type.
|
||||
*/
|
||||
int getPowerType();
|
||||
|
||||
/**
|
||||
* Returns the player's kill count for a given type.
|
||||
*
|
||||
* @param type the kill count type ("evil", "good", "neutral", or "all").
|
||||
* @return the kill count.
|
||||
*/
|
||||
int getKillCount(String type);
|
||||
|
||||
/**
|
||||
* Returns the fusion string for the player.
|
||||
*
|
||||
* @return the fusion string.
|
||||
*/
|
||||
String getFusionString();
|
||||
}
|
||||
@@ -1,370 +1,602 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.IParticle;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IEntity<T extends Entity> {
|
||||
|
||||
void spawnParticle(IParticle entityParticle);
|
||||
|
||||
int getEntityId();
|
||||
|
||||
String getUniqueID();
|
||||
|
||||
double getYOffset();
|
||||
|
||||
/**
|
||||
* @return The entities width
|
||||
*/
|
||||
double getWidth();
|
||||
|
||||
/**
|
||||
* @return The entities height
|
||||
*/
|
||||
double getHeight();
|
||||
|
||||
/**
|
||||
* @return The entities x position
|
||||
*/
|
||||
double getX();
|
||||
|
||||
/**
|
||||
* @param x The entities x position
|
||||
*/
|
||||
void setX(double x);
|
||||
|
||||
/**
|
||||
* @return The entities y position
|
||||
*/
|
||||
double getY();
|
||||
|
||||
/**
|
||||
* @param y The entities y position
|
||||
*/
|
||||
void setY(double y);
|
||||
|
||||
/**
|
||||
* @return The entities x position
|
||||
*/
|
||||
double getZ();
|
||||
|
||||
/**
|
||||
* @param z The entities x position
|
||||
*/
|
||||
void setZ(double z);
|
||||
|
||||
/**
|
||||
* @return The entities z motion
|
||||
*/
|
||||
double getMotionX();
|
||||
|
||||
/**
|
||||
* @param x The entities x motion
|
||||
*/
|
||||
void setMotionX(double x);
|
||||
|
||||
/**
|
||||
* @return The entities x motion
|
||||
*/
|
||||
double getMotionY();
|
||||
|
||||
/**
|
||||
* @param y The entities y motion
|
||||
*/
|
||||
void setMotionY(double y);
|
||||
|
||||
/**
|
||||
* @return The entities y motion
|
||||
*/
|
||||
double getMotionZ();
|
||||
|
||||
/**
|
||||
* @param z The entities z motion
|
||||
*/
|
||||
void setMotionZ(double z);
|
||||
|
||||
void setMotion(double x, double y, double z);
|
||||
|
||||
void setMotion(IPos pos);
|
||||
|
||||
IPos getMotion();
|
||||
|
||||
boolean isAirborne();
|
||||
|
||||
/**
|
||||
* @return The block x position
|
||||
*/
|
||||
int getBlockX();
|
||||
|
||||
/**
|
||||
* @return The block y position
|
||||
*/
|
||||
int getBlockY();
|
||||
|
||||
/**
|
||||
* @return The block z position
|
||||
*/
|
||||
int getBlockZ();
|
||||
|
||||
/**
|
||||
* @param x The x position
|
||||
* @param y The y position
|
||||
* @param z The z position
|
||||
*/
|
||||
void setPosition(double x, double y, double z);
|
||||
|
||||
void setPosition(IPos pos);
|
||||
|
||||
IPos getPosition();
|
||||
|
||||
int getDimension();
|
||||
|
||||
void setDimension(int dimensionId);
|
||||
|
||||
/**
|
||||
* @param range The search range for entities around this entity
|
||||
* @return Array of entities within range
|
||||
*/
|
||||
IEntity[] getSurroundingEntities(int range);
|
||||
|
||||
/**
|
||||
* @param range The search range for entities around this entity
|
||||
* @param type The EntityType you want to find
|
||||
* @return Array of entities within range
|
||||
*/
|
||||
IEntity[] getSurroundingEntities(int range, int type);
|
||||
|
||||
/**
|
||||
* @return Whether the entity is alive or not
|
||||
*/
|
||||
boolean isAlive();
|
||||
|
||||
/**
|
||||
* @param key Get temp data for this key
|
||||
* @return Returns the stored temp data
|
||||
*/
|
||||
Object getTempData(String key);
|
||||
|
||||
/**
|
||||
* Tempdata gets cleared when the entity gets unloaded or the world restarts
|
||||
* @param key The key for the data stored
|
||||
* @param value The data stored
|
||||
*/
|
||||
void setTempData(String key, Object value);
|
||||
|
||||
/**
|
||||
* @param key The key thats going to be tested against the temp data
|
||||
* @return Whether or not temp data containes the key
|
||||
*/
|
||||
boolean hasTempData(String key);
|
||||
|
||||
/**
|
||||
* @param key The key for the temp data to be removed
|
||||
*/
|
||||
void removeTempData(String key);
|
||||
|
||||
/**
|
||||
* Remove all tempdata
|
||||
*/
|
||||
void clearTempData();
|
||||
|
||||
String[] getTempDataKeys();
|
||||
|
||||
/**
|
||||
* @param key The key of the data to be returned
|
||||
* @return Returns the stored data
|
||||
*/
|
||||
Object getStoredData(String key);
|
||||
|
||||
/**
|
||||
* Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved
|
||||
* @param key The key for the data stored
|
||||
* @param value The data stored. This data can be either a Number or a String. Other data is not stored
|
||||
*/
|
||||
void setStoredData(String key, Object value);
|
||||
|
||||
/**
|
||||
* @param key The key of the data to be checked
|
||||
* @return Returns whether or not the stored data contains the key
|
||||
*/
|
||||
boolean hasStoredData(String key);
|
||||
|
||||
/**
|
||||
* @param key The key of the data to be removed
|
||||
*/
|
||||
void removeStoredData(String key);
|
||||
|
||||
/**
|
||||
* Remove all stored data
|
||||
*/
|
||||
void clearStoredData();
|
||||
|
||||
String[] getStoredDataKeys();
|
||||
|
||||
/**
|
||||
* @return The age of this entity in ticks
|
||||
*/
|
||||
long getAge();
|
||||
|
||||
/**
|
||||
* Despawns this entity. Removes it permanently
|
||||
*/
|
||||
void despawn();
|
||||
|
||||
/**
|
||||
* @return Return whether or not this entity is standing in water
|
||||
*/
|
||||
boolean inWater();
|
||||
|
||||
/**
|
||||
* @return Return whether or not this entity is standing in lava
|
||||
*/
|
||||
boolean inLava();
|
||||
|
||||
/**
|
||||
* @return Return whether or not this entity is standing in fire
|
||||
*/
|
||||
boolean inFire();
|
||||
|
||||
/**
|
||||
* @return Return whether or not this entity is on fire
|
||||
*/
|
||||
boolean isBurning();
|
||||
|
||||
/**
|
||||
* @param ticks Amount of world ticks this entity will burn. 20 ticks equals 1 second
|
||||
*/
|
||||
void setBurning(int ticks);
|
||||
|
||||
/**
|
||||
* Removes fire from this entity
|
||||
*/
|
||||
void extinguish();
|
||||
|
||||
/**
|
||||
* @return Name as which it's registered in minecraft
|
||||
*/
|
||||
String getTypeName();
|
||||
|
||||
/**
|
||||
* @param item Item to be dropped
|
||||
*/
|
||||
void dropItem(IItemStack item);
|
||||
|
||||
/**
|
||||
* @return Return the rider
|
||||
*/
|
||||
IEntity getRider();
|
||||
|
||||
/**
|
||||
* @param entity The entity to ride this entity
|
||||
*/
|
||||
void setRider(IEntity entity);
|
||||
|
||||
/**
|
||||
* @return Return the entity, this entity is riding
|
||||
*/
|
||||
IEntity getMount();
|
||||
|
||||
/**
|
||||
* @param entity The entity this entity will mount
|
||||
*/
|
||||
void setMount(IEntity entity);
|
||||
|
||||
/**
|
||||
* @see noppes.npcs.scripted.constants.EntityType
|
||||
* @return Returns the EntityType of this entity
|
||||
*/
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param type @EntityType to check
|
||||
* @return Returns whether the entity is type of the given @EntityType
|
||||
*/
|
||||
boolean typeOf(int type);
|
||||
|
||||
/**
|
||||
* @param rotation The rotation to be set (0-360)
|
||||
*/
|
||||
void setRotation(float rotation);
|
||||
|
||||
void setRotation(float rotationYaw, float rotationPitch);
|
||||
|
||||
/**
|
||||
* @return Current rotation of the npc
|
||||
*/
|
||||
float getRotation();
|
||||
|
||||
public void setPitch(float pitch);
|
||||
|
||||
public float getPitch();
|
||||
|
||||
/**
|
||||
* @param power How strong the knockback is
|
||||
* @param direction The direction in which he flies back (0-360). Usually based on getRotation()
|
||||
*/
|
||||
void knockback(int power, float direction);
|
||||
|
||||
void knockback(double xpower, double ypower, double zpower, float direction);
|
||||
void knockback(IPos pos, float direction);
|
||||
|
||||
void setImmune(int ticks);
|
||||
|
||||
public void setInvisible(boolean invisible);
|
||||
|
||||
public void setSneaking(boolean sneaking);
|
||||
|
||||
public void setSprinting(boolean sprinting);
|
||||
|
||||
boolean hasCollided();
|
||||
|
||||
boolean hasCollidedVertically();
|
||||
|
||||
boolean hasCollidedHorizontally();
|
||||
|
||||
boolean capturesDrops();
|
||||
|
||||
void setCapturesDrops(boolean capture);
|
||||
|
||||
void setCapturedDrops(IEntity<?>[] capturedDrops);
|
||||
|
||||
IEntity<?>[] getCapturedDrops();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not this entity is sneaking
|
||||
*/
|
||||
boolean isSneaking();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not this entity is sprinting
|
||||
*/
|
||||
boolean isSprinting();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* Expert users only
|
||||
* @return Returns minecrafts entity
|
||||
*/
|
||||
T getMCEntity();
|
||||
|
||||
public INbt getNbt();
|
||||
|
||||
public INbt getAllNbt();
|
||||
|
||||
public void setNbt(INbt nbt);
|
||||
|
||||
INbt getNbtOptional();
|
||||
|
||||
void storeAsClone(int tab, String name);
|
||||
|
||||
IWorld getWorld();
|
||||
|
||||
void updateEntity();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.IParticle;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents a generic entity in the world.
|
||||
* Provides methods to access or modify the entity's position, motion, temporary and persistent data,
|
||||
* and to perform various actions (such as spawning particles, dropping items, or changing dimensions).
|
||||
*
|
||||
* @param <T> The underlying Minecraft entity type.
|
||||
*/
|
||||
public interface IEntity<T extends Entity> {
|
||||
|
||||
/**
|
||||
* Spawns the given particle effect associated with this entity.
|
||||
*
|
||||
* @param entityParticle The particle effect to spawn.
|
||||
*/
|
||||
void spawnParticle(IParticle entityParticle);
|
||||
|
||||
/**
|
||||
* Returns the unique entity ID.
|
||||
*
|
||||
* @return the entity ID.
|
||||
*/
|
||||
int getEntityId();
|
||||
|
||||
/**
|
||||
* Returns the unique UUID string of the entity.
|
||||
*
|
||||
* @return the unique ID.
|
||||
*/
|
||||
String getUniqueID();
|
||||
|
||||
/**
|
||||
* Returns the vertical offset for rendering.
|
||||
*
|
||||
* @return the Y offset.
|
||||
*/
|
||||
double getYOffset();
|
||||
|
||||
/**
|
||||
* @return The entity's width.
|
||||
*/
|
||||
double getWidth();
|
||||
|
||||
/**
|
||||
* @return The entity's height.
|
||||
*/
|
||||
double getHeight();
|
||||
|
||||
/**
|
||||
* @return The entity's x position.
|
||||
*/
|
||||
double getX();
|
||||
|
||||
/**
|
||||
* Sets the entity's x position.
|
||||
*
|
||||
* @param x the new x position.
|
||||
*/
|
||||
void setX(double x);
|
||||
|
||||
/**
|
||||
* @return The entity's y position.
|
||||
*/
|
||||
double getY();
|
||||
|
||||
/**
|
||||
* Sets the entity's y position.
|
||||
*
|
||||
* @param y the new y position.
|
||||
*/
|
||||
void setY(double y);
|
||||
|
||||
/**
|
||||
* @return The entity's z position.
|
||||
*/
|
||||
double getZ();
|
||||
|
||||
/**
|
||||
* Sets the entity's z position.
|
||||
*
|
||||
* @param z the new z position.
|
||||
*/
|
||||
void setZ(double z);
|
||||
|
||||
/**
|
||||
* @return The entity's x motion.
|
||||
*/
|
||||
double getMotionX();
|
||||
|
||||
/**
|
||||
* Sets the entity's x motion.
|
||||
*
|
||||
* @param x the new x motion.
|
||||
*/
|
||||
void setMotionX(double x);
|
||||
|
||||
/**
|
||||
* @return The entity's y motion.
|
||||
*/
|
||||
double getMotionY();
|
||||
|
||||
/**
|
||||
* Sets the entity's y motion.
|
||||
*
|
||||
* @param y the new y motion.
|
||||
*/
|
||||
void setMotionY(double y);
|
||||
|
||||
/**
|
||||
* @return The entity's z motion.
|
||||
*/
|
||||
double getMotionZ();
|
||||
|
||||
/**
|
||||
* Sets the entity's z motion.
|
||||
*
|
||||
* @param z the new z motion.
|
||||
*/
|
||||
void setMotionZ(double z);
|
||||
|
||||
/**
|
||||
* Convenience method to set the entity's motion in all three axes.
|
||||
*
|
||||
* @param x the x motion.
|
||||
* @param y the y motion.
|
||||
* @param z the z motion.
|
||||
*/
|
||||
void setMotion(double x, double y, double z);
|
||||
|
||||
/**
|
||||
* Sets the entity's motion based on the given position.
|
||||
*
|
||||
* @param pos the position containing motion components.
|
||||
*/
|
||||
void setMotion(IPos pos);
|
||||
|
||||
/**
|
||||
* Returns the entity's current motion as an IPos object.
|
||||
*
|
||||
* @return the motion vector.
|
||||
*/
|
||||
IPos getMotion();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is airborne.
|
||||
*/
|
||||
boolean isAirborne();
|
||||
|
||||
/**
|
||||
* @return The block (integer) x position.
|
||||
*/
|
||||
int getBlockX();
|
||||
|
||||
/**
|
||||
* @return The block (integer) y position.
|
||||
*/
|
||||
int getBlockY();
|
||||
|
||||
/**
|
||||
* @return The block (integer) z position.
|
||||
*/
|
||||
int getBlockZ();
|
||||
|
||||
/**
|
||||
* Sets the entity's position to the specified coordinates.
|
||||
*
|
||||
* @param x the x coordinate.
|
||||
* @param y the y coordinate.
|
||||
* @param z the z coordinate.
|
||||
*/
|
||||
void setPosition(double x, double y, double z);
|
||||
|
||||
/**
|
||||
* Sets the entity's position using an IPos object.
|
||||
*
|
||||
* @param pos the position object.
|
||||
*/
|
||||
void setPosition(IPos pos);
|
||||
|
||||
/**
|
||||
* Returns the entity's current position as an IPos object.
|
||||
*
|
||||
* @return the position.
|
||||
*/
|
||||
IPos getPosition();
|
||||
|
||||
/**
|
||||
* @return The dimension ID the entity is in.
|
||||
*/
|
||||
int getDimension();
|
||||
|
||||
/**
|
||||
* Moves the entity to the specified dimension.
|
||||
*
|
||||
* @param dimensionId the dimension ID.
|
||||
*/
|
||||
void setDimension(int dimensionId);
|
||||
|
||||
/**
|
||||
* Returns an array of entities within the specified range.
|
||||
*
|
||||
* @param range the search range.
|
||||
* @return an array of surrounding entities.
|
||||
*/
|
||||
IEntity[] getSurroundingEntities(int range);
|
||||
|
||||
/**
|
||||
* Returns an array of entities of a specified type within the given range.
|
||||
*
|
||||
* @param range the search range.
|
||||
* @param type the EntityType to find.
|
||||
* @return an array of surrounding entities.
|
||||
*/
|
||||
IEntity[] getSurroundingEntities(int range, int type);
|
||||
|
||||
/**
|
||||
* @return Whether the entity is alive.
|
||||
*/
|
||||
boolean isAlive();
|
||||
|
||||
/**
|
||||
* Returns temporary data stored under the given key.
|
||||
*
|
||||
* @param key the key.
|
||||
* @return the temporary data.
|
||||
*/
|
||||
Object getTempData(String key);
|
||||
|
||||
/**
|
||||
* Stores temporary data that is cleared when the entity is unloaded.
|
||||
*
|
||||
* @param key the key.
|
||||
* @param value the value.
|
||||
*/
|
||||
void setTempData(String key, Object value);
|
||||
|
||||
/**
|
||||
* Checks if temporary data for the given key exists.
|
||||
*
|
||||
* @param key the key.
|
||||
* @return true if it exists; false otherwise.
|
||||
*/
|
||||
boolean hasTempData(String key);
|
||||
|
||||
/**
|
||||
* Removes the temporary data for the given key.
|
||||
*
|
||||
* @param key the key.
|
||||
*/
|
||||
void removeTempData(String key);
|
||||
|
||||
/**
|
||||
* Clears all temporary data.
|
||||
*/
|
||||
void clearTempData();
|
||||
|
||||
/**
|
||||
* Returns an array of keys for temporary data.
|
||||
*
|
||||
* @return the keys.
|
||||
*/
|
||||
String[] getTempDataKeys();
|
||||
|
||||
/**
|
||||
* Returns stored (persistent) data for the given key.
|
||||
*
|
||||
* @param key the key.
|
||||
* @return the stored data.
|
||||
*/
|
||||
Object getStoredData(String key);
|
||||
|
||||
/**
|
||||
* Stores persistent data under the given key.
|
||||
* Only Numbers and Strings are supported.
|
||||
*
|
||||
* @param key the key.
|
||||
* @param value the value.
|
||||
*/
|
||||
void setStoredData(String key, Object value);
|
||||
|
||||
/**
|
||||
* Checks if stored data for the given key exists.
|
||||
*
|
||||
* @param key the key.
|
||||
* @return true if it exists; false otherwise.
|
||||
*/
|
||||
boolean hasStoredData(String key);
|
||||
|
||||
/**
|
||||
* Removes the stored data for the given key.
|
||||
*
|
||||
* @param key the key.
|
||||
*/
|
||||
void removeStoredData(String key);
|
||||
|
||||
/**
|
||||
* Clears all stored data.
|
||||
*/
|
||||
void clearStoredData();
|
||||
|
||||
/**
|
||||
* Returns an array of keys for stored data.
|
||||
*
|
||||
* @return the keys.
|
||||
*/
|
||||
String[] getStoredDataKeys();
|
||||
|
||||
/**
|
||||
* @return The age of the entity in ticks.
|
||||
*/
|
||||
long getAge();
|
||||
|
||||
/**
|
||||
* Permanently despawns the entity.
|
||||
*/
|
||||
void despawn();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is standing in water.
|
||||
*/
|
||||
boolean inWater();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is standing in lava.
|
||||
*/
|
||||
boolean inLava();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is standing in fire.
|
||||
*/
|
||||
boolean inFire();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is on fire.
|
||||
*/
|
||||
boolean isBurning();
|
||||
|
||||
/**
|
||||
* Sets the entity on fire for the given number of ticks (20 ticks = 1 second).
|
||||
*
|
||||
* @param ticks the burn duration.
|
||||
*/
|
||||
void setBurning(int ticks);
|
||||
|
||||
/**
|
||||
* Extinguishes any fire on the entity.
|
||||
*/
|
||||
void extinguish();
|
||||
|
||||
/**
|
||||
* @return The entity type name as registered in Minecraft.
|
||||
*/
|
||||
String getTypeName();
|
||||
|
||||
/**
|
||||
* Causes the entity to drop the given item.
|
||||
*
|
||||
* @param item the item to drop.
|
||||
*/
|
||||
void dropItem(IItemStack item);
|
||||
|
||||
/**
|
||||
* @return The entity riding this entity.
|
||||
*/
|
||||
IEntity getRider();
|
||||
|
||||
/**
|
||||
* Sets the given entity as the rider of this entity.
|
||||
*
|
||||
* @param entity the rider.
|
||||
*/
|
||||
void setRider(IEntity entity);
|
||||
|
||||
/**
|
||||
* @return The entity this entity is riding.
|
||||
*/
|
||||
IEntity getMount();
|
||||
|
||||
/**
|
||||
* Sets the entity to be mounted by this entity.
|
||||
*
|
||||
* @param entity the mount.
|
||||
*/
|
||||
void setMount(IEntity entity);
|
||||
|
||||
/**
|
||||
* Returns the EntityType as defined in the scripting constants.
|
||||
*
|
||||
* @return the EntityType.
|
||||
*/
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* Checks whether the entity is of the specified EntityType.
|
||||
*
|
||||
* @param type the type to check.
|
||||
* @return true if the entity is of that type; false otherwise.
|
||||
*/
|
||||
boolean typeOf(int type);
|
||||
|
||||
/**
|
||||
* Sets the entity's rotation (yaw) in degrees (0-360).
|
||||
*
|
||||
* @param rotation the rotation angle.
|
||||
*/
|
||||
void setRotation(float rotation);
|
||||
|
||||
/**
|
||||
* Sets both the rotation (yaw) and pitch of the entity.
|
||||
*
|
||||
* @param rotationYaw the yaw angle.
|
||||
* @param rotationPitch the pitch angle.
|
||||
*/
|
||||
void setRotation(float rotationYaw, float rotationPitch);
|
||||
|
||||
/**
|
||||
* @return The current rotation (yaw) of the entity.
|
||||
*/
|
||||
float getRotation();
|
||||
|
||||
/**
|
||||
* Sets the entity's pitch.
|
||||
*
|
||||
* @param pitch the pitch angle.
|
||||
*/
|
||||
void setPitch(float pitch);
|
||||
|
||||
/**
|
||||
* Returns the entity's pitch.
|
||||
*
|
||||
* @return the pitch angle.
|
||||
*/
|
||||
float getPitch();
|
||||
|
||||
/**
|
||||
* Applies a knockback effect to the entity.
|
||||
*
|
||||
* @param power the strength of the knockback.
|
||||
* @param direction the direction in degrees (usually based on getRotation()).
|
||||
*/
|
||||
void knockback(int power, float direction);
|
||||
|
||||
/**
|
||||
* Applies knockback using individual power components.
|
||||
*
|
||||
* @param xpower the x-axis power.
|
||||
* @param ypower the y-axis power.
|
||||
* @param zpower the z-axis power.
|
||||
* @param direction the direction in degrees.
|
||||
*/
|
||||
void knockback(double xpower, double ypower, double zpower, float direction);
|
||||
|
||||
/**
|
||||
* Applies knockback using a position vector.
|
||||
*
|
||||
* @param pos the position vector.
|
||||
* @param direction the direction in degrees.
|
||||
*/
|
||||
void knockback(IPos pos, float direction);
|
||||
|
||||
/**
|
||||
* Sets the entity's immunity time (hurt resistance).
|
||||
*
|
||||
* @param ticks the number of ticks.
|
||||
*/
|
||||
void setImmune(int ticks);
|
||||
|
||||
/**
|
||||
* Sets the entity's invisibility.
|
||||
*
|
||||
* @param invisible true to make invisible.
|
||||
*/
|
||||
void setInvisible(boolean invisible);
|
||||
|
||||
/**
|
||||
* Sets whether the entity is sneaking.
|
||||
*
|
||||
* @param sneaking true to enable sneaking.
|
||||
*/
|
||||
void setSneaking(boolean sneaking);
|
||||
|
||||
/**
|
||||
* Sets whether the entity is sprinting.
|
||||
*
|
||||
* @param sprinting true to enable sprinting.
|
||||
*/
|
||||
void setSprinting(boolean sprinting);
|
||||
|
||||
/**
|
||||
* @return Whether the entity has collided with something.
|
||||
*/
|
||||
boolean hasCollided();
|
||||
|
||||
/**
|
||||
* @return Whether the entity has collided vertically.
|
||||
*/
|
||||
boolean hasCollidedVertically();
|
||||
|
||||
/**
|
||||
* @return Whether the entity has collided horizontally.
|
||||
*/
|
||||
boolean hasCollidedHorizontally();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is capturing drops.
|
||||
*/
|
||||
boolean capturesDrops();
|
||||
|
||||
/**
|
||||
* Sets whether the entity captures drops.
|
||||
*
|
||||
* @param capture true to capture drops.
|
||||
*/
|
||||
void setCapturesDrops(boolean capture);
|
||||
|
||||
/**
|
||||
* Sets the captured drops for this entity.
|
||||
*
|
||||
* @param capturedDrops an array of captured drops.
|
||||
*/
|
||||
void setCapturedDrops(IEntity<?>[] capturedDrops);
|
||||
|
||||
/**
|
||||
* Returns the captured drops.
|
||||
*
|
||||
* @return an array of captured drops.
|
||||
*/
|
||||
IEntity<?>[] getCapturedDrops();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is sneaking.
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
boolean isSneaking();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is sprinting.
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
boolean isSprinting();
|
||||
|
||||
/**
|
||||
* Expert users only.
|
||||
*
|
||||
* @return The underlying Minecraft entity.
|
||||
*/
|
||||
T getMCEntity();
|
||||
|
||||
/**
|
||||
* Returns the entity's NBT data.
|
||||
*
|
||||
* @return the NBT data.
|
||||
*/
|
||||
INbt getNbt();
|
||||
|
||||
/**
|
||||
* Returns all NBT data for the entity.
|
||||
*
|
||||
* @return the complete NBT data.
|
||||
*/
|
||||
INbt getAllNbt();
|
||||
|
||||
/**
|
||||
* Applies the given NBT data to the entity.
|
||||
*
|
||||
* @param nbt the NBT data.
|
||||
*/
|
||||
void setNbt(INbt nbt);
|
||||
|
||||
/**
|
||||
* Returns optional NBT data if available.
|
||||
*
|
||||
* @return the optional NBT data, or null if none.
|
||||
*/
|
||||
INbt getNbtOptional();
|
||||
|
||||
/**
|
||||
* Stores the entity as a clone with the given tab and name.
|
||||
*
|
||||
* @param tab the tab index.
|
||||
* @param name the name for the clone.
|
||||
*/
|
||||
void storeAsClone(int tab, String name);
|
||||
|
||||
/**
|
||||
* @return The world this entity exists in.
|
||||
*/
|
||||
IWorld getWorld();
|
||||
|
||||
/**
|
||||
* Updates the entity's state.
|
||||
*/
|
||||
void updateEntity();
|
||||
}
|
||||
@@ -1,56 +1,91 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IEntityItem<T extends EntityItem> extends IEntity<T> {
|
||||
|
||||
/**
|
||||
* @return The owner of the item, only the owner can pick the item up
|
||||
*/
|
||||
public String getOwner();
|
||||
|
||||
/**
|
||||
* @param name The owner of the item, only the owner can pick up the item
|
||||
* (note that the item can also be picked up if the lifetime - age is equal or smaller than 200)
|
||||
*/
|
||||
public void setOwner(String name);
|
||||
|
||||
public String getThrower();
|
||||
|
||||
public void setThrower(String name);
|
||||
|
||||
/**
|
||||
* @return Ticks remaining before it can be picked up (32767 is infinite)
|
||||
*/
|
||||
public int getPickupDelay();
|
||||
|
||||
/**
|
||||
* @param delay Delay before the item can be picked up (32767 is infinite delay)
|
||||
*/
|
||||
public void setPickupDelay(int delay);
|
||||
|
||||
/**
|
||||
* @return Returns the age of the item
|
||||
*/
|
||||
public long getAge();
|
||||
|
||||
/**
|
||||
* @param age Age of the item (-32767 is infinite age)
|
||||
*/
|
||||
public void setAge(long age);
|
||||
|
||||
/**
|
||||
* @return When the age reaches this the item despawns
|
||||
*/
|
||||
public int getLifeSpawn();
|
||||
|
||||
/**
|
||||
* @param age Age at which the item despawns
|
||||
*/
|
||||
public void setLifeSpawn(int age);
|
||||
|
||||
public IItemStack getItem();
|
||||
|
||||
public void setItem(IItemStack item);
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents an item entity in the world.
|
||||
* Provides methods to manage pickup delay, age, ownership, and the contained item.
|
||||
*
|
||||
* @param <T> The underlying Minecraft EntityItem type.
|
||||
*/
|
||||
public interface IEntityItem<T extends EntityItem> extends IEntity<T> {
|
||||
|
||||
/**
|
||||
* Returns the owner name of the item.
|
||||
* Only the owner can pick the item up (unless the age is very low).
|
||||
*
|
||||
* @return the owner's name.
|
||||
*/
|
||||
String getOwner();
|
||||
|
||||
/**
|
||||
* Sets the owner name of the item.
|
||||
*
|
||||
* @param name the owner's name.
|
||||
*/
|
||||
void setOwner(String name);
|
||||
|
||||
/**
|
||||
* Returns the thrower (entity that threw the item).
|
||||
*
|
||||
* @return the thrower's name.
|
||||
*/
|
||||
String getThrower();
|
||||
|
||||
/**
|
||||
* Sets the thrower (entity that threw the item).
|
||||
*
|
||||
* @param name the thrower's name.
|
||||
*/
|
||||
void setThrower(String name);
|
||||
|
||||
/**
|
||||
* @return Ticks remaining before the item can be picked up.
|
||||
* (32767 indicates an infinite delay.)
|
||||
*/
|
||||
int getPickupDelay();
|
||||
|
||||
/**
|
||||
* Sets the delay before the item can be picked up.
|
||||
*
|
||||
* @param delay the pickup delay in ticks (32767 for infinite delay).
|
||||
*/
|
||||
void setPickupDelay(int delay);
|
||||
|
||||
/**
|
||||
* @return The age of the item in ticks.
|
||||
*/
|
||||
long getAge();
|
||||
|
||||
/**
|
||||
* Sets the age of the item.
|
||||
*
|
||||
* @param age the new age (−32767 indicates infinite age).
|
||||
*/
|
||||
void setAge(long age);
|
||||
|
||||
/**
|
||||
* @return The lifespan threshold; when the age reaches this, the item despawns.
|
||||
*/
|
||||
int getLifeSpawn();
|
||||
|
||||
/**
|
||||
* Sets the age threshold at which the item will despawn.
|
||||
*
|
||||
* @param age the lifespan in ticks.
|
||||
*/
|
||||
void setLifeSpawn(int age);
|
||||
|
||||
/**
|
||||
* @return The item contained in this entity.
|
||||
*/
|
||||
IItemStack getItem();
|
||||
|
||||
/**
|
||||
* Sets the item contained in this entity.
|
||||
*
|
||||
* @param item the item to set.
|
||||
*/
|
||||
void setItem(IItemStack item);
|
||||
}
|
||||
@@ -1,51 +1,156 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
|
||||
public interface IEntityLiving<T extends EntityLiving> extends IEntityLivingBase<T> {
|
||||
boolean isNavigating();
|
||||
|
||||
void clearNavigation();
|
||||
|
||||
void navigateTo(double var1, double var3, double var5, double var7);
|
||||
|
||||
T getMCEntity();
|
||||
|
||||
void playLivingSound();
|
||||
|
||||
void spawnExplosionParticle();
|
||||
|
||||
void setMoveForward(float speed);
|
||||
|
||||
void faceEntity(IEntity entity, float pitch, float yaw);
|
||||
|
||||
boolean canPickUpLoot();
|
||||
|
||||
void setCanPickUpLoot(boolean pickUp);
|
||||
|
||||
boolean isPersistent();
|
||||
|
||||
void enablePersistence();
|
||||
|
||||
void setCustomNameTag(String text);
|
||||
|
||||
String getCustomNameTag();
|
||||
|
||||
boolean hasCustomNameTag();
|
||||
|
||||
void setAlwaysRenderNameTag(boolean alwaysRender);
|
||||
|
||||
boolean getAlwaysRenderNameTag();
|
||||
|
||||
void clearLeashed(boolean sendPacket, boolean dropLeash);
|
||||
|
||||
boolean allowLeashing();
|
||||
|
||||
boolean getLeashed();
|
||||
|
||||
IEntity getLeashedTo();
|
||||
|
||||
void setLeashedTo(IEntity entity, boolean sendPacket);
|
||||
|
||||
boolean canBeSteered();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
|
||||
/**
|
||||
* Represents a living entity (mob, NPC, etc.) that extends the base living functionality.
|
||||
* Provides additional methods for navigation, sound, custom name, leashing, and more.
|
||||
*
|
||||
* @param <T> The underlying Minecraft EntityLiving type.
|
||||
*/
|
||||
public interface IEntityLiving<T extends EntityLiving> extends IEntityLivingBase<T> {
|
||||
|
||||
/**
|
||||
* Checks if the entity is currently navigating (pathfinding).
|
||||
*
|
||||
* @return true if navigating; false otherwise.
|
||||
*/
|
||||
boolean isNavigating();
|
||||
|
||||
/**
|
||||
* Clears the current navigation path.
|
||||
*/
|
||||
void clearNavigation();
|
||||
|
||||
/**
|
||||
* Commands the entity to navigate toward the specified destination.
|
||||
*
|
||||
* @param x Destination x coordinate.
|
||||
* @param y Destination y coordinate.
|
||||
* @param z Destination z coordinate.
|
||||
* @param speed Movement speed (0.7 is default).
|
||||
*/
|
||||
void navigateTo(double x, double y, double z, double speed);
|
||||
|
||||
/**
|
||||
* Returns the underlying Minecraft entity.
|
||||
*
|
||||
* @return the Minecraft entity.
|
||||
*/
|
||||
T getMCEntity();
|
||||
|
||||
/**
|
||||
* Plays the entity's living sound.
|
||||
*/
|
||||
void playLivingSound();
|
||||
|
||||
/**
|
||||
* Spawns explosion particles for this entity.
|
||||
*/
|
||||
void spawnExplosionParticle();
|
||||
|
||||
/**
|
||||
* Sets the forward movement speed for the entity.
|
||||
*
|
||||
* @param speed the forward speed.
|
||||
*/
|
||||
void setMoveForward(float speed);
|
||||
|
||||
/**
|
||||
* Rotates the entity to face the given entity.
|
||||
*
|
||||
* @param entity the target entity.
|
||||
* @param pitch the pitch angle.
|
||||
* @param yaw the yaw angle.
|
||||
*/
|
||||
void faceEntity(IEntity entity, float pitch, float yaw);
|
||||
|
||||
/**
|
||||
* @return Whether the entity can pick up loot.
|
||||
*/
|
||||
boolean canPickUpLoot();
|
||||
|
||||
/**
|
||||
* Sets whether the entity can pick up loot.
|
||||
*
|
||||
* @param pickUp true to allow picking up loot.
|
||||
*/
|
||||
void setCanPickUpLoot(boolean pickUp);
|
||||
|
||||
/**
|
||||
* @return Whether the entity is persistent (won't despawn).
|
||||
*/
|
||||
boolean isPersistent();
|
||||
|
||||
/**
|
||||
* Enables persistence so that the entity does not despawn.
|
||||
*/
|
||||
void enablePersistence();
|
||||
|
||||
/**
|
||||
* Sets a custom name tag for the entity.
|
||||
*
|
||||
* @param text the custom name.
|
||||
*/
|
||||
void setCustomNameTag(String text);
|
||||
|
||||
/**
|
||||
* Returns the entity's custom name tag.
|
||||
*
|
||||
* @return the custom name.
|
||||
*/
|
||||
String getCustomNameTag();
|
||||
|
||||
/**
|
||||
* @return Whether the entity has a custom name tag.
|
||||
*/
|
||||
boolean hasCustomNameTag();
|
||||
|
||||
/**
|
||||
* Sets whether the entity's name tag is always rendered.
|
||||
*
|
||||
* @param alwaysRender true to always render the name tag.
|
||||
*/
|
||||
void setAlwaysRenderNameTag(boolean alwaysRender);
|
||||
|
||||
/**
|
||||
* @return Whether the name tag is always rendered.
|
||||
*/
|
||||
boolean getAlwaysRenderNameTag();
|
||||
|
||||
/**
|
||||
* Clears the entity's leash.
|
||||
*
|
||||
* @param sendPacket whether to send a packet update.
|
||||
* @param dropLeash whether to drop the leash item.
|
||||
*/
|
||||
void clearLeashed(boolean sendPacket, boolean dropLeash);
|
||||
|
||||
/**
|
||||
* @return Whether the entity allows leashing.
|
||||
*/
|
||||
boolean allowLeashing();
|
||||
|
||||
/**
|
||||
* @return Whether the entity is currently leashed.
|
||||
*/
|
||||
boolean getLeashed();
|
||||
|
||||
/**
|
||||
* @return The entity to which this entity is leashed.
|
||||
*/
|
||||
IEntity getLeashedTo();
|
||||
|
||||
/**
|
||||
* Leashes this entity to the specified entity.
|
||||
*
|
||||
* @param entity the entity to leash to.
|
||||
* @param sendPacket whether to send a packet update.
|
||||
*/
|
||||
void setLeashedTo(IEntity entity, boolean sendPacket);
|
||||
|
||||
/**
|
||||
* @return Whether the entity can be steered.
|
||||
*/
|
||||
boolean canBeSteered();
|
||||
}
|
||||
@@ -1,210 +1,439 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.api.IBlock;
|
||||
import noppes.npcs.api.IDamageSource;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T> {
|
||||
/**
|
||||
* @return The entity's current health
|
||||
*/
|
||||
float getHealth();
|
||||
|
||||
/**
|
||||
* @param health The new health of this entity
|
||||
*/
|
||||
void setHealth(float health);
|
||||
|
||||
void hurt(float damage);
|
||||
|
||||
void hurt(float damage, IEntity source);
|
||||
|
||||
void hurt(float damage, IDamageSource damageSource);
|
||||
|
||||
void setMaxHurtTime(int time);
|
||||
|
||||
int setMaxHurtTime();
|
||||
|
||||
/**
|
||||
* @return Entity's max health
|
||||
*/
|
||||
double getMaxHealth();
|
||||
|
||||
double getFollowRange();
|
||||
|
||||
double getKnockbackResistance();
|
||||
|
||||
double getSpeed();
|
||||
|
||||
double getMeleeStrength();
|
||||
|
||||
void setMaxHealth(double health);
|
||||
|
||||
void setFollowRange(double range);
|
||||
|
||||
void setKnockbackResistance(double knockbackResistance);
|
||||
|
||||
void setSpeed(double speed);
|
||||
|
||||
void setMeleeStrength(double attackDamage);
|
||||
|
||||
/**
|
||||
* @return Whether or not this entity is attacking something
|
||||
*/
|
||||
boolean isAttacking();
|
||||
|
||||
/**
|
||||
* @param living Entity which this entity will attack
|
||||
*/
|
||||
void setAttackTarget(IEntityLivingBase living);
|
||||
|
||||
/**
|
||||
* @return The entity which this entity is attacking
|
||||
*/
|
||||
IEntityLivingBase getAttackTarget();
|
||||
|
||||
int getAttackTargetTime();
|
||||
|
||||
void setLastAttacker(IEntity p_130011_1_);
|
||||
|
||||
IEntity getLastAttacker();
|
||||
|
||||
int getLastAttackerTime();
|
||||
|
||||
boolean canBreatheUnderwater();
|
||||
|
||||
int getType();
|
||||
|
||||
boolean typeOf(int type);
|
||||
|
||||
/**
|
||||
* @param entity Entity to check
|
||||
* @return Whether or not this entity can see the given entity
|
||||
*/
|
||||
boolean canSeeEntity(IEntity entity);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Returns the look vector of this entity as an IPos object.
|
||||
*/
|
||||
IPos getLookVector();
|
||||
|
||||
IBlock getLookingAtBlock(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param maxDistance The max distance to perform checks before stopping
|
||||
* @return The first block found by following along the entity's look vector.
|
||||
*/
|
||||
IBlock getLookingAtBlock(int maxDistance);
|
||||
|
||||
IPos getLookingAtPos(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
/**
|
||||
* Returns an IPos object corresponding to the final obstructed point following along the
|
||||
* entity's look vector. If no obstructions are found (entity is looking in a straight path of
|
||||
* air with no blocks in the way), the final position is returned.
|
||||
*
|
||||
* @param maxDistance The max distance to perform checks before stopping
|
||||
* @return The position the entity is looking at.
|
||||
*/
|
||||
IPos getLookingAtPos(int maxDistance);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param maxDistance The max distance to perform checks before stopping
|
||||
* @param range The radius to check for surrounding entities at every point on the vector
|
||||
* @return A list of entities, sorted first by closest to the entity along the look vector, then by which
|
||||
* entities are closest to the vector.
|
||||
*/
|
||||
IEntity[] getLookingAtEntities(IEntity[] ignoreEntities, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
IEntity[] getLookingAtEntities(int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
IEntity[] getLookingAtEntities(int maxDistance, double offset, double range);
|
||||
|
||||
/**
|
||||
* Expert use only
|
||||
* @return Returns the minecraft entity object
|
||||
*/
|
||||
T getMCEntity();
|
||||
|
||||
/**
|
||||
* Makes the entity swing its hand
|
||||
*/
|
||||
void swingHand();
|
||||
|
||||
/**
|
||||
* Works the same as the <a href="http://minecraft.wiki/w/Commands#effect">/effect command</a>
|
||||
* @param effect
|
||||
* @param duration The duration in seconds
|
||||
* @param strength The amplifier of the potion effect
|
||||
* @param hideParticles Whether or not you want to hide potion particles
|
||||
*/
|
||||
void addPotionEffect(int effect, int duration, int strength, boolean hideParticles);
|
||||
|
||||
/**
|
||||
* Clears all potion effects
|
||||
*/
|
||||
void clearPotionEffects();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param effect Potion effect to check
|
||||
* @return Returns -1 if its not active. Otherwise returns the strenght of the potion
|
||||
*/
|
||||
int getPotionEffect(int effect);
|
||||
|
||||
/**
|
||||
* Note not all Living Entities support this
|
||||
* @since 1.7.10c
|
||||
* @return The item the entity is holding
|
||||
*/
|
||||
IItemStack getHeldItem();
|
||||
|
||||
/**
|
||||
* Note not all Living Entities support this
|
||||
* @since 1.7.10c
|
||||
* @param item The item to be set
|
||||
*/
|
||||
void setHeldItem(IItemStack item);
|
||||
|
||||
/**
|
||||
* Note not all Living Entities support this
|
||||
* @param slot Slot of what armor piece to get, 0:boots, 1:pants, 2:body, 3:head
|
||||
* @return The item in the given slot
|
||||
*/
|
||||
IItemStack getArmor(int slot);
|
||||
|
||||
/**
|
||||
* Note not all Living Entities support this
|
||||
* @since 1.7.10c
|
||||
* @param slot Slot of what armor piece to set, 0:boots, 1:pants, 2:body, 3:head
|
||||
* @param item Item to be set
|
||||
*/
|
||||
void setArmor(int slot, IItemStack item);
|
||||
|
||||
boolean isChild();
|
||||
|
||||
void renderBrokenItemStack(IItemStack itemStack);
|
||||
|
||||
boolean isOnLadder();
|
||||
|
||||
int getTotalArmorValue();
|
||||
|
||||
int getArrowCountInEntity();
|
||||
|
||||
void setArrowCountInEntity(int count);
|
||||
|
||||
void dismountEntity(IEntity entity);
|
||||
|
||||
void setAIMoveSpeed(float speed);
|
||||
|
||||
float getAIMoveSpeed();
|
||||
|
||||
void setAbsorptionAmount(float amount);
|
||||
|
||||
float getAbsorptionAmount();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import noppes.npcs.api.IBlock;
|
||||
import noppes.npcs.api.IDamageSource;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents a living entity (mob, NPC, etc.) with additional methods to manage health,
|
||||
* damage, targeting, vision, potion effects, equipment, and various attributes.
|
||||
* <p>
|
||||
* This interface extends {@link IEntity} and provides functionality specific to living entities.
|
||||
*
|
||||
* @param <T> the underlying Minecraft EntityLivingBase type.
|
||||
*/
|
||||
public interface IEntityLivingBase<T extends EntityLivingBase> extends IEntity<T> {
|
||||
|
||||
/**
|
||||
* Returns the entity's current health.
|
||||
*
|
||||
* @return the health value.
|
||||
*/
|
||||
float getHealth();
|
||||
|
||||
/**
|
||||
* Sets the entity's health to the specified value.
|
||||
*
|
||||
* @param health the new health value.
|
||||
*/
|
||||
void setHealth(float health);
|
||||
|
||||
/**
|
||||
* Applies damage to this entity using a generic damage source.
|
||||
*
|
||||
* @param damage the damage amount.
|
||||
*/
|
||||
void hurt(float damage);
|
||||
|
||||
/**
|
||||
* Applies damage to this entity with the given source entity.
|
||||
*
|
||||
* @param damage the damage amount.
|
||||
* @param source the source entity.
|
||||
*/
|
||||
void hurt(float damage, IEntity source);
|
||||
|
||||
/**
|
||||
* Applies damage to this entity using a custom damage source.
|
||||
*
|
||||
* @param damage the damage amount.
|
||||
* @param damageSource the damage source.
|
||||
*/
|
||||
void hurt(float damage, IDamageSource damageSource);
|
||||
|
||||
/**
|
||||
* Sets the maximum hurt time (hurt resistance time) for this entity.
|
||||
*
|
||||
* @param time the time in ticks.
|
||||
*/
|
||||
void setMaxHurtTime(int time);
|
||||
|
||||
/**
|
||||
* Returns the maximum hurt time (hurt resistance time) for this entity.
|
||||
*
|
||||
* @return the time in ticks.
|
||||
*/
|
||||
int setMaxHurtTime();
|
||||
|
||||
/**
|
||||
* Returns the entity's maximum health.
|
||||
*
|
||||
* @return the maximum health.
|
||||
*/
|
||||
double getMaxHealth();
|
||||
|
||||
/**
|
||||
* Returns the follow range attribute of the entity.
|
||||
*
|
||||
* @return the follow range.
|
||||
*/
|
||||
double getFollowRange();
|
||||
|
||||
/**
|
||||
* Returns the knockback resistance of the entity.
|
||||
*
|
||||
* @return the knockback resistance.
|
||||
*/
|
||||
double getKnockbackResistance();
|
||||
|
||||
/**
|
||||
* Returns the movement speed of the entity.
|
||||
*
|
||||
* @return the speed.
|
||||
*/
|
||||
double getSpeed();
|
||||
|
||||
/**
|
||||
* Returns the melee strength (attack damage) of the entity.
|
||||
*
|
||||
* @return the melee strength.
|
||||
*/
|
||||
double getMeleeStrength();
|
||||
|
||||
/**
|
||||
* Sets the entity's maximum health.
|
||||
*
|
||||
* @param health the new maximum health.
|
||||
*/
|
||||
void setMaxHealth(double health);
|
||||
|
||||
/**
|
||||
* Sets the follow range of the entity.
|
||||
*
|
||||
* @param range the new follow range.
|
||||
*/
|
||||
void setFollowRange(double range);
|
||||
|
||||
/**
|
||||
* Sets the knockback resistance of the entity.
|
||||
*
|
||||
* @param knockbackResistance the new knockback resistance.
|
||||
*/
|
||||
void setKnockbackResistance(double knockbackResistance);
|
||||
|
||||
/**
|
||||
* Sets the movement speed of the entity.
|
||||
*
|
||||
* @param speed the new movement speed.
|
||||
*/
|
||||
void setSpeed(double speed);
|
||||
|
||||
/**
|
||||
* Sets the melee strength (attack damage) of the entity.
|
||||
*
|
||||
* @param attackDamage the new attack damage.
|
||||
*/
|
||||
void setMeleeStrength(double attackDamage);
|
||||
|
||||
/**
|
||||
* @return true if this entity is currently attacking a target; false otherwise.
|
||||
*/
|
||||
boolean isAttacking();
|
||||
|
||||
/**
|
||||
* Sets the attack target for this entity.
|
||||
*
|
||||
* @param living the target entity.
|
||||
*/
|
||||
void setAttackTarget(IEntityLivingBase living);
|
||||
|
||||
/**
|
||||
* Returns the current attack target.
|
||||
*
|
||||
* @return the target entity.
|
||||
*/
|
||||
IEntityLivingBase getAttackTarget();
|
||||
|
||||
/**
|
||||
* Returns the time (in ticks) for which the current attack target has been active.
|
||||
*
|
||||
* @return the attack target time.
|
||||
*/
|
||||
int getAttackTargetTime();
|
||||
|
||||
/**
|
||||
* Sets the last attacker for this entity.
|
||||
*
|
||||
* @param p_130011_1_ the last attacker.
|
||||
*/
|
||||
void setLastAttacker(IEntity p_130011_1_);
|
||||
|
||||
/**
|
||||
* Returns the last attacker of this entity.
|
||||
*
|
||||
* @return the last attacker.
|
||||
*/
|
||||
IEntity getLastAttacker();
|
||||
|
||||
/**
|
||||
* Returns the time (in ticks) since the entity was last attacked.
|
||||
*
|
||||
* @return the last attacker time.
|
||||
*/
|
||||
int getLastAttackerTime();
|
||||
|
||||
/**
|
||||
* Checks whether the entity can breathe underwater.
|
||||
*
|
||||
* @return true if it can breathe underwater; false otherwise.
|
||||
*/
|
||||
boolean canBreatheUnderwater();
|
||||
|
||||
/**
|
||||
* Returns the EntityType (as defined in scripting constants) for this entity.
|
||||
*
|
||||
* @return the entity type.
|
||||
*/
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* Checks if this entity is of the specified type.
|
||||
*
|
||||
* @param type the type to check.
|
||||
* @return true if this entity is of that type; false otherwise.
|
||||
*/
|
||||
boolean typeOf(int type);
|
||||
|
||||
/**
|
||||
* Returns the look vector of this entity as an IPos object.
|
||||
*
|
||||
* @return the look vector.
|
||||
*/
|
||||
IPos getLookVector();
|
||||
|
||||
/**
|
||||
* Returns the block that the entity is looking at, with detailed stopping conditions.
|
||||
*
|
||||
* @param maxDistance the maximum distance to check.
|
||||
* @param stopOnBlock whether to stop on any block.
|
||||
* @param stopOnLiquid whether to stop on liquids.
|
||||
* @param stopOnCollision whether to stop on collisions.
|
||||
* @return the block being looked at.
|
||||
*/
|
||||
IBlock getLookingAtBlock(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
/**
|
||||
* Returns the first block found by following the entity's look vector,
|
||||
* using default parameters (stop on block).
|
||||
*
|
||||
* @param maxDistance the maximum distance to check.
|
||||
* @return the block being looked at.
|
||||
*/
|
||||
IBlock getLookingAtBlock(int maxDistance);
|
||||
|
||||
/**
|
||||
* Returns the position (IPos) corresponding to the final obstructed point along the entity's look vector,
|
||||
* with detailed stopping conditions.
|
||||
*
|
||||
* @param maxDistance the maximum distance to check.
|
||||
* @param stopOnBlock whether to stop on blocks.
|
||||
* @param stopOnLiquid whether to stop on liquids.
|
||||
* @param stopOnCollision whether to stop on collisions.
|
||||
* @return the obstructed position, or the final position if unobstructed.
|
||||
*/
|
||||
IPos getLookingAtPos(int maxDistance, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
/**
|
||||
* Returns the position (IPos) corresponding to the final obstructed point along the entity's look vector,
|
||||
* using default parameters (stop on block).
|
||||
*
|
||||
* @param maxDistance the maximum distance to check.
|
||||
* @return the position being looked at.
|
||||
*/
|
||||
IPos getLookingAtPos(int maxDistance);
|
||||
|
||||
/**
|
||||
* Returns an array of entities intersecting with the entity's look vector.
|
||||
* Entities are sorted first by proximity along the vector, then by closeness to the vector.
|
||||
*
|
||||
* @param ignoreEntities an array of entities to ignore.
|
||||
* @param maxDistance the maximum distance to check.
|
||||
* @param offset the offset along the vector.
|
||||
* @param range the search radius around the vector.
|
||||
* @param stopOnBlock whether to stop on blocks.
|
||||
* @param stopOnLiquid whether to stop on liquids.
|
||||
* @param stopOnCollision whether to stop on collisions.
|
||||
* @return an array of entities.
|
||||
*/
|
||||
IEntity[] getLookingAtEntities(IEntity[] ignoreEntities, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
/**
|
||||
* Returns an array of entities intersecting with the entity's look vector with detailed stop conditions.
|
||||
*
|
||||
* @param maxDistance the maximum distance.
|
||||
* @param offset the offset.
|
||||
* @param range the search radius.
|
||||
* @param stopOnBlock whether to stop on blocks.
|
||||
* @param stopOnLiquid whether to stop on liquids.
|
||||
* @param stopOnCollision whether to stop on collisions.
|
||||
* @return an array of entities.
|
||||
*/
|
||||
IEntity[] getLookingAtEntities(int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision);
|
||||
|
||||
/**
|
||||
* Returns an array of entities intersecting with the entity's look vector using default stop conditions.
|
||||
*
|
||||
* @param maxDistance the maximum distance.
|
||||
* @param offset the offset.
|
||||
* @param range the search radius.
|
||||
* @return an array of entities.
|
||||
*/
|
||||
IEntity[] getLookingAtEntities(int maxDistance, double offset, double range);
|
||||
|
||||
/**
|
||||
* Expert use only.
|
||||
* Returns the underlying Minecraft EntityLivingBase object.
|
||||
*
|
||||
* @return the Minecraft entity.
|
||||
*/
|
||||
T getMCEntity();
|
||||
|
||||
/**
|
||||
* Makes the entity swing its hand.
|
||||
*/
|
||||
void swingHand();
|
||||
|
||||
/**
|
||||
* Applies a potion effect to the entity.
|
||||
* Works similarly to the /effect command.
|
||||
*
|
||||
* @param effect the potion effect ID.
|
||||
* @param duration the duration in seconds.
|
||||
* @param strength the amplifier of the effect.
|
||||
* @param hideParticles whether to hide potion particles.
|
||||
*/
|
||||
void addPotionEffect(int effect, int duration, int strength, boolean hideParticles);
|
||||
|
||||
/**
|
||||
* Clears all active potion effects from the entity.
|
||||
*/
|
||||
void clearPotionEffects();
|
||||
|
||||
/**
|
||||
* Returns the amplifier of the specified potion effect.
|
||||
* If the effect is not active, returns -1.
|
||||
*
|
||||
* @param effect the potion effect ID.
|
||||
* @return the amplifier, or -1 if not active.
|
||||
*/
|
||||
int getPotionEffect(int effect);
|
||||
|
||||
/**
|
||||
* Returns the item the entity is currently holding.
|
||||
* Note that not all living entities support this.
|
||||
*
|
||||
* @return the held item.
|
||||
*/
|
||||
IItemStack getHeldItem();
|
||||
|
||||
/**
|
||||
* Sets the item the entity is holding.
|
||||
* Note that not all living entities support this.
|
||||
*
|
||||
* @param item the item to set.
|
||||
*/
|
||||
void setHeldItem(IItemStack item);
|
||||
|
||||
/**
|
||||
* Returns the armor piece in the given slot.
|
||||
* Slots: 0 - boots, 1 - pants, 2 - body, 3 - head.
|
||||
*
|
||||
* @param slot the armor slot.
|
||||
* @return the armor item.
|
||||
*/
|
||||
IItemStack getArmor(int slot);
|
||||
|
||||
/**
|
||||
* Sets the armor piece in the given slot.
|
||||
* Slots: 0 - boots, 1 - pants, 2 - body, 3 - head.
|
||||
*
|
||||
* @param slot the armor slot.
|
||||
* @param item the item to set.
|
||||
*/
|
||||
void setArmor(int slot, IItemStack item);
|
||||
|
||||
/**
|
||||
* @return true if this entity is a child.
|
||||
*/
|
||||
boolean isChild();
|
||||
|
||||
/**
|
||||
* Renders a broken item stack effect for the given item.
|
||||
*
|
||||
* @param itemStack the item stack.
|
||||
*/
|
||||
void renderBrokenItemStack(IItemStack itemStack);
|
||||
|
||||
/**
|
||||
* @return true if the entity is on a ladder.
|
||||
*/
|
||||
boolean isOnLadder();
|
||||
|
||||
/**
|
||||
* Returns the total armor value of the entity.
|
||||
*
|
||||
* @return the armor value.
|
||||
*/
|
||||
int getTotalArmorValue();
|
||||
|
||||
/**
|
||||
* Returns the number of arrows currently embedded in the entity.
|
||||
*
|
||||
* @return the arrow count.
|
||||
*/
|
||||
int getArrowCountInEntity();
|
||||
|
||||
/**
|
||||
* Sets the number of arrows embedded in the entity.
|
||||
*
|
||||
* @param count the new arrow count.
|
||||
*/
|
||||
void setArrowCountInEntity(int count);
|
||||
|
||||
/**
|
||||
* Dismounts the specified entity from this entity.
|
||||
*
|
||||
* @param entity the entity to dismount.
|
||||
*/
|
||||
void dismountEntity(IEntity entity);
|
||||
|
||||
/**
|
||||
* Sets the AI move speed for the entity.
|
||||
*
|
||||
* @param speed the speed value.
|
||||
*/
|
||||
void setAIMoveSpeed(float speed);
|
||||
|
||||
/**
|
||||
* Returns the AI move speed of the entity.
|
||||
*
|
||||
* @return the speed.
|
||||
*/
|
||||
float getAIMoveSpeed();
|
||||
|
||||
/**
|
||||
* Sets the absorption (extra health) amount.
|
||||
*
|
||||
* @param amount the absorption amount.
|
||||
*/
|
||||
void setAbsorptionAmount(float amount);
|
||||
|
||||
/**
|
||||
* Returns the absorption (extra health) amount.
|
||||
*
|
||||
* @return the absorption amount.
|
||||
*/
|
||||
float getAbsorptionAmount();
|
||||
}
|
||||
@@ -1,6 +1,13 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
|
||||
public interface IMonster<T extends EntityMob> extends IEntityLiving<T> {
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
|
||||
/**
|
||||
* Represents a monster entity.
|
||||
* This interface does not add new methods, but allows type checking
|
||||
* against the EntityType.MONSTER.
|
||||
*
|
||||
* @param <T> The underlying Minecraft EntityMob type.
|
||||
*/
|
||||
public interface IMonster<T extends EntityMob> extends IEntityLiving<T> {
|
||||
}
|
||||
@@ -1,96 +1,167 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.passive.EntityTameable;
|
||||
|
||||
public interface IPixelmon<T extends EntityTameable> extends IAnimal<T> {
|
||||
boolean getIsShiny();
|
||||
|
||||
void setIsShiny(boolean bo);
|
||||
|
||||
int getLevel();
|
||||
|
||||
void setLevel(int level);
|
||||
|
||||
/**
|
||||
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
|
||||
*/
|
||||
int getIV(int type);
|
||||
|
||||
|
||||
/**
|
||||
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
|
||||
*/
|
||||
void setIV(int type, int value);
|
||||
|
||||
/**
|
||||
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
|
||||
*/
|
||||
int getEV(int type);
|
||||
|
||||
|
||||
/**
|
||||
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
|
||||
*/
|
||||
void setEV(int type, int value);
|
||||
|
||||
/**
|
||||
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
|
||||
*/
|
||||
int getStat(int type);
|
||||
|
||||
|
||||
/**
|
||||
* @param type 0:HP, 1:Attack, 2:Defense, 3:SpAttack, 4:SpDefense, 5:Speed
|
||||
*/
|
||||
void setStat(int type, int value);
|
||||
|
||||
/**
|
||||
* @return type 0:Pygmy, 1:Runt, 2:Small, 3:Normal, 4:Huge, 5:Giant, 6:Enormous, 7:Ginormous, 8:Microscopic
|
||||
*/
|
||||
int getSize();
|
||||
|
||||
/**
|
||||
* @param type 0:Pygmy, 1:Runt, 2:Small, 3:Normal, 4:Huge, 5:Giant, 6:Enormous, 7:Ginormous, 8:Microscopic
|
||||
*/
|
||||
void setSize(int type);
|
||||
|
||||
/**
|
||||
* @return 0-255
|
||||
*/
|
||||
int getHapiness();
|
||||
|
||||
/**
|
||||
* @param value 0-255
|
||||
*/
|
||||
void setHapiness(int value);
|
||||
|
||||
/**
|
||||
* @return 0:Hardy, 1:Serious, 2:Docile, 3:Bashful, 4:Quirky, 5:Lonely, 6:Brave, 7:Adamant, 8:Naughty, 9:Bold, 10:Relaxed, 11:Impish, 12:Lax, 13:Timid, 14:Hasty, 15:Jolly, 16:Naive, 17:Modest, 18:Mild, 19:Quiet, 20:Rash, 21:Calm, 22:Gentle, 23:Sassy, 24:Careful
|
||||
*/
|
||||
int getNature();
|
||||
|
||||
/**
|
||||
* @param type 0:Hardy, 1:Serious, 2:Docile, 3:Bashful, 4:Quirky, 5:Lonely, 6:Brave, 7:Adamant, 8:Naughty, 9:Bold, 10:Relaxed, 11:Impish, 12:Lax, 13:Timid, 14:Hasty, 15:Jolly, 16:Naive, 17:Modest, 18:Mild, 19:Quiet, 20:Rash, 21:Calm, 22:Gentle, 23:Sassy, 24:Careful
|
||||
*/
|
||||
void setNature(int type);
|
||||
|
||||
/**
|
||||
* @return -1:Uncaught, 0:Pokeball, 1:GreatBall, 2:UltraBall, 3:MasterBall, 4:LevelBall, 5:MoonBall, 6:FriendBall, 7:LoveBall, 8:SafariBall, 9:HeavyBall, 10:FastBall, 11:RepeatBall, 12:TimerBall, 13:NestBall, 14:NetBall, 15:DiveBall, 16:LuxuryBall, 17:HealBall, 18:DuskBall, 19:PremierBall, 20:SportBall, 21:QuickBall, 22:ParkBall, 23:LureBall, 24:CherishBall, 25:GSBall
|
||||
*/
|
||||
int getPokeball();
|
||||
|
||||
/**
|
||||
* @param type -1:Uncaught, 0:Pokeball, 1:GreatBall, 2:UltraBall, 3:MasterBall, 4:LevelBall, 5:MoonBall, 6:FriendBall, 7:LoveBall, 8:SafariBall, 9:HeavyBall, 10:FastBall, 11:RepeatBall, 12:TimerBall, 13:NestBall, 14:NetBall, 15:DiveBall, 16:LuxuryBall, 17:HealBall, 18:DuskBall, 19:PremierBall, 20:SportBall, 21:QuickBall, 22:ParkBall, 23:LureBall, 24:CherishBall, 25:GSBall
|
||||
*/
|
||||
void setPokeball(int type);
|
||||
|
||||
String getNickname();
|
||||
|
||||
boolean hasNickname();
|
||||
|
||||
void setNickname(String name);
|
||||
|
||||
String getMove(int slot);
|
||||
|
||||
void setMove(int slot, String move);
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.passive.EntityTameable;
|
||||
|
||||
/**
|
||||
* Represents a Pixelmon (a tameable creature) with additional attributes
|
||||
* such as shiny state, level, IV/EV values, nature, moves, and more.
|
||||
*
|
||||
* @param <T> The underlying Minecraft EntityTameable type.
|
||||
*/
|
||||
public interface IPixelmon<T extends EntityTameable> extends IAnimal<T> {
|
||||
|
||||
/**
|
||||
* @return true if the Pixelmon is shiny.
|
||||
*/
|
||||
boolean getIsShiny();
|
||||
|
||||
/**
|
||||
* Sets whether the Pixelmon is shiny.
|
||||
*
|
||||
* @param bo true for shiny.
|
||||
*/
|
||||
void setIsShiny(boolean bo);
|
||||
|
||||
/**
|
||||
* @return The Pixelmon's level.
|
||||
*/
|
||||
int getLevel();
|
||||
|
||||
/**
|
||||
* Sets the Pixelmon's level.
|
||||
*
|
||||
* @param level the new level.
|
||||
*/
|
||||
void setLevel(int level);
|
||||
|
||||
/**
|
||||
* Gets the Individual Value (IV) for the specified stat.
|
||||
*
|
||||
* @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed
|
||||
* @return the IV value, or -1 if invalid.
|
||||
*/
|
||||
int getIV(int type);
|
||||
|
||||
/**
|
||||
* Sets the Individual Value (IV) for the specified stat.
|
||||
*
|
||||
* @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed
|
||||
* @param value the new IV value.
|
||||
*/
|
||||
void setIV(int type, int value);
|
||||
|
||||
/**
|
||||
* Gets the Effort Value (EV) for the specified stat.
|
||||
*
|
||||
* @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed
|
||||
* @return the EV value, or -1 if invalid.
|
||||
*/
|
||||
int getEV(int type);
|
||||
|
||||
/**
|
||||
* Sets the Effort Value (EV) for the specified stat.
|
||||
*
|
||||
* @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed
|
||||
* @param value the new EV value.
|
||||
*/
|
||||
void setEV(int type, int value);
|
||||
|
||||
/**
|
||||
* Gets the calculated stat for the specified stat type.
|
||||
*
|
||||
* @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed
|
||||
* @return the stat value, or -1 if invalid.
|
||||
*/
|
||||
int getStat(int type);
|
||||
|
||||
/**
|
||||
* Sets the calculated stat for the specified stat type.
|
||||
*
|
||||
* @param type 0: HP, 1: Attack, 2: Defense, 3: SpAttack, 4: SpDefense, 5: Speed
|
||||
* @param value the new stat value.
|
||||
*/
|
||||
void setStat(int type, int value);
|
||||
|
||||
/**
|
||||
* @return The Pixelmon's size type (0: Pygmy, 1: Runt, 2: Small, 3: Normal, 4: Huge, 5: Giant,
|
||||
* 6: Enormous, 7: Ginormous, 8: Microscopic).
|
||||
*/
|
||||
int getSize();
|
||||
|
||||
/**
|
||||
* Sets the Pixelmon's size type.
|
||||
*
|
||||
* @param type the size type.
|
||||
*/
|
||||
void setSize(int type);
|
||||
|
||||
/**
|
||||
* @return The Pixelmon's happiness (0-255).
|
||||
*/
|
||||
int getHapiness();
|
||||
|
||||
/**
|
||||
* Sets the Pixelmon's happiness.
|
||||
*
|
||||
* @param value a value between 0 and 255.
|
||||
*/
|
||||
void setHapiness(int value);
|
||||
|
||||
/**
|
||||
* @return The Pixelmon's nature as an integer (see nature definitions).
|
||||
*/
|
||||
int getNature();
|
||||
|
||||
/**
|
||||
* Sets the Pixelmon's nature.
|
||||
*
|
||||
* @param type the nature value.
|
||||
*/
|
||||
void setNature(int type);
|
||||
|
||||
/**
|
||||
* @return The type of Poké Ball in which the Pixelmon is contained
|
||||
* (-1: Uncaught, 0: Pokéball, 1: Great Ball, etc.).
|
||||
*/
|
||||
int getPokeball();
|
||||
|
||||
/**
|
||||
* Sets the type of Poké Ball for this Pixelmon.
|
||||
*
|
||||
* @param type -1 for Uncaught, 0 for Pokéball, etc.
|
||||
*/
|
||||
void setPokeball(int type);
|
||||
|
||||
/**
|
||||
* @return The Pixelmon's nickname.
|
||||
*/
|
||||
String getNickname();
|
||||
|
||||
/**
|
||||
* @return true if the Pixelmon has a nickname.
|
||||
*/
|
||||
boolean hasNickname();
|
||||
|
||||
/**
|
||||
* Sets the Pixelmon's nickname.
|
||||
*
|
||||
* @param name the new nickname.
|
||||
*/
|
||||
void setNickname(String name);
|
||||
|
||||
/**
|
||||
* Returns the name of the move in the specified slot.
|
||||
*
|
||||
* @param slot the move slot.
|
||||
* @return the move name.
|
||||
*/
|
||||
String getMove(int slot);
|
||||
|
||||
/**
|
||||
* Sets the move in the specified slot.
|
||||
*
|
||||
* @param slot the move slot.
|
||||
* @param move the move name.
|
||||
*/
|
||||
void setMove(int slot, String move);
|
||||
}
|
||||
@@ -6,13 +6,14 @@ import noppes.npcs.api.*;
|
||||
import noppes.npcs.api.gui.ICustomGui;
|
||||
import noppes.npcs.api.handler.IOverlayHandler;
|
||||
import noppes.npcs.api.handler.IPlayerData;
|
||||
import noppes.npcs.api.handler.data.IAnimationData;
|
||||
import noppes.npcs.api.handler.data.IDialog;
|
||||
import noppes.npcs.api.handler.data.IQuest;
|
||||
import noppes.npcs.api.handler.data.ISound;
|
||||
import noppes.npcs.api.handler.data.*;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.api.overlay.ICustomOverlay;
|
||||
|
||||
/**
|
||||
* Represents a player in the game with methods for managing dialogs, quests,
|
||||
* inventory, sound, and more.
|
||||
*/
|
||||
public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>, IAnimatable {
|
||||
/**
|
||||
* @return Returns the displayed name of the player
|
||||
@@ -20,299 +21,640 @@ public interface IPlayer<T extends EntityPlayerMP> extends IEntityLivingBase<T>,
|
||||
String getDisplayName();
|
||||
|
||||
/**
|
||||
* @return Returns the players name
|
||||
* @return Returns the player's name
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Kicks the player from the server with the specified reason.
|
||||
*
|
||||
* @param reason The reason for kicking the player.
|
||||
*/
|
||||
void kick(String reason);
|
||||
|
||||
/**
|
||||
* Teleports the player to the specified coordinates in the current dimension.
|
||||
*
|
||||
* @param x The x-coordinate.
|
||||
* @param y The y-coordinate.
|
||||
* @param z The z-coordinate.
|
||||
*/
|
||||
void setPosition(double x, double y, double z);
|
||||
|
||||
/**
|
||||
* Teleports the player to the coordinates specified by the given position.
|
||||
*
|
||||
* @param pos The position object containing coordinates.
|
||||
*/
|
||||
void setPosition(IPos pos);
|
||||
|
||||
/**
|
||||
* Teleports the player to the specified coordinates in the given dimension.
|
||||
*
|
||||
* @param x The x-coordinate.
|
||||
* @param y The y-coordinate.
|
||||
* @param z The z-coordinate.
|
||||
* @param dimensionId The dimension ID.
|
||||
*/
|
||||
void setPosition(double x, double y, double z, int dimensionId);
|
||||
|
||||
/**
|
||||
* Teleports the player to the position in the specified dimension.
|
||||
*
|
||||
* @param pos The position object containing coordinates.
|
||||
* @param dimensionId The dimension ID.
|
||||
*/
|
||||
void setPosition(IPos pos, int dimensionId);
|
||||
|
||||
/**
|
||||
* Teleports the player to the specified coordinates in the dimension of the provided world.
|
||||
*
|
||||
* @param x The x-coordinate.
|
||||
* @param y The y-coordinate.
|
||||
* @param z The z-coordinate.
|
||||
* @param world The world whose dimension will be used.
|
||||
*/
|
||||
void setPosition(double x, double y, double z, IWorld world);
|
||||
|
||||
/**
|
||||
* Teleports the player to the position specified by the given position in the dimension of the provided world.
|
||||
*
|
||||
* @param pos The position object containing coordinates.
|
||||
* @param world The world whose dimension will be used.
|
||||
*/
|
||||
void setPosition(IPos pos, IWorld world);
|
||||
|
||||
/**
|
||||
* Changes the player's dimension by teleporting them to their current position in the specified dimension.
|
||||
*
|
||||
* @param dimension The dimension ID to move the player to.
|
||||
*/
|
||||
void setDimension(int dimension);
|
||||
|
||||
/**
|
||||
* @return Returns the player's current hunger level.
|
||||
*/
|
||||
int getHunger();
|
||||
|
||||
/**
|
||||
* Sets the player's hunger level.
|
||||
*
|
||||
* @param hunger The new hunger level.
|
||||
*/
|
||||
void setHunger(int hunger);
|
||||
|
||||
/**
|
||||
* @return Returns the player's current saturation level.
|
||||
*/
|
||||
float getSaturation();
|
||||
|
||||
/**
|
||||
* Sets the player's saturation level.
|
||||
*
|
||||
* @param saturation The new saturation level.
|
||||
*/
|
||||
void setSaturation(float saturation);
|
||||
|
||||
/**
|
||||
* Displays the specified dialog to the player.
|
||||
*
|
||||
* @param dialog The dialog to display.
|
||||
*/
|
||||
void showDialog(IDialog dialog);
|
||||
|
||||
/**
|
||||
* Checks whether the player has read the specified dialog.
|
||||
*
|
||||
* @param dialog The dialog to check.
|
||||
* @return True if the dialog has been read, false otherwise.
|
||||
*/
|
||||
boolean hasReadDialog(IDialog dialog);
|
||||
|
||||
/**
|
||||
* Marks the specified dialog as read for the player.
|
||||
*
|
||||
* @param dialog The dialog to mark as read.
|
||||
*/
|
||||
void readDialog(IDialog dialog);
|
||||
|
||||
/**
|
||||
* Marks the specified dialog as unread for the player.
|
||||
*
|
||||
* @param dialog The dialog to mark as unread.
|
||||
*/
|
||||
void unreadDialog(IDialog dialog);
|
||||
|
||||
/**
|
||||
* Displays the dialog with the specified ID to the player.
|
||||
*
|
||||
* @param id The dialog ID.
|
||||
*/
|
||||
void showDialog(int id);
|
||||
|
||||
/**
|
||||
* Checks whether the player has read the dialog with the specified ID.
|
||||
*
|
||||
* @param id The dialog ID.
|
||||
* @return True if the dialog has been read, false otherwise.
|
||||
*/
|
||||
boolean hasReadDialog(int id);
|
||||
|
||||
/**
|
||||
* Marks the dialog with the specified ID as read for the player.
|
||||
*
|
||||
* @param id The dialog ID.
|
||||
*/
|
||||
void readDialog(int id);
|
||||
|
||||
/**
|
||||
* Marks the dialog with the specified ID as unread for the player.
|
||||
*
|
||||
* @param id The dialog ID.
|
||||
*/
|
||||
void unreadDialog(int id);
|
||||
|
||||
/**
|
||||
* Checks whether the player has finished the specified quest.
|
||||
*
|
||||
* @param quest The quest to check.
|
||||
* @return True if the quest has been finished, false otherwise.
|
||||
*/
|
||||
boolean hasFinishedQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Checks whether the player has an active quest matching the specified quest.
|
||||
*
|
||||
* @param quest The quest to check.
|
||||
* @return True if the quest is active, false otherwise.
|
||||
*/
|
||||
boolean hasActiveQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Add the quest from active quest list
|
||||
* @param quest The quest
|
||||
* Add the quest from active quest list.
|
||||
*
|
||||
* @param quest The quest.
|
||||
*/
|
||||
void startQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Add the quest from finished quest list
|
||||
* @param quest The quest
|
||||
* Add the quest from finished quest list.
|
||||
*
|
||||
* @param quest The quest.
|
||||
*/
|
||||
void finishQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Removes the quest from active quest list
|
||||
* @param quest The quest
|
||||
* Removes the quest from active quest list.
|
||||
*
|
||||
* @param quest The quest.
|
||||
*/
|
||||
void stopQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Removes the quest from active and finished quest list
|
||||
* @param quest The quest
|
||||
* Removes the quest from active and finished quest list.
|
||||
*
|
||||
* @param quest The quest.
|
||||
*/
|
||||
void removeQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Checks whether the player has finished the quest with the given ID.
|
||||
*
|
||||
* @param id The quest ID.
|
||||
* @return True if the quest has been finished, false otherwise.
|
||||
*/
|
||||
boolean hasFinishedQuest(int id);
|
||||
|
||||
/**
|
||||
* Checks whether the player has an active quest with the given ID.
|
||||
*
|
||||
* @param id The quest ID.
|
||||
* @return True if the quest is active, false otherwise.
|
||||
*/
|
||||
boolean hasActiveQuest(int id);
|
||||
|
||||
/**
|
||||
* @param id The quest ID
|
||||
* @param id The quest ID.
|
||||
*/
|
||||
void startQuest(int id);
|
||||
|
||||
/**
|
||||
* @param id The quest ID
|
||||
* @param id The quest ID.
|
||||
*/
|
||||
void finishQuest(int id);
|
||||
|
||||
/**
|
||||
* @param id The quest ID
|
||||
* @param id The quest ID.
|
||||
*/
|
||||
void stopQuest(int id);
|
||||
|
||||
/**
|
||||
* @param id The quest ID
|
||||
* @param id The quest ID.
|
||||
*/
|
||||
void removeQuest(int id);
|
||||
|
||||
/**
|
||||
* Returns an array of quests that the player has finished.
|
||||
*
|
||||
* @return An array of finished quests.
|
||||
*/
|
||||
IQuest[] getFinishedQuests();
|
||||
|
||||
/**
|
||||
* Returns the entity type identifier for the player.
|
||||
*
|
||||
* @return The type as an integer.
|
||||
*/
|
||||
int getType();
|
||||
|
||||
boolean typeOf(int type);
|
||||
/**
|
||||
* @param faction The faction id
|
||||
* @param points The points to increase. Use negative values to decrease
|
||||
* Checks if the player is of the specified entity type.
|
||||
*
|
||||
* @param type The entity type to check.
|
||||
* @return True if the player is of the specified type, false otherwise.
|
||||
*/
|
||||
boolean typeOf(int type);
|
||||
|
||||
/**
|
||||
* @param faction The faction id.
|
||||
* @param points The points to increase. Use negative values to decrease.
|
||||
*/
|
||||
void addFactionPoints(int faction, int points);
|
||||
|
||||
/**
|
||||
* @param faction The faction id
|
||||
* @param points The new point value for this faction
|
||||
*/
|
||||
void setFactionPoints(int faction, int points);
|
||||
* @param faction The faction id.
|
||||
* @param points The new point value for this faction.
|
||||
*/
|
||||
void setFactionPoints(int faction, int points);
|
||||
|
||||
/**
|
||||
* @param faction The faction id
|
||||
* @return points
|
||||
* @param faction The faction id.
|
||||
* @return The current point total for the faction.
|
||||
*/
|
||||
int getFactionPoints(int faction);
|
||||
|
||||
/**
|
||||
* @param message The message you want to send. Compatible with formatting codes, which can be found on the attached link.
|
||||
* @see <a href="https://static.wikia.nocookie.net/minecraft_gamepedia/images/7/7e/Minecraft_Formatting.gif/revision/latest/scale-to-width-down/200?cb=20200828001454">Minecraft formatting codes</a>
|
||||
* Sends a chat message to the player.
|
||||
*
|
||||
* @param message The message you want to send. Compatible with formatting codes.
|
||||
* @see <a href="https://static.wikia.nocookie.net/minecraft_gamepedia/images/7/7e/Minecraft_Formatting.gif/revision/latest/scale-to-width-down/200?cb=20200828001454">Minecraft formatting codes</a>
|
||||
*/
|
||||
void sendMessage(String message);
|
||||
|
||||
/**
|
||||
* @return Return gamemode. 0: Survival, 1: Creative, 2: Adventure
|
||||
* @return Returns gamemode. 0: Survival, 1: Creative, 2: Adventure.
|
||||
*/
|
||||
int getMode();
|
||||
|
||||
/**
|
||||
* @param type The gamemode type. 0:SURVIVAL, 1:CREATIVE, 2:ADVENTURE
|
||||
* @param type The gamemode type. 0:SURVIVAL, 1:CREATIVE, 2:ADVENTURE.
|
||||
*/
|
||||
void setMode(int type);
|
||||
|
||||
/**
|
||||
* @return Returns an IItemStack array of size 36 representing the player's inventory.
|
||||
* @since 1.7.10d
|
||||
* @return Returns a IItemStack array size 36
|
||||
*/
|
||||
IItemStack[] getInventory();
|
||||
|
||||
/**
|
||||
* @param item The item to be checked
|
||||
* @param ignoreNBT Whether the item's NBT tags will be checked to be equal
|
||||
* @param ignoreDamage Whether the item's damage will be checked to be equal
|
||||
* @return How many of this item the player has
|
||||
* @param item The item to be checked.
|
||||
* @param ignoreNBT Whether the item's NBT tags will be checked for equality.
|
||||
* @param ignoreDamage Whether the item's damage will be checked for equality.
|
||||
* @return The total count of the specified item in the player's inventory.
|
||||
*/
|
||||
int inventoryItemCount(IItemStack item, boolean ignoreNBT, boolean ignoreDamage);
|
||||
|
||||
/**
|
||||
* @param id The item's name.
|
||||
* @param damage The damage value.
|
||||
* @param amount How many items will be removed.
|
||||
* @return True if the items were removed successfully, false if the amount exceeds what the player has or the item doesn't exist.
|
||||
* @since 1.7.10c
|
||||
* @param id The items name
|
||||
* @param damage The damage value
|
||||
* @param amount How many will be removed
|
||||
* @return True if the items were removed succesfully. Returns false incase a bigger amount than what the player has was given or item doesnt exist
|
||||
*/
|
||||
boolean removeItem(String id, int damage, int amount);
|
||||
|
||||
/**
|
||||
* @param item The Item type to be removed
|
||||
* @param amount How many will be removed
|
||||
* @param ignoreNBT Whether the item's NBT tags will be checked to be equal
|
||||
* @param ignoreDamage Whether the item's damage will be checked to be equal
|
||||
* @return True if the items were removed succesfully. Returns false incase a bigger amount than what the player has was given
|
||||
* @param item The item type to be removed.
|
||||
* @param amount The number of items to remove.
|
||||
* @param ignoreNBT Whether the item's NBT tags will be checked for equality.
|
||||
* @param ignoreDamage Whether the item's damage will be checked for equality.
|
||||
* @return True if the items were removed successfully, false if the removal amount exceeds the player's count.
|
||||
*/
|
||||
boolean removeItem(IItemStack item, int amount, boolean ignoreNBT, boolean ignoreDamage);
|
||||
|
||||
/**
|
||||
* @param item The item to be removed from the players inventory
|
||||
* @param ignoreNBT Whether the item's NBT tags will be checked to be equal
|
||||
* @param ignoreDamage Whether the item's damage will be checked to be equal
|
||||
* @return The amount of item stacks that were removed
|
||||
* @param item The item to be removed from the player's inventory.
|
||||
* @param ignoreNBT Whether the item's NBT tags will be checked for equality.
|
||||
* @param ignoreDamage Whether the item's damage will be checked for equality.
|
||||
* @return The number of item stacks that were removed.
|
||||
*/
|
||||
int removeAllItems(IItemStack item, boolean ignoreNBT, boolean ignoreDamage);
|
||||
|
||||
/**
|
||||
* @param item The item to be added.
|
||||
* @param amount The number of items to add.
|
||||
* @return True if the item was given successfully, false otherwise.
|
||||
* @since 1.7.10c
|
||||
* @param item Item to be added
|
||||
* @param amount The amount of the item to be added
|
||||
* @return Returns whether or not it gave the item succesfully
|
||||
*/
|
||||
boolean giveItem(IItemStack item, int amount);
|
||||
|
||||
/**
|
||||
* @param id The item's name.
|
||||
* @param damage The damage value.
|
||||
* @param amount The number of items to add.
|
||||
* @return True if the item was given successfully, false otherwise.
|
||||
* @since 1.7.10c
|
||||
* @param id The items name
|
||||
* @param damage The damage value
|
||||
* @param amount The amount of the item to be added
|
||||
* @return Returns whether or not it gave the item succesfully
|
||||
*/
|
||||
boolean giveItem(String id, int damage, int amount);
|
||||
|
||||
/**
|
||||
* Same as the /spawnpoint command
|
||||
* @param x The x position
|
||||
* @param y The y position
|
||||
* @param z The z position
|
||||
* Same as the /spawnpoint command.
|
||||
*
|
||||
* @param x The x-coordinate.
|
||||
* @param y The y-coordinate.
|
||||
* @param z The z-coordinate.
|
||||
*/
|
||||
void setSpawnpoint(int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Sets the player's spawnpoint to the coordinates of the provided position.
|
||||
*
|
||||
* @param pos The position containing the spawn coordinates.
|
||||
*/
|
||||
void setSpawnpoint(IPos pos);
|
||||
|
||||
/**
|
||||
* Resets the player's spawnpoint to the default spawn.
|
||||
*/
|
||||
void resetSpawnpoint();
|
||||
|
||||
/**
|
||||
* Sets the player's rotation.
|
||||
*
|
||||
* @param rotationYaw The horizontal rotation (yaw).
|
||||
* @param rotationPitch The vertical rotation (pitch).
|
||||
*/
|
||||
void setRotation(float rotationYaw, float rotationPitch);
|
||||
|
||||
/**
|
||||
* Disables mouse input for the specified time and buttons for the player.
|
||||
*
|
||||
* @param time The duration for which mouse input is disabled.
|
||||
* @param buttonIds The IDs of the mouse buttons to disable.
|
||||
*/
|
||||
void disableMouseInput(long time, int... buttonIds);
|
||||
|
||||
/**
|
||||
* Stops the player from using the currently active item.
|
||||
*/
|
||||
void stopUsingItem();
|
||||
|
||||
/**
|
||||
* Clears the currently in-use item.
|
||||
*/
|
||||
void clearItemInUse();
|
||||
|
||||
public void clearInventory();
|
||||
/**
|
||||
* Clears the player's entire inventory, including main and armor slots.
|
||||
*/
|
||||
void clearInventory();
|
||||
|
||||
/**
|
||||
* Plays the specified sound at the given volume and pitch for the player.
|
||||
*
|
||||
* @param name The sound name.
|
||||
* @param volume The volume level.
|
||||
* @param pitch The pitch level.
|
||||
*/
|
||||
void playSound(String name, float volume, float pitch);
|
||||
|
||||
/**
|
||||
* Plays the specified sound with an identifier for the player.
|
||||
*
|
||||
* @param id The sound identifier.
|
||||
* @param sound The sound to play.
|
||||
*/
|
||||
void playSound(int id, ISound sound);
|
||||
|
||||
/**
|
||||
* Plays the specified sound for the player.
|
||||
*
|
||||
* @param sound The sound to play.
|
||||
*/
|
||||
void playSound(ISound sound);
|
||||
|
||||
/**
|
||||
* Stops the sound with the given identifier for the player.
|
||||
*
|
||||
* @param id The sound identifier.
|
||||
*/
|
||||
void stopSound(int id);
|
||||
|
||||
/**
|
||||
* Pauses all sounds currently playing for the player.
|
||||
*/
|
||||
void pauseSounds();
|
||||
|
||||
/**
|
||||
* Resumes paused sounds for the player.
|
||||
*/
|
||||
void continueSounds();
|
||||
|
||||
/**
|
||||
* Stops all sounds currently playing for the player.
|
||||
*/
|
||||
void stopSounds();
|
||||
|
||||
/**
|
||||
* Mounts the specified entity onto the player.
|
||||
*
|
||||
* @param ridingEntity The entity to mount.
|
||||
*/
|
||||
void mountEntity(Entity ridingEntity);
|
||||
|
||||
/**
|
||||
* Drops one item from the player's inventory.
|
||||
*
|
||||
* @param dropStack If true, drops the entire stack; otherwise, drops a single item.
|
||||
* @return The dropped item as an IEntity.
|
||||
*/
|
||||
IEntity dropOneItem(boolean dropStack);
|
||||
|
||||
/**
|
||||
* Checks if the player can harvest the specified block.
|
||||
*
|
||||
* @param block The block to check.
|
||||
* @return True if the player can harvest the block, false otherwise.
|
||||
*/
|
||||
boolean canHarvestBlock(IBlock block);
|
||||
|
||||
/**
|
||||
* Interacts with the specified entity.
|
||||
*
|
||||
* @param entity The entity to interact with.
|
||||
* @return True if the interaction was successful, false otherwise.
|
||||
*/
|
||||
boolean interactWith(IEntity entity);
|
||||
|
||||
/**
|
||||
* @param achievement The achievement id. For a complete list see http://minecraft.wiki/w/Achievements
|
||||
* @return Returns whether or not the player has this achievement
|
||||
* @return Returns whether or not the player has this achievement.
|
||||
*/
|
||||
boolean hasAchievement(String achievement);
|
||||
|
||||
/**
|
||||
* @param permission Bukkit/Cauldron permission
|
||||
* @return Returns whether or not the player has the permission
|
||||
* @param permission Bukkit/Cauldron permission.
|
||||
* @return Returns whether or not the player has the specified permission.
|
||||
*/
|
||||
boolean hasBukkitPermission(String permission);
|
||||
|
||||
/**
|
||||
* @return Returns the player's experience level.
|
||||
* @since 1.7.10c
|
||||
* @return Returns the exp level
|
||||
*/
|
||||
int getExpLevel();
|
||||
|
||||
/**
|
||||
* @param level The new experience level to set.
|
||||
* @since 1.7.10c
|
||||
* @param level The new exp level you want to set
|
||||
*/
|
||||
void setExpLevel(int level);
|
||||
|
||||
/**
|
||||
* Requires pixelmon to be installed
|
||||
* Requires Pixelmon to be installed.
|
||||
*
|
||||
* @return Returns the player's Pixelmon data, or null if Pixelmon is not enabled.
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
IPixelmonPlayerData getPixelmonData();
|
||||
|
||||
/**
|
||||
* Returns the player's timers.
|
||||
*
|
||||
* @return The timers associated with the player.
|
||||
*/
|
||||
ITimers getTimers();
|
||||
|
||||
/**
|
||||
* Updates the player's inventory on the client side.
|
||||
*/
|
||||
void updatePlayerInventory();
|
||||
|
||||
/**
|
||||
* Returns the player's DBC (database) data, if available.
|
||||
*
|
||||
* @return The DBC data, or null if not applicable.
|
||||
*/
|
||||
IDBCPlayer getDBCPlayer();
|
||||
|
||||
/**
|
||||
* Checks if the player is currently blocking.
|
||||
*
|
||||
* @return True if blocking, false otherwise.
|
||||
*/
|
||||
boolean blocking();
|
||||
|
||||
public IPlayerData getData();
|
||||
/**
|
||||
* Returns the player's associated data (quest, faction, timers, etc.).
|
||||
*
|
||||
* @return The player's data.
|
||||
*/
|
||||
IPlayerData getData();
|
||||
|
||||
/**
|
||||
* Checks if the player is flagged as a scripting developer.
|
||||
*
|
||||
* @return True if the player is a scripting developer, false otherwise.
|
||||
*/
|
||||
boolean isScriptingDev();
|
||||
|
||||
/**
|
||||
* Returns an array of quests that the player is actively undertaking.
|
||||
*
|
||||
* @return An array of active quests.
|
||||
*/
|
||||
IQuest[] getActiveQuests();
|
||||
|
||||
/**
|
||||
* Returns the container (GUI) that the player currently has open, if any.
|
||||
*
|
||||
* @return The open container, or null if none is open.
|
||||
*/
|
||||
IContainer getOpenContainer();
|
||||
|
||||
/**
|
||||
* Displays a custom GUI to the player.
|
||||
*
|
||||
* @param gui The custom GUI to show.
|
||||
*/
|
||||
void showCustomGui(ICustomGui gui);
|
||||
|
||||
/**
|
||||
* Returns the custom GUI currently open for the player.
|
||||
*
|
||||
* @return The custom GUI, or null if none is open.
|
||||
*/
|
||||
ICustomGui getCustomGui();
|
||||
|
||||
/**
|
||||
* Closes the currently open GUI for the player.
|
||||
*/
|
||||
void closeGui();
|
||||
|
||||
/**
|
||||
* Displays a custom overlay on the player's screen.
|
||||
*
|
||||
* @param overlay The custom overlay to display.
|
||||
*/
|
||||
void showCustomOverlay(ICustomOverlay overlay);
|
||||
|
||||
/**
|
||||
* Closes the custom overlay with the specified identifier.
|
||||
*
|
||||
* @param id The overlay ID.
|
||||
*/
|
||||
void closeOverlay(int id);
|
||||
|
||||
/**
|
||||
* Returns the player's overlay handler which manages custom overlays.
|
||||
*
|
||||
* @return The overlay handler.
|
||||
*/
|
||||
IOverlayHandler getOverlays();
|
||||
|
||||
/**
|
||||
* Returns the player's animation data.
|
||||
*
|
||||
* @return The animation data.
|
||||
*/
|
||||
IAnimationData getAnimationData();
|
||||
|
||||
/**
|
||||
* Sets whether the player has conquered the End dimension.
|
||||
*
|
||||
* @param conqueredEnd True if the End is conquered, false otherwise.
|
||||
*/
|
||||
void setConqueredEnd(boolean conqueredEnd);
|
||||
|
||||
/**
|
||||
* Checks whether the player has conquered the End dimension.
|
||||
*
|
||||
* @return True if the End has been conquered, false otherwise.
|
||||
*/
|
||||
boolean conqueredEnd();
|
||||
|
||||
public IScreenSize getScreenSize();
|
||||
/**
|
||||
* Returns the player's screen size information.
|
||||
*
|
||||
* @return The screen size.
|
||||
*/
|
||||
IScreenSize getScreenSize();
|
||||
|
||||
/**
|
||||
* Returns the player's magic-related data.
|
||||
*
|
||||
* @return The magic data.
|
||||
*/
|
||||
IMagicData getMagicData();
|
||||
}
|
||||
@@ -1,51 +1,90 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IProjectile {
|
||||
|
||||
public IItemStack getItem();
|
||||
|
||||
public void setItem(IItemStack item);
|
||||
|
||||
/**
|
||||
* @return Returns whether the arrow flies in a straight line or not
|
||||
*/
|
||||
public boolean getHasGravity();
|
||||
|
||||
/**
|
||||
* @param bo Whether the arrow flies in a straight line or not
|
||||
*/
|
||||
public void setHasGravity(boolean bo);
|
||||
|
||||
public int getAccuracy();
|
||||
|
||||
public void setAccuracy(int accuracy);
|
||||
|
||||
/**
|
||||
* Entity where the projectile heads towards
|
||||
* The position for the projectile needs to have been set for this
|
||||
*/
|
||||
public void setHeading(IEntity entity);
|
||||
|
||||
/**
|
||||
* Position where the projectile heads towards.
|
||||
* The position for the projectile needs to have been set for this
|
||||
*/
|
||||
public void setHeading(double x, double y, double z);
|
||||
|
||||
/**
|
||||
* @param yaw Rotation yaw
|
||||
* @param pitch Rotation pitch
|
||||
*/
|
||||
public void setHeading(float yaw, float pitch);
|
||||
|
||||
|
||||
public IEntity getThrower();
|
||||
|
||||
|
||||
/**
|
||||
* For scripters to enable projectile events in their current scripting container
|
||||
*/
|
||||
public void enableEvents();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents a projectile entity.
|
||||
* Provides methods to access and modify the projectile's item, gravity, accuracy, heading,
|
||||
* and to enable scripting events.
|
||||
*/
|
||||
public interface IProjectile {
|
||||
|
||||
/**
|
||||
* Returns the item associated with the projectile (e.g. arrow, fireball).
|
||||
*
|
||||
* @return the item as an IItemStack.
|
||||
*/
|
||||
IItemStack getItem();
|
||||
|
||||
/**
|
||||
* Sets the item for the projectile.
|
||||
*
|
||||
* @param item the item to set.
|
||||
*/
|
||||
void setItem(IItemStack item);
|
||||
|
||||
/**
|
||||
* @return true if the projectile is affected by gravity; false if it flies straight.
|
||||
*/
|
||||
boolean getHasGravity();
|
||||
|
||||
/**
|
||||
* Sets whether the projectile is affected by gravity.
|
||||
*
|
||||
* @param bo true to enable gravity; false otherwise.
|
||||
*/
|
||||
void setHasGravity(boolean bo);
|
||||
|
||||
/**
|
||||
* Returns the accuracy value for the projectile.
|
||||
*
|
||||
* @return the accuracy.
|
||||
*/
|
||||
int getAccuracy();
|
||||
|
||||
/**
|
||||
* Sets the accuracy value for the projectile.
|
||||
*
|
||||
* @param accuracy the accuracy value.
|
||||
*/
|
||||
void setAccuracy(int accuracy);
|
||||
|
||||
/**
|
||||
* Sets the heading (target destination) for the projectile based on the target entity.
|
||||
* The projectile's position should already be set.
|
||||
*
|
||||
* @param entity the target entity.
|
||||
*/
|
||||
void setHeading(IEntity entity);
|
||||
|
||||
/**
|
||||
* Sets the heading for the projectile to the specified coordinates.
|
||||
* The projectile's position should already be set.
|
||||
*
|
||||
* @param x the target x coordinate.
|
||||
* @param y the target y coordinate.
|
||||
* @param z the target z coordinate.
|
||||
*/
|
||||
void setHeading(double x, double y, double z);
|
||||
|
||||
/**
|
||||
* Sets the heading using yaw and pitch values.
|
||||
*
|
||||
* @param yaw the yaw angle.
|
||||
* @param pitch the pitch angle.
|
||||
*/
|
||||
void setHeading(float yaw, float pitch);
|
||||
|
||||
/**
|
||||
* Returns the thrower (the entity that launched the projectile).
|
||||
*
|
||||
* @return the thrower as an IEntity.
|
||||
*/
|
||||
IEntity getThrower();
|
||||
|
||||
/**
|
||||
* Enables projectile events for the current scripting container.
|
||||
* Must be called during a script.
|
||||
**/
|
||||
void enableEvents();
|
||||
}
|
||||
@@ -1,12 +1,28 @@
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
|
||||
public interface IVillager<T extends EntityMob> extends IEntityLiving<T>{
|
||||
|
||||
int getProfession();
|
||||
|
||||
boolean getIsTrading();
|
||||
|
||||
IEntityLivingBase getCustomer();
|
||||
}
|
||||
package noppes.npcs.api.entity;
|
||||
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
|
||||
/**
|
||||
* Represents a villager entity with additional trading-related methods.
|
||||
*
|
||||
* @param <T> The underlying Minecraft EntityVillager type.
|
||||
*/
|
||||
public interface IVillager<T extends EntityVillager> extends IEntityLiving<T> {
|
||||
|
||||
/**
|
||||
* @return The profession of the villager.
|
||||
*/
|
||||
int getProfession();
|
||||
|
||||
/**
|
||||
* @return true if the villager is currently trading.
|
||||
*/
|
||||
boolean getIsTrading();
|
||||
|
||||
/**
|
||||
* Returns the customer (player) who is currently trading with the villager.
|
||||
*
|
||||
* @return the customer as an IEntityLivingBase.
|
||||
*/
|
||||
IEntityLivingBase getCustomer();
|
||||
}
|
||||
@@ -1,21 +1,50 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IAvailability;
|
||||
|
||||
public interface IMark {
|
||||
|
||||
public IAvailability getAvailability();
|
||||
|
||||
public int getColor();
|
||||
|
||||
public void setColor(int color);
|
||||
|
||||
public int getType();
|
||||
|
||||
public void setType(int type);
|
||||
|
||||
/**
|
||||
* Calling this will send the changes you've made to the clients
|
||||
*/
|
||||
public void update();
|
||||
}
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
import noppes.npcs.api.handler.data.IAvailability;
|
||||
|
||||
/**
|
||||
* Represents a mark that can be applied to an entity.
|
||||
* A mark holds a type, a color, and availability conditions.
|
||||
*/
|
||||
public interface IMark {
|
||||
|
||||
/**
|
||||
* Returns the availability conditions associated with this mark.
|
||||
*
|
||||
* @return the availability.
|
||||
*/
|
||||
IAvailability getAvailability();
|
||||
|
||||
/**
|
||||
* Returns the color value of this mark.
|
||||
*
|
||||
* @return the color as an integer.
|
||||
*/
|
||||
int getColor();
|
||||
|
||||
/**
|
||||
* Sets the color value of this mark.
|
||||
*
|
||||
* @param color the new color.
|
||||
*/
|
||||
void setColor(int color);
|
||||
|
||||
/**
|
||||
* Returns the type of this mark.
|
||||
*
|
||||
* @return the mark type as an integer.
|
||||
*/
|
||||
int getType();
|
||||
|
||||
/**
|
||||
* Sets the type of this mark.
|
||||
*
|
||||
* @param type the new type.
|
||||
*/
|
||||
void setType(int type);
|
||||
|
||||
/**
|
||||
* Calling this will send the changes you've made to the clients.
|
||||
*/
|
||||
void update();
|
||||
}
|
||||
@@ -1,49 +1,163 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
public interface IModelData {
|
||||
|
||||
void headWear(byte config);
|
||||
|
||||
byte headWear();
|
||||
|
||||
void bodyWear(byte config);
|
||||
|
||||
byte bodyWear();
|
||||
|
||||
void rightArmWear(byte config);
|
||||
|
||||
byte rightArmWear();
|
||||
|
||||
void leftArmWear(byte config);
|
||||
|
||||
byte leftArmWear();
|
||||
|
||||
void rightLegWear(byte config);
|
||||
|
||||
byte rightLegWear();
|
||||
|
||||
void leftLegWear(byte config);
|
||||
|
||||
byte leftLegWear();
|
||||
|
||||
/**
|
||||
* Hide Body Parts
|
||||
* part: [0: Head, 1: Body, 2: Arms, 3: Legs]
|
||||
* hide: [0: None, 1: Both, 2: Right, 3: Left], only values 0 and 1 used for head & body.
|
||||
*/
|
||||
void hidePart(int part, byte hide);
|
||||
|
||||
int hidden(int part);
|
||||
|
||||
void enableRotation(boolean enableRotation);
|
||||
|
||||
boolean enableRotation();
|
||||
|
||||
IModelRotate getRotation();
|
||||
|
||||
IModelScale getScale();
|
||||
|
||||
void setEntity(String string);
|
||||
|
||||
String getEntity();
|
||||
}
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
/**
|
||||
* Provides configuration data for a model including wearable settings,
|
||||
* hidden parts, rotation, and scale.
|
||||
* <p>
|
||||
* This interface allows controlling the appearance of an entity's model
|
||||
* such as headwear, bodywear, arm and leg configurations, and the ability
|
||||
* to hide parts. It also manages model rotation and scaling settings as well
|
||||
* as the association with an entity type.
|
||||
*/
|
||||
public interface IModelData {
|
||||
|
||||
/**
|
||||
* Sets the headwear configuration.
|
||||
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
|
||||
*
|
||||
* @param config the headwear configuration.
|
||||
*/
|
||||
void headWear(byte config);
|
||||
|
||||
/**
|
||||
* Gets the current headwear configuration.
|
||||
*
|
||||
* @return the headwear configuration.
|
||||
*/
|
||||
byte headWear();
|
||||
|
||||
/**
|
||||
* Sets the bodywear configuration.
|
||||
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
|
||||
*
|
||||
* @param config the bodywear configuration.
|
||||
*/
|
||||
void bodyWear(byte config);
|
||||
|
||||
/**
|
||||
* Gets the current bodywear configuration.
|
||||
*
|
||||
* @return the bodywear configuration.
|
||||
*/
|
||||
byte bodyWear();
|
||||
|
||||
/**
|
||||
* Sets the right arm wear configuration.
|
||||
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
|
||||
*
|
||||
* @param config the right arm configuration.
|
||||
*/
|
||||
void rightArmWear(byte config);
|
||||
|
||||
/**
|
||||
* Gets the current right arm wear configuration.
|
||||
*
|
||||
* @return the right arm configuration.
|
||||
*/
|
||||
byte rightArmWear();
|
||||
|
||||
/**
|
||||
* Sets the left arm wear configuration.
|
||||
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
|
||||
*
|
||||
* @param config the left arm configuration.
|
||||
*/
|
||||
void leftArmWear(byte config);
|
||||
|
||||
/**
|
||||
* Gets the current left arm wear configuration.
|
||||
*
|
||||
* @return the left arm configuration.
|
||||
*/
|
||||
byte leftArmWear();
|
||||
|
||||
/**
|
||||
* Sets the right leg wear configuration.
|
||||
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
|
||||
*
|
||||
* @param config the right leg configuration.
|
||||
*/
|
||||
void rightLegWear(byte config);
|
||||
|
||||
/**
|
||||
* Gets the current right leg wear configuration.
|
||||
*
|
||||
* @return the right leg configuration.
|
||||
*/
|
||||
byte rightLegWear();
|
||||
|
||||
/**
|
||||
* Sets the left leg wear configuration.
|
||||
* Valid values: 0 (hidden), 1 (2D), 2 (3D).
|
||||
*
|
||||
* @param config the left leg configuration.
|
||||
*/
|
||||
void leftLegWear(byte config);
|
||||
|
||||
/**
|
||||
* Gets the current left leg wear configuration.
|
||||
*
|
||||
* @return the left leg configuration.
|
||||
*/
|
||||
byte leftLegWear();
|
||||
|
||||
/**
|
||||
* Hide Body Parts
|
||||
* part: [0: Head, 1: Body, 2: Arms, 3: Legs]
|
||||
* hide: [0: None, 1: Both, 2: Right, 3: Left], only values 0 and 1 used for head & body.
|
||||
*
|
||||
* @param part the part index.
|
||||
* @param hide the hide configuration.
|
||||
*/
|
||||
void hidePart(int part, byte hide);
|
||||
|
||||
/**
|
||||
* Returns the hide configuration for the specified part.
|
||||
*
|
||||
* @param part the part index.
|
||||
* @return the current hide configuration.
|
||||
*/
|
||||
int hidden(int part);
|
||||
|
||||
/**
|
||||
* Enables or disables rotation for the model.
|
||||
*
|
||||
* @param enableRotation true to enable rotation; false to disable.
|
||||
*/
|
||||
void enableRotation(boolean enableRotation);
|
||||
|
||||
/**
|
||||
* Checks whether rotation is enabled for the model.
|
||||
*
|
||||
* @return true if rotation is enabled; false otherwise.
|
||||
*/
|
||||
boolean enableRotation();
|
||||
|
||||
/**
|
||||
* Returns the model rotation configuration.
|
||||
*
|
||||
* @return the rotation settings.
|
||||
*/
|
||||
IModelRotate getRotation();
|
||||
|
||||
/**
|
||||
* Returns the model scaling configuration.
|
||||
*
|
||||
* @return the scale settings.
|
||||
*/
|
||||
IModelScale getScale();
|
||||
|
||||
/**
|
||||
* Associates this model data with an entity using its class name.
|
||||
*
|
||||
* @param string the fully qualified class name of the entity.
|
||||
*/
|
||||
void setEntity(String string);
|
||||
|
||||
/**
|
||||
* Gets the entity class name associated with this model data.
|
||||
*
|
||||
* @return the entity class name, or null if not set.
|
||||
*/
|
||||
String getEntity();
|
||||
}
|
||||
@@ -1,18 +1,59 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
public interface IModelRotate {
|
||||
|
||||
boolean whileStanding();
|
||||
|
||||
void whileStanding(boolean whileStanding);
|
||||
|
||||
boolean whileAttacking();
|
||||
|
||||
void whileAttacking(boolean whileAttacking);
|
||||
|
||||
boolean whileMoving();
|
||||
|
||||
void whileMoving(boolean whileMoving);
|
||||
|
||||
IModelRotatePart getPart(int part);
|
||||
}
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
/**
|
||||
* Represents the rotation configuration for a model.
|
||||
* It controls how different parts of a model rotate under various conditions.
|
||||
*/
|
||||
public interface IModelRotate {
|
||||
|
||||
/**
|
||||
* Checks if rotation is applied while the entity is standing.
|
||||
*
|
||||
* @return true if rotation while standing is enabled; false otherwise.
|
||||
*/
|
||||
boolean whileStanding();
|
||||
|
||||
/**
|
||||
* Sets whether rotation should be applied while the entity is standing.
|
||||
*
|
||||
* @param whileStanding true to enable; false to disable.
|
||||
*/
|
||||
void whileStanding(boolean whileStanding);
|
||||
|
||||
/**
|
||||
* Checks if rotation is applied while the entity is attacking.
|
||||
*
|
||||
* @return true if rotation while attacking is enabled; false otherwise.
|
||||
*/
|
||||
boolean whileAttacking();
|
||||
|
||||
/**
|
||||
* Sets whether rotation should be applied while the entity is attacking.
|
||||
*
|
||||
* @param whileAttacking true to enable; false to disable.
|
||||
*/
|
||||
void whileAttacking(boolean whileAttacking);
|
||||
|
||||
/**
|
||||
* Checks if rotation is applied while the entity is moving.
|
||||
*
|
||||
* @return true if rotation while moving is enabled; false otherwise.
|
||||
*/
|
||||
boolean whileMoving();
|
||||
|
||||
/**
|
||||
* Sets whether rotation should be applied while the entity is moving.
|
||||
*
|
||||
* @param whileMoving true to enable; false to disable.
|
||||
*/
|
||||
void whileMoving(boolean whileMoving);
|
||||
|
||||
/**
|
||||
* Retrieves the rotation settings for a specific part of the model.
|
||||
* Parts are indexed as follows: 0 - head, 1 - body, 2 - left arm, 3 - right arm, 4 - left leg, 5 - right leg.
|
||||
*
|
||||
* @param part the index of the model part.
|
||||
* @return the rotation settings for the specified part.
|
||||
*/
|
||||
IModelRotatePart getPart(int part);
|
||||
}
|
||||
@@ -1,16 +1,53 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
public interface IModelRotatePart {
|
||||
|
||||
void setRotation(float x, float y, float z);
|
||||
|
||||
float getRotateX();
|
||||
|
||||
float getRotateY();
|
||||
|
||||
float getRotateZ();
|
||||
|
||||
void disabled(boolean enabled);
|
||||
|
||||
boolean disabled();
|
||||
}
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
/**
|
||||
* Represents the rotation settings for a specific part of a model.
|
||||
* Allows configuring the rotation angles along the X, Y, and Z axes
|
||||
* as well as enabling/disabling the rotation.
|
||||
*/
|
||||
public interface IModelRotatePart {
|
||||
|
||||
/**
|
||||
* Sets the rotation angles for this model part.
|
||||
*
|
||||
* @param x the rotation angle around the X-axis.
|
||||
* @param y the rotation angle around the Y-axis.
|
||||
* @param z the rotation angle around the Z-axis.
|
||||
*/
|
||||
void setRotation(float x, float y, float z);
|
||||
|
||||
/**
|
||||
* Returns the rotation angle around the X-axis.
|
||||
*
|
||||
* @return the X-axis rotation.
|
||||
*/
|
||||
float getRotateX();
|
||||
|
||||
/**
|
||||
* Returns the rotation angle around the Y-axis.
|
||||
*
|
||||
* @return the Y-axis rotation.
|
||||
*/
|
||||
float getRotateY();
|
||||
|
||||
/**
|
||||
* Returns the rotation angle around the Z-axis.
|
||||
*
|
||||
* @return the Z-axis rotation.
|
||||
*/
|
||||
float getRotateZ();
|
||||
|
||||
/**
|
||||
* Enables or disables rotation for this part.
|
||||
*
|
||||
* @param enabled true to disable rotation; false to enable.
|
||||
*/
|
||||
void disabled(boolean enabled);
|
||||
|
||||
/**
|
||||
* Checks whether rotation is disabled for this part.
|
||||
*
|
||||
* @return true if rotation is disabled; false otherwise.
|
||||
*/
|
||||
boolean disabled();
|
||||
}
|
||||
@@ -1,5 +1,17 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
public interface IModelScale {
|
||||
IModelScalePart getPart(int part);
|
||||
}
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
/**
|
||||
* Represents the scaling configuration for a model.
|
||||
* Provides access to scaling data for individual parts of a model.
|
||||
*/
|
||||
public interface IModelScale {
|
||||
|
||||
/**
|
||||
* Retrieves the scaling settings for a specified model part.
|
||||
* Parts are indexed as follows: 0 - head, 1 - body, 2 - arms, 3 - legs.
|
||||
*
|
||||
* @param part the index of the model part.
|
||||
* @return the scale configuration for that part.
|
||||
*/
|
||||
IModelScalePart getPart(int part);
|
||||
}
|
||||
@@ -1,12 +1,38 @@
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
public interface IModelScalePart {
|
||||
|
||||
void setScale(float x, float y, float z);
|
||||
|
||||
float getScaleX();
|
||||
|
||||
float getScaleY();
|
||||
|
||||
float getScaleZ();
|
||||
}
|
||||
package noppes.npcs.api.entity.data;
|
||||
|
||||
/**
|
||||
* Represents the scale configuration for a specific part of a model.
|
||||
* Allows setting and retrieving scale factors along the X, Y, and Z axes.
|
||||
*/
|
||||
public interface IModelScalePart {
|
||||
|
||||
/**
|
||||
* Sets the scale factors for this model part.
|
||||
*
|
||||
* @param x the scale factor along the X-axis.
|
||||
* @param y the scale factor along the Y-axis.
|
||||
* @param z the scale factor along the Z-axis.
|
||||
*/
|
||||
void setScale(float x, float y, float z);
|
||||
|
||||
/**
|
||||
* Returns the scale factor along the X-axis.
|
||||
*
|
||||
* @return the X-axis scale.
|
||||
*/
|
||||
float getScaleX();
|
||||
|
||||
/**
|
||||
* Returns the scale factor along the Y-axis.
|
||||
*
|
||||
* @return the Y-axis scale.
|
||||
*/
|
||||
float getScaleY();
|
||||
|
||||
/**
|
||||
* Returns the scale factor along the Z-axis.
|
||||
*
|
||||
* @return the Z-axis scale.
|
||||
*/
|
||||
float getScaleZ();
|
||||
}
|
||||
@@ -8,9 +8,11 @@ import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
public interface IBlockEvent extends ICustomNPCsEvent {
|
||||
IBlock getBlock();
|
||||
|
||||
@Cancelable
|
||||
interface EntityFallenUponEvent extends IBlockEvent{
|
||||
interface EntityFallenUponEvent extends IBlockEvent {
|
||||
IEntity getEntity();
|
||||
|
||||
float getDistanceFallen();
|
||||
}
|
||||
|
||||
@@ -27,18 +29,22 @@ public interface IBlockEvent extends ICustomNPCsEvent {
|
||||
int getSide();
|
||||
}
|
||||
|
||||
interface RedstoneEvent extends IBlockEvent{
|
||||
interface RedstoneEvent extends IBlockEvent {
|
||||
int getPrevPower();
|
||||
|
||||
int getPower();
|
||||
}
|
||||
interface BreakEvent extends IBlockEvent{
|
||||
|
||||
interface BreakEvent extends IBlockEvent {
|
||||
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface ExplodedEvent extends IBlockEvent{
|
||||
interface ExplodedEvent extends IBlockEvent {
|
||||
|
||||
}
|
||||
interface RainFillEvent extends IBlockEvent{
|
||||
|
||||
interface RainFillEvent extends IBlockEvent {
|
||||
|
||||
}
|
||||
|
||||
@@ -46,10 +52,11 @@ public interface IBlockEvent extends ICustomNPCsEvent {
|
||||
IPos getChangedPos();
|
||||
}
|
||||
|
||||
interface InitEvent extends IBlockEvent{
|
||||
interface InitEvent extends IBlockEvent {
|
||||
|
||||
}
|
||||
interface UpdateEvent extends IBlockEvent{
|
||||
|
||||
interface UpdateEvent extends IBlockEvent {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface INpcEvent extends ICustomNPCsEvent {
|
||||
int getId();
|
||||
}
|
||||
|
||||
interface CollideEvent extends INpcEvent{
|
||||
interface CollideEvent extends INpcEvent {
|
||||
IEntity getEntity();
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public interface INpcEvent extends ICustomNPCsEvent {
|
||||
|
||||
/**
|
||||
* Can be null
|
||||
*
|
||||
* @return Returns the swung item
|
||||
*/
|
||||
IItemStack getItemStack();
|
||||
|
||||
@@ -19,7 +19,8 @@ public interface IPartyEvent {
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface PartyQuestTurnedInEvent extends IPartyEvent { }
|
||||
interface PartyQuestTurnedInEvent extends IPartyEvent {
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface PartyInviteEvent extends IPartyEvent {
|
||||
|
||||
@@ -8,6 +8,7 @@ import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.IPlayerEffect;
|
||||
import noppes.npcs.api.handler.data.IProfile;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IPlayerEvent extends ICustomNPCsEvent {
|
||||
@@ -252,7 +253,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent {
|
||||
}
|
||||
|
||||
interface FillBucketEvent extends IPlayerEvent {
|
||||
IItemStack getCurrent() ;
|
||||
IItemStack getCurrent();
|
||||
|
||||
IItemStack getFilled();
|
||||
}
|
||||
@@ -277,9 +278,11 @@ public interface IPlayerEvent extends ICustomNPCsEvent {
|
||||
interface Added extends EffectEvent {
|
||||
|
||||
}
|
||||
|
||||
interface Ticked extends EffectEvent {
|
||||
|
||||
}
|
||||
|
||||
interface Removed extends EffectEvent {
|
||||
|
||||
/**
|
||||
@@ -294,4 +297,39 @@ public interface IPlayerEvent extends ICustomNPCsEvent {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface ProfileEvent extends IPlayerEvent {
|
||||
|
||||
/**
|
||||
* @return IProfile Object of the Operation
|
||||
*/
|
||||
IProfile getProfile();
|
||||
|
||||
/**
|
||||
* @return Slot ID in question
|
||||
*/
|
||||
int getSlot();
|
||||
|
||||
/**
|
||||
* @return returns true if it occurs after the operation (not cancellable)
|
||||
*/
|
||||
boolean isPost();
|
||||
|
||||
@Cancelable
|
||||
interface Changed extends ProfileEvent {
|
||||
/**
|
||||
* @return The previous slot before the switch
|
||||
*/
|
||||
int getPrevSlot();
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface Create extends ProfileEvent {
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
interface Removed extends ProfileEvent {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,16 +6,19 @@ import noppes.npcs.api.entity.IProjectile;
|
||||
|
||||
public interface IProjectileEvent extends ICustomNPCsEvent {
|
||||
|
||||
public IProjectile getProjectile();
|
||||
public IEntity getSource();
|
||||
IProjectile getProjectile();
|
||||
|
||||
IEntity getSource();
|
||||
|
||||
interface UpdateEvent extends IProjectileEvent {
|
||||
}
|
||||
|
||||
interface ImpactEvent extends IProjectileEvent {
|
||||
public int getType();
|
||||
public IEntity getEntity();
|
||||
public IBlock getBlock();
|
||||
int getType();
|
||||
|
||||
IEntity getEntity();
|
||||
|
||||
IBlock getBlock();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,33 +1,119 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
/**
|
||||
* Represents a clickable button component in a custom GUI.
|
||||
* Provides methods to control size, label, texture, and state.
|
||||
*/
|
||||
public interface IButton extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the button's width.
|
||||
*
|
||||
* @return the width in pixels.
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the button's height.
|
||||
*
|
||||
* @return the height in pixels.
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Sets the size of the button.
|
||||
*
|
||||
* @param width the new width in pixels.
|
||||
* @param height the new height in pixels.
|
||||
* @return this button instance.
|
||||
*/
|
||||
IButton setSize(int width, int height);
|
||||
|
||||
/**
|
||||
* Returns the button's label text.
|
||||
*
|
||||
* @return the label.
|
||||
*/
|
||||
String getLabel();
|
||||
|
||||
/**
|
||||
* Sets the button's label text.
|
||||
*
|
||||
* @param text the new label.
|
||||
* @return this button instance.
|
||||
*/
|
||||
IButton setLabel(String text);
|
||||
|
||||
/**
|
||||
* Returns the texture resource location for this button.
|
||||
*
|
||||
* @return the texture location as a string.
|
||||
*/
|
||||
String getTexture();
|
||||
|
||||
/**
|
||||
* Checks if the button has an assigned texture.
|
||||
*
|
||||
* @return true if a texture is set; false otherwise.
|
||||
*/
|
||||
boolean hasTexture();
|
||||
|
||||
/**
|
||||
* Sets the texture resource location for this button.
|
||||
*
|
||||
* @param texture the texture resource location.
|
||||
* @return this button instance.
|
||||
*/
|
||||
IButton setTexture(String texture);
|
||||
|
||||
/**
|
||||
* Returns the X offset within the texture.
|
||||
*
|
||||
* @return the texture X offset.
|
||||
*/
|
||||
int getTextureX();
|
||||
|
||||
/**
|
||||
* Returns the Y offset within the texture.
|
||||
*
|
||||
* @return the texture Y offset.
|
||||
*/
|
||||
int getTextureY();
|
||||
|
||||
/**
|
||||
* Sets the texture offset (X and Y) for this button.
|
||||
*
|
||||
* @param textureX the new X offset.
|
||||
* @param textureY the new Y offset.
|
||||
* @return this button instance.
|
||||
*/
|
||||
IButton setTextureOffset(int textureX, int textureY);
|
||||
|
||||
/**
|
||||
* Sets the scale factor of the button.
|
||||
*
|
||||
* @param scale the scale factor.
|
||||
*/
|
||||
void setScale(float scale);
|
||||
|
||||
/**
|
||||
* Returns the scale factor of the button.
|
||||
*
|
||||
* @return the scale.
|
||||
*/
|
||||
float getScale();
|
||||
|
||||
/**
|
||||
* Enables or disables the button.
|
||||
*
|
||||
* @param enabled true to enable; false to disable.
|
||||
*/
|
||||
void setEnabled(boolean enabled);
|
||||
|
||||
/**
|
||||
* Checks if the button is enabled.
|
||||
*
|
||||
* @return true if enabled; false otherwise.
|
||||
*/
|
||||
boolean isEnabled();
|
||||
}
|
||||
@@ -1,85 +1,350 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICustomGui {
|
||||
int getID();
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
List<ICustomGuiComponent> getComponents();
|
||||
|
||||
void clear();
|
||||
|
||||
List<IItemSlot> getSlots();
|
||||
|
||||
void setSize(int width, int height);
|
||||
|
||||
void setDoesPauseGame(boolean pauseGame);
|
||||
|
||||
boolean doesPauseGame();
|
||||
|
||||
void setBackgroundTexture(String resourceLocation);
|
||||
|
||||
String getBackgroundTexture();
|
||||
|
||||
IButton addButton(int id, String text, int x, int y);
|
||||
|
||||
IButton addButton(int id, String text, int x, int y, int width, int height);
|
||||
|
||||
IButton addTexturedButton(int id, String text, int x, int y, int width, int height, String texture);
|
||||
|
||||
IButton addTexturedButton(int id, String text, int x, int y, int width, int height, String texture, int textureX, int textureY);
|
||||
|
||||
ILabel addLabel(int id, String text, int x, int y, int width, int height);
|
||||
|
||||
ILabel addLabel(int id, String text, int x, int y, int width, int height, int color);
|
||||
|
||||
ITextField addTextField(int id, int x, int y, int width, int height);
|
||||
|
||||
ITexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height);
|
||||
|
||||
ITexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height, int textureX, int textureY);
|
||||
|
||||
IScroll addScroll(int id, int x, int y, int width, int height, String[] list);
|
||||
|
||||
ILine addLine(int id, int x1, int y1, int x2, int y2, int color, int thickness);
|
||||
|
||||
ILine addLine(int id, int x1, int y1, int x2, int y2);
|
||||
|
||||
IItemSlot addItemSlot(int id, int x, int y);
|
||||
|
||||
IItemSlot addItemSlot(int id, int x, int y, IItemStack itemStack);
|
||||
|
||||
@Deprecated
|
||||
IItemSlot addItemSlot(int x, int y);
|
||||
|
||||
@Deprecated
|
||||
IItemSlot addItemSlot(int x, int y, IItemStack itemStack);
|
||||
|
||||
void showPlayerInventory(int x, int y);
|
||||
|
||||
ICustomGuiComponent getComponent(int id);
|
||||
|
||||
void removeComponent(int id);
|
||||
|
||||
void updateComponent(ICustomGuiComponent component);
|
||||
|
||||
void update(IPlayer player);
|
||||
|
||||
boolean getShowPlayerInv();
|
||||
|
||||
int getPlayerInvX();
|
||||
|
||||
int getPlayerInvY();
|
||||
|
||||
ICustomGui fromNBT(NBTTagCompound tag);
|
||||
|
||||
NBTTagCompound toNBT();
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a custom graphical user interface (GUI) that can contain various components
|
||||
* such as buttons, labels, text fields, item slots, etc.
|
||||
*/
|
||||
public interface ICustomGui {
|
||||
|
||||
/**
|
||||
* Returns the unique ID of the GUI.
|
||||
*
|
||||
* @return the GUI ID.
|
||||
*/
|
||||
int getID();
|
||||
|
||||
/**
|
||||
* Returns the width of the GUI.
|
||||
*
|
||||
* @return the width in pixels.
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the height of the GUI.
|
||||
*
|
||||
* @return the height in pixels.
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Returns a list of all components contained in this GUI.
|
||||
*
|
||||
* @return the list of components.
|
||||
*/
|
||||
List<ICustomGuiComponent> getComponents();
|
||||
|
||||
/**
|
||||
* Clears all components from the GUI.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* Returns a list of item slot components in this GUI.
|
||||
*
|
||||
* @return the list of item slots.
|
||||
*/
|
||||
List<IItemSlot> getSlots();
|
||||
|
||||
/**
|
||||
* Sets the size of the GUI.
|
||||
*
|
||||
* @param width the new width.
|
||||
* @param height the new height.
|
||||
*/
|
||||
void setSize(int width, int height);
|
||||
|
||||
/**
|
||||
* Specifies whether the GUI pauses the game.
|
||||
*
|
||||
* @param pauseGame true to pause the game.
|
||||
*/
|
||||
void setDoesPauseGame(boolean pauseGame);
|
||||
|
||||
/**
|
||||
* Checks if the GUI pauses the game.
|
||||
*
|
||||
* @return true if it pauses the game; false otherwise.
|
||||
*/
|
||||
boolean doesPauseGame();
|
||||
|
||||
/**
|
||||
* Sets the background texture resource location for the GUI.
|
||||
*
|
||||
* @param resourceLocation the texture resource location.
|
||||
*/
|
||||
void setBackgroundTexture(String resourceLocation);
|
||||
|
||||
/**
|
||||
* Returns the background texture resource location.
|
||||
*
|
||||
* @return the texture as a string.
|
||||
*/
|
||||
String getBackgroundTexture();
|
||||
|
||||
/**
|
||||
* Adds a button to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param text the button label.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @return the created button.
|
||||
*/
|
||||
IButton addButton(int id, String text, int x, int y);
|
||||
|
||||
/**
|
||||
* Adds a button to the GUI with a specified size.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param text the button label.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the button width.
|
||||
* @param height the button height.
|
||||
* @return the created button.
|
||||
*/
|
||||
IButton addButton(int id, String text, int x, int y, int width, int height);
|
||||
|
||||
/**
|
||||
* Adds a textured button to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param text the button label.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the button width.
|
||||
* @param height the button height.
|
||||
* @param texture the texture resource location.
|
||||
* @return the created button.
|
||||
*/
|
||||
IButton addTexturedButton(int id, String text, int x, int y, int width, int height, String texture);
|
||||
|
||||
/**
|
||||
* Adds a textured button with texture offset.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param text the button label.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the button width.
|
||||
* @param height the button height.
|
||||
* @param texture the texture resource location.
|
||||
* @param textureX the x offset in the texture.
|
||||
* @param textureY the y offset in the texture.
|
||||
* @return the created button.
|
||||
*/
|
||||
IButton addTexturedButton(int id, String text, int x, int y, int width, int height, String texture, int textureX, int textureY);
|
||||
|
||||
/**
|
||||
* Adds a label component to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param text the label text.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the width.
|
||||
* @param height the height.
|
||||
* @return the created label.
|
||||
*/
|
||||
ILabel addLabel(int id, String text, int x, int y, int width, int height);
|
||||
|
||||
/**
|
||||
* Adds a label component with a specified text color.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param text the label text.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the width.
|
||||
* @param height the height.
|
||||
* @param color the text color.
|
||||
* @return the created label.
|
||||
*/
|
||||
ILabel addLabel(int id, String text, int x, int y, int width, int height, int color);
|
||||
|
||||
/**
|
||||
* Adds a text field component to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the width.
|
||||
* @param height the height.
|
||||
* @return the created text field.
|
||||
*/
|
||||
ITextField addTextField(int id, int x, int y, int width, int height);
|
||||
|
||||
/**
|
||||
* Adds a textured rectangle component to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param texture the texture resource location.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the width.
|
||||
* @param height the height.
|
||||
* @return the created textured rectangle.
|
||||
*/
|
||||
ITexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height);
|
||||
|
||||
/**
|
||||
* Adds a textured rectangle component with texture offset.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param texture the texture resource location.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the width.
|
||||
* @param height the height.
|
||||
* @param textureX the x offset within the texture.
|
||||
* @param textureY the y offset within the texture.
|
||||
* @return the created textured rectangle.
|
||||
*/
|
||||
ITexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height, int textureX, int textureY);
|
||||
|
||||
/**
|
||||
* Adds an item slot component to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @return the created item slot.
|
||||
*/
|
||||
IItemSlot addItemSlot(int id, int x, int y);
|
||||
|
||||
/**
|
||||
* Adds an item slot component with an initial item stack.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param itemStack the initial item.
|
||||
* @return the created item slot.
|
||||
*/
|
||||
IItemSlot addItemSlot(int id, int x, int y, IItemStack itemStack);
|
||||
|
||||
/**
|
||||
* @deprecated Use addItemSlot(int, int, IItemStack) with an ID instead.
|
||||
*/
|
||||
@Deprecated
|
||||
IItemSlot addItemSlot(int x, int y);
|
||||
|
||||
/**
|
||||
* @deprecated Use addItemSlot(int, int, IItemStack) with an ID instead.
|
||||
*/
|
||||
@Deprecated
|
||||
IItemSlot addItemSlot(int x, int y, IItemStack itemStack);
|
||||
|
||||
/**
|
||||
* Adds a scroll component to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
* @param width the width.
|
||||
* @param height the height.
|
||||
* @param list the list of strings to display.
|
||||
* @return the created scroll component.
|
||||
*/
|
||||
IScroll addScroll(int id, int x, int y, int width, int height, String[] list);
|
||||
|
||||
/**
|
||||
* Adds a line component to the GUI.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param x1 the start x position.
|
||||
* @param y1 the start y position.
|
||||
* @param x2 the end x position.
|
||||
* @param y2 the end y position.
|
||||
* @param color the line color.
|
||||
* @param thickness the line thickness.
|
||||
* @return the created line component.
|
||||
*/
|
||||
ILine addLine(int id, int x1, int y1, int x2, int y2, int color, int thickness);
|
||||
|
||||
/**
|
||||
* Adds a line component with default thickness.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @param x1 the start x position.
|
||||
* @param y1 the start y position.
|
||||
* @param x2 the end x position.
|
||||
* @param y2 the end y position.
|
||||
* @return the created line component.
|
||||
*/
|
||||
ILine addLine(int id, int x1, int y1, int x2, int y2);
|
||||
|
||||
/**
|
||||
* Displays the player's inventory at the specified position.
|
||||
*
|
||||
* @param x the x position.
|
||||
* @param y the y position.
|
||||
*/
|
||||
void showPlayerInventory(int x, int y);
|
||||
|
||||
/**
|
||||
* Retrieves the GUI component with the given ID.
|
||||
*
|
||||
* @param id the component ID.
|
||||
* @return the component.
|
||||
*/
|
||||
ICustomGuiComponent getComponent(int id);
|
||||
|
||||
/**
|
||||
* Removes the GUI component with the specified ID.
|
||||
*
|
||||
* @param id the component ID.
|
||||
*/
|
||||
void removeComponent(int id);
|
||||
|
||||
/**
|
||||
* Updates the specified GUI component.
|
||||
*
|
||||
* @param component the component to update.
|
||||
*/
|
||||
void updateComponent(ICustomGuiComponent component);
|
||||
|
||||
/**
|
||||
* Sends an update of the GUI to the given player.
|
||||
*
|
||||
* @param player the player to update.
|
||||
*/
|
||||
void update(IPlayer player);
|
||||
|
||||
/**
|
||||
* @return true if the player inventory is shown.
|
||||
*/
|
||||
boolean getShowPlayerInv();
|
||||
|
||||
/**
|
||||
* @return the x position where the player inventory is displayed.
|
||||
*/
|
||||
int getPlayerInvX();
|
||||
|
||||
/**
|
||||
* @return the y position where the player inventory is displayed.
|
||||
*/
|
||||
int getPlayerInvY();
|
||||
|
||||
/**
|
||||
* Recreates the GUI from NBT data.
|
||||
*
|
||||
* @param tag the NBT tag.
|
||||
* @return this GUI.
|
||||
*/
|
||||
ICustomGui fromNBT(NBTTagCompound tag);
|
||||
|
||||
/**
|
||||
* Serializes the GUI to an NBT tag.
|
||||
*
|
||||
* @return the NBT data.
|
||||
*/
|
||||
NBTTagCompound toNBT();
|
||||
}
|
||||
@@ -2,38 +2,136 @@ package noppes.npcs.api.gui;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Base interface for all custom GUI components.
|
||||
* Defines common methods for position, appearance, and NBT serialization.
|
||||
*/
|
||||
public interface ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the unique ID of this component.
|
||||
*
|
||||
* @return the component ID.
|
||||
*/
|
||||
int getID();
|
||||
|
||||
/**
|
||||
* Sets the unique ID for this component.
|
||||
*
|
||||
* @param id the new ID.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setID(int id);
|
||||
|
||||
/**
|
||||
* Returns the x position of this component.
|
||||
*
|
||||
* @return the x position.
|
||||
*/
|
||||
int getPosX();
|
||||
|
||||
/**
|
||||
* Returns the y position of this component.
|
||||
*
|
||||
* @return the y position.
|
||||
*/
|
||||
int getPosY();
|
||||
|
||||
/**
|
||||
* Sets the position of the component.
|
||||
*
|
||||
* @param x the new x position.
|
||||
* @param y the new y position.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setPos(int x, int y);
|
||||
|
||||
/**
|
||||
* Checks if the component has hover text.
|
||||
*
|
||||
* @return true if hover text is set.
|
||||
*/
|
||||
boolean hasHoverText();
|
||||
|
||||
/**
|
||||
* Returns the hover text as an array of strings.
|
||||
*
|
||||
* @return the hover text.
|
||||
*/
|
||||
String[] getHoverText();
|
||||
|
||||
/**
|
||||
* Sets the hover text with a single line.
|
||||
*
|
||||
* @param hoverText the hover text.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setHoverText(String hoverText);
|
||||
|
||||
/**
|
||||
* Sets the hover text with multiple lines.
|
||||
*
|
||||
* @param hoverTextLines the hover text lines.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setHoverText(String[] hoverTextLines);
|
||||
|
||||
/**
|
||||
* Returns the text color.
|
||||
*
|
||||
* @return the color as an integer.
|
||||
*/
|
||||
int getColor();
|
||||
|
||||
/**
|
||||
* Sets the text color.
|
||||
*
|
||||
* @param color the color.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent setColor(int color);
|
||||
|
||||
float getAlpha();
|
||||
/**
|
||||
* Returns the component's transparency (alpha).
|
||||
*
|
||||
* @return the alpha value.
|
||||
*/
|
||||
float getAlpha();
|
||||
|
||||
/**
|
||||
* Sets the component's transparency (alpha).
|
||||
*
|
||||
* @param alpha the alpha value.
|
||||
*/
|
||||
void setAlpha(float alpha);
|
||||
|
||||
/**
|
||||
* Returns the component's rotation.
|
||||
*
|
||||
* @return the rotation angle.
|
||||
*/
|
||||
float getRotation();
|
||||
|
||||
/**
|
||||
* Sets the component's rotation.
|
||||
*
|
||||
* @param rotation the rotation angle.
|
||||
*/
|
||||
void setRotation(float rotation);
|
||||
|
||||
/**
|
||||
* Serializes the component to an NBT compound.
|
||||
*
|
||||
* @param nbt the NBT compound to populate.
|
||||
* @return the NBT compound.
|
||||
*/
|
||||
NBTTagCompound toNBT(NBTTagCompound nbt);
|
||||
|
||||
/**
|
||||
* Deserializes the component from an NBT compound.
|
||||
*
|
||||
* @param nbt the NBT compound.
|
||||
* @return this component instance.
|
||||
*/
|
||||
ICustomGuiComponent fromNBT(NBTTagCompound nbt);
|
||||
}
|
||||
@@ -1,14 +1,40 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
import net.minecraft.inventory.Slot;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
public interface IItemSlot extends ICustomGuiComponent {
|
||||
boolean hasStack();
|
||||
|
||||
IItemStack getStack();
|
||||
|
||||
IItemSlot setStack(IItemStack itemStack);
|
||||
|
||||
Slot getMCSlot();
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
import net.minecraft.inventory.Slot;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Represents an item slot component in a custom GUI.
|
||||
* Provides methods to get or set the contained item.
|
||||
*/
|
||||
public interface IItemSlot extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Checks if the slot currently contains an item stack.
|
||||
*
|
||||
* @return true if a stack exists; false otherwise.
|
||||
*/
|
||||
boolean hasStack();
|
||||
|
||||
/**
|
||||
* Returns the item stack contained in this slot.
|
||||
*
|
||||
* @return the item stack.
|
||||
*/
|
||||
IItemStack getStack();
|
||||
|
||||
/**
|
||||
* Sets the item stack for this slot.
|
||||
*
|
||||
* @param itemStack the item stack to set.
|
||||
* @return this item slot instance.
|
||||
*/
|
||||
IItemSlot setStack(IItemStack itemStack);
|
||||
|
||||
/**
|
||||
* Returns the underlying Minecraft slot object.
|
||||
*
|
||||
* @return the Minecraft Slot.
|
||||
*/
|
||||
Slot getMCSlot();
|
||||
}
|
||||
@@ -1,21 +1,75 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
public interface ILabel extends ICustomGuiComponent {
|
||||
String getText();
|
||||
|
||||
ILabel setText(String text);
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
ILabel setSize(int width, int height);
|
||||
|
||||
float getScale();
|
||||
|
||||
ILabel setScale(float scale);
|
||||
|
||||
boolean getShadow();
|
||||
|
||||
void setShadow(boolean shadow);
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
/**
|
||||
* Represents a text label component in a custom GUI.
|
||||
* Provides methods to get or set text, size, scale, and shadow properties.
|
||||
*/
|
||||
public interface ILabel extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the text of the label.
|
||||
*
|
||||
* @return the label text.
|
||||
*/
|
||||
String getText();
|
||||
|
||||
/**
|
||||
* Sets the label text.
|
||||
*
|
||||
* @param text the new text.
|
||||
* @return this label instance.
|
||||
*/
|
||||
ILabel setText(String text);
|
||||
|
||||
/**
|
||||
* Returns the label's width.
|
||||
*
|
||||
* @return the width in pixels.
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the label's height.
|
||||
*
|
||||
* @return the height in pixels.
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Sets the size of the label.
|
||||
*
|
||||
* @param width the new width.
|
||||
* @param height the new height.
|
||||
* @return this label instance.
|
||||
*/
|
||||
ILabel setSize(int width, int height);
|
||||
|
||||
/**
|
||||
* Returns the scale factor of the label.
|
||||
*
|
||||
* @return the scale.
|
||||
*/
|
||||
float getScale();
|
||||
|
||||
/**
|
||||
* Sets the scale factor of the label.
|
||||
*
|
||||
* @param scale the new scale.
|
||||
* @return this label instance.
|
||||
*/
|
||||
ILabel setScale(float scale);
|
||||
|
||||
/**
|
||||
* Returns whether the label text is rendered with a shadow.
|
||||
*
|
||||
* @return true if shadow is enabled; false otherwise.
|
||||
*/
|
||||
boolean getShadow();
|
||||
|
||||
/**
|
||||
* Sets whether the label text should be rendered with a shadow.
|
||||
*
|
||||
* @param shadow true to enable shadow.
|
||||
*/
|
||||
void setShadow(boolean shadow);
|
||||
}
|
||||
@@ -1,15 +1,78 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
public interface ILine extends ICustomGuiComponent {
|
||||
int getX1();
|
||||
int getY1();
|
||||
int getX2();
|
||||
int getY2();
|
||||
int getThickness();
|
||||
|
||||
void setX1(int x1);
|
||||
void setY1(int y1);
|
||||
void setX2(int x2);
|
||||
void setY2(int y2);
|
||||
void setThickness(int thickness);
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
/**
|
||||
* Represents a line component in a custom GUI.
|
||||
* Provides methods to get or set endpoints and thickness.
|
||||
*/
|
||||
public interface ILine extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the starting x coordinate of the line.
|
||||
*
|
||||
* @return the x1 value.
|
||||
*/
|
||||
int getX1();
|
||||
|
||||
/**
|
||||
* Returns the starting y coordinate of the line.
|
||||
*
|
||||
* @return the y1 value.
|
||||
*/
|
||||
int getY1();
|
||||
|
||||
/**
|
||||
* Returns the ending x coordinate of the line.
|
||||
*
|
||||
* @return the x2 value.
|
||||
*/
|
||||
int getX2();
|
||||
|
||||
/**
|
||||
* Returns the ending y coordinate of the line.
|
||||
*
|
||||
* @return the y2 value.
|
||||
*/
|
||||
int getY2();
|
||||
|
||||
/**
|
||||
* Returns the thickness of the line.
|
||||
*
|
||||
* @return the thickness in pixels.
|
||||
*/
|
||||
int getThickness();
|
||||
|
||||
/**
|
||||
* Sets the starting x coordinate of the line.
|
||||
*
|
||||
* @param x1 the new x1 value.
|
||||
*/
|
||||
void setX1(int x1);
|
||||
|
||||
/**
|
||||
* Sets the starting y coordinate of the line.
|
||||
*
|
||||
* @param y1 the new y1 value.
|
||||
*/
|
||||
void setY1(int y1);
|
||||
|
||||
/**
|
||||
* Sets the ending x coordinate of the line.
|
||||
*
|
||||
* @param x2 the new x2 value.
|
||||
*/
|
||||
void setX2(int x2);
|
||||
|
||||
/**
|
||||
* Sets the ending y coordinate of the line.
|
||||
*
|
||||
* @param y2 the new y2 value.
|
||||
*/
|
||||
void setY2(int y2);
|
||||
|
||||
/**
|
||||
* Sets the thickness of the line.
|
||||
*
|
||||
* @param thickness the new thickness.
|
||||
*/
|
||||
void setThickness(int thickness);
|
||||
}
|
||||
@@ -1,21 +1,76 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
public interface IScroll extends ICustomGuiComponent {
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
IScroll setSize(int width, int height);
|
||||
|
||||
String[] getList();
|
||||
|
||||
IScroll setList(String[] textList);
|
||||
|
||||
int getDefaultSelection();
|
||||
|
||||
IScroll setDefaultSelection(int defaultSelection);
|
||||
|
||||
boolean isMultiSelect();
|
||||
|
||||
IScroll setMultiSelect(boolean selectMultiple);
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
/**
|
||||
* Represents a scrollable list component in a custom GUI.
|
||||
* Provides methods to control size, selection, and the displayed list.
|
||||
*/
|
||||
public interface IScroll extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the width of the scroll component.
|
||||
*
|
||||
* @return the width in pixels.
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the height of the scroll component.
|
||||
*
|
||||
* @return the height in pixels.
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Sets the size of the scroll component.
|
||||
*
|
||||
* @param width the new width.
|
||||
* @param height the new height.
|
||||
* @return this scroll instance.
|
||||
*/
|
||||
IScroll setSize(int width, int height);
|
||||
|
||||
/**
|
||||
* Returns the list of text entries displayed in the scroll.
|
||||
*
|
||||
* @return an array of strings.
|
||||
*/
|
||||
String[] getList();
|
||||
|
||||
/**
|
||||
* Sets the list of text entries to display.
|
||||
*
|
||||
* @param textList an array of strings.
|
||||
* @return this scroll instance.
|
||||
*/
|
||||
IScroll setList(String[] textList);
|
||||
|
||||
/**
|
||||
* Returns the default selection index.
|
||||
*
|
||||
* @return the default selection.
|
||||
*/
|
||||
int getDefaultSelection();
|
||||
|
||||
/**
|
||||
* Sets the default selection index.
|
||||
*
|
||||
* @param defaultSelection the selection index.
|
||||
* @return this scroll instance.
|
||||
*/
|
||||
IScroll setDefaultSelection(int defaultSelection);
|
||||
|
||||
/**
|
||||
* Checks whether multiple selections are allowed.
|
||||
*
|
||||
* @return true if multi-select is enabled.
|
||||
*/
|
||||
boolean isMultiSelect();
|
||||
|
||||
/**
|
||||
* Sets whether multiple selections are allowed.
|
||||
*
|
||||
* @param selectMultiple true to allow multi-select.
|
||||
* @return this scroll instance.
|
||||
*/
|
||||
IScroll setMultiSelect(boolean selectMultiple);
|
||||
}
|
||||
@@ -1,13 +1,46 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
public interface ITextField extends ICustomGuiComponent {
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
ITextField setSize(int width, int height);
|
||||
|
||||
String getText();
|
||||
|
||||
ITextField setText(String text);
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
/**
|
||||
* Represents a text field component in a custom GUI.
|
||||
* Provides methods to get or set its size and text content.
|
||||
*/
|
||||
public interface ITextField extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the width of the text field.
|
||||
*
|
||||
* @return the width in pixels.
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the height of the text field.
|
||||
*
|
||||
* @return the height in pixels.
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Sets the size of the text field.
|
||||
*
|
||||
* @param width the new width.
|
||||
* @param height the new height.
|
||||
* @return this text field instance.
|
||||
*/
|
||||
ITextField setSize(int width, int height);
|
||||
|
||||
/**
|
||||
* Returns the current text content of the text field.
|
||||
*
|
||||
* @return the text.
|
||||
*/
|
||||
String getText();
|
||||
|
||||
/**
|
||||
* Sets the text content of the text field.
|
||||
*
|
||||
* @param text the new text.
|
||||
* @return this text field instance.
|
||||
*/
|
||||
ITextField setText(String text);
|
||||
}
|
||||
@@ -1,23 +1,84 @@
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
public interface ITexturedRect extends ICustomGuiComponent {
|
||||
String getTexture();
|
||||
|
||||
ITexturedRect setTexture(String texture);
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
ITexturedRect setSize(int width, int height);
|
||||
|
||||
float getScale();
|
||||
|
||||
ITexturedRect setScale(float scale);
|
||||
|
||||
int getTextureX();
|
||||
|
||||
int getTextureY();
|
||||
|
||||
ITexturedRect setTextureOffset(int textureX, int textureY);
|
||||
}
|
||||
package noppes.npcs.api.gui;
|
||||
|
||||
/**
|
||||
* Represents a textured rectangle component in a custom GUI.
|
||||
* Allows configuration of texture resource, size, scale, and texture offset.
|
||||
*/
|
||||
public interface ITexturedRect extends ICustomGuiComponent {
|
||||
|
||||
/**
|
||||
* Returns the texture resource location.
|
||||
*
|
||||
* @return the texture as a string.
|
||||
*/
|
||||
String getTexture();
|
||||
|
||||
/**
|
||||
* Sets the texture resource location.
|
||||
*
|
||||
* @param texture the texture resource location.
|
||||
* @return this textured rectangle instance.
|
||||
*/
|
||||
ITexturedRect setTexture(String texture);
|
||||
|
||||
/**
|
||||
* Returns the width of the rectangle.
|
||||
*
|
||||
* @return the width in pixels.
|
||||
*/
|
||||
int getWidth();
|
||||
|
||||
/**
|
||||
* Returns the height of the rectangle.
|
||||
*
|
||||
* @return the height in pixels.
|
||||
*/
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
* Sets the size of the rectangle.
|
||||
*
|
||||
* @param width the new width.
|
||||
* @param height the new height.
|
||||
* @return this textured rectangle instance.
|
||||
*/
|
||||
ITexturedRect setSize(int width, int height);
|
||||
|
||||
/**
|
||||
* Returns the scale factor of the rectangle.
|
||||
*
|
||||
* @return the scale.
|
||||
*/
|
||||
float getScale();
|
||||
|
||||
/**
|
||||
* Sets the scale factor of the rectangle.
|
||||
*
|
||||
* @param scale the new scale.
|
||||
* @return this textured rectangle instance.
|
||||
*/
|
||||
ITexturedRect setScale(float scale);
|
||||
|
||||
/**
|
||||
* Returns the texture's x offset.
|
||||
*
|
||||
* @return the x offset.
|
||||
*/
|
||||
int getTextureX();
|
||||
|
||||
/**
|
||||
* Returns the texture's y offset.
|
||||
*
|
||||
* @return the y offset.
|
||||
*/
|
||||
int getTextureY();
|
||||
|
||||
/**
|
||||
* Sets the texture offset.
|
||||
*
|
||||
* @param textureX the new x offset.
|
||||
* @param textureY the new y offset.
|
||||
* @return this textured rectangle instance.
|
||||
*/
|
||||
ITexturedRect setTextureOffset(int textureX, int textureY);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import noppes.npcs.api.handler.data.IAction;
|
||||
|
||||
import java.util.Queue;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@ import noppes.npcs.api.entity.IEntity;
|
||||
public interface ICloneHandler {
|
||||
|
||||
IEntity spawn(double x, double y, double z, int tab, String name, IWorld world, boolean ignoreProtection);
|
||||
|
||||
IEntity spawn(IPos pos, int tab, String name, IWorld world, boolean ignoreProtection);
|
||||
|
||||
IEntity spawn(double x, double y, double z, int tab, String name, IWorld world);
|
||||
|
||||
IEntity spawn(IPos pos, int tab, String name, IWorld world);
|
||||
|
||||
IEntity[] getTab(int tab, IWorld world);
|
||||
|
||||
@@ -3,56 +3,250 @@ package noppes.npcs.api.handler;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.handler.data.ICustomEffect;
|
||||
|
||||
/**
|
||||
* Handler interface for managing custom effects.
|
||||
* Provides methods to create, retrieve, apply, remove, and save custom effects.
|
||||
*/
|
||||
public interface ICustomEffectHandler {
|
||||
|
||||
/**
|
||||
* Creates a new custom effect with the specified name.
|
||||
* If an effect with the given name already exists, the existing effect is returned.
|
||||
*
|
||||
* @param name the name of the custom effect to create
|
||||
* @return the newly created or existing custom effect
|
||||
*/
|
||||
ICustomEffect createEffect(String name);
|
||||
|
||||
/**
|
||||
* Retrieves the custom effect with the specified name.
|
||||
*
|
||||
* @param name the name of the custom effect to retrieve
|
||||
* @return the custom effect with the given name, or null if not found
|
||||
*/
|
||||
ICustomEffect getEffect(String name);
|
||||
|
||||
/**
|
||||
* Deletes the custom effect with the specified name.
|
||||
*
|
||||
* @param name the name of the custom effect to delete
|
||||
*/
|
||||
void deleteEffect(String name);
|
||||
|
||||
/**
|
||||
* Checks if the specified player currently has an effect with the given ID.
|
||||
*
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect -- Only DBC Addon
|
||||
* @return True if Player has Effect
|
||||
* @param player the player to check
|
||||
* @param id the ID of the status effect
|
||||
* @return true if the player has the effect, false otherwise
|
||||
*/
|
||||
boolean hasEffect(IPlayer player, int id);
|
||||
|
||||
/**
|
||||
* Checks if the specified player currently has the given custom effect.
|
||||
*
|
||||
* @param player the player to check
|
||||
* @param effect the custom effect to check for
|
||||
* @return true if the player has the effect, false otherwise
|
||||
*/
|
||||
boolean hasEffect(IPlayer player, ICustomEffect effect);
|
||||
|
||||
/**
|
||||
* Retrieves the remaining duration of the effect with the specified ID for the given player.
|
||||
* <p>
|
||||
* Return values:
|
||||
* <ul>
|
||||
* <li>-1 if the player does not have the effect</li>
|
||||
* <li>-100 if the effect has an infinite duration</li>
|
||||
* </ul>
|
||||
*
|
||||
* -1 : Does not have effect
|
||||
* -100 : Has infinite effect
|
||||
*
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect -- Only DBC Addon
|
||||
* @return Effect Time
|
||||
* @param player the player whose effect duration is queried
|
||||
* @param id the ID of the status effect
|
||||
* @return the remaining effect time in seconds
|
||||
*/
|
||||
int getEffectDuration(IPlayer player, int id);
|
||||
|
||||
/**
|
||||
* Retrieves the remaining duration of the given custom effect for the specified player.
|
||||
* <p>
|
||||
* Return values:
|
||||
* <ul>
|
||||
* <li>-1 if the player does not have the effect</li>
|
||||
* <li>-100 if the effect has an infinite duration</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param player the player whose effect duration is queried
|
||||
* @param effect the custom effect to check
|
||||
* @return the remaining effect time in seconds
|
||||
*/
|
||||
int getEffectDuration(IPlayer player, ICustomEffect effect);
|
||||
|
||||
/**
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect
|
||||
* @param duration Duration of Effect in Seconds | -100 : Has infinite effect
|
||||
* @param level Level of Effect [Some effects not affected by level]
|
||||
* Applies the effect with the specified ID to the player.
|
||||
*
|
||||
* @param player the player to apply the effect to
|
||||
* @param id the ID of the status effect
|
||||
* @param duration the duration of the effect in seconds (-100 for infinite duration)
|
||||
* @param level the level of the effect (some effects may ignore this value)
|
||||
*/
|
||||
void applyEffect(IPlayer player, int id, int duration, byte level);
|
||||
|
||||
/**
|
||||
* Applies the specified custom effect to the player.
|
||||
*
|
||||
* @param player the player to apply the effect to
|
||||
* @param effect the custom effect to apply
|
||||
* @param duration the duration of the effect in seconds (-100 for infinite duration)
|
||||
* @param level the level of the effect (some effects may ignore this value)
|
||||
*/
|
||||
void applyEffect(IPlayer player, ICustomEffect effect, int duration, byte level);
|
||||
|
||||
/**
|
||||
* @param player Player
|
||||
* @param id ID of Status Effect
|
||||
* Removes the effect with the specified ID from the player.
|
||||
*
|
||||
* @param player the player to remove the effect from
|
||||
* @param id the ID of the status effect to remove
|
||||
*/
|
||||
void removeEffect(IPlayer player, int id);
|
||||
|
||||
/**
|
||||
* Removes the specified custom effect from the player.
|
||||
*
|
||||
* @param player the player to remove the effect from
|
||||
* @param effect the custom effect to remove
|
||||
*/
|
||||
void removeEffect(IPlayer player, ICustomEffect effect);
|
||||
|
||||
/**
|
||||
* Clears all custom effects from the specified player.
|
||||
*
|
||||
* @param player the player whose effects should be cleared
|
||||
*/
|
||||
void clearEffects(IPlayer player);
|
||||
|
||||
/**
|
||||
* Applies the effect with the specified ID and index to the player.
|
||||
* The index parameter allows for multiple variants of the same effect.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player to apply the effect to
|
||||
* @param id the ID of the status effect
|
||||
* @param duration the duration of the effect in seconds (-100 for infinite duration)
|
||||
* @param level the level of the effect
|
||||
* @param index the index to differentiate between variants of the effect (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
*/
|
||||
void applyEffect(IPlayer player, int id, int duration, byte level, int index);
|
||||
|
||||
/**
|
||||
* Applies the specified custom effect (with the given index) to the player.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player to apply the effect to
|
||||
* @param effect the custom effect to apply
|
||||
* @param duration the duration of the effect in seconds (-100 for infinite duration)
|
||||
* @param level the level of the effect
|
||||
* @param index the index to differentiate between variants of the effect (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
*/
|
||||
void applyEffect(IPlayer player, ICustomEffect effect, int duration, byte level, int index);
|
||||
|
||||
/**
|
||||
* Removes the effect with the specified ID and index from the player.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player to remove the effect from
|
||||
* @param id the ID of the status effect to remove
|
||||
* @param index the index of the effect variant to remove (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
*/
|
||||
void removeEffect(IPlayer player, int id, int index);
|
||||
|
||||
/**
|
||||
* Removes the specified custom effect (with the given index) from the player.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player to remove the effect from
|
||||
* @param effect the custom effect to remove
|
||||
* @param index the index of the effect variant to remove (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
*/
|
||||
void removeEffect(IPlayer player, ICustomEffect effect, int index);
|
||||
|
||||
/**
|
||||
* Clears all custom effects with the specified index from the player.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player whose effects should be cleared
|
||||
* @param index the index of the effect variants to clear (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
*/
|
||||
void clearEffects(IPlayer player, int index);
|
||||
|
||||
/**
|
||||
* Retrieves the remaining duration of the effect with the specified ID and index for the given player.
|
||||
* <p>
|
||||
* Return values:
|
||||
* <ul>
|
||||
* <li>-1 if the player does not have the effect</li>
|
||||
* <li>-100 if the effect has an infinite duration</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player whose effect duration is queried
|
||||
* @param id the ID of the status effect
|
||||
* @param index the index of the effect variant (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
* @return the remaining effect time in seconds
|
||||
*/
|
||||
int getEffectDuration(IPlayer player, int id, int index);
|
||||
|
||||
/**
|
||||
* Retrieves the remaining duration of the specified custom effect (with the given index) for the player.
|
||||
* <p>
|
||||
* Return values:
|
||||
* <ul>
|
||||
* <li>-1 if the player does not have the effect</li>
|
||||
* <li>-100 if the effect has an infinite duration</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param player the player whose effect duration is queried
|
||||
* @param effect the custom effect to check
|
||||
* @param index the index of the effect variant (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
* @return the remaining effect time in seconds
|
||||
*/
|
||||
int getEffectDuration(IPlayer player, ICustomEffect effect, int index);
|
||||
|
||||
/**
|
||||
* Retrieves the custom effect with the specified name and index.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param name the name of the custom effect
|
||||
* @param index the index of the effect variant (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
* @return the custom effect matching the name and index, or null if not found
|
||||
*/
|
||||
ICustomEffect getEffect(String name, int index);
|
||||
|
||||
/**
|
||||
* Retrieves the custom effect with the specified ID and index.
|
||||
* <p>
|
||||
* Note: INDEX: 0: CNPC+, 1: DBC Addon
|
||||
*
|
||||
* @param id the ID of the custom effect
|
||||
* @param index the index of the effect variant (INDEX: 0: CNPC+, 1: DBC Addon)
|
||||
* @return the custom effect matching the ID and index, or null if not found
|
||||
*/
|
||||
ICustomEffect getEffect(int id, int index);
|
||||
|
||||
/**
|
||||
* Persists the given custom effect.
|
||||
* This method saves the effect and returns the saved instance, potentially with an updated ID or name.
|
||||
*
|
||||
* @param customEffect the custom effect to save
|
||||
* @return the saved custom effect instance
|
||||
*/
|
||||
ICustomEffect saveEffect(ICustomEffect customEffect);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import noppes.npcs.api.handler.data.IMagic;
|
||||
import noppes.npcs.api.handler.data.IMagicCycle;
|
||||
|
||||
/**
|
||||
* Provides methods to access and modify magic and magic cycles.
|
||||
* Implementations of this interface are responsible for managing the lifecycle,
|
||||
* storage, and associations between individual magics and cycles.
|
||||
*/
|
||||
public interface IMagicHandler {
|
||||
|
||||
/**
|
||||
* Retrieves a magic instance by its unique ID.
|
||||
*
|
||||
* @param magicId the unique identifier of the magic
|
||||
* @return the magic corresponding to the given ID, or null if not found
|
||||
*/
|
||||
IMagic getMagic(int magicId);
|
||||
|
||||
/**
|
||||
* Retrieves a magic cycle (or category) by its unique ID.
|
||||
*
|
||||
* @param cycleID the unique identifier of the magic cycle
|
||||
* @return the magic cycle corresponding to the given ID, or null if not found
|
||||
*/
|
||||
IMagicCycle getCycle(int cycleID);
|
||||
|
||||
/**
|
||||
* Adds a magic to a specific cycle with ordering details.
|
||||
* The provided index and priority help determine the magic's position in the cycle.
|
||||
*
|
||||
* @param magicId the unique identifier of the magic to add
|
||||
* @param cycleId the unique identifier of the cycle to add the magic to
|
||||
* @param index the index position within the cycle
|
||||
* @param priority the priority value within the cycle
|
||||
*/
|
||||
void addMagicToCycle(int magicId, int cycleId, int index, int priority);
|
||||
|
||||
/**
|
||||
* Removes a magic from a specified cycle.
|
||||
*
|
||||
* @param magicId the unique identifier of the magic to remove
|
||||
* @param cycleId the unique identifier of the cycle from which the magic is removed
|
||||
*/
|
||||
void removeMagicFromCycle(int magicId, int cycleId);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package noppes.npcs.api.handler;
|
||||
|
||||
import noppes.npcs.api.entity.ICustomNpc;
|
||||
|
||||
public interface IPlayerData {
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface IPlayerQuestData {
|
||||
|
||||
boolean hasFinishedQuest(int id);
|
||||
|
||||
public boolean hasActiveQuest(int id);
|
||||
boolean hasActiveQuest(int id);
|
||||
|
||||
IQuest[] getActiveQuests();
|
||||
|
||||
@@ -24,5 +24,5 @@ public interface IPlayerQuestData {
|
||||
|
||||
long getLastCompletedTime(int id);
|
||||
|
||||
void setLastCompletedTime(int id,long time);
|
||||
void setLastCompletedTime(int id, long time);
|
||||
}
|
||||
@@ -2,23 +2,71 @@ package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.entity.IAnimatable;
|
||||
|
||||
/**
|
||||
* Holds and manages animation data for an animatable entity.
|
||||
* This includes the current animation, its timing, and the ability to update
|
||||
* the animation state on clients.
|
||||
*/
|
||||
public interface IAnimationData {
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the animatable entity this data is associated with.
|
||||
*
|
||||
* @return the animatable entity.
|
||||
*/
|
||||
IAnimatable getEntity();
|
||||
|
||||
/**
|
||||
* Updates the animation data on the client side.
|
||||
*/
|
||||
void updateClient();
|
||||
|
||||
/**
|
||||
* Checks whether the current animation is active.
|
||||
*
|
||||
* @return true if an animation is active; false otherwise.
|
||||
*/
|
||||
boolean isActive();
|
||||
|
||||
/**
|
||||
* Checks whether the client is currently animating.
|
||||
*
|
||||
* @return true if client animation is active; false otherwise.
|
||||
*/
|
||||
boolean isClientAnimating();
|
||||
|
||||
/**
|
||||
* Enables or disables animations for the entity.
|
||||
*
|
||||
* @param enabled true to enable animations; false to disable.
|
||||
*/
|
||||
void setEnabled(boolean enabled);
|
||||
|
||||
/**
|
||||
* Checks if animations are enabled.
|
||||
*
|
||||
* @return true if enabled; false otherwise.
|
||||
*/
|
||||
boolean enabled();
|
||||
|
||||
/**
|
||||
* Sets the current animation.
|
||||
*
|
||||
* @param animation the animation to set.
|
||||
*/
|
||||
void setAnimation(IAnimation animation);
|
||||
|
||||
/**
|
||||
* Returns the current animation.
|
||||
*
|
||||
* @return the animation, or null if none is set.
|
||||
*/
|
||||
IAnimation getAnimation();
|
||||
|
||||
/**
|
||||
* Returns the total time the current animation has been running.
|
||||
*
|
||||
* @return the animating time in ticks.
|
||||
*/
|
||||
long getAnimatingTime();
|
||||
}
|
||||
@@ -20,7 +20,8 @@ public interface IAnvilRecipe {
|
||||
|
||||
/**
|
||||
* Checks whether the provided item and repair material match this recipe.
|
||||
* @param itemToRepair the damaged item
|
||||
*
|
||||
* @param itemToRepair the damaged item
|
||||
* @param repairMaterial the material used to repair
|
||||
* @return true if the items match the recipe requirements
|
||||
*/
|
||||
@@ -28,6 +29,7 @@ public interface IAnvilRecipe {
|
||||
|
||||
/**
|
||||
* Returns the repaired item based on the input damaged item.
|
||||
*
|
||||
* @param itemToRepair the input damaged item
|
||||
* @return a copy with reduced damage
|
||||
*/
|
||||
|
||||
@@ -1,31 +1,173 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
public interface IAvailability {
|
||||
boolean isAvailable(IPlayer var1);
|
||||
|
||||
int getDaytime();
|
||||
|
||||
void setDaytime(int var1);
|
||||
|
||||
int getMinPlayerLevel();
|
||||
|
||||
void setMinPlayerLevel(int var1);
|
||||
|
||||
int getDialog(int var1);
|
||||
|
||||
void setDialog(int var1, int var2, int var3);
|
||||
|
||||
void removeDialog(int var1);
|
||||
|
||||
int getQuest(int var1);
|
||||
|
||||
void setQuest(int var1, int var2, int var3);
|
||||
|
||||
void removeQuest(int var1);
|
||||
|
||||
void setFaction(int var1, int var2, int var3, int var4);
|
||||
|
||||
void removeFaction(int var1);
|
||||
}
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
/**
|
||||
* Defines the conditions that determine if certain NPC interactions
|
||||
* (dialogs, quests, and faction requirements) are available to a player.
|
||||
* <p>
|
||||
* Availability conditions include:
|
||||
* <ul>
|
||||
* <li>Daytime restrictions (Always, Day, or Night)</li>
|
||||
* <li>Dialog conditions (based on whether a dialog has been read or not)</li>
|
||||
* <li>Quest conditions (before, after, active, not active, acceptable, etc.)</li>
|
||||
* <li>Faction requirements (faction ID, availability type and required stance)</li>
|
||||
* <li>Minimum player level</li>
|
||||
* </ul>
|
||||
* The method {@link #isAvailable(IPlayer)} evaluates all these criteria.
|
||||
*/
|
||||
public interface IAvailability {
|
||||
|
||||
/**
|
||||
* Determines whether all availability conditions are met for the given player.
|
||||
* <p>
|
||||
* Conditions checked include:
|
||||
* <ul>
|
||||
* <li>Daytime requirement – if set to Day, the player must be in daytime; if Night, in nighttime.</li>
|
||||
* <li>Dialog conditions – all dialog slots (0–3) must match their respective availability settings.</li>
|
||||
* <li>Quest conditions – all quest slots (0–3) must satisfy their availability criteria.</li>
|
||||
* <li>Faction conditions – each faction requirement (slot 0 and 1) must match the specified faction availability and stance.</li>
|
||||
* <li>Minimum player level – the player's level must be at least the required minimum.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param player the player for whom availability is being checked.
|
||||
* @return true if all conditions are met; false otherwise.
|
||||
*/
|
||||
boolean isAvailable(IPlayer player);
|
||||
|
||||
/**
|
||||
* Returns the daytime condition requirement as an ordinal value.
|
||||
* <p>
|
||||
* The returned value corresponds to:
|
||||
* <ul>
|
||||
* <li>0 – Always</li>
|
||||
* <li>1 – Day</li>
|
||||
* <li>2 – Night</li>
|
||||
* </ul>
|
||||
*
|
||||
* @return the ordinal value representing the required daytime condition.
|
||||
*/
|
||||
int getDaytime();
|
||||
|
||||
/**
|
||||
* Sets the daytime condition requirement.
|
||||
* <p>
|
||||
* The provided value is clamped between 0 and 2, corresponding to:
|
||||
* <ul>
|
||||
* <li>0 – Always</li>
|
||||
* <li>1 – Day</li>
|
||||
* <li>2 – Night</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param daytime the ordinal value for the daytime condition.
|
||||
*/
|
||||
void setDaytime(int daytime);
|
||||
|
||||
/**
|
||||
* Returns the minimum player level required for the availability conditions.
|
||||
*
|
||||
* @return the minimum player level.
|
||||
*/
|
||||
int getMinPlayerLevel();
|
||||
|
||||
/**
|
||||
* Sets the minimum player level required for the availability conditions.
|
||||
*
|
||||
* @param level the minimum player level.
|
||||
*/
|
||||
void setMinPlayerLevel(int level);
|
||||
|
||||
/**
|
||||
* Retrieves the dialog ID for the specified slot.
|
||||
* <p>
|
||||
* Valid slot indices are 0 to 3. A dialog ID of -1 indicates no dialog is set.
|
||||
*
|
||||
* @param index the dialog slot index (0–3).
|
||||
* @return the dialog ID associated with the specified slot.
|
||||
*/
|
||||
int getDialog(int index);
|
||||
|
||||
/**
|
||||
* Sets the dialog for the specified slot with the given dialog ID and availability type.
|
||||
* <p>
|
||||
* The availability type (provided as an ordinal) determines when the dialog is available:
|
||||
* <ul>
|
||||
* <li>0 – Always</li>
|
||||
* <li>1 – Before (available before the dialog is read)</li>
|
||||
* <li>2 – After (available after the dialog is read)</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param index the dialog slot index (0–3).
|
||||
* @param id the dialog ID to set.
|
||||
* @param type the availability type as an ordinal value.
|
||||
*/
|
||||
void setDialog(int index, int id, int type);
|
||||
|
||||
/**
|
||||
* Removes the dialog from the specified slot, resetting it to default values.
|
||||
* <p>
|
||||
* After removal, the dialog ID is set to -1 and its availability is reset to Always.
|
||||
*
|
||||
* @param index the dialog slot index (0–3).
|
||||
*/
|
||||
void removeDialog(int index);
|
||||
|
||||
/**
|
||||
* Retrieves the quest ID for the specified slot.
|
||||
* <p>
|
||||
* Valid slot indices are 0 to 3. A quest ID of -1 indicates no quest is set.
|
||||
*
|
||||
* @param index the quest slot index (0–3).
|
||||
* @return the quest ID for the specified slot.
|
||||
*/
|
||||
int getQuest(int index);
|
||||
|
||||
/**
|
||||
* Sets the quest for the specified slot with the given quest ID and availability type.
|
||||
* <p>
|
||||
* The availability type for quests is provided as an ordinal and can represent various conditions
|
||||
* such as Always, After, Before, Active, NotActive, Acceptable, or NotAcceptable.
|
||||
*
|
||||
* @param index the quest slot index (0–3).
|
||||
* @param id the quest ID to set.
|
||||
* @param type the availability type as an ordinal value.
|
||||
*/
|
||||
void setQuest(int index, int id, int type);
|
||||
|
||||
/**
|
||||
* Removes the quest from the specified slot, resetting it to default values.
|
||||
* <p>
|
||||
* After removal, the quest ID is set to -1 and its availability is reset to Always.
|
||||
*
|
||||
* @param index the quest slot index (0–3).
|
||||
*/
|
||||
void removeQuest(int index);
|
||||
|
||||
/**
|
||||
* Sets the faction requirement for the specified slot with the given parameters.
|
||||
* <p>
|
||||
* The parameters are:
|
||||
* <ul>
|
||||
* <li><code>slot</code> – the faction slot index (0 or 1).</li>
|
||||
* <li><code>id</code> – the faction ID.</li>
|
||||
* <li><code>type</code> – the faction availability type (clamped between 0 and 2).</li>
|
||||
* <li><code>stance</code> – the required faction stance (clamped between 0 and 2).</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param slot the faction slot index (0 or 1).
|
||||
* @param id the faction ID.
|
||||
* @param type the faction availability type as an ordinal value.
|
||||
* @param stance the required faction stance as an ordinal value.
|
||||
*/
|
||||
void setFaction(int slot, int id, int type, int stance);
|
||||
|
||||
/**
|
||||
* Removes the faction requirement from the specified slot, resetting it to default values.
|
||||
* <p>
|
||||
* After removal, the faction ID is set to -1, the availability type is set to Always,
|
||||
* and the faction stance is reset to Friendly.
|
||||
*
|
||||
* @param slot the faction slot index (0 or 1).
|
||||
*/
|
||||
void removeFaction(int slot);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IDialog {
|
||||
@@ -29,18 +30,23 @@ public interface IDialog {
|
||||
IDialogCategory getCategory();
|
||||
|
||||
void setDarkenScreen(boolean darkenScreen);
|
||||
|
||||
boolean getDarkenScreen();
|
||||
|
||||
void setDisableEsc(boolean disableEsc);
|
||||
|
||||
boolean getDisableEsc();
|
||||
|
||||
void setShowWheel(boolean showWheel);
|
||||
|
||||
boolean getShowWheel();
|
||||
|
||||
void setHideNPC(boolean hideNPC);
|
||||
|
||||
boolean getHideNPC();
|
||||
|
||||
void setSound(String sound);
|
||||
|
||||
String getSound();
|
||||
|
||||
void save();
|
||||
|
||||
@@ -4,38 +4,52 @@ public interface IDialogImage {
|
||||
int getId();
|
||||
|
||||
void setTexture(String texture);
|
||||
|
||||
String getTexture();
|
||||
|
||||
void setPosition(int x, int y);
|
||||
|
||||
int getX();
|
||||
|
||||
int getY();
|
||||
|
||||
void setWidthHeight(int width, int height);
|
||||
|
||||
int getWidth();
|
||||
|
||||
int getHeight();
|
||||
|
||||
void setTextureOffset(int offsetX, int offsetY);
|
||||
|
||||
int getTextureX();
|
||||
|
||||
int getTextureY();
|
||||
|
||||
void setColor(int color);
|
||||
|
||||
int getColor();
|
||||
|
||||
void setSelectedColor(int color);
|
||||
|
||||
int getSelectedColor();
|
||||
|
||||
void setScale(float scale);
|
||||
|
||||
float getScale();
|
||||
|
||||
void setAlpha(float alpha);
|
||||
|
||||
float getAlpha();
|
||||
|
||||
void setRotation(float rotation);
|
||||
|
||||
float getRotation();
|
||||
|
||||
void setImageType(int imageType);
|
||||
|
||||
int getImageType();
|
||||
|
||||
void setAlignment(int alignment);
|
||||
|
||||
int getAlignment();
|
||||
}
|
||||
@@ -34,6 +34,10 @@ public interface IFaction {
|
||||
|
||||
void setIsHidden(boolean hidden);
|
||||
|
||||
boolean isPassive();
|
||||
|
||||
void setIsPassive(boolean passive);
|
||||
|
||||
boolean attackedByMobs();
|
||||
|
||||
void setAttackedByMobs(boolean attacked);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
public interface IFramePart{
|
||||
public interface IFramePart {
|
||||
|
||||
String getName();
|
||||
|
||||
|
||||
@@ -1,18 +1,89 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
import noppes.npcs.api.entity.ICustomNpc;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
/**
|
||||
* Represents a magic element that can have interactions with other magics.
|
||||
* Each magic has unique properties such as an ID, name, color, and display name,
|
||||
* and can hold interaction values with other magics.
|
||||
*/
|
||||
public interface IMagic {
|
||||
|
||||
/**
|
||||
* Gets the unique identifier of this magic.
|
||||
*
|
||||
* @return the magic ID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Gets the internal name of the magic.
|
||||
*
|
||||
* @return the name of the magic
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the internal name of the magic.
|
||||
*
|
||||
* @param name the new name of the magic
|
||||
*/
|
||||
void setName(String name);
|
||||
|
||||
/**
|
||||
* Sets the color for this magic.
|
||||
*
|
||||
* @param c the color represented as an integer (typically in hexadecimal)
|
||||
*/
|
||||
void setColor(int c);
|
||||
|
||||
/**
|
||||
* Gets the color of this magic.
|
||||
*
|
||||
* @return the color as an integer
|
||||
*/
|
||||
int getColor();
|
||||
|
||||
/**
|
||||
* Gets the display name of the magic.
|
||||
*
|
||||
* @return the display name of the magic
|
||||
*/
|
||||
String getDisplayName();
|
||||
|
||||
/**
|
||||
* Sets the display name of the magic.
|
||||
*
|
||||
* @param displayName the new display name
|
||||
*/
|
||||
void setDisplayName(String displayName);
|
||||
|
||||
/**
|
||||
* Saves the current state of the magic.
|
||||
* Typically persists changes to a controller or storage system.
|
||||
*/
|
||||
void save();
|
||||
|
||||
/**
|
||||
* Checks if this magic has an interaction value set for another magic.
|
||||
*
|
||||
* @param magicID the unique identifier of the other magic
|
||||
* @return true if an interaction is present, false otherwise
|
||||
*/
|
||||
boolean hasInteraction(int magicID);
|
||||
|
||||
/**
|
||||
* Sets an interaction value for a specific other magic.
|
||||
*
|
||||
* @param magicID the unique identifier of the other magic
|
||||
* @param value the interaction value (usually a percentage or multiplier)
|
||||
*/
|
||||
void setInteraction(int magicID, float value);
|
||||
|
||||
/**
|
||||
* Retrieves the interaction value for a specific other magic.
|
||||
*
|
||||
* @param magicID the unique identifier of the other magic
|
||||
* @param value the default value to return if no interaction is found
|
||||
* @return the interaction value if present; otherwise, the default value
|
||||
*/
|
||||
float getInteraction(int magicID, float value);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
/**
|
||||
* Represents a cycle (or category) grouping for magics.
|
||||
* A magic cycle holds ordering and display information as well as associations
|
||||
* to multiple magics.
|
||||
*/
|
||||
public interface IMagicCycle {
|
||||
|
||||
/**
|
||||
* Gets the unique identifier of this magic cycle.
|
||||
*
|
||||
* @return the cycle ID
|
||||
*/
|
||||
int getId();
|
||||
|
||||
/**
|
||||
* Gets the internal name of the magic cycle.
|
||||
*
|
||||
* @return the name of the cycle
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the internal name of the magic cycle.
|
||||
*
|
||||
* @param name the new name of the cycle
|
||||
*/
|
||||
void setName(String name);
|
||||
|
||||
/**
|
||||
* Gets the display name of the magic cycle.
|
||||
*
|
||||
* @return the display name for the cycle
|
||||
*/
|
||||
String getDisplayName();
|
||||
|
||||
/**
|
||||
* Sets the display name of the magic cycle.
|
||||
*
|
||||
* @param displayName the new display name of the cycle
|
||||
*/
|
||||
void setDisplayName(String displayName);
|
||||
|
||||
/**
|
||||
* Gets the layout type for the cycle.
|
||||
* This is typically an integer representation of the layout enum.
|
||||
*
|
||||
* 0: CIRCULAR
|
||||
* 1: SQUARE
|
||||
* 2: TREE
|
||||
* 3: GENERATED
|
||||
* 4: CIRCULAR_MANUAL
|
||||
* 5: SQUARE_MANUAL
|
||||
* 6: TREE_MANUAL
|
||||
* 7: CHART
|
||||
*
|
||||
* @return the layout type as an integer
|
||||
*/
|
||||
int getLayoutType();
|
||||
|
||||
/**
|
||||
* Sets the layout type for the cycle.
|
||||
* The provided integer should correspond to a valid layout type.
|
||||
*
|
||||
* 0: CIRCULAR
|
||||
* 1: SQUARE
|
||||
* 2: TREE
|
||||
* 3: GENERATED
|
||||
* 4: CIRCULAR_MANUAL
|
||||
* 5: SQUARE_MANUAL
|
||||
* 6: TREE_MANUAL
|
||||
* 7: CHART
|
||||
*
|
||||
* @param layout the layout type as an integer
|
||||
*/
|
||||
void setLayoutType(int layout);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package noppes.npcs.api.handler.data;
|
||||
|
||||
public interface IMagicData {
|
||||
|
||||
/**
|
||||
* @param id The ID of the Magic
|
||||
*/
|
||||
void removeMagic(int id);
|
||||
|
||||
/**
|
||||
* @param id The ID of the Magic
|
||||
* @return If the Magic exists
|
||||
*/
|
||||
boolean hasMagic(int id);
|
||||
|
||||
/**
|
||||
* Clears the Magics
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @return If the Magics are empty
|
||||
*/
|
||||
boolean isEmpty();
|
||||
|
||||
/**
|
||||
* @param id The ID of the Magic
|
||||
* @param damage The bonus damage for the Magic
|
||||
* @param split The split of the Magic
|
||||
*/
|
||||
void addMagic(int id, float damage, float split);
|
||||
|
||||
/**
|
||||
* @param id The ID of the Magic
|
||||
* @return The bonus damage for the Magic
|
||||
*/
|
||||
float getMagicDamage(int id);
|
||||
|
||||
/**
|
||||
* @param id The ID of the Magic
|
||||
* @return The split of the Magic
|
||||
*/
|
||||
float getMagicSplit(int id);
|
||||
}
|
||||
@@ -18,24 +18,28 @@ public interface IParty {
|
||||
|
||||
/**
|
||||
* Set a quest to the party (this does not validate use validateQuest())
|
||||
*
|
||||
* @param quest Quest Object
|
||||
*/
|
||||
void setQuest(IQuest quest);
|
||||
|
||||
/**
|
||||
* Get the Quest for the Party, can be null
|
||||
*
|
||||
* @return quest
|
||||
*/
|
||||
IQuest getQuest();
|
||||
|
||||
/**
|
||||
* Get the Quest ID for Party | -1 if no quest
|
||||
*
|
||||
* @return quest id
|
||||
*/
|
||||
int getCurrentQuestID();
|
||||
|
||||
/**
|
||||
* Get the Quest Name for Party | BLANK if no quest
|
||||
*
|
||||
* @return quest name
|
||||
*/
|
||||
String getCurrentQuestName();
|
||||
@@ -68,12 +72,14 @@ public interface IParty {
|
||||
|
||||
/**
|
||||
* Check if Player is in Party with IPlayer
|
||||
*
|
||||
* @return true/false if player is in party
|
||||
*/
|
||||
boolean hasPlayer(IPlayer player);
|
||||
|
||||
/**
|
||||
* Check if Player is in Party with Player Name
|
||||
*
|
||||
* @return true/false if player is in party
|
||||
*/
|
||||
boolean hasPlayer(String playerName);
|
||||
@@ -90,7 +96,7 @@ public interface IParty {
|
||||
|
||||
|
||||
/**
|
||||
* @param questID ID for the Quest to Verify
|
||||
* @param questID ID for the Quest to Verify
|
||||
* @param sendLeaderMessages IF true will send ERROR message to Party Leader on why the quest could not be set
|
||||
* @return true/false if the party CAN have the quest set
|
||||
*/
|
||||
|
||||
@@ -3,46 +3,46 @@ package noppes.npcs.api.handler.data;
|
||||
public interface IPartyOptions {
|
||||
|
||||
|
||||
public boolean isAllowParty();
|
||||
boolean isAllowParty();
|
||||
|
||||
public void setAllowParty(boolean allowParty);
|
||||
void setAllowParty(boolean allowParty);
|
||||
|
||||
public boolean isOnlyParty();
|
||||
boolean isOnlyParty();
|
||||
|
||||
public void setOnlyParty(boolean onlyParty);
|
||||
void setOnlyParty(boolean onlyParty);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Valid
|
||||
* @return 0:Leader, 1:All, 2:Valid
|
||||
*/
|
||||
public int getPartyRequirements();
|
||||
int getPartyRequirements();
|
||||
|
||||
/**
|
||||
* @param partyRequirements 0:Leader, 1:All, 2:Valid
|
||||
*/
|
||||
public void setPartyRequirements(int partyRequirements);
|
||||
void setPartyRequirements(int partyRequirements);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public int getRewardControl();
|
||||
int getRewardControl();
|
||||
|
||||
/**
|
||||
* @param rewardControl 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public void setRewardControl(int rewardControl);
|
||||
void setRewardControl(int rewardControl);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public int getCompleteFor();
|
||||
int getCompleteFor();
|
||||
|
||||
/**
|
||||
* @param completeFor 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
public void setCompleteFor(int completeFor);
|
||||
void setCompleteFor(int completeFor);
|
||||
|
||||
/**
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
* @return 0:Leader, 1:All, 2:Enrolled, 3:Valid
|
||||
*/
|
||||
int getExecuteCommandFor();
|
||||
|
||||
@@ -54,19 +54,19 @@ public interface IPartyOptions {
|
||||
/**
|
||||
* @return 0:Shard, 1:All, 2:Leader
|
||||
*/
|
||||
public int getObjectiveRequirement();
|
||||
int getObjectiveRequirement();
|
||||
|
||||
/**
|
||||
* @param requirement 0:Shard, 1:All, 2:Leader
|
||||
*/
|
||||
public void setObjectiveRequirement(int requirement);
|
||||
void setObjectiveRequirement(int requirement);
|
||||
|
||||
public int getMinPartySize();
|
||||
int getMinPartySize();
|
||||
|
||||
public void setMinPartySize(int newSize);
|
||||
void setMinPartySize(int newSize);
|
||||
|
||||
|
||||
public int getMaxPartySize();
|
||||
int getMaxPartySize();
|
||||
|
||||
public void setMaxPartySize(int newSize);
|
||||
void setMaxPartySize(int newSize);
|
||||
}
|
||||
@@ -7,22 +7,22 @@ public interface IProfileOptions {
|
||||
void setProfileOptions(boolean enable);
|
||||
|
||||
/**
|
||||
* @param profileType 0:Individual, 1:Shared
|
||||
* @param profileType 0:Individual, 1:Shared
|
||||
*/
|
||||
void setCooldownControl(int profileType);
|
||||
|
||||
/**
|
||||
* @return 0:Individual, 1:Shared
|
||||
* @return 0:Individual, 1:Shared
|
||||
*/
|
||||
int getCooldownControl();
|
||||
|
||||
/**
|
||||
* @param profileType 0:Individual, 1:Shared
|
||||
* @param profileType 0:Individual, 1:Shared
|
||||
*/
|
||||
void setCompleteControl(int profileType);
|
||||
|
||||
/**
|
||||
* @return 0:Individual, 1:Shared
|
||||
* @return 0:Individual, 1:Shared
|
||||
*/
|
||||
int getCompleteControl();
|
||||
}
|
||||
@@ -2,11 +2,14 @@ package noppes.npcs.api.handler.data;
|
||||
|
||||
public interface IQuestItem extends IQuestInterface {
|
||||
void setLeaveItems(boolean leaveItems);
|
||||
|
||||
boolean getLeaveItems();
|
||||
|
||||
void setIgnoreDamage(boolean ignoreDamage);
|
||||
|
||||
boolean getIgnoreDamage();
|
||||
|
||||
void setIgnoreNbt(boolean ignoreNbt);
|
||||
|
||||
boolean getIgnoreNbt();
|
||||
}
|
||||
@@ -2,5 +2,6 @@ package noppes.npcs.api.handler.data;
|
||||
|
||||
public interface IQuestKill extends IQuestInterface {
|
||||
void setTargetType(int type);
|
||||
|
||||
int getTargetType();
|
||||
}
|
||||
@@ -2,11 +2,14 @@ package noppes.npcs.api.handler.data;
|
||||
|
||||
public interface IQuestLocation extends IQuestInterface {
|
||||
void setLocation1(String loc1);
|
||||
|
||||
String getLocation1();
|
||||
|
||||
void setLocation2(String loc2);
|
||||
|
||||
String getLocation2();
|
||||
|
||||
void setLocation3(String loc3);
|
||||
|
||||
String getLocation3();
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public interface IQuestObjective {
|
||||
* have a party
|
||||
*
|
||||
* @param playerName Name of Player
|
||||
* @param progress Progress Amount
|
||||
* @param progress Progress Amount
|
||||
*/
|
||||
void setPlayerProgress(String playerName, int progress);
|
||||
|
||||
|
||||
@@ -14,12 +14,14 @@ public interface IItemCustom extends IItemCustomizable {
|
||||
|
||||
/**
|
||||
* Sets the armor type for the scripted item.
|
||||
*
|
||||
* @param armorType The armor type
|
||||
*/
|
||||
void setArmorType(int armorType);
|
||||
|
||||
/**
|
||||
* Sets whether the scripted item is a tool.
|
||||
*
|
||||
* @param isTool True if the item is a tool, false otherwise
|
||||
*/
|
||||
void setIsTool(boolean isTool);
|
||||
@@ -27,42 +29,49 @@ public interface IItemCustom extends IItemCustomizable {
|
||||
/**
|
||||
* Sets whether the scripted item is a normal item. Will disable
|
||||
* all forms of Rotation, Translation, Scale Rendering in hand and on ground
|
||||
*
|
||||
* @param normalItem True if the item is a normal item, false otherwise
|
||||
*/
|
||||
void setIsNormalItem(boolean normalItem);
|
||||
|
||||
/**
|
||||
* Sets the dig speed for the scripted item.
|
||||
*
|
||||
* @param digSpeed The dig speed
|
||||
*/
|
||||
void setDigSpeed(int digSpeed);
|
||||
|
||||
/**
|
||||
* Sets the maximum stack size for the scripted item.
|
||||
*
|
||||
* @param maxStackSize The maximum stack size
|
||||
*/
|
||||
void setMaxStackSize(int maxStackSize);
|
||||
|
||||
/**
|
||||
* Sets the current durability value for the scripted item.
|
||||
*
|
||||
* @param durabilityValue The durability value
|
||||
*/
|
||||
void setDurabilityValue(float durabilityValue);
|
||||
|
||||
/**
|
||||
* Sets the maximum item use duration for the scripted item.
|
||||
*
|
||||
* @param duration The maximum item use duration
|
||||
*/
|
||||
void setMaxItemUseDuration(int duration);
|
||||
|
||||
/**
|
||||
* Sets the item use action for the scripted item.
|
||||
*
|
||||
* @param action The item use action
|
||||
*/
|
||||
void setItemUseAction(int action);
|
||||
|
||||
/**
|
||||
* Sets the enchantability for the scripted item.
|
||||
*
|
||||
* @param enchantability The enchantability
|
||||
*/
|
||||
void setEnchantability(int enchantability);
|
||||
|
||||
@@ -8,102 +8,119 @@ public interface IItemCustomizable extends IItemStack {
|
||||
|
||||
/**
|
||||
* Gets the armor type for the scripted item.
|
||||
*
|
||||
* @return The armor type
|
||||
*/
|
||||
int getArmorType();
|
||||
|
||||
/**
|
||||
* Checks if the scripted item is a tool. Allows for enchanting
|
||||
*
|
||||
* @return True if the item is a tool, false otherwise
|
||||
*/
|
||||
boolean isTool();
|
||||
|
||||
/**
|
||||
* Checks if the scripted item is a normal item.
|
||||
*
|
||||
* @return True if the item is a normal item, false otherwise
|
||||
*/
|
||||
boolean isNormalItem();
|
||||
|
||||
/**
|
||||
* Gets the dig speed for the scripted item.
|
||||
*
|
||||
* @return The dig speed
|
||||
*/
|
||||
int getDigSpeed();
|
||||
|
||||
/**
|
||||
* Gets the current durability value for the scripted item.
|
||||
*
|
||||
* @return The durability value
|
||||
*/
|
||||
double getDurabilityValue();
|
||||
|
||||
/**
|
||||
* Gets the maximum item use duration for the scripted item.
|
||||
*
|
||||
* @return The maximum item use duration
|
||||
*/
|
||||
int getMaxItemUseDuration();
|
||||
|
||||
/**
|
||||
* Gets the item use action for the scripted item.
|
||||
*
|
||||
* @return The item use action
|
||||
*/
|
||||
int getItemUseAction();
|
||||
|
||||
/**
|
||||
* Gets the enchantability for the scripted item.
|
||||
*
|
||||
* @return The enchantability
|
||||
*/
|
||||
int getEnchantability();
|
||||
|
||||
/**
|
||||
* Gets the texture path for the scripted item.
|
||||
*
|
||||
* @return The texture path
|
||||
*/
|
||||
String getTexture();
|
||||
|
||||
/**
|
||||
* Sets the texture path for the scripted item. Can be a URL
|
||||
*
|
||||
* @param texture The texture path
|
||||
*/
|
||||
void setTexture(String texture);
|
||||
|
||||
/**
|
||||
* Checks if the durability bar should be shown for the scripted item.
|
||||
*
|
||||
* @return True if the durability bar should be shown, false otherwise
|
||||
*/
|
||||
Boolean getDurabilityShow();
|
||||
|
||||
/**
|
||||
* Sets whether the durability bar should be shown for the scripted item.
|
||||
*
|
||||
* @param durabilityShow True if the durability bar should be shown, false otherwise
|
||||
*/
|
||||
void setDurabilityShow(Boolean durabilityShow);
|
||||
|
||||
/**
|
||||
* Gets the color of the durability bar for the scripted item.
|
||||
*
|
||||
* @return The durability bar color
|
||||
*/
|
||||
Integer getDurabilityColor();
|
||||
|
||||
/**
|
||||
* Sets the color of the durability bar for the scripted item.
|
||||
*
|
||||
* @param durabilityColor The durability bar color
|
||||
*/
|
||||
void setDurabilityColor(Integer durabilityColor);
|
||||
|
||||
/**
|
||||
* Gets the color of the scripted item.
|
||||
*
|
||||
* @return The item color
|
||||
*/
|
||||
Integer getColor();
|
||||
|
||||
/**
|
||||
* Sets the color of the scripted item.
|
||||
*
|
||||
* @param color The item color
|
||||
*/
|
||||
void setColor(Integer color);
|
||||
|
||||
/**
|
||||
* Sets the rotation values for the scripted item.
|
||||
*
|
||||
* @param rotationX The X-axis rotation
|
||||
* @param rotationY The Y-axis rotation
|
||||
* @param rotationZ The Z-axis rotation
|
||||
@@ -112,6 +129,7 @@ public interface IItemCustomizable extends IItemStack {
|
||||
|
||||
/**
|
||||
* Sets the rotation rate values for the scripted item. Spinning Speed
|
||||
*
|
||||
* @param rotationXRate The X-axis rotation rate
|
||||
* @param rotationYRate The Y-axis rotation rate
|
||||
* @param rotationZRate The Z-axis rotation rate
|
||||
@@ -120,6 +138,7 @@ public interface IItemCustomizable extends IItemStack {
|
||||
|
||||
/**
|
||||
* Sets the scale values for the scripted item.
|
||||
*
|
||||
* @param scaleX The X-axis scale
|
||||
* @param scaleY The Y-axis scale
|
||||
* @param scaleZ The Z-axis scale
|
||||
@@ -128,6 +147,7 @@ public interface IItemCustomizable extends IItemStack {
|
||||
|
||||
/**
|
||||
* Sets the translation values for the scripted item.
|
||||
*
|
||||
* @param translateX The X-axis translation
|
||||
* @param translateY The Y-axis translation
|
||||
* @param translateZ The Z-axis translation
|
||||
@@ -136,72 +156,84 @@ public interface IItemCustomizable extends IItemStack {
|
||||
|
||||
/**
|
||||
* Gets the X-axis rotation for the scripted item.
|
||||
*
|
||||
* @return The X-axis rotation
|
||||
*/
|
||||
Float getRotationX();
|
||||
|
||||
/**
|
||||
* Gets the Y-axis rotation for the scripted item.
|
||||
*
|
||||
* @return The Y-axis rotation
|
||||
*/
|
||||
Float getRotationY();
|
||||
|
||||
/**
|
||||
* Gets the Z-axis rotation for the scripted item.
|
||||
*
|
||||
* @return The Z-axis rotation
|
||||
*/
|
||||
Float getRotationZ();
|
||||
|
||||
/**
|
||||
* Gets the X-axis rotation rate for the scripted item.
|
||||
*
|
||||
* @return The X-axis rotation rate
|
||||
*/
|
||||
Float getRotationXRate();
|
||||
|
||||
/**
|
||||
* Gets the Y-axis rotation rate for the scripted item.
|
||||
*
|
||||
* @return The Y-axis rotation rate
|
||||
*/
|
||||
Float getRotationYRate();
|
||||
|
||||
/**
|
||||
* Gets the Z-axis rotation rate for the scripted item.
|
||||
*
|
||||
* @return The Z-axis rotation rate
|
||||
*/
|
||||
Float getRotationZRate();
|
||||
|
||||
/**
|
||||
* Gets the X-axis scale for the scripted item.
|
||||
*
|
||||
* @return The X-axis scale
|
||||
*/
|
||||
Float getScaleX();
|
||||
|
||||
/**
|
||||
* Gets the Y-axis scale for the scripted item.
|
||||
*
|
||||
* @return The Y-axis scale
|
||||
*/
|
||||
Float getScaleY();
|
||||
|
||||
/**
|
||||
* Gets the Z-axis scale for the scripted item.
|
||||
*
|
||||
* @return The Z-axis scale
|
||||
*/
|
||||
Float getScaleZ();
|
||||
|
||||
/**
|
||||
* Gets the X-axis translation for the scripted item.
|
||||
*
|
||||
* @return The X-axis translation
|
||||
*/
|
||||
Float getTranslateX();
|
||||
|
||||
/**
|
||||
* Gets the Y-axis translation for the scripted item.
|
||||
*
|
||||
* @return The Y-axis translation
|
||||
*/
|
||||
Float getTranslateY();
|
||||
|
||||
/**
|
||||
* Gets the Z-axis translation for the scripted item.
|
||||
*
|
||||
* @return The Z-axis translation
|
||||
*/
|
||||
Float getTranslateZ();
|
||||
|
||||
@@ -4,6 +4,6 @@ import noppes.npcs.api.handler.data.ILinkedItem;
|
||||
|
||||
public interface IItemLinked extends IItemCustomizable {
|
||||
|
||||
public ILinkedItem getLinkedItem();
|
||||
ILinkedItem getLinkedItem();
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public interface IItemStack {
|
||||
void setItemDamage(int value);
|
||||
|
||||
/**
|
||||
* @param key The key of this NBTTag
|
||||
* @param key The key of this NBTTag
|
||||
* @param value The value to be stored. Can be a Number or String
|
||||
*/
|
||||
void setTag(String key, Object value);
|
||||
@@ -72,9 +72,9 @@ public interface IItemStack {
|
||||
boolean isEnchanted();
|
||||
|
||||
/**
|
||||
* @since 1.7.10d
|
||||
* @param id The enchantment id
|
||||
* @return
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
boolean hasEnchant(int id);
|
||||
|
||||
@@ -97,26 +97,26 @@ public interface IItemStack {
|
||||
int getMaxItemDamage();
|
||||
|
||||
/**
|
||||
* @since 1.7.10d
|
||||
* @return Returns whether this item is a book
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
boolean isWrittenBook();
|
||||
|
||||
/**
|
||||
* @since 1.7.10d
|
||||
* @return Returns the books title
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
String getBookTitle();
|
||||
|
||||
/**
|
||||
* @since 1.7.10d
|
||||
* @return Returns the books author
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
String getBookAuthor();
|
||||
|
||||
/**
|
||||
* @since 1.7.10d
|
||||
* @return If the item is a book, returns a string array with book pages
|
||||
* @since 1.7.10d
|
||||
*/
|
||||
String[] getBookText();
|
||||
|
||||
@@ -131,6 +131,7 @@ public interface IItemStack {
|
||||
|
||||
/**
|
||||
* No support is given for this method. Dont use if you dont know what you are doing.
|
||||
*
|
||||
* @return Minecraft ItemStack
|
||||
*/
|
||||
ItemStack getMCItemStack();
|
||||
@@ -141,7 +142,7 @@ public interface IItemStack {
|
||||
|
||||
void setMCNbt(NBTTagCompound compound);
|
||||
|
||||
public boolean compare(IItemStack item, boolean ignoreNBT);
|
||||
boolean compare(IItemStack item, boolean ignoreNBT);
|
||||
|
||||
boolean compare(IItemStack item, boolean ignoreDamage, boolean ignoreNBT);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs.api.jobs;
|
||||
|
||||
public interface IJobBard extends IJob {
|
||||
|
||||
|
||||
String getSong();
|
||||
|
||||
void setSong(String song);
|
||||
@@ -11,14 +11,18 @@ public interface IJobBard extends IJob {
|
||||
int getInstrumentId();
|
||||
|
||||
void setMinRange(int range);
|
||||
|
||||
int getMinRange();
|
||||
|
||||
void setMaxRange(int range);
|
||||
|
||||
int getMaxRange();
|
||||
|
||||
void setStreaming(boolean streaming);
|
||||
|
||||
boolean getStreaming();
|
||||
|
||||
void hasOffRange(boolean value);
|
||||
|
||||
boolean hasOffRange();
|
||||
}
|
||||
@@ -2,11 +2,14 @@ package noppes.npcs.api.jobs;
|
||||
|
||||
public interface IJobGuard extends IJob {
|
||||
boolean attackCreepers();
|
||||
|
||||
void attackCreepers(boolean value);
|
||||
|
||||
boolean attacksAnimals();
|
||||
|
||||
void attacksAnimals(boolean value);
|
||||
|
||||
boolean attackHostileMobs();
|
||||
|
||||
void attackHostileMobs(boolean value);
|
||||
}
|
||||
@@ -7,8 +7,10 @@ public interface IJobHealer extends IJob {
|
||||
void heal(IEntityLivingBase entity, float amount);
|
||||
|
||||
void setRange(int range);
|
||||
|
||||
int getRange();
|
||||
|
||||
void setSpeed(int speed);
|
||||
|
||||
int getSpeed();
|
||||
}
|
||||
@@ -2,14 +2,22 @@ package noppes.npcs.api.overlay;
|
||||
|
||||
public interface IOverlayLine extends ICustomOverlayComponent {
|
||||
int getX1();
|
||||
|
||||
int getY1();
|
||||
|
||||
int getX2();
|
||||
|
||||
int getY2();
|
||||
|
||||
int getThickness();
|
||||
|
||||
void setX1(int x1);
|
||||
|
||||
void setY1(int y1);
|
||||
|
||||
void setX2(int x2);
|
||||
|
||||
void setY2(int y2);
|
||||
|
||||
void setThickness(int thickness);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
@API(owner = "customnpcs", provides = "Core", apiVersion = "0.1")
|
||||
package noppes.npcs.api;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -5,20 +5,20 @@ import noppes.npcs.api.entity.IPlayer;
|
||||
public interface IRoleFollower extends IRole {
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param player Player who is set as the owner. If null given everything resets
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
void setOwner(IPlayer player);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns the followers owner. Returns null if he has no owner or the owner is offline
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
IPlayer getOwner();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower has an owner
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
boolean hasOwner();
|
||||
|
||||
@@ -27,71 +27,71 @@ public interface IRoleFollower extends IRole {
|
||||
void setIsFollowing(boolean following);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns days left
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
int getDaysLeft();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param days The days you want to add to the days remaining
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
void addDaysLeft(int days);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower is set to infinite days
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
boolean getInfiniteDays();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param infinite Sets whether the days hired are infinite
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
void setInfiniteDays(boolean infinite);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Return whether the gui is disabled
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
boolean getGuiDisabled();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param disabled Set the gui to be disabled or not
|
||||
* @since 1.7.10c
|
||||
*/
|
||||
void setGuiDisabled(boolean disabled);
|
||||
|
||||
|
||||
/**
|
||||
* @param index Index of Rate [0 - 2]
|
||||
* @param index Index of Rate [0 - 2]
|
||||
* @param amount Amount hired for
|
||||
*/
|
||||
public void setRate(int index, int amount);
|
||||
void setRate(int index, int amount);
|
||||
|
||||
/**
|
||||
* @param index Index of Rate [0 - 2]
|
||||
* @return amount fired for
|
||||
*/
|
||||
public int getRate(int index);
|
||||
int getRate(int index);
|
||||
|
||||
/**
|
||||
* @param dialogHire New dialog hire string
|
||||
*/
|
||||
public void setDialogHire(String dialogHire);
|
||||
void setDialogHire(String dialogHire);
|
||||
|
||||
/**
|
||||
* @return dialog hire string
|
||||
*/
|
||||
public String getDialogHire();
|
||||
String getDialogHire();
|
||||
|
||||
/**
|
||||
* @param dialogFarewell New dialog farewell string
|
||||
*/
|
||||
public void setDialogFarewell(String dialogFarewell);
|
||||
void setDialogFarewell(String dialogFarewell);
|
||||
|
||||
/**
|
||||
* @return dialog farewell string
|
||||
*/
|
||||
public String getDialogFarewell();
|
||||
String getDialogFarewell();
|
||||
}
|
||||
@@ -6,17 +6,17 @@ import noppes.npcs.api.item.IItemStack;
|
||||
public interface IRoleTrader extends IRole {
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param currency2 Currency item number two
|
||||
* @param sold Item to be sold by this npc
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
void setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold);
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param sold Item to be sold by this npc
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
void setSellOption(int slot, IItemStack currency, IItemStack sold);
|
||||
|
||||
@@ -67,12 +67,14 @@ public interface IRoleTrader extends IRole {
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot to 0
|
||||
*
|
||||
* @param slot
|
||||
*/
|
||||
void resetPurchaseNum(int slot);
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot and player to 0
|
||||
*
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
@@ -93,12 +95,14 @@ public interface IRoleTrader extends IRole {
|
||||
|
||||
/**
|
||||
* prevent an item from being sold on that slot
|
||||
*
|
||||
* @param slot
|
||||
*/
|
||||
void disableSlot(int slot);
|
||||
|
||||
/**
|
||||
* disables the slot for this player
|
||||
*
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
@@ -106,12 +110,14 @@ public interface IRoleTrader extends IRole {
|
||||
|
||||
/**
|
||||
* allow an item to be sold on that slot
|
||||
*
|
||||
* @param slot
|
||||
*/
|
||||
void enableSlot(int slot);
|
||||
|
||||
/**
|
||||
* enables the slot for this player
|
||||
*
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface IScoreboard {
|
||||
void setPlayerScore(String player, String objective, int score, String datatag);
|
||||
|
||||
void setPlayerScore(IPlayer player, String objective, int score, String datatag);
|
||||
|
||||
|
||||
int getPlayerScore(String player, String objective, String datatag);
|
||||
|
||||
int getPlayerScore(IPlayer player, String objective, String datatag);
|
||||
|
||||
Reference in new issue
Block a user