From afb5f1d64576b978d75938a514b211a9f4430371 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 12 Mar 2025 20:11:39 -0400 Subject: [PATCH] Full Imports and Code Format Optimization --- README.md | 7 +- .../minecraft/block/properties/IProperty.java | 9 +- .../minecraft/block/state/IBlockState.java | 7 +- java/net/minecraft/util/Vec3i.java | 89 +++---- java/net/minecraft/util/math/BlockPos.java | 248 +++++++----------- java/net/minecraft/util/math/IntHashMap.java | 14 +- java/noppes/npcs/api/AbstractNpcAPI.java | 32 +-- java/noppes/npcs/api/IBlock.java | 16 +- java/noppes/npcs/api/IContainer.java | 10 +- java/noppes/npcs/api/IDamageSource.java | 4 - java/noppes/npcs/api/INbt.java | 13 +- java/noppes/npcs/api/IParticle.java | 129 +++++---- java/noppes/npcs/api/IPos.java | 16 -- java/noppes/npcs/api/IScreenSize.java | 8 +- java/noppes/npcs/api/ISkinOverlay.java | 14 +- java/noppes/npcs/api/ITileEntity.java | 5 +- java/noppes/npcs/api/ITimers.java | 10 +- java/noppes/npcs/api/IWorld.java | 117 ++++++--- .../noppes/npcs/api/block/IBlockScripted.java | 1 + java/noppes/npcs/api/block/ITextPlane.java | 32 +-- java/noppes/npcs/api/entity/IEntity.java | 5 +- .../noppes/npcs/api/entity/IEntityLiving.java | 1 - java/noppes/npcs/api/entity/IPixelmon.java | 6 +- java/noppes/npcs/api/entity/IPlayer.java | 14 +- java/noppes/npcs/api/entity/IVillager.java | 1 - java/noppes/npcs/api/event/IBlockEvent.java | 21 +- java/noppes/npcs/api/event/INpcEvent.java | 3 +- java/noppes/npcs/api/event/IPartyEvent.java | 3 +- java/noppes/npcs/api/event/IPlayerEvent.java | 10 +- .../npcs/api/event/IProjectileEvent.java | 13 +- java/noppes/npcs/api/gui/ICustomGui.java | 9 +- .../npcs/api/handler/IActionManager.java | 1 + .../npcs/api/handler/ICloneHandler.java | 2 + java/noppes/npcs/api/handler/IPlayerData.java | 1 + .../npcs/api/handler/IPlayerQuestData.java | 4 +- .../npcs/api/handler/data/IAnvilRecipe.java | 4 +- .../noppes/npcs/api/handler/data/IDialog.java | 6 + .../npcs/api/handler/data/IDialogImage.java | 14 + .../npcs/api/handler/data/IFramePart.java | 2 +- java/noppes/npcs/api/handler/data/IMagic.java | 3 - .../npcs/api/handler/data/IMagicData.java | 4 +- java/noppes/npcs/api/handler/data/IParty.java | 8 +- .../npcs/api/handler/data/IPartyOptions.java | 40 +-- .../api/handler/data/IProfileOptions.java | 8 +- .../npcs/api/handler/data/IQuestItem.java | 3 + .../npcs/api/handler/data/IQuestKill.java | 1 + .../npcs/api/handler/data/IQuestLocation.java | 3 + .../api/handler/data/IQuestObjective.java | 2 +- java/noppes/npcs/api/item/IItemCustom.java | 9 + .../npcs/api/item/IItemCustomizable.java | 32 +++ java/noppes/npcs/api/item/IItemLinked.java | 2 +- java/noppes/npcs/api/item/IItemStack.java | 15 +- java/noppes/npcs/api/jobs/IJobBard.java | 6 +- java/noppes/npcs/api/jobs/IJobGuard.java | 3 + java/noppes/npcs/api/jobs/IJobHealer.java | 2 + .../noppes/npcs/api/overlay/IOverlayLine.java | 8 + java/noppes/npcs/api/package-info.java | 1 + java/noppes/npcs/api/roles/IRoleFollower.java | 32 +-- java/noppes/npcs/api/roles/IRoleTrader.java | 16 +- .../npcs/api/scoreboard/IScoreboard.java | 2 +- 60 files changed, 592 insertions(+), 509 deletions(-) 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..4458f1c 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) - { - this((double) xIn, (double) yIn, (double) zIn); + public Vec3i(int xIn, int yIn, int zIn) { + this(xIn, yIn, (double) zIn); } - public Vec3i(double xIn, double yIn, double zIn) - { + public Vec3i(double xIn, double yIn, double zIn) { this.x = MathHelper.floor_double(xIn); this.y = MathHelper.floor_double(yIn); this.z = MathHelper.floor_double(zIn); @@ -35,54 +46,43 @@ public class Vec3i implements Comparable this.zd = zIn; } - public boolean equals(Object p_equals_1_) - { - if (this == p_equals_1_) - { + public boolean equals(Object p_equals_1_) { + if (this == p_equals_1_) { return true; - } - else if (!(p_equals_1_ instanceof Vec3i)) - { + } else if (!(p_equals_1_ instanceof Vec3i)) { return false; - } - else - { - Vec3i vec3I = (Vec3i)p_equals_1_; - return this.getX() != vec3I.getX() ? false : (this.getY() != vec3I.getY() ? false : this.getZ() == vec3I.getZ()); + } else { + Vec3i vec3I = (Vec3i) p_equals_1_; + return this.getX() == vec3I.getX() && (this.getY() == vec3I.getY() && this.getZ() == vec3I.getZ()); } } - public int hashCode() - { + public int hashCode() { return (this.getY() + this.getZ() * 31) * 31 + this.getX(); } - public int compareTo(Vec3i p_compareTo_1_) - { + public int compareTo(Vec3i p_compareTo_1_) { return this.getY() == p_compareTo_1_.getY() ? (this.getZ() == p_compareTo_1_.getZ() ? this.getX() - p_compareTo_1_.getX() : this.getZ() - p_compareTo_1_.getZ()) : this.getY() - p_compareTo_1_.getY(); } /** * Get the X coordinate */ - public int getX() - { + public int getX() { return this.x; } /** * Get the Y coordinate */ - public int getY() - { + public int getY() { return this.y; } /** * Get the Z coordinate */ - public int getZ() - { + public int getZ() { return this.z; } @@ -90,37 +90,32 @@ public class Vec3i implements Comparable /** * 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..593516d 100644 --- a/java/net/minecraft/util/math/BlockPos.java +++ b/java/net/minecraft/util/math/BlockPos.java @@ -17,245 +17,208 @@ import java.util.List; * Pasted in from 1.9, with the Vec3d constructor removed */ @Immutable -public class BlockPos extends Vec3i -{ +public class BlockPos extends Vec3i { private static final Logger LOGGER = LogManager.getLogger(); - /** The BlockPos with all coordinates 0 */ + /** + * The BlockPos with all coordinates 0 + */ public static final BlockPos ORIGIN = new BlockPos(0, 0, 0); private static final int NUM_X_BITS = 26; //1 + MathHelper.calculateLogBaseTwo(MathHelper.roundUpToPowerOfTwo(30000000)); //Manually calculated because of crash private static final int NUM_Z_BITS = NUM_X_BITS; private static final int NUM_Y_BITS = 64 - NUM_X_BITS - NUM_Z_BITS; - private static final int Y_SHIFT = 0 + NUM_Z_BITS; + private static final int Y_SHIFT = NUM_Z_BITS; private static final int X_SHIFT = Y_SHIFT + NUM_Y_BITS; private static final long X_MASK = (1L << NUM_X_BITS) - 1L; private static final long Y_MASK = (1L << NUM_Y_BITS) - 1L; private static final long Z_MASK = (1L << NUM_Z_BITS) - 1L; - public BlockPos(int x, int y, int z) - { + public BlockPos(int x, int y, int z) { super(x, y, z); } - public BlockPos(double x, double y, double z) - { + public BlockPos(double x, double y, double z) { super(x, y, z); } - public BlockPos(Entity source) - { + public BlockPos(Entity source) { this(source.posX, source.posY, source.posZ); } - public BlockPos(Vec3i source) - { + public BlockPos(Vec3i source) { this(source.getXD(), source.getYD(), source.getZD()); } /** * Add the given coordinates to the coordinates of this BlockPos */ - public BlockPos add(double x, double y, double z) - { + public BlockPos add(double x, double y, double z) { return x == 0.0D && y == 0.0D && z == 0.0D ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z); } /** * Add the given coordinates to the coordinates of this BlockPos */ - public BlockPos add(int x, int y, int z) - { + public BlockPos add(int x, int y, int z) { return x == 0 && y == 0 && z == 0 ? this : new BlockPos(this.getXD() + x, this.getYD() + y, this.getZD() + z); } /** * Add the given Vector to this BlockPos */ - public BlockPos add(Vec3i vec) - { + public BlockPos add(Vec3i vec) { return vec.getXD() == 0 && vec.getYD() == 0 && vec.getZD() == 0 ? this : new BlockPos(this.getXD() + vec.getXD(), this.getYD() + vec.getYD(), this.getZD() + vec.getZD()); } /** * Offset this BlockPos 1 block up */ - public BlockPos up() - { + public BlockPos up() { return this.up(1); } /** * Offset this BlockPos n blocks up */ - public BlockPos up(double n) - { + public BlockPos up(double n) { return this.offset(EnumFacing.UP, n); } /** * Offset this BlockPos 1 block down */ - public BlockPos down() - { + public BlockPos down() { return this.down(1); } /** * Offset this BlockPos n blocks down */ - public BlockPos down(double n) - { + public BlockPos down(double n) { return this.offset(EnumFacing.DOWN, n); } /** * Offset this BlockPos 1 block in northern direction */ - public BlockPos north() - { + public BlockPos north() { return this.north(1); } /** * Offset this BlockPos n blocks in northern direction */ - public BlockPos north(double n) - { + public BlockPos north(double n) { return this.offset(EnumFacing.NORTH, n); } /** * Offset this BlockPos 1 block in southern direction */ - public BlockPos south() - { + public BlockPos south() { return this.south(1); } /** * Offset this BlockPos n blocks in southern direction */ - public BlockPos south(double n) - { + public BlockPos south(double n) { return this.offset(EnumFacing.SOUTH, n); } /** * Offset this BlockPos 1 block in western direction */ - public BlockPos west() - { + public BlockPos west() { return this.west(1); } /** * Offset this BlockPos n blocks in western direction */ - public BlockPos west(double n) - { + public BlockPos west(double n) { return this.offset(EnumFacing.WEST, n); } /** * Offset this BlockPos 1 block in eastern direction */ - public BlockPos east() - { + public BlockPos east() { return this.east(1); } /** * Offset this BlockPos n blocks in eastern direction */ - public BlockPos east(double n) - { + public BlockPos east(double n) { return this.offset(EnumFacing.EAST, n); } /** * Offset this BlockPos 1 block in the given direction */ - public BlockPos offset(EnumFacing facing) - { + public BlockPos offset(EnumFacing facing) { return this.offset(facing, 1); } /** * Offsets this BlockPos n blocks in the given direction */ - public BlockPos offset(EnumFacing facing, double n) - { + public BlockPos offset(EnumFacing facing, double n) { return n == 0 ? this : new BlockPos(this.getXD() + facing.getFrontOffsetX() * n, this.getYD() + facing.getFrontOffsetY() * n, this.getZD() + facing.getFrontOffsetZ() * n); } /** * Calculate the cross product of this and the given Vector */ - public BlockPos crossProduct(Vec3i vec) - { + public BlockPos crossProduct(Vec3i vec) { return new BlockPos(this.getYD() * vec.getZD() - this.getZD() * vec.getYD(), this.getZD() * vec.getXD() - this.getXD() * vec.getZD(), this.getXD() * vec.getYD() - this.getYD() * vec.getXD()); } /** * Serialize this BlockPos into a long value */ - public long toLong() - { - return ((long)this.getX() & X_MASK) << X_SHIFT | ((long)this.getY() & Y_MASK) << Y_SHIFT | ((long)this.getZ() & Z_MASK) << 0; + public long toLong() { + return ((long) this.getX() & X_MASK) << X_SHIFT | ((long) this.getY() & Y_MASK) << Y_SHIFT | ((long) this.getZ() & Z_MASK) << 0; } /** * Create a BlockPos from a serialized long value (created by toLong) */ - public static BlockPos fromLong(long serialized) - { - int i = (int)(serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); - int j = (int)(serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS); - int k = (int)(serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS); + public static BlockPos fromLong(long serialized) { + int i = (int) (serialized << 64 - X_SHIFT - NUM_X_BITS >> 64 - NUM_X_BITS); + int j = (int) (serialized << 64 - Y_SHIFT - NUM_Y_BITS >> 64 - NUM_Y_BITS); + int k = (int) (serialized << 64 - NUM_Z_BITS >> 64 - NUM_Z_BITS); return new BlockPos(i, j, k); } /** * Create an Iterable that returns all positions in the box specified by the given corners */ - public static Iterable 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 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 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 = 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/net/minecraft/util/math/IntHashMap.java b/java/net/minecraft/util/math/IntHashMap.java index 797013d..e7cf4ee 100644 --- a/java/net/minecraft/util/math/IntHashMap.java +++ b/java/net/minecraft/util/math/IntHashMap.java @@ -1,5 +1,7 @@ package net.minecraft.util.math; +import java.util.Objects; + public class IntHashMap { private transient IntHashMap.Entry[] slots = new IntHashMap.Entry[16]; /** @@ -42,7 +44,7 @@ public class IntHashMap { } } - return (V) null; + return null; } /** @@ -131,7 +133,7 @@ public class IntHashMap { */ public V removeObject(int p_76049_1_) { IntHashMap.Entry entry = this.removeEntry(p_76049_1_); - return (V) (entry == null ? null : entry.valueEntry); + return entry == null ? null : entry.valueEntry; } final IntHashMap.Entry removeEntry(int p_76036_1_) { @@ -231,13 +233,11 @@ public class IntHashMap { Object object = Integer.valueOf(this.getHash()); Object object1 = Integer.valueOf(entry.getHash()); - if (object == object1 || object != null && object.equals(object1)) { + if (Objects.equals(object, object1)) { Object object2 = this.getValue(); Object object3 = entry.getValue(); - if (object2 == object3 || object2 != null && object2.equals(object3)) { - return true; - } + return Objects.equals(object2, object3); } return false; @@ -252,4 +252,4 @@ public class IntHashMap { return this.getHash() + "=" + this.getValue(); } } -} \ No newline at end of file +} diff --git a/java/noppes/npcs/api/AbstractNpcAPI.java b/java/noppes/npcs/api/AbstractNpcAPI.java index a85dd75..976e8fd 100644 --- a/java/noppes/npcs/api/AbstractNpcAPI.java +++ b/java/noppes/npcs/api/AbstractNpcAPI.java @@ -29,7 +29,6 @@ import java.util.HashMap; /** * This object stores functions available to all scripting handlers through the "API" keyword. - * */ public abstract class AbstractNpcAPI { private static AbstractNpcAPI instance = null; @@ -45,7 +44,8 @@ public abstract class AbstractNpcAPI { /** * Tempdata gets cleared when the server restarts. All worlds share the same temp data. - * @param key The key for the data stored + * + * @param key The key for the data stored * @param value The data stored */ public abstract void setTempData(String key, Object value); @@ -76,7 +76,8 @@ public abstract class AbstractNpcAPI { /** * Stored data persists through world restart. Unlike tempdata only Strings and Numbers can be saved - * @param key The key for the data stored + * + * @param key The key for the data stored * @param value The data stored. This data can be either a Number or a String. Other data is not stored */ public abstract void setStoredData(String key, Object value); @@ -109,7 +110,7 @@ public abstract class AbstractNpcAPI { public abstract boolean hasGlobalObject(String key); - public abstract HashMap getEngineObjects(); + public abstract HashMap getEngineObjects(); public abstract long sizeOfObject(Object obj); @@ -154,7 +155,6 @@ public abstract class AbstractNpcAPI { public abstract ICustomNpc createNPC(IWorld var1); /** - * * Spawns a new NPC in the world at the given coordinates and returns an ICustomNpc object of it. */ public abstract ICustomNpc spawnNPC(IWorld var1, int var2, int var3, int var4); @@ -193,8 +193,8 @@ public abstract class AbstractNpcAPI { * Forms a box with corners as the input IPos parameters, and returns all * points inside the box as a list of IPos vectors. * - * @param from The starting IPos vector, first corner of the box. - * @param to The ending IPos vector, opposite corner of the box. + * @param from The starting IPos vector, first corner of the box. + * @param to The ending IPos vector, opposite corner of the box. * @param sortByDistance Sorts the list by distance from the "from" IPos parameter. * @return The list of all IPos vectors inside the box. */ @@ -254,7 +254,7 @@ public abstract class AbstractNpcAPI { } else { try { Class c = Class.forName("noppes.npcs.scripted.NpcAPI"); - instance = (AbstractNpcAPI) c.getMethod("Instance").invoke((Object) null); + instance = (AbstractNpcAPI) c.getMethod("Instance").invoke(null); } catch (Exception var1) { var1.printStackTrace(); } @@ -279,7 +279,7 @@ public abstract class AbstractNpcAPI { * 7: Aztec * 8: CustomNPCs Classic * 9: Spanish - * @param gender The gender of the name: + * @param gender The gender of the name: * 0: Random * 1: Male * 2: Female @@ -303,7 +303,6 @@ public abstract class AbstractNpcAPI { public abstract void playSoundToNearExcept(IPlayer player, String sound, float volume, float pitch); /** - * * @return Returns the server's Message of The Day. */ public abstract String getMOTD(); @@ -314,7 +313,6 @@ public abstract class AbstractNpcAPI { public abstract void setMOTD(String motd); /** - * * @return A new IParticle object initialized with the given texture. */ public abstract IParticle createParticle(String directory); @@ -337,7 +335,6 @@ public abstract class AbstractNpcAPI { public abstract void stopSounds(); /** - * * @return The uptime of the server in MC ticks. */ public abstract int getServerTime(); @@ -355,23 +352,20 @@ public abstract class AbstractNpcAPI { public abstract void enableGlobalNPCScripts(boolean enable); /** - * - * @param id The id of the custom GUI. - * @param width The width of the GUI in pixels. - * @param height The height of the GUI in pixels. + * @param id The id of the custom GUI. + * @param width The width of the GUI in pixels. + * @param height The height of the GUI in pixels. * @param pauseGame Whether the GUI pauses the game or not. * @return A new ICustomGui object with the given attributes. */ public abstract ICustomGui createCustomGui(int id, int width, int height, boolean pauseGame); /** - * - * @return A new ICustomOverlay overlay object with the given ID. + * @return A new ICustomOverlay overlay object with the given ID. */ public abstract ICustomOverlay createCustomOverlay(int id); /** - * * @return A new ISkinOverlay object initialized with the given texture. */ public abstract ISkinOverlay createSkinOverlay(String texture); diff --git a/java/noppes/npcs/api/IBlock.java b/java/noppes/npcs/api/IBlock.java index 18ed908..d877a8c 100644 --- a/java/noppes/npcs/api/IBlock.java +++ b/java/noppes/npcs/api/IBlock.java @@ -11,7 +11,6 @@ public interface IBlock { int getZ(); /** - * * @return An IPos object with the block's XYZ position. */ IPos getPosition(); @@ -19,7 +18,7 @@ public interface IBlock { /** * Moves the block to a new position in the given world. The old position is replaced with air. * - * @param pos The new position of the block + * @param pos The new position of the block * @param world The destination world of the block * @return Whether the block was successfully placed */ @@ -32,7 +31,6 @@ public interface IBlock { boolean setPosition(int x, int y, int z); /** - * * @return The block name as it appears in the block registry. Return example: "minecraft:stone" */ String getName(); @@ -45,63 +43,53 @@ public interface IBlock { boolean isAir(); /** - * * @param blockName The name of the block to be set in place of this block. * @return The new block set in place of this block as an IBlock object. */ IBlock setBlock(String blockName); /** - * * @param block Input IBlock object to replace this block. * @return The new block set in place of the previous block. */ IBlock setBlock(IBlock block); /** - * * @return True if the block can contain items like a chest does. */ boolean isContainer(); /** - * * @return The container object of this block. If this block is not a container, an exception will be thrown. */ IContainer getContainer(); /** - * * @return An IWorld object of the world this block is in. */ IWorld getWorld(); /** - * * @return True if this block has a tile entity. Blocks with custom data like signs, player skulls, chests, etc. will have tile entities. */ boolean hasTileEntity(); /** - * * @return An ITileEntity object which can modify this block's tile entity. */ ITileEntity getTileEntity(); /** - * * @param tileEntity Replaces this block's tile entity based on the data given by this parameter. */ void setTileEntity(ITileEntity tileEntity); /** - * * @return An obfuscated MC object for the block's tile entity. */ TileEntity getMCTileEntity(); /** - * * @return An obfuscated MC block object. */ Block getMCBlock(); @@ -109,13 +97,11 @@ public interface IBlock { String getDisplayName(); /** - * * @return An INbt object which can modify the block's tile entity's NBT data. */ INbt getTileEntityNBT(); /** - * * @param maxVolume The volume threshold to determine whether this block's bounding box collides, if it has one. * @return Whether this block can be collided with */ diff --git a/java/noppes/npcs/api/IContainer.java b/java/noppes/npcs/api/IContainer.java index 691f5ad..e7953a5 100644 --- a/java/noppes/npcs/api/IContainer.java +++ b/java/noppes/npcs/api/IContainer.java @@ -11,41 +11,35 @@ public interface IContainer { IItemStack getSlot(int slot); /** - * * @param slot The slot to be replaced * @param item The item replacing the previous item in that slot, as an IItemStack object */ void setSlot(int slot, IItemStack item); /** - * * @return An obfuscated MC inventory object. */ IInventory getMCInventory(); /** - * * @return An obfuscated MC container object. */ Container getMCContainer(); /** - * - * @param itemStack The item stack to be searched in the container + * @param itemStack The item stack to be searched in the container * @param ignoreDamage Whether damage should be ignored when searching - * @param ignoreNBT Whether NBT values should be ignored when searching + * @param ignoreNBT Whether NBT values should be ignored when searching * @return The amount of the item stack found, based on the flags given above. */ int count(IItemStack itemStack, boolean ignoreDamage, boolean ignoreNBT); /** - * * @return A list of all item stacks in the container as a list of IItemStack objects. */ IItemStack[] getItems(); /** - * * @return True if this container belongs to a Custom GUI. */ boolean isCustomGUI(); diff --git a/java/noppes/npcs/api/IDamageSource.java b/java/noppes/npcs/api/IDamageSource.java index 1ab0210..b06b8a3 100644 --- a/java/noppes/npcs/api/IDamageSource.java +++ b/java/noppes/npcs/api/IDamageSource.java @@ -5,7 +5,6 @@ import noppes.npcs.api.entity.IEntity; public interface IDamageSource { /** - * * @return The damage type of the damage source as a string. Ex: "lava", "explosion", "magic", "outOfWorld", etc. */ String getType(); @@ -15,19 +14,16 @@ public interface IDamageSource { boolean isProjectile(); /** - * * @return The entity source of where the damage source originated. If a player was shot by an arrow from a skeleton, this would return an IEntity object of the skeleton. */ IEntity getTrueSource(); /** - * * @return The entity source of where the damage source originated. If a player was shot by an arrow from a skeleton, this would return an IEntity object of the arrow. */ IEntity getImmediateSource(); /** - * * @return An obfuscated MC damage source object. */ DamageSource getMCDamageSource(); diff --git a/java/noppes/npcs/api/INbt.java b/java/noppes/npcs/api/INbt.java index e8efebb..7847f66 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 @@ -25,7 +25,6 @@ import net.minecraft.nbt.NBTTagCompound; * 9: Tag list * 10: Compound * 11: Integer array - * */ public interface INbt { /** @@ -94,7 +93,7 @@ public interface INbt { /** * Adds a new tag list to the compound tag with the given key. * - * @param key The key for the list tag + * @param key The key for the list tag * @param value The list of objects to be in the list. The type of the first element in this list becomes the tag * list's type, and if later objects are not of this type, they will not be added. */ @@ -105,25 +104,21 @@ public interface INbt { void setCompound(String key, INbt value); /** - * * @return A list of all the compound tag's keys. */ String[] getKeys(); /** - * * @return The type of the tag with the input key as an integer. */ int getType(String key); /** - * * @return An obfuscated MC NBTTagCompound object. */ NBTTagCompound getMCNBT(); /** - * * @return A curly-bracket formatted JSON string of all the compound tag. */ String toJsonString(); diff --git a/java/noppes/npcs/api/IParticle.java b/java/noppes/npcs/api/IParticle.java index e5fa14b..68c62d5 100644 --- a/java/noppes/npcs/api/IParticle.java +++ b/java/noppes/npcs/api/IParticle.java @@ -5,38 +5,34 @@ import noppes.npcs.api.entity.IEntity; /** * A particle that can be spawned in the world, complete with translation, scale, rotate, and color transformations. * (CNPC+ original!) - * + *

* 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. - * */ public interface IParticle { /** - * * @param entity Spawns this particle object on the given entity. When spawned this way, the particle will always have its origin at the entity. */ void spawn(IEntity entity); /** - * * @param world Spawns the particle in the given world, at a position corresponding to this particle's position variables. */ void spawn(IWorld world); /** - * * @param world Spawns the particle in the given world, at a position determined by the input parameters. - * @param x The X position the particle will spawn in the world. - * @param y The Y position the particle will spawn in the world. - * @param z The Z position the particle will spawn in the world. + * @param x The X position the particle will spawn in the world. + * @param y The Y position the particle will spawn in the world. + * @param z The Z position the particle will spawn in the world. */ void spawn(IWorld world, double x, double y, double z); @@ -50,177 +46,216 @@ public interface IParticle { void spawnInWorld(IWorld world, double x, double y, double z); /** - * * @param glows If true, this particle ignores all lighting and always renders with full brightness. */ void setGlows(boolean glows); + boolean getGlows(); void setNoClip(boolean noClip); + boolean getNoClip(); /** - * * @param facePlayer Whether the particle is always facing the player's camera. If this is disabled, the particle will appear to be laying flat face down on the ground if its rotation is unchanged. */ void setFacePlayer(boolean facePlayer); + boolean getFacePlayer(); /** - * * @param directory The directory of this particle's texture. This can be any texture in a resource pack or mod, and even a URL! */ void setDirectory(String directory); + String getDirectory(); /** - * * @param amount The amount of multiples of this particle to spawn in the world. Not too good looking if used, but has some edge cases where it's alright. */ void setAmount(int amount); + int getAmount(); /** - * * @param maxAge The maximum age this particle will be around for, in MC ticks. */ void setMaxAge(int maxAge); + int getMaxAge(); /** * The width and height of the particle's texture you want to render in pixels. Anything more gets cut off. - * @param width The width of the particle's texture, in pixels. + * + * @param width The width of the particle's texture, in pixels. * @param height The height of the particle's texture, in pixels. */ void setSize(int width, int height); + int getWidth(); + int getHeight(); /** - * The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point. + * The horizontal and vertical offset of the particle's texture from the top-left, starts rendering the particle at this point. + * * @param offsetX The horizontal offset, in pixels (u). * @param offsetY The vertical offset, in pixels (v). */ void setOffset(int offsetX, int offsetY); + int getOffsetX(); + int getOffsetY(); /** * Enables animation on the particle. Must set a custom width and height first using the setSize(width,height) function. * Every frame of animation the particle goes through should be saved on a single image file. - * + *

* The renderer will read the frames of animation based on the given width and height of the particle, starting from the given X & Y offsets. * The renderer then goes rightwards (width) pixels for every frame. Once it can't go rightwards anymore, * the animation goes down (height) pixels, and once again keeps going rightwards if it has to. - * + *

* If the animation loops, once there is nowhere downward to go, the animation will start over at the X & Y offset. * - * @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second) - * @param animLoop Whether the animation loops or not. + * @param animRate The frame rate of the particle's animation, in MC ticks. (20 ticks = 1 second) + * @param animLoop Whether the animation loops or not. * @param animStart The amount of ticks before the particle starts animating. - * @param animEnd The amount of ticks the particle is around for before it stops animating. + * @param animEnd The amount of ticks the particle is around for before it stops animating. */ void setAnim(int animRate, boolean animLoop, int animStart, int animEnd); + int getAnimRate(); + boolean getAnimLoop(); + int getAnimStart(); + int getAnimEnd(); /** - * * @param x The X position from the particle's origin the particle will spawn at. * @param y The Y position from the particle's origin the particle will spawn at. * @param z The Z position from the particle's origin the particle will spawn at. */ void setPosition(double x, double y, double z); + double getX(); + double getY(); + double getZ(); void setPosition(IPos pos); + void getPos(); void setMotion(double motionX, double motionY, double motionZ, float gravity); + double getMotionX(); + double getMotionY(); + double getMotionZ(); + float getGravity(); /** - * - * @param HEXColor The starting HEX color of the particle. - * @param HEXColor2 The ending HEX color of the particle. - * @param HEXColorRate The rate of interpolation between the two HEX colors. + * @param HEXColor The starting HEX color of the particle. + * @param HEXColor2 The ending HEX color of the particle. + * @param HEXColorRate The rate of interpolation between the two HEX colors. * @param HEXColorStart The amount of ticks the particle is around for before its colors begin interpolating between HEXColor and HEXColor2. */ void setHEXColor(int HEXColor, int HEXColor2, float HEXColorRate, int HEXColorStart); + int getHEXColor1(); + int getHEXColor2(); + float getHEXColorRate(); + int getHEXColorStart(); /** - * - * @param alpha1 The starting transparency of the particle. - * @param alpha2 The ending transparency of the particle. - * @param alphaRate The rate of interpolation between the two transparency values. + * @param alpha1 The starting transparency of the particle. + * @param alpha2 The ending transparency of the particle. + * @param alphaRate The rate of interpolation between the two transparency values. * @param alphaRateStart The amount of ticks the particle is around for before its colors begin interpolating between alpha1 and alpha2. */ void setAlpha(float alpha1, float alpha2, float alphaRate, int alphaRateStart); + float getAlpha1(); + float getAlpha2(); + float getAlphaRate(); + int getAlphaRateStart(); /** - * - * @param scale1 The starting scale/size of the particle. - * @param scale2 The ending scale/size of the particle. - * @param scaleRate The rate of interpolation between the two scale values. + * @param scale1 The starting scale/size of the particle. + * @param scale2 The ending scale/size of the particle. + * @param scaleRate The rate of interpolation between the two scale values. * @param scaleRateStart The amount of ticks the particle is around for before its colors begin interpolating between scale1 and scale2. */ void setScale(float scale1, float scale2, float scaleRate, int scaleRateStart); void setScaleX(float scale1, float scale2, float scaleRate, int scaleRateStart); + float getScaleX1(); + float getScaleX2(); + float getScaleXRate(); + int getScaleXRateStart(); void setScaleY(float scale1, float scale2, float scaleRate, int scaleRateStart); + float getScaleY1(); + float getScaleY2(); + float getScaleYRate(); + int getScaleYRateStart(); /** * Enables rotation about the X axis. * If the particle is set to always face the player, this axis is a constant horizontal line on the player's camera. * - * @param rotationX1 The starting X rotation of the particle. - * @param rotationX2 The ending X rotation of the particle. - * @param rotationXRate The rate of interpolation between the two X rotation values. + * @param rotationX1 The starting X rotation of the particle. + * @param rotationX2 The ending X rotation of the particle. + * @param rotationXRate The rate of interpolation between the two X rotation values. * @param rotationXRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationX1 and rotationX2. */ void setRotationX(float rotationX1, float rotationX2, float rotationXRate, int rotationXRateStart); + float getRotationX1(); + float getRotationX2(); + float getRotationXRate(); + int getRotationXRateStart(); /** * Enables rotation about the Y axis. * If the particle is set to always face the player, this axis is a constant vertical line on the player's camera. * - * @param rotationY1 The starting Y rotation of the particle. - * @param rotationY2 The ending Y rotation of the particle. - * @param rotationYRate The rate of interpolation between the two Y rotation values. + * @param rotationY1 The starting Y rotation of the particle. + * @param rotationY2 The ending Y rotation of the particle. + * @param rotationYRate The rate of interpolation between the two Y rotation values. * @param rotationYRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationY1 and rotationY2. */ void setRotationY(float rotationY1, float rotationY2, float rotationYRate, int rotationYRateStart); + float getRotationY1(); + float getRotationY2(); + float getRotationYRate(); + int getRotationYRateStart(); /** @@ -228,15 +263,19 @@ public interface IParticle { * If the particle is set to always face the player, this axis is a constant line going into the player's camera. * You'll be using this one most often if the particle is set to face the player. * - * @param rotationZ1 The starting Z rotation of the particle. - * @param rotationZ2 The ending Z rotation of the particle. - * @param rotationZRate The rate of interpolation between the two Z rotation values. + * @param rotationZ1 The starting Z rotation of the particle. + * @param rotationZ2 The ending Z rotation of the particle. + * @param rotationZRate The rate of interpolation between the two Z rotation values. * @param rotationZRateStart The amount of ticks the particle is around for before its colors begin interpolating between rotationZ1 and rotationZ2. */ void setRotationZ(float rotationZ1, float rotationZ2, float rotationZRate, int rotationZRateStart); + float getRotationZ1(); + float getRotationZ2(); + float getRotationZRate(); + int getRotationZRateStart(); - + } diff --git a/java/noppes/npcs/api/IPos.java b/java/noppes/npcs/api/IPos.java index 3e06a31..f42035a 100644 --- a/java/noppes/npcs/api/IPos.java +++ b/java/noppes/npcs/api/IPos.java @@ -18,12 +18,10 @@ public interface IPos { /** * Shifts the IPos up by 1 block and returns the new object. - * */ IPos up(); /** - * * @param n The number of blocks to move the position up by. * @return The new IPos object. */ @@ -31,12 +29,10 @@ public interface IPos { /** * Shifts the IPos down by 1 block and returns the new object. - * */ IPos down(); /** - * * @param n The number of blocks to move the position down by. * @return The new IPos object. */ @@ -44,12 +40,10 @@ public interface IPos { /** * Shifts the IPos north by 1 block and returns the new object. - * */ IPos north(); /** - * * @param n The number of blocks to move the position north by. * @return The new IPos object. */ @@ -57,12 +51,10 @@ public interface IPos { /** * Shifts the IPos east by 1 block and returns the new object. - * */ IPos east(); /** - * * @param n The number of blocks to move the position east by. * @return The new IPos object. */ @@ -70,12 +62,10 @@ public interface IPos { /** * Shifts the IPos south by 1 block and returns the new object. - * */ IPos south(); /** - * * @param n The number of blocks to move the position south by. * @return The new IPos object. */ @@ -83,12 +73,10 @@ public interface IPos { /** * Shifts the IPos west by 1 block and returns the new object. - * */ IPos west(); /** - * * @param n The number of blocks to move the position west by. * @return The new IPos object. */ @@ -137,7 +125,6 @@ public interface IPos { /** * Returns a normalized vector of this block's position, calculated by: * - * * @return The normalized vector of this block position. */ IPos normalize(); @@ -146,13 +133,11 @@ public interface IPos { /** * Offsets the block by 1 block in the given direction and returns the resulting IPos object - * */ IPos offset(int direction); /** * Offsets the block by n blocks in the given direction and returns the resulting IPos object - * */ IPos offset(int direction, double n); @@ -167,7 +152,6 @@ public interface IPos { IPos fromLong(long serialized); /** - * * @param pos The IPos object to calculate the distance to * @return The distance between this IPos object and the other. */ diff --git a/java/noppes/npcs/api/IScreenSize.java b/java/noppes/npcs/api/IScreenSize.java index 07d98af..73e3b44 100644 --- a/java/noppes/npcs/api/IScreenSize.java +++ b/java/noppes/npcs/api/IScreenSize.java @@ -2,11 +2,11 @@ package noppes.npcs.api; public interface IScreenSize { - public int getWidth(); + int getWidth(); - public int getHeight(); + int getHeight(); - public int getWidthPercent(double percent); + int getWidthPercent(double percent); - public int getHeightPercent(double percent); + int getHeightPercent(double percent); } 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..55085fc 100644 --- a/java/noppes/npcs/api/ITileEntity.java +++ b/java/noppes/npcs/api/ITileEntity.java @@ -4,7 +4,6 @@ import net.minecraft.tileentity.TileEntity; public interface ITileEntity { /** - * * @return An integer representing the metadata of this block. Blocks with different states will * return different values. For example, each stage of growth for a wheat crop will return a different value, each * orientation of a stair block will return a different value, etc. @@ -12,7 +11,6 @@ public interface ITileEntity { int getBlockMetadata(); /** - * * @return The world this tile entity is in. */ IWorld getWorld(); @@ -20,7 +18,6 @@ public interface ITileEntity { void setWorld(IWorld world); /** - * * @return An obfuscated MC tile entity object. */ TileEntity getMCTileEntity(); @@ -36,6 +33,7 @@ public interface ITileEntity { * @return The distance of this tile entity from the point given by the x, y, and z parameters. */ double getDistanceFrom(double x, double y, double z); + double getDistanceFrom(IPos pos); /** @@ -44,7 +42,6 @@ public interface ITileEntity { IBlock getBlockType(); /** - * * @return True if the tile entity is invalid, false otherwise. */ boolean isInvalid(); diff --git a/java/noppes/npcs/api/ITimers.java b/java/noppes/npcs/api/ITimers.java index b450fa4..2bb2a91 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,14 +18,13 @@ public interface ITimers { * Adds a timer to the NPC or player with the given attributes. No exception will be thrown if there is already a * timer with the given ID when using this function. * - * @param id The id of the timer. - * @param ticks The amount of ticks before the timer ends. + * @param id The id of the timer. + * @param ticks The amount of ticks before the timer ends. * @param repeat Whether this timer repeats when it reaches its maximum amount of ticks. */ void forceStart(int id, int ticks, boolean repeat); /** - * * @return True if the set of timers contains a timer with the given id, false otherwise. */ boolean has(int id); @@ -80,7 +79,6 @@ public interface ITimers { void setRepeats(int id, boolean repeat); /** - * * @return The amount of timers in the set of timers. */ int size(); diff --git a/java/noppes/npcs/api/IWorld.java b/java/noppes/npcs/api/IWorld.java index be3cfab..05fb9cc 100644 --- a/java/noppes/npcs/api/IWorld.java +++ b/java/noppes/npcs/api/IWorld.java @@ -26,58 +26,68 @@ public interface IWorld { * @param z World position z * @return The block at the given position. Returns null if there isn't a block */ - public IBlock getBlock(int x, int y, int z); + IBlock getBlock(int x, int y, int z); /** - * @param pos - * @return The block at the given position. Returns null if there isn't a block - */ - public IBlock getBlock(IPos pos); + * @param pos + * @return The block at the given position. Returns null if there isn't a block + */ + IBlock getBlock(IPos pos); /** - * * @return The top-most block in the world as an IBlock object. */ IBlock getTopBlock(int x, int z); + IBlock getTopBlock(IPos pos); boolean isBlockFreezable(IPos pos); + boolean isBlockFreezable(int x, int y, int z); boolean isBlockFreezableNaturally(IPos pos); + boolean isBlockFreezableNaturally(int x, int y, int z); boolean canBlockFreeze(IPos pos, boolean adjacentToWater); + boolean canBlockFreeze(int x, int y, int z, boolean adjacentToWater); boolean canBlockFreezeBody(IPos pos, boolean adjacentToWater); + boolean canBlockFreezeBody(int x, int y, int z, boolean adjacentToWater); boolean canSnowAt(IPos pos, boolean checkLight); + boolean canSnowAt(int x, int y, int z, boolean checkLight); boolean canSnowAtBody(IPos pos, boolean checkLight); + boolean canSnowAtBody(int x, int y, int z, boolean checkLight); /** * @return The Y-value of the world at this x & z value based on the height map of the world. */ int getHeightValue(int x, int z); + int getHeightValue(IPos pos); /** * @return The minimum Y-value of the world at this x & z value based on the height map of the world. */ int getChunkHeightMapMinimum(int x, int z); + int getChunkHeightMapMinimum(IPos pos); /** * @return The metadata of the block at this position. */ int getBlockMetadata(int x, int y, int z); + int getBlockMetadata(IPos pos); boolean setBlockMetadataWithNotify(int x, int y, int z, int metadata, int flag); + boolean setBlockMetadataWithNotify(IPos pos, int metadata, int flag); /** @@ -87,6 +97,7 @@ public interface IWorld { * @return can the block at this position see the sky or are there no blocks above this one */ boolean canSeeSky(int x, int y, int z); + /** * @param pos * @return can the block at this position see the sky or are there no blocks above this one @@ -94,9 +105,11 @@ public interface IWorld { boolean canSeeSky(IPos pos); int getFullBlockLightValue(int x, int y, int z); + int getFullBlockLightValue(IPos pos); int getBlockLightValue(int x, int y, int z); + int getBlockLightValue(IPos pos); void playSoundAtEntity(IEntity entity, String sound, float volume, float pitch); @@ -120,15 +133,16 @@ public interface IWorld { IPlayer getClosestPlayerToEntity(IEntity entity, double range); IPlayer getClosestPlayer(double x, double y, double z, double range); + IPlayer getClosestPlayer(IPos pos, double range); IPlayer getClosestVulnerablePlayerToEntity(IEntity entity, double range); IPlayer getClosestVulnerablePlayer(double x, double y, double z, double range); + IPlayer getClosestVulnerablePlayer(IPos pos, double range); /** - * * @param entity The entity whose type will be used as a parameter * @return The amount of entities of the given type in the world. */ @@ -144,30 +158,35 @@ public interface IWorld { * Sets the block's tile entity at the given position. */ void setTileEntity(int x, int y, int z, ITileEntity tileEntity); + void setTileEntity(IPos pos, ITileEntity tileEntity); /** * Removes the block's tile entity at the given position. */ void removeTileEntity(int x, int y, int z); + void removeTileEntity(IPos pos); /** - * * @return True if the block at this position is of cubic shape. (Not a stair, slab, etc.) */ boolean isBlockFullCube(int x, int y, int z); + boolean isBlockFullCube(IPos pos); long getSeed(); void setSpawnLocation(int x, int y, int z); + void setSpawnLocation(IPos pos); boolean canLightningStrikeAt(int x, int y, int z); + boolean canLightningStrikeAt(IPos pos); boolean isBlockHighHumidity(int x, int y, int z); + boolean isBlockHighHumidity(IPos pos); /** @@ -178,24 +197,27 @@ public interface IWorld { * @since 1.7.10d */ String getSignText(int x, int y, int z); + String getSignText(IPos pos); /** - * @param x World position x - * @param y World position y - * @param z World position z + * @param x World position x + * @param y World position y + * @param z World position z * @param item The block to be set */ boolean setBlock(int x, int y, int z, IItemStack item); + boolean setBlock(IPos pos, IItemStack item); - /** - * @param x World position x - * @param y World position y - * @param z World position z - * @param block The block to be set - */ + /** + * @param x World position x + * @param y World position y + * @param z World position z + * @param block The block to be set + */ boolean setBlock(int x, int y, int z, IBlock block); + boolean setBlock(IPos pos, IBlock block); /** @@ -204,6 +226,7 @@ public interface IWorld { * @param z World position z */ void removeBlock(int x, int y, int z); + void removeBlock(IPos pos); boolean isPlaceCancelled(int posX, int posY, int posZ); @@ -224,8 +247,9 @@ public interface IWorld { /** * starting at the start position, draw a line in the lookVector direction until a block is detected + * * @param startPos - * @param lookVector should be a normalized direction vector + * @param lookVector should be a normalized direction vector * @param maxDistance * @return the first detected block but null if maxDistance is reached */ @@ -242,11 +266,11 @@ public interface IWorld { * @param maxHeight * @return the position of the closest block of air to startPos */ - public IPos getNearestAir(IPos startPos, int maxHeight); + IPos getNearestAir(IPos startPos, int maxHeight); IEntity[] rayCastEntities(double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision); - public IEntity[] rayCastEntities(IEntity[] ignoreEntities, double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision); + IEntity[] rayCastEntities(IEntity[] ignoreEntities, double[] startPos, double[] lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision); IEntity[] rayCastEntities(IPos startPos, IPos lookVector, int maxDistance, double offset, double range, boolean stopOnBlock, boolean stopOnLiquid, boolean stopOnCollision); @@ -288,27 +312,30 @@ public interface IWorld { * @param z The z position */ void thunderStrike(double x, double y, double z); + void thunderStrike(IPos pos); /** * Sends a packet from the server to the client everytime its called. Probably should not use this too much. + * * @param particle Particle name. Particle name list: http://minecraft.wiki/w/Particles - * @param x The x position - * @param y The y position - * @param z The z position - * @param dx Usually used for the x motion - * @param dy Usually used for the y motion - * @param dz Usually used for the z motion - * @param speed Speed of the particles, usually between 0 and 1 - * @param count Particle count + * @param x The x position + * @param y The y position + * @param z The z position + * @param dx Usually used for the x motion + * @param dy Usually used for the y motion + * @param dz Usually used for the z motion + * @param speed Speed of the particles, usually between 0 and 1 + * @param count Particle count */ void spawnParticle(String particle, double x, double y, double z, double dx, double dy, double dz, double speed, int count); + void spawnParticle(String particle, IPos pos, double dx, double dy, double dz, double speed, int count); /** - * @param id The items name + * @param id The items name * @param damage The damage value - * @param size The number of items in the item + * @param size The number of items in the item * @return Returns the item */ IItemStack createItem(String id, int damage, int size); @@ -356,56 +383,60 @@ public interface IWorld { String[] getStoredDataKeys(); /** - * @param x Position x - * @param y Position y - * @param z Position z + * @param x Position x + * @param y Position y + * @param z Position z * @param range Range of the explosion - * @param fire Whether or not the explosion does fire damage + * @param fire Whether or not the explosion does fire damage * @param grief Whether or not the explosion does damage to blocks */ void explode(double x, double y, double z, float range, boolean fire, boolean grief); + void explode(IPos pos, float range, boolean fire, boolean grief); IPlayer[] getAllServerPlayers(); - public String[] getPlayerNames(); + String[] getPlayerNames(); /** - * @since 1.7.10c * @param x Position x * @param z Position z * @return Returns the name of the biome + * @since 1.7.10c */ String getBiomeName(int x, int z); + String getBiomeName(IPos pos); /** * Lets you spawn a server side cloned entity - * @param x The x position the clone will be spawned at - * @param y The y position the clone will be spawned at - * @param z The z position the clone will be spawned at - * @param tab The tab in which the clone is - * @param name Name of the cloned entity + * + * @param x The x position the clone will be spawned at + * @param y The y position the clone will be spawned at + * @param z The z position the clone will be spawned at + * @param tab The tab in which the clone is + * @param name Name of the cloned entity * @param ignoreProtection Whether the spawning of this clone skips protection checks. * @return Returns the entity which was spawned */ IEntity spawnClone(int x, int y, int z, int tab, String name, boolean ignoreProtection); + IEntity spawnClone(IPos pos, int tab, String name, boolean ignoreProtection); IEntity spawnClone(int x, int y, int z, int tab, String name); + IEntity spawnClone(IPos pos, int tab, String name); IScoreboard getScoreboard(); /** + * @return Returns minecraft world object * @since 1.7.10c * Expert use only - * @return Returns minecraft world object */ WorldServer getMCWorld(); /** - * * @return The ID of this world's dimension. 0 for overworld, 1 for End, -1 for Nether, etc. */ int getDimensionID(); 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/block/ITextPlane.java b/java/noppes/npcs/api/block/ITextPlane.java index 337bf07..92dd00c 100644 --- a/java/noppes/npcs/api/block/ITextPlane.java +++ b/java/noppes/npcs/api/block/ITextPlane.java @@ -2,41 +2,41 @@ package noppes.npcs.api.block; public interface ITextPlane { - public String getText(); + String getText(); - public void setText(String text); + void setText(String text); - public int getRotationX(); + int getRotationX(); - public int getRotationY(); + int getRotationY(); - public int getRotationZ(); + int getRotationZ(); - public void setRotationX(int x); + void setRotationX(int x); - public void setRotationY(int y); + void setRotationY(int y); /** * @param z Default: 0.5 */ - public void setRotationZ(int z); + void setRotationZ(int z); - public float getOffsetX(); + float getOffsetX(); - public float getOffsetY(); + float getOffsetY(); - public float getOffsetZ(); + float getOffsetZ(); - public void setOffsetX(float x); + void setOffsetX(float x); - public void setOffsetY(float y); + void setOffsetY(float y); - public void setOffsetZ(float z); + void setOffsetZ(float z); - public float getScale(); + float getScale(); /** * @param scale Default: 1 */ - public void setScale(float scale); + void setScale(float scale); } diff --git a/java/noppes/npcs/api/entity/IEntity.java b/java/noppes/npcs/api/entity/IEntity.java index 406da65..d661b90 100644 --- a/java/noppes/npcs/api/entity/IEntity.java +++ b/java/noppes/npcs/api/entity/IEntity.java @@ -536,19 +536,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 eb0478c..611c0ac 100644 --- a/java/noppes/npcs/api/entity/IPlayer.java +++ b/java/noppes/npcs/api/entity/IPlayer.java @@ -312,8 +312,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(); @@ -326,11 +326,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); @@ -352,19 +352,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); @@ -510,22 +510,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(); 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/IBlockEvent.java b/java/noppes/npcs/api/event/IBlockEvent.java index 2e85076..7c1ec86 100644 --- a/java/noppes/npcs/api/event/IBlockEvent.java +++ b/java/noppes/npcs/api/event/IBlockEvent.java @@ -8,9 +8,11 @@ import noppes.npcs.api.entity.IPlayer; public interface IBlockEvent extends ICustomNPCsEvent { IBlock getBlock(); + @Cancelable - interface EntityFallenUponEvent extends IBlockEvent{ + interface EntityFallenUponEvent extends IBlockEvent { IEntity getEntity(); + float getDistanceFallen(); } @@ -27,18 +29,22 @@ public interface IBlockEvent extends ICustomNPCsEvent { int getSide(); } - interface RedstoneEvent extends IBlockEvent{ + interface RedstoneEvent extends IBlockEvent { int getPrevPower(); + int getPower(); } - interface BreakEvent extends IBlockEvent{ + + interface BreakEvent extends IBlockEvent { } + @Cancelable - interface ExplodedEvent extends IBlockEvent{ + interface ExplodedEvent extends IBlockEvent { } - interface RainFillEvent extends IBlockEvent{ + + interface RainFillEvent extends IBlockEvent { } @@ -46,10 +52,11 @@ public interface IBlockEvent extends ICustomNPCsEvent { IPos getChangedPos(); } - interface InitEvent extends IBlockEvent{ + interface InitEvent extends IBlockEvent { } - interface UpdateEvent extends IBlockEvent{ + + interface UpdateEvent extends IBlockEvent { } diff --git a/java/noppes/npcs/api/event/INpcEvent.java b/java/noppes/npcs/api/event/INpcEvent.java index d6bfa85..6c0ecc3 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(); } @@ -61,6 +61,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 fe8e484..1e07d39 100644 --- a/java/noppes/npcs/api/event/IPlayerEvent.java +++ b/java/noppes/npcs/api/event/IPlayerEvent.java @@ -253,7 +253,7 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } interface FillBucketEvent extends IPlayerEvent { - IItemStack getCurrent() ; + IItemStack getCurrent(); IItemStack getFilled(); } @@ -278,9 +278,11 @@ public interface IPlayerEvent extends ICustomNPCsEvent { interface Added extends EffectEvent { } + interface Ticked extends EffectEvent { } + interface Removed extends EffectEvent { /** @@ -323,9 +325,11 @@ public interface IPlayerEvent extends ICustomNPCsEvent { } @Cancelable - interface Create extends ProfileEvent {} + interface Create extends ProfileEvent { + } @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 657c68d..d015d7d 100644 --- a/java/noppes/npcs/api/event/IProjectileEvent.java +++ b/java/noppes/npcs/api/event/IProjectileEvent.java @@ -6,16 +6,19 @@ import noppes.npcs.api.entity.IProjectile; public interface IProjectileEvent extends ICustomNPCsEvent { - public IProjectile getProjectile(); - public IEntity getSource(); + IProjectile getProjectile(); + + IEntity getSource(); interface UpdateEvent extends IProjectileEvent { } interface ImpactEvent extends IProjectileEvent { - public int getType(); - public IEntity getEntity(); - public IBlock getBlock(); + int getType(); + + IEntity getEntity(); + + IBlock getBlock(); } } 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/IActionManager.java b/java/noppes/npcs/api/handler/IActionManager.java index b8dfd34..536ef62 100644 --- a/java/noppes/npcs/api/handler/IActionManager.java +++ b/java/noppes/npcs/api/handler/IActionManager.java @@ -1,6 +1,7 @@ package noppes.npcs.api.handler; import noppes.npcs.api.handler.data.IAction; + import java.util.Queue; import java.util.function.Consumer; 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/IPlayerData.java b/java/noppes/npcs/api/handler/IPlayerData.java index 88c1ce5..2508708 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..5e33376 100644 --- a/java/noppes/npcs/api/handler/IPlayerQuestData.java +++ b/java/noppes/npcs/api/handler/IPlayerQuestData.java @@ -16,7 +16,7 @@ public interface IPlayerQuestData { boolean hasFinishedQuest(int id); - public boolean hasActiveQuest(int id); + boolean hasActiveQuest(int id); IQuest[] getActiveQuests(); @@ -24,5 +24,5 @@ public interface IPlayerQuestData { long getLastCompletedTime(int id); - void setLastCompletedTime(int id,long time); + void setLastCompletedTime(int id, long time); } 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/IMagic.java b/java/noppes/npcs/api/handler/data/IMagic.java index 6d3c2bb..fd58ea7 100644 --- a/java/noppes/npcs/api/handler/data/IMagic.java +++ b/java/noppes/npcs/api/handler/data/IMagic.java @@ -1,8 +1,5 @@ package noppes.npcs.api.handler.data; -import noppes.npcs.api.entity.ICustomNpc; -import noppes.npcs.api.entity.IPlayer; - public interface IMagic { int getId(); 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..392e918 100644 --- a/java/noppes/npcs/api/handler/data/IPartyOptions.java +++ b/java/noppes/npcs/api/handler/data/IPartyOptions.java @@ -3,46 +3,46 @@ package noppes.npcs.api.handler.data; public interface IPartyOptions { - public boolean isAllowParty(); + boolean isAllowParty(); - public void setAllowParty(boolean allowParty); + void setAllowParty(boolean allowParty); - public boolean isOnlyParty(); + boolean isOnlyParty(); - public void setOnlyParty(boolean onlyParty); + void setOnlyParty(boolean onlyParty); /** - * @return 0:Leader, 1:All, 2:Valid + * @return 0:Leader, 1:All, 2:Valid */ - public int getPartyRequirements(); + int getPartyRequirements(); /** * @param partyRequirements 0:Leader, 1:All, 2:Valid */ - public void setPartyRequirements(int partyRequirements); + void setPartyRequirements(int partyRequirements); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ - public int getRewardControl(); + int getRewardControl(); /** * @param rewardControl 0:Leader, 1:All, 2:Enrolled, 3:Valid */ - public void setRewardControl(int rewardControl); + void setRewardControl(int rewardControl); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ - public int getCompleteFor(); + int getCompleteFor(); /** * @param completeFor 0:Leader, 1:All, 2:Enrolled, 3:Valid */ - public void setCompleteFor(int completeFor); + void setCompleteFor(int completeFor); /** - * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid + * @return 0:Leader, 1:All, 2:Enrolled, 3:Valid */ int getExecuteCommandFor(); @@ -54,19 +54,19 @@ public interface IPartyOptions { /** * @return 0:Shard, 1:All, 2:Leader */ - public int getObjectiveRequirement(); + int getObjectiveRequirement(); /** * @param requirement 0:Shard, 1:All, 2:Leader */ - public void setObjectiveRequirement(int requirement); + void setObjectiveRequirement(int requirement); - public int getMinPartySize(); + int getMinPartySize(); - public void setMinPartySize(int newSize); + void setMinPartySize(int newSize); - public int getMaxPartySize(); + int getMaxPartySize(); - public void setMaxPartySize(int newSize); + void setMaxPartySize(int newSize); } 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/item/IItemCustom.java b/java/noppes/npcs/api/item/IItemCustom.java index 355d900..deb32a1 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,42 +29,49 @@ public interface IItemCustom extends IItemCustomizable { /** * Sets whether the scripted item is a normal item. Will disable * all forms of Rotation, Translation, Scale Rendering in hand and on ground + * * @param normalItem True if the item is a normal item, false otherwise */ void setIsNormalItem(boolean normalItem); /** * Sets the dig speed for the scripted item. + * * @param digSpeed The dig speed */ void setDigSpeed(int digSpeed); /** * Sets the maximum stack size for the scripted item. + * * @param maxStackSize The maximum stack size */ void setMaxStackSize(int maxStackSize); /** * Sets the current durability value for the scripted item. + * * @param durabilityValue The durability value */ void setDurabilityValue(float durabilityValue); /** * Sets the maximum item use duration for the scripted item. + * * @param duration The maximum item use duration */ void setMaxItemUseDuration(int duration); /** * Sets the item use action for the scripted item. + * * @param action The item use action */ void setItemUseAction(int action); /** * Sets the enchantability for the scripted item. + * * @param enchantability The enchantability */ void setEnchantability(int enchantability); diff --git a/java/noppes/npcs/api/item/IItemCustomizable.java b/java/noppes/npcs/api/item/IItemCustomizable.java index 58df90b..bbf0291 100644 --- a/java/noppes/npcs/api/item/IItemCustomizable.java +++ b/java/noppes/npcs/api/item/IItemCustomizable.java @@ -8,102 +8,119 @@ public interface IItemCustomizable extends IItemStack { /** * Gets the armor type for the scripted item. + * * @return The armor type */ int getArmorType(); /** * Checks if the scripted item is a tool. Allows for enchanting + * * @return True if the item is a tool, false otherwise */ boolean isTool(); /** * Checks if the scripted item is a normal item. + * * @return True if the item is a normal item, false otherwise */ boolean isNormalItem(); /** * Gets the dig speed for the scripted item. + * * @return The dig speed */ int getDigSpeed(); /** * Gets the current durability value for the scripted item. + * * @return The durability value */ double getDurabilityValue(); /** * Gets the maximum item use duration for the scripted item. + * * @return The maximum item use duration */ int getMaxItemUseDuration(); /** * Gets the item use action for the scripted item. + * * @return The item use action */ int getItemUseAction(); /** * Gets the enchantability for the scripted item. + * * @return The enchantability */ int getEnchantability(); /** * Gets the texture path for the scripted item. + * * @return The texture path */ String getTexture(); /** * Sets the texture path for the scripted item. Can be a URL + * * @param texture The texture path */ void setTexture(String texture); /** * Checks if the durability bar should be shown for the scripted item. + * * @return True if the durability bar should be shown, false otherwise */ Boolean getDurabilityShow(); /** * Sets whether the durability bar should be shown for the scripted item. + * * @param durabilityShow True if the durability bar should be shown, false otherwise */ void setDurabilityShow(Boolean durabilityShow); /** * Gets the color of the durability bar for the scripted item. + * * @return The durability bar color */ Integer getDurabilityColor(); /** * Sets the color of the durability bar for the scripted item. + * * @param durabilityColor The durability bar color */ void setDurabilityColor(Integer durabilityColor); /** * Gets the color of the scripted item. + * * @return The item color */ Integer getColor(); /** * Sets the color of the scripted item. + * * @param color The item color */ void setColor(Integer color); /** * Sets the rotation values for the scripted item. + * * @param rotationX The X-axis rotation * @param rotationY The Y-axis rotation * @param rotationZ The Z-axis rotation @@ -112,6 +129,7 @@ public interface IItemCustomizable extends IItemStack { /** * Sets the rotation rate values for the scripted item. Spinning Speed + * * @param rotationXRate The X-axis rotation rate * @param rotationYRate The Y-axis rotation rate * @param rotationZRate The Z-axis rotation rate @@ -120,6 +138,7 @@ public interface IItemCustomizable extends IItemStack { /** * Sets the scale values for the scripted item. + * * @param scaleX The X-axis scale * @param scaleY The Y-axis scale * @param scaleZ The Z-axis scale @@ -128,6 +147,7 @@ public interface IItemCustomizable extends IItemStack { /** * Sets the translation values for the scripted item. + * * @param translateX The X-axis translation * @param translateY The Y-axis translation * @param translateZ The Z-axis translation @@ -136,72 +156,84 @@ public interface IItemCustomizable extends IItemStack { /** * Gets the X-axis rotation for the scripted item. + * * @return The X-axis rotation */ Float getRotationX(); /** * Gets the Y-axis rotation for the scripted item. + * * @return The Y-axis rotation */ Float getRotationY(); /** * Gets the Z-axis rotation for the scripted item. + * * @return The Z-axis rotation */ Float getRotationZ(); /** * Gets the X-axis rotation rate for the scripted item. + * * @return The X-axis rotation rate */ Float getRotationXRate(); /** * Gets the Y-axis rotation rate for the scripted item. + * * @return The Y-axis rotation rate */ Float getRotationYRate(); /** * Gets the Z-axis rotation rate for the scripted item. + * * @return The Z-axis rotation rate */ Float getRotationZRate(); /** * Gets the X-axis scale for the scripted item. + * * @return The X-axis scale */ Float getScaleX(); /** * Gets the Y-axis scale for the scripted item. + * * @return The Y-axis scale */ Float getScaleY(); /** * Gets the Z-axis scale for the scripted item. + * * @return The Z-axis scale */ Float getScaleZ(); /** * Gets the X-axis translation for the scripted item. + * * @return The X-axis translation */ Float getTranslateX(); /** * Gets the Y-axis translation for the scripted item. + * * @return The Y-axis translation */ Float getTranslateY(); /** * Gets the Z-axis translation for the scripted item. + * * @return The Z-axis translation */ Float getTranslateZ(); diff --git a/java/noppes/npcs/api/item/IItemLinked.java b/java/noppes/npcs/api/item/IItemLinked.java index b3285bd..e664938 100644 --- a/java/noppes/npcs/api/item/IItemLinked.java +++ b/java/noppes/npcs/api/item/IItemLinked.java @@ -4,6 +4,6 @@ import noppes.npcs.api.handler.data.ILinkedItem; public interface IItemLinked extends IItemCustomizable { - public ILinkedItem getLinkedItem(); + ILinkedItem getLinkedItem(); } diff --git a/java/noppes/npcs/api/item/IItemStack.java b/java/noppes/npcs/api/item/IItemStack.java index 84991cc..255e3a6 100644 --- a/java/noppes/npcs/api/item/IItemStack.java +++ b/java/noppes/npcs/api/item/IItemStack.java @@ -50,7 +50,7 @@ public interface IItemStack { void setItemDamage(int value); /** - * @param key The key of this NBTTag + * @param key The key of this NBTTag * @param value The value to be stored. Can be a Number or String */ void setTag(String key, Object value); @@ -72,9 +72,9 @@ public interface IItemStack { boolean isEnchanted(); /** - * @since 1.7.10d * @param id The enchantment id * @return + * @since 1.7.10d */ boolean hasEnchant(int id); @@ -97,26 +97,26 @@ public interface IItemStack { int getMaxItemDamage(); /** - * @since 1.7.10d * @return Returns whether this item is a book + * @since 1.7.10d */ boolean isWrittenBook(); /** - * @since 1.7.10d * @return Returns the books title + * @since 1.7.10d */ String getBookTitle(); /** - * @since 1.7.10d * @return Returns the books author + * @since 1.7.10d */ String getBookAuthor(); /** - * @since 1.7.10d * @return If the item is a book, returns a string array with book pages + * @since 1.7.10d */ String[] getBookText(); @@ -131,6 +131,7 @@ public interface IItemStack { /** * No support is given for this method. Dont use if you dont know what you are doing. + * * @return Minecraft ItemStack */ ItemStack getMCItemStack(); @@ -141,7 +142,7 @@ public interface IItemStack { void setMCNbt(NBTTagCompound compound); - public boolean compare(IItemStack item, boolean ignoreNBT); + boolean compare(IItemStack item, boolean ignoreNBT); boolean compare(IItemStack item, boolean ignoreDamage, boolean ignoreNBT); } 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..a4fc3d9 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,71 +27,71 @@ public interface IRoleFollower extends IRole { void setIsFollowing(boolean following); /** - * @since 1.7.10c * @return Returns days left + * @since 1.7.10c */ int getDaysLeft(); /** - * @since 1.7.10c * @param days The days you want to add to the days remaining + * @since 1.7.10c */ void addDaysLeft(int days); /** - * @since 1.7.10c * @return Returns whether or not the follower is set to infinite days + * @since 1.7.10c */ boolean getInfiniteDays(); /** - * @since 1.7.10c * @param infinite Sets whether the days hired are infinite + * @since 1.7.10c */ void setInfiniteDays(boolean infinite); /** - * @since 1.7.10c * @return Return whether the gui is disabled + * @since 1.7.10c */ boolean getGuiDisabled(); /** - * @since 1.7.10c * @param disabled Set the gui to be disabled or not + * @since 1.7.10c */ void setGuiDisabled(boolean disabled); /** - * @param index Index of Rate [0 - 2] + * @param index Index of Rate [0 - 2] * @param amount Amount hired for */ - public void setRate(int index, int amount); + void setRate(int index, int amount); /** * @param index Index of Rate [0 - 2] * @return amount fired for */ - public int getRate(int index); + int getRate(int index); /** * @param dialogHire New dialog hire string */ - public void setDialogHire(String dialogHire); + void setDialogHire(String dialogHire); /** * @return dialog hire string */ - public String getDialogHire(); + String getDialogHire(); /** * @param dialogFarewell New dialog farewell string */ - public void setDialogFarewell(String dialogFarewell); + void setDialogFarewell(String dialogFarewell); /** * @return dialog farewell string */ - public String getDialogFarewell(); + String getDialogFarewell(); } diff --git a/java/noppes/npcs/api/roles/IRoleTrader.java b/java/noppes/npcs/api/roles/IRoleTrader.java index 69ee2b3..d444cf3 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 */ 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);