diff --git a/build.gradle b/build.gradle index 80a2de1c7..99a17a3b5 100755 --- a/build.gradle +++ b/build.gradle @@ -98,6 +98,11 @@ mixin { add sourceSets.launch, 'mixins.baritone.refmap.json' } +javadoc { + source = sourceSets.api.allJava + classpath = sourceSets.api.compileClasspath +} + jar { from sourceSets.launch.output, sourceSets.api.output preserveFileTimestamps = false diff --git a/src/api/java/baritone/api/cache/ICachedRegion.java b/src/api/java/baritone/api/cache/ICachedRegion.java index 6b9048a57..cf63f54ba 100644 --- a/src/api/java/baritone/api/cache/ICachedRegion.java +++ b/src/api/java/baritone/api/cache/ICachedRegion.java @@ -37,12 +37,12 @@ public interface ICachedRegion extends IBlockTypeAccess { boolean isCached(int blockX, int blockZ); /** - * The X coordinate of this region + * @return The X coordinate of this region */ int getX(); /** - * The Z coordinate of this region + * @return The Z coordinate of this region */ int getZ(); } diff --git a/src/api/java/baritone/api/cache/IWorldData.java b/src/api/java/baritone/api/cache/IWorldData.java index 3543dd397..1eaade4c0 100644 --- a/src/api/java/baritone/api/cache/IWorldData.java +++ b/src/api/java/baritone/api/cache/IWorldData.java @@ -27,12 +27,12 @@ public interface IWorldData { * Returns the cached world for this world. A cached world is a simplified format * of a regular world, intended for use on multiplayer servers where chunks are not * traditionally stored to disk, allowing for long distance pathing with minimal disk usage. + * + * @return The cached world for this world */ ICachedWorld getCachedWorld(); /** - * Returns the waypoint collection for this world. - * * @return The waypoint collection for this world */ IWaypointCollection getWaypoints(); diff --git a/src/api/java/baritone/api/event/listener/IGameEventListener.java b/src/api/java/baritone/api/event/listener/IGameEventListener.java index c3b4e6880..5cca43a55 100644 --- a/src/api/java/baritone/api/event/listener/IGameEventListener.java +++ b/src/api/java/baritone/api/event/listener/IGameEventListener.java @@ -41,6 +41,8 @@ public interface IGameEventListener { * Run once per game tick before screen input is handled. * * @see Minecraft#runTick() + * + * @param event The event */ void onTick(TickEvent event); @@ -48,13 +50,13 @@ public interface IGameEventListener { * Run once per game tick from before and after the player rotation is sent to the server. * * @see EntityPlayerSP#onUpdate() + * + * @param event The event */ void onPlayerUpdate(PlayerUpdateEvent event); /** * Run once per game tick from before keybinds are processed. - * - * @see Minecraft#processKeyBinds() */ void onProcessKeyBinds(); @@ -62,6 +64,8 @@ public interface IGameEventListener { * Runs whenever the client player sends a message to the server. * * @see EntityPlayerSP#sendChatMessage(String) + * + * @param event The event */ void onSendChatMessage(ChatEvent event); @@ -69,6 +73,8 @@ public interface IGameEventListener { * Runs before and after whenever a chunk is either loaded, unloaded, or populated. * * @see WorldClient#doPreChunk(int, int, boolean) + * + * @param event The event */ void onChunkEvent(ChunkEvent event); @@ -77,7 +83,7 @@ public interface IGameEventListener { *

* Note: {@link GameSettings#anaglyph} has been removed in Minecraft 1.13 * - * @see EntityRenderer#renderWorldPass(int, float, long) + * @param event The event */ void onRenderPass(RenderEvent event); @@ -85,24 +91,28 @@ public interface IGameEventListener { * Runs before and after whenever a new world is loaded * * @see Minecraft#loadWorld(WorldClient, String) + * + * @param event The event */ void onWorldEvent(WorldEvent event); /** * Runs before a outbound packet is sent * - * @see NetworkManager#dispatchPacket(Packet, GenericFutureListener[]) * @see Packet * @see GenericFutureListener + * + * @param event The event */ void onSendPacket(PacketEvent event); /** * Runs before an inbound packet is processed * - * @see NetworkManager#dispatchPacket(Packet, GenericFutureListener[]) * @see Packet * @see GenericFutureListener + * + * @param event The event */ void onReceivePacket(PacketEvent event); @@ -111,30 +121,29 @@ public interface IGameEventListener { * and before and after the player jumps. * * @see Entity#moveRelative(float, float, float, float) - * @see EntityLivingBase#jump() + * + * @param event The event */ void onPlayerRotationMove(RotationMoveEvent event); /** * Called when the local player interacts with a block, whether it is breaking or opening/placing. * - * @see Minecraft#clickMouse() - * @see Minecraft#rightClickMouse() + * @param event The event */ void onBlockInteract(BlockInteractEvent event); /** * Called when the local player dies, as indicated by the creation of the {@link GuiGameOver} screen. * - * @see GuiGameOver(ITextComponent) - * @see ITextComponent + * @see GuiGameOver */ void onPlayerDeath(); /** * When the pathfinder's state changes * - * @param event + * @param event The event */ void onPathEvent(PathEvent event); } diff --git a/src/api/java/baritone/api/pathing/calc/IPath.java b/src/api/java/baritone/api/pathing/calc/IPath.java index 63c01101e..ec51861dc 100644 --- a/src/api/java/baritone/api/pathing/calc/IPath.java +++ b/src/api/java/baritone/api/pathing/calc/IPath.java @@ -51,6 +51,8 @@ public interface IPath { /** * This path is actually going to be executed in the world. Do whatever additional processing is required. * (as opposed to Path objects that are just constructed every frame for rendering) + * + * @return The result of path post processing */ default IPath postProcess() { throw new UnsupportedOperationException(); @@ -121,6 +123,7 @@ public interface IPath { *

* The argument is supposed to be a BlockStateInterface LOL LOL LOL LOL LOL * + * @param bsi The block state lookup, highly cursed * @return The result of this cut-off operation */ default IPath cutoffAtLoadedChunks(Object bsi) { @@ -131,6 +134,7 @@ public interface IPath { * Cuts off this path using the min length and cutoff factor settings, and returns the resulting path. * Default implementation just returns this path, without the intended functionality. * + * @param destination The end goal of this path * @return The result of this cut-off operation * @see Settings#pathCutoffMinimumLength * @see Settings#pathCutoffFactor diff --git a/src/api/java/baritone/api/pathing/calc/IPathFinder.java b/src/api/java/baritone/api/pathing/calc/IPathFinder.java index fa83295f7..7f73693fa 100644 --- a/src/api/java/baritone/api/pathing/calc/IPathFinder.java +++ b/src/api/java/baritone/api/pathing/calc/IPathFinder.java @@ -34,6 +34,9 @@ public interface IPathFinder { /** * Calculate the path in full. Will take several seconds. * + * @param primaryTimeout If a path is found, the path finder will stop after this amount of time + * @param failureTimeout If a path isn't found, the path finder will continue for this amount of time + * * @return The final path */ PathCalculationResult calculate(long primaryTimeout, long failureTimeout); diff --git a/src/api/java/baritone/api/pathing/goals/Goal.java b/src/api/java/baritone/api/pathing/goals/Goal.java index 38cfb9d78..1ecf2dfb9 100644 --- a/src/api/java/baritone/api/pathing/goals/Goal.java +++ b/src/api/java/baritone/api/pathing/goals/Goal.java @@ -30,6 +30,10 @@ public interface Goal { * Returns whether or not the specified position * meets the requirement for this goal based. * + * @param x The goal X position + * @param y The goal Y position + * @param z The goal Z position + * * @return Whether or not it satisfies this goal */ boolean isInGoal(int x, int y, int z); @@ -37,6 +41,10 @@ public interface Goal { /** * Estimate the number of ticks it will take to get to the goal * + * @param x The goal X position + * @param y The goal Y position + * @param z The goal Z position + * * @return The estimate number of ticks to satisfy the goal */ double heuristic(int x, int y, int z); diff --git a/src/api/java/baritone/api/utils/RayTraceUtils.java b/src/api/java/baritone/api/utils/RayTraceUtils.java index 61086f3db..0fd1e4e01 100644 --- a/src/api/java/baritone/api/utils/RayTraceUtils.java +++ b/src/api/java/baritone/api/utils/RayTraceUtils.java @@ -34,7 +34,9 @@ public final class RayTraceUtils { * any entity collisions can be ignored, because this method will not recognize if an * entity is in the way or not. The local player's block reach distance will be used. * - * @param rotation The rotation to raytrace towards + * @param entity The entity representing the raytrace source + * @param rotation The rotation to raytrace towards + * @param blockReachDistance The block reach distance of the entity * @return The calculated raytrace result */ public static RayTraceResult rayTraceTowards(Entity entity, Rotation rotation, double blockReachDistance) { diff --git a/src/api/java/baritone/api/utils/RotationUtils.java b/src/api/java/baritone/api/utils/RotationUtils.java index 20cb0dde2..0649ff107 100644 --- a/src/api/java/baritone/api/utils/RotationUtils.java +++ b/src/api/java/baritone/api/utils/RotationUtils.java @@ -134,8 +134,9 @@ public final class RotationUtils { * side that is reachable. The return type will be {@link Optional#empty()} if the entity is * unable to reach any of the sides of the block. * - * @param entity The viewing entity - * @param pos The target block position + * @param entity The viewing entity + * @param pos The target block position + * @param blockReachDistance The block reach distance of the entity * @return The optional rotation */ public static Optional reachable(EntityPlayerSP entity, BlockPos pos, double blockReachDistance) { @@ -178,9 +179,10 @@ public final class RotationUtils { * the given offsetted position. The return type will be {@link Optional#empty()} if * the entity is unable to reach the block with the offset applied. * - * @param entity The viewing entity - * @param pos The target block position - * @param offsetPos The position of the block with the offset applied. + * @param entity The viewing entity + * @param pos The target block position + * @param offsetPos The position of the block with the offset applied. + * @param blockReachDistance The block reach distance of the entity * @return The optional rotation */ public static Optional reachableOffset(Entity entity, BlockPos pos, Vec3d offsetPos, double blockReachDistance) { @@ -202,8 +204,9 @@ public final class RotationUtils { * Determines if the specified entity is able to reach the specified block where it is * looking at the direct center of it's hitbox. * - * @param entity The viewing entity - * @param pos The target block position + * @param entity The viewing entity + * @param pos The target block position + * @param blockReachDistance The block reach distance of the entity * @return The optional rotation */ public static Optional reachableCenter(Entity entity, BlockPos pos, double blockReachDistance) { diff --git a/src/api/java/baritone/api/utils/VecUtils.java b/src/api/java/baritone/api/utils/VecUtils.java index 1df011632..4c35c05e8 100644 --- a/src/api/java/baritone/api/utils/VecUtils.java +++ b/src/api/java/baritone/api/utils/VecUtils.java @@ -36,7 +36,8 @@ public final class VecUtils { /** * Calculates the center of the block at the specified position's bounding box * - * @param pos The block position + * @param world The world that the block is in, used to provide the bounding box + * @param pos The block position * @return The center of the block's bounding box * @see #getBlockPosCenter(BlockPos) */