diff --git a/README.md b/README.md index e8dbef2..c11cdcf 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # CustomNPC-Plus-API + External API for scripting and to allow mods/plugins to hook into CustomNPC+ ## How to use in a Mod -Basically just download the api code and include it in your mod. -In your mod you can check if CustomNPC+ is installed with `NpcAPI.IsAvailable()` +Basically just download the api code and include it in your mod. + +In your mod you can check if CustomNPC+ is installed with `NpcAPI.IsAvailable()` To use the events, register your events with `NpcAPI.Instance().events().register(youreventclass)` ## Extra + JavaDocs: https://kamkeel.github.io/CustomNPC-Plus/ [![Discord Badge](https://img.shields.io/badge/KAMKEEL_Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/pQqRTvFeJ5) diff --git a/java/net/minecraft/block/properties/IProperty.java b/java/net/minecraft/block/properties/IProperty.java index 046b17e..06ef729 100644 --- a/java/net/minecraft/block/properties/IProperty.java +++ b/java/net/minecraft/block/properties/IProperty.java @@ -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> -{ +public interface IProperty> { String getName(); Collection getAllowedValues(); @@ -16,4 +17,4 @@ public interface IProperty> * Get the name for the given value. */ String getName(T value); -} \ No newline at end of file +} diff --git a/java/net/minecraft/block/state/IBlockState.java b/java/net/minecraft/block/state/IBlockState.java index da591b8..ef8dacb 100644 --- a/java/net/minecraft/block/state/IBlockState.java +++ b/java/net/minecraft/block/state/IBlockState.java @@ -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 getPropertyNames(); > T getValue(IProperty property); diff --git a/java/net/minecraft/util/Vec3i.java b/java/net/minecraft/util/Vec3i.java index cc672cd..9c7bdef 100644 --- a/java/net/minecraft/util/Vec3i.java +++ b/java/net/minecraft/util/Vec3i.java @@ -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 -{ - /** X coordinate */ +public class Vec3i implements Comparable { + /** + * 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) - { + public Vec3i(int xIn, int yIn, int zIn) { this((double) xIn, (double) 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 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_; + } else { + Vec3i vec3I = (Vec3i) p_equals_1_; return this.getX() != vec3I.getX() ? false : (this.getY() != vec3I.getY() ? false : 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 /** * 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(); } -} \ No newline at end of file +} diff --git a/java/net/minecraft/util/math/BlockPos.java b/java/net/minecraft/util/math/BlockPos.java index 20b8857..131e037 100644 --- a/java/net/minecraft/util/math/BlockPos.java +++ b/java/net/minecraft/util/math/BlockPos.java @@ -17,10 +17,11 @@ 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; @@ -31,231 +32,193 @@ public class BlockPos extends Vec3i 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 getAllInBox(BlockPos from, BlockPos to) - { + public static Iterable 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() - { - public Iterator iterator() - { - return new AbstractIterator() - { + return new Iterable() { + public Iterator iterator() { + return new AbstractIterator() { 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 (BlockPos) 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 *

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.

*/ - 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 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 = (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_); } } } diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index f07dd98..488b3a1 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -19,7 +19,6 @@ import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IAbilityHandler; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IAnimationHandler; -import noppes.npcs.api.handler.IAttributeHandler; import noppes.npcs.api.handler.ICloneHandler; import noppes.npcs.api.handler.ICustomEffectHandler; import noppes.npcs.api.handler.IDialogHandler; @@ -60,7 +59,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); @@ -91,7 +91,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); @@ -124,7 +125,7 @@ public abstract class AbstractNpcAPI { public abstract boolean hasGlobalObject(String key); - public abstract HashMap getEngineObjects(); + public abstract HashMap getEngineObjects(); public abstract long sizeOfObject(Object obj); @@ -220,8 +221,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. */ @@ -312,7 +313,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 @@ -389,9 +390,9 @@ public abstract class AbstractNpcAPI { /** * - * @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. */ @@ -399,7 +400,7 @@ public abstract class AbstractNpcAPI { /** * - * @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); diff --git a/java/noppes/npcs/api/IBlock.java b/java/noppes/npcs/api/IBlock.java index 18ed908..cadd035 100644 --- a/java/noppes/npcs/api/IBlock.java +++ b/java/noppes/npcs/api/IBlock.java @@ -19,7 +19,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 */ diff --git a/java/noppes/npcs/api/IContainer.java b/java/noppes/npcs/api/IContainer.java index 691f5ad..d3543c2 100644 --- a/java/noppes/npcs/api/IContainer.java +++ b/java/noppes/npcs/api/IContainer.java @@ -31,9 +31,9 @@ public interface IContainer { /** * - * @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); diff --git a/java/noppes/npcs/api/INbt.java b/java/noppes/npcs/api/INbt.java index e8efebb..234befa 100644 --- a/java/noppes/npcs/api/INbt.java +++ b/java/noppes/npcs/api/INbt.java @@ -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. - * + *

* 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! - * + *

* 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. - * + *

* The types and their type as an integer are as follows: * 1: Byte * 2: Short @@ -94,7 +94,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. */ diff --git a/java/noppes/npcs/api/IParticle.java b/java/noppes/npcs/api/IParticle.java index 51187b6..aec09be 100644 --- a/java/noppes/npcs/api/IParticle.java +++ b/java/noppes/npcs/api/IParticle.java @@ -5,14 +5,14 @@ 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!) - * + *

* 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. - * + *

* 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. - * + *

* 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. * @@ -34,9 +34,9 @@ public interface IParticle { /** * * @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); @@ -54,9 +54,11 @@ public interface IParticle { * @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(); /** @@ -64,6 +66,7 @@ public interface IParticle { * @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(); /** @@ -71,6 +74,7 @@ public interface IParticle { * @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(); /** @@ -78,6 +82,7 @@ public interface IParticle { * @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(); /** @@ -85,45 +90,56 @@ public interface IParticle { * @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. - * + *

* The renderer will read the frames of animation based on the given width and height of the particle, starting from the given X and 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. - * + *

* If the animation loops, once there is nowhere downward to go, the animation will start over at the X and 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(); /** @@ -133,94 +149,126 @@ public interface IParticle { * @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 +276,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(); } diff --git a/java/noppes/npcs/api/IPos.java b/java/noppes/npcs/api/IPos.java index 3e06a31..45ba39e 100644 --- a/java/noppes/npcs/api/IPos.java +++ b/java/noppes/npcs/api/IPos.java @@ -137,7 +137,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(); diff --git a/java/noppes/npcs/api/ISkinOverlay.java b/java/noppes/npcs/api/ISkinOverlay.java index 8582af5..04b43c6 100644 --- a/java/noppes/npcs/api/ISkinOverlay.java +++ b/java/noppes/npcs/api/ISkinOverlay.java @@ -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. - * + *

* 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(); } diff --git a/java/noppes/npcs/api/ITileEntity.java b/java/noppes/npcs/api/ITileEntity.java index 86b9b97..4443c85 100644 --- a/java/noppes/npcs/api/ITileEntity.java +++ b/java/noppes/npcs/api/ITileEntity.java @@ -36,6 +36,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); /** diff --git a/java/noppes/npcs/api/ITimers.java b/java/noppes/npcs/api/ITimers.java index b450fa4..b0da686 100644 --- a/java/noppes/npcs/api/ITimers.java +++ b/java/noppes/npcs/api/ITimers.java @@ -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,8 +18,8 @@ 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); diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index be3cfab..b25d3a8 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -29,9 +29,9 @@ public interface IWorld { public 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 - */ + * @param pos + * @return The block at the given position. Returns null if there isn't a block + */ public IBlock getBlock(IPos pos); /** @@ -39,45 +39,56 @@ public interface IWorld { * @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 +98,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 +106,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,11 +134,13 @@ 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); /** @@ -144,12 +160,14 @@ 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); /** @@ -157,17 +175,21 @@ public interface IWorld { * @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 +200,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 +229,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 +250,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 */ @@ -288,27 +315,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,14 +386,15 @@ 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(); @@ -371,36 +402,40 @@ public interface IWorld { public 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(); diff --git a/java/noppes/npcs/api/ability/IAbilityHandler.java b/java/noppes/npcs/api/ability/IAbilityHandler.java index 56cf621..1f0b689 100644 --- a/java/noppes/npcs/api/ability/IAbilityHandler.java +++ b/java/noppes/npcs/api/ability/IAbilityHandler.java @@ -10,7 +10,7 @@ public interface IAbilityHandler { * Register a custom ability type. * Call during FMLInitializationEvent. * - * @param typeId The unique type ID (e.g., "mymod:custom_ability") + * @param typeId The unique type ID (e.g., "mymod:custom_ability") * @param abilityClass The class that implements the ability */ void registerType(String typeId, Class abilityClass); diff --git a/java/noppes/npcs/api/block/IBlockScripted.java b/java/noppes/npcs/api/block/IBlockScripted.java index a6da807..213c04d 100644 --- a/java/noppes/npcs/api/block/IBlockScripted.java +++ b/java/noppes/npcs/api/block/IBlockScripted.java @@ -72,6 +72,7 @@ public interface IBlockScripted extends IBlock { * Use /gamerule commandBlockOutput false/true to turn off/on command block feedback
* 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
* 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); diff --git a/java/noppes/npcs/api/entity/ICustomNpc.java b/java/noppes/npcs/api/entity/ICustomNpc.java index 9d51ff1..dd92407 100644 --- a/java/noppes/npcs/api/entity/ICustomNpc.java +++ b/java/noppes/npcs/api/entity/ICustomNpc.java @@ -6,7 +6,11 @@ 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.*; +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.IMagicData; import noppes.npcs.api.item.IItemStack; import noppes.npcs.api.jobs.IJob; import noppes.npcs.api.roles.IRole; @@ -494,7 +498,7 @@ public interface ICustomNpc extends IEntityLiving, /** * Gets the Aim Type for an NPC * - * @return 0: No, 1: Yes, 2: On Shot + * @return 0: No, 1: Yes, 2: On Shot */ byte getAimType(); diff --git a/java/noppes/npcs/api/entity/IEntity.java b/java/noppes/npcs/api/entity/IEntity.java index 340cd5e..4255d73 100644 --- a/java/noppes/npcs/api/entity/IEntity.java +++ b/java/noppes/npcs/api/entity/IEntity.java @@ -541,19 +541,20 @@ public interface IEntity { IEntity[] getCapturedDrops(); /** - * @since 1.7.10c * @return Whether the entity is sneaking. + * @since 1.7.10c */ boolean isSneaking(); /** - * @since 1.7.10c * @return Whether the entity is sprinting. + * @since 1.7.10c */ boolean isSprinting(); /** * Expert users only. + * * @return The underlying Minecraft entity. */ T getMCEntity(); diff --git a/java/noppes/npcs/api/entity/IEntityLiving.java b/java/noppes/npcs/api/entity/IEntityLiving.java index 86afb01..4e3f479 100644 --- a/java/noppes/npcs/api/entity/IEntityLiving.java +++ b/java/noppes/npcs/api/entity/IEntityLiving.java @@ -1,7 +1,6 @@ package noppes.npcs.api.entity; import net.minecraft.entity.EntityLiving; -import noppes.npcs.api.entity.IEntityLivingBase; /** * Represents a living entity (mob, NPC, etc.) that extends the base living functionality. diff --git a/java/noppes/npcs/api/entity/IPixelmon.java b/java/noppes/npcs/api/entity/IPixelmon.java index 085a280..e8ab427 100644 --- a/java/noppes/npcs/api/entity/IPixelmon.java +++ b/java/noppes/npcs/api/entity/IPixelmon.java @@ -1,7 +1,6 @@ package noppes.npcs.api.entity; import net.minecraft.entity.passive.EntityTameable; -import noppes.npcs.api.item.IItemStack; /** * Represents a Pixelmon (a tameable creature) with additional attributes @@ -37,6 +36,7 @@ public interface IPixelmon extends IAnimal { /** * 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. */ @@ -84,7 +84,7 @@ public interface IPixelmon extends IAnimal { /** * @return The Pixelmon's size type (0: Pygmy, 1: Runt, 2: Small, 3: Normal, 4: Huge, 5: Giant, - * 6: Enormous, 7: Ginormous, 8: Microscopic). + * 6: Enormous, 7: Ginormous, 8: Microscopic). */ int getSize(); @@ -121,7 +121,7 @@ public interface IPixelmon extends IAnimal { /** * @return The type of Poké Ball in which the Pixelmon is contained - * (-1: Uncaught, 0: Pokéball, 1: Great Ball, etc.). + * (-1: Uncaught, 0: Pokéball, 1: Great Ball, etc.). */ int getPokeball(); diff --git a/java/noppes/npcs/api/entity/IPlayer.java b/java/noppes/npcs/api/entity/IPlayer.java index ba3a1f9..9026f9a 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -2,12 +2,23 @@ package noppes.npcs.api.entity; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; -import noppes.npcs.api.*; +import noppes.npcs.api.IBlock; +import noppes.npcs.api.IContainer; +import noppes.npcs.api.IPixelmonPlayerData; +import noppes.npcs.api.IPos; +import noppes.npcs.api.IScreenSize; +import noppes.npcs.api.ITimers; +import noppes.npcs.api.IWorld; import noppes.npcs.api.gui.ICustomGui; import noppes.npcs.api.handler.IActionManager; import noppes.npcs.api.handler.IOverlayHandler; import noppes.npcs.api.handler.IPlayerData; -import noppes.npcs.api.handler.data.*; +import noppes.npcs.api.handler.data.IAnimationData; +import noppes.npcs.api.handler.data.IDialog; +import noppes.npcs.api.handler.data.IMagicData; +import noppes.npcs.api.handler.data.IPlayerAttributes; +import noppes.npcs.api.handler.data.IQuest; +import noppes.npcs.api.handler.data.ISound; import noppes.npcs.api.item.IItemStack; import noppes.npcs.api.overlay.ICustomOverlay; @@ -313,8 +324,8 @@ public interface IPlayer extends IEntityLivingBase, void setMode(int type); /** - * @since 1.7.10d * @return Returns an IItemStack array of size 36 representing the player's inventory. + * @since 1.7.10d */ IItemStack[] getInventory(); @@ -327,11 +338,11 @@ public interface IPlayer extends IEntityLivingBase, int inventoryItemCount(IItemStack item, boolean ignoreNBT, boolean ignoreDamage); /** - * @since 1.7.10c * @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 */ boolean removeItem(String id, int damage, int amount); @@ -353,19 +364,19 @@ public interface IPlayer extends IEntityLivingBase, int removeAllItems(IItemStack item, boolean ignoreNBT, boolean ignoreDamage); /** - * @since 1.7.10c * @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 */ boolean giveItem(IItemStack item, int amount); /** - * @since 1.7.10c * @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 */ boolean giveItem(String id, int damage, int amount); @@ -511,22 +522,22 @@ public interface IPlayer extends IEntityLivingBase, boolean hasBukkitPermission(String permission); /** - * @since 1.7.10c * @return Returns the player's experience level. + * @since 1.7.10c */ int getExpLevel(); /** - * @since 1.7.10c * @param level The new experience level to set. + * @since 1.7.10c */ void setExpLevel(int level); /** * Requires Pixelmon to be installed. * - * @since 1.7.10d * @return Returns the player's Pixelmon data, or null if Pixelmon is not enabled. + * @since 1.7.10d */ IPixelmonPlayerData getPixelmonData(); @@ -673,7 +684,6 @@ public interface IPlayer extends IEntityLivingBase, IActionManager getActionManager(); - IPlayer[] getPartyMembers(); // ========================================= diff --git a/java/noppes/npcs/api/entity/IVillager.java b/java/noppes/npcs/api/entity/IVillager.java index a7eb5e3..fa6e51d 100644 --- a/java/noppes/npcs/api/entity/IVillager.java +++ b/java/noppes/npcs/api/entity/IVillager.java @@ -1,7 +1,6 @@ package noppes.npcs.api.entity; import net.minecraft.entity.passive.EntityVillager; -import noppes.npcs.api.entity.IEntityLivingBase; /** * Represents a villager entity with additional trading-related methods. diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 57ab8e2..21c9cd3 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -3,7 +3,6 @@ package noppes.npcs.api.event; import cpw.mods.fml.common.eventhandler.Cancelable; import noppes.npcs.api.IDamageSource; import noppes.npcs.api.ability.IAbility; -import noppes.npcs.api.entity.ICustomNpc; import noppes.npcs.api.entity.IEntityLivingBase; /** diff --git a/java/noppes/npcs/api/event/IBlockEvent.java b/java/noppes/npcs/api/event/IBlockEvent.java index bd7d65f..67bece3 100644 --- a/java/noppes/npcs/api/event/IBlockEvent.java +++ b/java/noppes/npcs/api/event/IBlockEvent.java @@ -8,12 +8,14 @@ import noppes.npcs.api.entity.IPlayer; public interface IBlockEvent extends ICustomNPCsEvent { IBlock getBlock(); + /** * @hookName fallenUpon */ @Cancelable - interface EntityFallenUponEvent extends IBlockEvent{ + interface EntityFallenUponEvent extends IBlockEvent { IEntity getEntity(); + float getDistanceFallen(); } @@ -30,24 +32,28 @@ public interface IBlockEvent extends ICustomNPCsEvent { int getSide(); } - interface RedstoneEvent extends IBlockEvent{ + interface RedstoneEvent extends IBlockEvent { int getPrevPower(); + int getPower(); } + /** * @hookName broken */ - interface BreakEvent extends IBlockEvent{ + interface BreakEvent extends IBlockEvent { } + @Cancelable - interface ExplodedEvent extends IBlockEvent{ + interface ExplodedEvent extends IBlockEvent { } + /** * @hookName rainFilled */ - interface RainFillEvent extends IBlockEvent{ + interface RainFillEvent extends IBlockEvent { } @@ -55,13 +61,14 @@ public interface IBlockEvent extends ICustomNPCsEvent { IPos getChangedPos(); } - interface InitEvent extends IBlockEvent{ + interface InitEvent extends IBlockEvent { } + /** * @hookName tick */ - interface UpdateEvent extends IBlockEvent{ + interface UpdateEvent extends IBlockEvent { } diff --git a/java/noppes/npcs/api/event/INpcEvent.java b/java/noppes/npcs/api/event/INpcEvent.java index adcc400..4c4bac9 100644 --- a/java/noppes/npcs/api/event/INpcEvent.java +++ b/java/noppes/npcs/api/event/INpcEvent.java @@ -17,7 +17,7 @@ public interface INpcEvent extends ICustomNPCsEvent { int getId(); } - interface CollideEvent extends INpcEvent{ + interface CollideEvent extends INpcEvent { IEntity getEntity(); } @@ -64,6 +64,7 @@ public interface INpcEvent extends ICustomNPCsEvent { /** * Can be null + * * @return Returns the swung item */ IItemStack getItemStack(); diff --git a/java/noppes/npcs/api/event/IPartyEvent.java b/java/noppes/npcs/api/event/IPartyEvent.java index 9094d2a..d1994de 100644 --- a/java/noppes/npcs/api/event/IPartyEvent.java +++ b/java/noppes/npcs/api/event/IPartyEvent.java @@ -19,7 +19,8 @@ public interface IPartyEvent { } @Cancelable - interface PartyQuestTurnedInEvent extends IPartyEvent { } + interface PartyQuestTurnedInEvent extends IPartyEvent { + } @Cancelable interface PartyInviteEvent extends IPartyEvent { diff --git a/java/noppes/npcs/api/event/IPlayerEvent.java b/java/noppes/npcs/api/event/IPlayerEvent.java index 82e82f8..2d36189 100644 --- a/java/noppes/npcs/api/event/IPlayerEvent.java +++ b/java/noppes/npcs/api/event/IPlayerEvent.java @@ -289,7 +289,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } interface FillBucketEvent extends IPlayerEvent { - IItemStack getCurrent() ; + IItemStack getCurrent(); IItemStack getFilled(); } @@ -376,12 +376,14 @@ public interface IPlayerEvent extends ICustomNPCsEvent { * @hookName profileCreate */ @Cancelable - interface Create extends ProfileEvent {} + interface Create extends ProfileEvent { + } /** * @hookName profileRemove */ @Cancelable - interface Removed extends ProfileEvent {} + interface Removed extends ProfileEvent { + } } } diff --git a/java/noppes/npcs/api/event/IProjectileEvent.java b/java/noppes/npcs/api/event/IProjectileEvent.java index 949318f..5137273 100644 --- a/java/noppes/npcs/api/event/IProjectileEvent.java +++ b/java/noppes/npcs/api/event/IProjectileEvent.java @@ -7,6 +7,7 @@ import noppes.npcs.api.entity.IProjectile; public interface IProjectileEvent extends ICustomNPCsEvent { public IProjectile getProjectile(); + public IEntity getSource(); /** @@ -20,7 +21,9 @@ public interface IProjectileEvent extends ICustomNPCsEvent { */ interface ImpactEvent extends IProjectileEvent { public int getType(); + public IEntity getEntity(); + public IBlock getBlock(); } diff --git a/java/noppes/npcs/api/gui/ICustomGui.java b/java/noppes/npcs/api/gui/ICustomGui.java index 1cc286a..3a92495 100644 --- a/java/noppes/npcs/api/gui/ICustomGui.java +++ b/java/noppes/npcs/api/gui/ICustomGui.java @@ -3,6 +3,7 @@ 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; /** @@ -90,10 +91,10 @@ public interface ICustomGui { /** * 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. + * @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); diff --git a/java/noppes/npcs/api/handler/IAbilityHandler.java b/java/noppes/npcs/api/handler/IAbilityHandler.java index fc873c2..f6e8670 100644 --- a/java/noppes/npcs/api/handler/IAbilityHandler.java +++ b/java/noppes/npcs/api/handler/IAbilityHandler.java @@ -3,7 +3,7 @@ package noppes.npcs.api.handler; /** * Handler for ability presets. Allows scripts to save, load, and manage * reusable ability templates. - * + *

* Access via API.getAbilities() */ public interface IAbilityHandler { diff --git a/java/noppes/npcs/api/handler/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index cff50a4..683f410 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -5,7 +5,6 @@ import noppes.npcs.api.handler.data.IActionChain; import noppes.npcs.api.handler.data.IActionQueue; import noppes.npcs.api.handler.data.actions.IConditionalAction; -import java.util.List; import java.util.Queue; import java.util.function.Consumer; import java.util.function.Function; @@ -35,10 +34,10 @@ public interface IActionManager { /** * Create a new action instance without immediately scheduling it. * - * @param name a unique name for this action - * @param maxDuration the maximum lifetime of the action in ticks - * @param delay number of ticks to wait before the first run - * @param action code to execute each time the action "fires" + * @param name a unique name for this action + * @param maxDuration the maximum lifetime of the action in ticks + * @param delay number of ticks to wait before the first run + * @param action code to execute each time the action "fires" * @return a fresh {@link IAction} object */ IAction create(String name, int maxDuration, int delay, Consumer action); @@ -59,6 +58,7 @@ public interface IActionManager { /** * Enabling prints to the console the life cycle of IActionManager, it's IActionQueues and the scheduled IActions + * * @param debug * @return */ @@ -131,8 +131,8 @@ public interface IActionManager { */ IConditionalAction create(String name, Function condition, Consumer task, Function terminateWhen, Consumer onTermination); - /////////////////////////////////////////////////// - /////////////////////////////////////////////////// + /// //////////////////////////////////////////////// + /// //////////////////////////////////////////////// // Queues IActionQueue createQueue(String name); @@ -183,7 +183,7 @@ public interface IActionManager { /** * Convenience for {@link #create(Consumer)} + enqueue. * - * @param task code to execute each time the task "fires" + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(Consumer task); @@ -199,8 +199,8 @@ public interface IActionManager { /** * Convenience for {@link #create(String, Consumer)} + enqueue. * - * @param delay number of ticks to wait before the first task run - * @param task code to execute each time the task "fires" + * @param delay number of ticks to wait before the first task run + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(int delay, Consumer task); @@ -208,8 +208,8 @@ public interface IActionManager { /** * Convenience for {@link #create(String, Consumer)} + enqueue. * - * @param name a unique name for this action - * @param task code to execute each time the task "fires" + * @param name a unique name for this action + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(String name, Consumer task); @@ -217,9 +217,9 @@ public interface IActionManager { /** * Convenience for {@link #create(String, int, Consumer)} + enqueue. * - * @param name a unique name for this action + * @param name a unique name for this action * @param delay number of ticks to wait before the first task run - * @param task code to execute each time the task "fires" + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(String name, int delay, Consumer task); @@ -227,10 +227,10 @@ public interface IActionManager { /** * Convenience for {@link #create(String, int, int, Consumer)} + enqueue. * - * @param name a unique name for this action - * @param maxDuration the maximum lifetime of the action in ticks - * @param delay number of ticks to wait before the first task run - * @param task code to execute each time the task "fires" + * @param name a unique name for this action + * @param maxDuration the maximum lifetime of the action in ticks + * @param delay number of ticks to wait before the first task run + * @param task code to execute each time the task "fires" * @return the task scheduled */ IAction schedule(String name, int maxDuration, int delay, Consumer task); diff --git a/java/noppes/npcs/api/handler/IAttributeHandler.java b/java/noppes/npcs/api/handler/IAttributeHandler.java index 0ff0068..94a2ce5 100644 --- a/java/noppes/npcs/api/handler/IAttributeHandler.java +++ b/java/noppes/npcs/api/handler/IAttributeHandler.java @@ -19,7 +19,7 @@ public interface IAttributeHandler { * * @param player the player whose attributes are requested * @return an {@link IPlayerAttributes} instance containing all custom attributes for the player, - * or null if the player is invalid + * or null if the player is invalid */ IPlayerAttributes getPlayerAttributes(IPlayer player); diff --git a/java/noppes/npcs/api/handler/ICloneHandler.java b/java/noppes/npcs/api/handler/ICloneHandler.java index 6d8f8c2..90fecfb 100644 --- a/java/noppes/npcs/api/handler/ICloneHandler.java +++ b/java/noppes/npcs/api/handler/ICloneHandler.java @@ -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); diff --git a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java b/java/noppes/npcs/api/handler/IPlayerCurrencyData.java index 5e41452..0b9c84b 100644 --- a/java/noppes/npcs/api/handler/IPlayerCurrencyData.java +++ b/java/noppes/npcs/api/handler/IPlayerCurrencyData.java @@ -14,12 +14,14 @@ public interface IPlayerCurrencyData { /** * Set the balance directly + * * @param balance The new balance */ void setBalance(long balance); /** * Add currency to balance (deposit) + * * @param amount Amount to add * @return true if successful, false if would exceed max balance */ @@ -27,6 +29,7 @@ public interface IPlayerCurrencyData { /** * Remove currency from balance (withdraw) + * * @param amount Amount to remove * @return true if successful, false if insufficient funds */ @@ -34,6 +37,7 @@ public interface IPlayerCurrencyData { /** * Check if player can afford an amount + * * @param amount Amount to check * @return true if player has enough balance */ @@ -56,6 +60,7 @@ public interface IPlayerCurrencyData { /** * Check if Vault is being used for currency operations + * * @return true if Vault is handling currency, false if using CNPC+ built-in */ boolean isUsingVault(); diff --git a/java/noppes/npcs/api/handler/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index cbcb397..9382a69 100644 --- a/java/noppes/npcs/api/handler/IPlayerData.java +++ b/java/noppes/npcs/api/handler/IPlayerData.java @@ -1,4 +1,5 @@ package noppes.npcs.api.handler; + import noppes.npcs.api.entity.ICustomNpc; public interface IPlayerData { diff --git a/java/noppes/npcs/api/handler/IPlayerQuestData.java b/java/noppes/npcs/api/handler/IPlayerQuestData.java index 219a146..0e7afae 100644 --- a/java/noppes/npcs/api/handler/IPlayerQuestData.java +++ b/java/noppes/npcs/api/handler/IPlayerQuestData.java @@ -24,5 +24,5 @@ public interface IPlayerQuestData { long getLastCompletedTime(int id); - void setLastCompletedTime(int id,long time); + void setLastCompletedTime(int id, long time); } diff --git a/java/noppes/npcs/api/handler/IScriptHookHandler.java b/java/noppes/npcs/api/handler/IScriptHookHandler.java index a1eab86..3290e28 100644 --- a/java/noppes/npcs/api/handler/IScriptHookHandler.java +++ b/java/noppes/npcs/api/handler/IScriptHookHandler.java @@ -31,7 +31,7 @@ public interface IScriptHookHandler { /** * Register a hook with full metadata including event type and imports. * - * @param context The context identifier (e.g., "npc", "player", "block") + * @param context The context identifier (e.g., "npc", "player", "block") * @param definition The hook definition containing all metadata */ void registerHookDefinition(String context, IHookDefinition definition); @@ -39,7 +39,7 @@ public interface IScriptHookHandler { /** * Get the hook definition for a specific hook. * - * @param context The context identifier + * @param context The context identifier * @param hookName The hook function name * @return The hook definition, or null if not found */ @@ -64,7 +64,7 @@ public interface IScriptHookHandler { /** * Check if a hook is registered in a specific context. * - * @param context The context to check + * @param context The context to check * @param hookName The function name to look for * @return true if the hook is registered */ diff --git a/java/noppes/npcs/api/handler/data/IAction.java b/java/noppes/npcs/api/handler/data/IAction.java index 9d7e104..29e3d9e 100644 --- a/java/noppes/npcs/api/handler/data/IAction.java +++ b/java/noppes/npcs/api/handler/data/IAction.java @@ -72,15 +72,15 @@ public interface IAction { /** * @return the maximum number of ticks this action is allowed to run before auto marking done - * + *

* P.S: If max duration is reached and this IAction's thread (created using {@link #threadify()}) is paused by any of the pausing methods, - * the thread is forcibly resumed and finishes the task execution. + * the thread is forcibly resumed and finishes the task execution. */ int getMaxDuration(); /** * @param ticks max duration - * default: -1, infinite + * default: -1, infinite * @return */ IAction setMaxDuration(int ticks); @@ -171,12 +171,14 @@ public interface IAction { /** * Executes task every tick (Sets updateEvery to 1) + * * @return */ IAction everyTick(); /** * Executes task every second (Sets updateEvery to 20) + * * @return */ IAction everySecond(); @@ -206,7 +208,7 @@ public interface IAction { * Must call {@link #threadify()} before using, else throws exception. * Pauses IAction's thread until the supplied condition is satisfied or {@link #resume()} is called. */ - void pauseUntil(Function until); + void pauseUntil(Function until); /** * Resumes thread that was previously paused by {@link #pause()}, {@link #pauseUntil(Function)}, {@link #pauseFor(int)} or {@link #pauseFor(long)} @@ -306,17 +308,17 @@ public interface IAction { void conditional(IConditionalAction... actions); - IConditionalAction conditional(Function condition, Consumer task); + IConditionalAction conditional(Function condition, Consumer task); - IConditionalAction conditional(String name, Function condition, Consumer task); + IConditionalAction conditional(String name, Function condition, Consumer task); - IConditionalAction conditional(Function condition, Consumer task, Function terminate); + IConditionalAction conditional(Function condition, Consumer task, Function terminate); - IConditionalAction conditional(String name, Function condition, Consumer task, Function terminate); + IConditionalAction conditional(String name, Function condition, Consumer task, Function terminate); - IConditionalAction conditional(Function condition, Consumer task, Function terminateWhen, Consumer onTermination); + IConditionalAction conditional(Function condition, Consumer task, Function terminateWhen, Consumer onTermination); - IConditionalAction conditional(String name, Function condition, Consumer task, Function terminateWhen, Consumer onTermination); + IConditionalAction conditional(String name, Function condition, Consumer task, Function terminateWhen, Consumer onTermination); /** * Enqueue another IAction on the parallel chain which starts firing simultaneously as this. diff --git a/java/noppes/npcs/api/handler/data/IActionChain.java b/java/noppes/npcs/api/handler/data/IActionChain.java index cd4efcf..7192c27 100644 --- a/java/noppes/npcs/api/handler/data/IActionChain.java +++ b/java/noppes/npcs/api/handler/data/IActionChain.java @@ -21,8 +21,8 @@ public interface IActionChain { /** * * @param delay ticks between an IAction and another - * @param name name of IAction - * @param task task of IAction + * @param name name of IAction + * @param task task of IAction * @return */ IActionChain after(int delay, String name, Consumer task); @@ -31,6 +31,7 @@ public interface IActionChain { /** * Start IActionManager + * * @return */ IActionChain start(); diff --git a/java/noppes/npcs/api/handler/data/IAnvilRecipe.java b/java/noppes/npcs/api/handler/data/IAnvilRecipe.java index 6fcda5b..9de714b 100644 --- a/java/noppes/npcs/api/handler/data/IAnvilRecipe.java +++ b/java/noppes/npcs/api/handler/data/IAnvilRecipe.java @@ -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 */ diff --git a/java/noppes/npcs/api/handler/data/IDialog.java b/java/noppes/npcs/api/handler/data/IDialog.java index 82743a0..620f286 100644 --- a/java/noppes/npcs/api/handler/data/IDialog.java +++ b/java/noppes/npcs/api/handler/data/IDialog.java @@ -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(); diff --git a/java/noppes/npcs/api/handler/data/IDialogImage.java b/java/noppes/npcs/api/handler/data/IDialogImage.java index f019cd5..f48cefd 100644 --- a/java/noppes/npcs/api/handler/data/IDialogImage.java +++ b/java/noppes/npcs/api/handler/data/IDialogImage.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IFramePart.java b/java/noppes/npcs/api/handler/data/IFramePart.java index 66a9f09..3bb63e2 100644 --- a/java/noppes/npcs/api/handler/data/IFramePart.java +++ b/java/noppes/npcs/api/handler/data/IFramePart.java @@ -1,6 +1,6 @@ package noppes.npcs.api.handler.data; -public interface IFramePart{ +public interface IFramePart { String getName(); diff --git a/java/noppes/npcs/api/handler/data/IMagicCycle.java b/java/noppes/npcs/api/handler/data/IMagicCycle.java index 976fed2..3f88337 100644 --- a/java/noppes/npcs/api/handler/data/IMagicCycle.java +++ b/java/noppes/npcs/api/handler/data/IMagicCycle.java @@ -45,7 +45,7 @@ public interface IMagicCycle { /** * Gets the layout type for the cycle. * This is typically an integer representation of the layout enum. - * + *

* 0: CIRCULAR * 1: SQUARE * 2: TREE @@ -62,7 +62,7 @@ public interface IMagicCycle { /** * Sets the layout type for the cycle. * The provided integer should correspond to a valid layout type. - * + *

* 0: CIRCULAR * 1: SQUARE * 2: TREE diff --git a/java/noppes/npcs/api/handler/data/IMagicData.java b/java/noppes/npcs/api/handler/data/IMagicData.java index c72f0e8..de3e080 100644 --- a/java/noppes/npcs/api/handler/data/IMagicData.java +++ b/java/noppes/npcs/api/handler/data/IMagicData.java @@ -24,9 +24,9 @@ public interface IMagicData { boolean isEmpty(); /** - * @param id The ID of the Magic + * @param id The ID of the Magic * @param damage The bonus damage for the Magic - * @param split The split of the Magic + * @param split The split of the Magic */ void addMagic(int id, float damage, float split); diff --git a/java/noppes/npcs/api/handler/data/IParty.java b/java/noppes/npcs/api/handler/data/IParty.java index c2b6e4a..9595d0e 100644 --- a/java/noppes/npcs/api/handler/data/IParty.java +++ b/java/noppes/npcs/api/handler/data/IParty.java @@ -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 */ diff --git a/java/noppes/npcs/api/handler/data/IPartyOptions.java b/java/noppes/npcs/api/handler/data/IPartyOptions.java index 038902a..4ce1b72 100644 --- a/java/noppes/npcs/api/handler/data/IPartyOptions.java +++ b/java/noppes/npcs/api/handler/data/IPartyOptions.java @@ -12,7 +12,7 @@ public interface IPartyOptions { public void setOnlyParty(boolean onlyParty); /** - * @return 0:Leader, 1:All, 2:Valid + * @return 0:Leader, 1:All, 2:Valid */ public int getPartyRequirements(); @@ -22,7 +22,7 @@ public interface IPartyOptions { public 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(); @@ -32,7 +32,7 @@ public interface IPartyOptions { public 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(); @@ -42,7 +42,7 @@ public interface IPartyOptions { public void setCompleteFor(int completeFor); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ int getExecuteCommandFor(); diff --git a/java/noppes/npcs/api/handler/data/IProfileOptions.java b/java/noppes/npcs/api/handler/data/IProfileOptions.java index 8caed42..025e56b 100644 --- a/java/noppes/npcs/api/handler/data/IProfileOptions.java +++ b/java/noppes/npcs/api/handler/data/IProfileOptions.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestItem.java b/java/noppes/npcs/api/handler/data/IQuestItem.java index 4a025b6..883634b 100644 --- a/java/noppes/npcs/api/handler/data/IQuestItem.java +++ b/java/noppes/npcs/api/handler/data/IQuestItem.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestKill.java b/java/noppes/npcs/api/handler/data/IQuestKill.java index aaaa20a..86074d1 100644 --- a/java/noppes/npcs/api/handler/data/IQuestKill.java +++ b/java/noppes/npcs/api/handler/data/IQuestKill.java @@ -2,5 +2,6 @@ package noppes.npcs.api.handler.data; public interface IQuestKill extends IQuestInterface { void setTargetType(int type); + int getTargetType(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestLocation.java b/java/noppes/npcs/api/handler/data/IQuestLocation.java index c27a97a..27e43b5 100644 --- a/java/noppes/npcs/api/handler/data/IQuestLocation.java +++ b/java/noppes/npcs/api/handler/data/IQuestLocation.java @@ -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(); } diff --git a/java/noppes/npcs/api/handler/data/IQuestObjective.java b/java/noppes/npcs/api/handler/data/IQuestObjective.java index 84b997f..d909a08 100644 --- a/java/noppes/npcs/api/handler/data/IQuestObjective.java +++ b/java/noppes/npcs/api/handler/data/IQuestObjective.java @@ -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); diff --git a/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java b/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java index 0b94a64..63b5f30 100644 --- a/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java +++ b/java/noppes/npcs/api/handler/data/actions/IConditionalAction.java @@ -33,12 +33,14 @@ public interface IConditionalAction extends IAction { /** * Note: Only for Conditional Actions + * * @return how many times this conditional action has tested its condition */ int getCheckCount(); /** * Note: Only for Conditional Actions + * * @return the maximum number of checks before auto-expiring, or -1 if unlimited */ int getMaxChecks(); diff --git a/java/noppes/npcs/api/item/IItemCustom.java b/java/noppes/npcs/api/item/IItemCustom.java index c91f087..45145b7 100644 --- a/java/noppes/npcs/api/item/IItemCustom.java +++ b/java/noppes/npcs/api/item/IItemCustom.java @@ -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,36 +29,42 @@ 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); @@ -64,12 +72,14 @@ public interface IItemCustom extends IItemCustomizable { /** * Sets the attack speed for the scripted item. * Speed is the max resistantance time between two attacks in ticks. + * * @param speed The attack speed */ void setAttackSpeed(int speed); /** * Sets the enchantability for the scripted item. + * * @param enchantability The enchantability */ void setEnchantability(int enchantability); diff --git a/java/noppes/npcs/api/item/IItemCustomizable.java b/java/noppes/npcs/api/item/IItemCustomizable.java index 68e9fcf..c085052 100644 --- a/java/noppes/npcs/api/item/IItemCustomizable.java +++ b/java/noppes/npcs/api/item/IItemCustomizable.java @@ -8,48 +8,56 @@ 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(); @@ -57,60 +65,70 @@ public interface IItemCustomizable extends IItemStack { /** * Gets the attack speed for the scripted item. * Speed is the max hurt resistant time in ticks (20 ticks = 1 second) + * * @return The attack speed */ int getAttackSpeed(); /** * 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 @@ -119,6 +137,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 @@ -127,6 +146,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 @@ -135,6 +155,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 @@ -143,72 +164,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(); diff --git a/java/noppes/npcs/api/item/IItemStack.java b/java/noppes/npcs/api/item/IItemStack.java index 92e51dd..8aa50d2 100644 --- a/java/noppes/npcs/api/item/IItemStack.java +++ b/java/noppes/npcs/api/item/IItemStack.java @@ -375,9 +375,9 @@ public interface IItemStack { /** * Compares this item with another item, with options to ignore damage and/or NBT data. * - * @param item The item to compare. + * @param item The item to compare. * @param ignoreDamage true to ignore damage values. - * @param ignoreNBT true to ignore NBT data. + * @param ignoreNBT true to ignore NBT data. * @return true if the items are considered equal, false otherwise. */ boolean compare(IItemStack item, boolean ignoreDamage, boolean ignoreNBT); diff --git a/java/noppes/npcs/api/jobs/IJobBard.java b/java/noppes/npcs/api/jobs/IJobBard.java index 7dbb2d3..b3a5cd8 100644 --- a/java/noppes/npcs/api/jobs/IJobBard.java +++ b/java/noppes/npcs/api/jobs/IJobBard.java @@ -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(); } diff --git a/java/noppes/npcs/api/jobs/IJobGuard.java b/java/noppes/npcs/api/jobs/IJobGuard.java index 166f7df..51e1f3f 100644 --- a/java/noppes/npcs/api/jobs/IJobGuard.java +++ b/java/noppes/npcs/api/jobs/IJobGuard.java @@ -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); } diff --git a/java/noppes/npcs/api/jobs/IJobHealer.java b/java/noppes/npcs/api/jobs/IJobHealer.java index 361df11..14e51c4 100644 --- a/java/noppes/npcs/api/jobs/IJobHealer.java +++ b/java/noppes/npcs/api/jobs/IJobHealer.java @@ -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(); } diff --git a/java/noppes/npcs/api/overlay/IOverlayLine.java b/java/noppes/npcs/api/overlay/IOverlayLine.java index 8b47d98..1e12b1b 100644 --- a/java/noppes/npcs/api/overlay/IOverlayLine.java +++ b/java/noppes/npcs/api/overlay/IOverlayLine.java @@ -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); } diff --git a/java/noppes/npcs/api/package-info.java b/java/noppes/npcs/api/package-info.java index 4ab2b54..9e53615 100644 --- a/java/noppes/npcs/api/package-info.java +++ b/java/noppes/npcs/api/package-info.java @@ -1,3 +1,4 @@ @API(owner = "customnpcs", provides = "Core", apiVersion = "0.1") package noppes.npcs.api; + import cpw.mods.fml.common.API; diff --git a/java/noppes/npcs/api/roles/IRoleFollower.java b/java/noppes/npcs/api/roles/IRoleFollower.java index 6e7aaa7..78b2aed 100644 --- a/java/noppes/npcs/api/roles/IRoleFollower.java +++ b/java/noppes/npcs/api/roles/IRoleFollower.java @@ -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,44 +27,44 @@ 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); diff --git a/java/noppes/npcs/api/roles/IRoleTrader.java b/java/noppes/npcs/api/roles/IRoleTrader.java index 3f43146..b76a39e 100644 --- a/java/noppes/npcs/api/roles/IRoleTrader.java +++ b/java/noppes/npcs/api/roles/IRoleTrader.java @@ -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 */ @@ -141,30 +147,35 @@ public interface IRoleTrader extends IRole { /** * Get the stock reset type + * * @return 0=NONE, 1=MCDAILY, 2=MCWEEKLY, 3=MCCUSTOM, 4=RLDAILY, 5=RLWEEKLY, 6=RLCUSTOM */ int getStockResetType(); /** * Set stock reset type + * * @param type 0=NONE, 1=MCDAILY, 2=MCWEEKLY, 3=MCCUSTOM, 4=RLDAILY, 5=RLWEEKLY, 6=RLCUSTOM */ void setStockResetType(int type); /** * Get custom reset time (only used for MCCUSTOM/RLCUSTOM) + * * @return Custom time in ticks (MC) or milliseconds (RL) */ long getCustomResetTime(); /** * Set custom reset time + * * @param time Time in ticks (MC) or milliseconds (RL) */ void setCustomResetTime(long time); /** * Get max stock for a slot + * * @param slot Slot number 0-17 * @return Max stock, -1 = unlimited */ @@ -172,13 +183,15 @@ public interface IRoleTrader extends IRole { /** * Set max stock for a slot - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param amount Max stock, -1 = unlimited */ void setMaxStock(int slot, int amount); /** * Get available stock for a slot (global mode) + * * @param slot Slot number 0-17 * @return Available stock, Integer.MAX_VALUE if unlimited */ @@ -186,7 +199,8 @@ public interface IRoleTrader extends IRole { /** * Get available stock for a slot for a specific player (per-player mode) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param player The player * @return Available stock, Integer.MAX_VALUE if unlimited */ @@ -205,6 +219,7 @@ public interface IRoleTrader extends IRole { /** * Get current stock for a slot (global mode) + * * @param slot Slot number 0-17 * @return Current stock, -1 if not initialized */ @@ -212,14 +227,16 @@ public interface IRoleTrader extends IRole { /** * Set current stock for a slot (global mode only) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param amount Current stock amount */ void setCurrentStock(int slot, int amount); /** * Get purchased amount for a player in a slot (per-player mode) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param player The player * @return Purchased amount (stock available = maxStock - purchasedAmount) */ @@ -227,7 +244,8 @@ public interface IRoleTrader extends IRole { /** * Set purchased amount for a player in a slot (per-player mode) - * @param slot Slot number 0-17 + * + * @param slot Slot number 0-17 * @param player The player * @param amount Purchased amount */ @@ -235,12 +253,14 @@ public interface IRoleTrader extends IRole { /** * Get the timestamp of the last stock reset + * * @return Time in ticks (MC) or milliseconds (RL), depending on reset type */ long getLastResetTime(); /** * Get time remaining until next stock reset + * * @return Time remaining in ticks (MC) or milliseconds (RL), -1 if no reset scheduled */ long getTimeUntilReset(); @@ -249,6 +269,7 @@ public interface IRoleTrader extends IRole { /** * Get the currency cost for a slot (additive to item costs) + * * @param slot Slot number 0-17 * @return Currency cost, 0 = no cost */ @@ -256,6 +277,7 @@ public interface IRoleTrader extends IRole { /** * Set the currency cost for a slot (additive to item costs) + * * @param slot Slot number 0-17 * @param cost Currency cost, 0 = no cost */ diff --git a/java/noppes/npcs/api/scoreboard/IScoreboard.java b/java/noppes/npcs/api/scoreboard/IScoreboard.java index 6e5f7af..3adf4ed 100644 --- a/java/noppes/npcs/api/scoreboard/IScoreboard.java +++ b/java/noppes/npcs/api/scoreboard/IScoreboard.java @@ -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);