diff --git a/src/main/java/org/spongepowered/api/Game.java b/src/main/java/org/spongepowered/api/Game.java index 2dbd3231431..fa299cca0da 100644 --- a/src/main/java/org/spongepowered/api/Game.java +++ b/src/main/java/org/spongepowered/api/Game.java @@ -74,7 +74,7 @@ public interface Game { */ GameRegistry getRegistry(); - /* + /** * Gets the {@link Player}s currently online * * @return a {@link Collection} of online players @@ -91,7 +91,8 @@ public interface Game { /** * Gets a {@link Player} by their unique id * - * @param uniqueId + * @param uniqueId The UUID to get the player from + * * @return {@link Player} or null if none found */ @Nullable diff --git a/src/main/java/org/spongepowered/api/Platform.java b/src/main/java/org/spongepowered/api/Platform.java index a39078ee51d..d01dc3c2f25 100644 --- a/src/main/java/org/spongepowered/api/Platform.java +++ b/src/main/java/org/spongepowered/api/Platform.java @@ -23,6 +23,19 @@ */ package org.spongepowered.api; +/** + * Effective side platforms + * + * A side is what part of minecraft this is being run on. The client, or the server. + * The internal server is also treated like a dedicated server. + */ public enum Platform { - CLIENT, SERVER + /** + * The platform of a minecraft CLIENT is expected + */ + CLIENT, + /** + * The platform of a mincecraft SERVER is expected + */ + SERVER } diff --git a/src/main/java/org/spongepowered/api/entity/Damageable.java b/src/main/java/org/spongepowered/api/entity/Damageable.java index b38b7bbd016..942b3dcd4c4 100644 --- a/src/main/java/org/spongepowered/api/entity/Damageable.java +++ b/src/main/java/org/spongepowered/api/entity/Damageable.java @@ -23,12 +23,15 @@ */ package org.spongepowered.api.entity; +/** + * Something that can have damage/health on it should inherit this + */ public interface Damageable { /** * Damages the entity by a specified amount; * - * @param damage the damage amount + * @param amount the damage amount */ void damage(double amount); @@ -41,6 +44,8 @@ public interface Damageable { /** * Sets the Health of the {@code Damageable} + * + * @param health The health to set this damageable's health to */ void setHealth(double health); } \ No newline at end of file diff --git a/src/main/java/org/spongepowered/api/entity/Entity.java b/src/main/java/org/spongepowered/api/entity/Entity.java index 14a291f16e0..aeac9bf75cf 100644 --- a/src/main/java/org/spongepowered/api/entity/Entity.java +++ b/src/main/java/org/spongepowered/api/entity/Entity.java @@ -33,5 +33,4 @@ public interface Entity { * @return The entity's {@link UUID} */ UUID getUniqueID(); - } diff --git a/src/main/java/org/spongepowered/api/entity/Player.java b/src/main/java/org/spongepowered/api/entity/Player.java index 965ceec9b18..1b01dd0d6d4 100644 --- a/src/main/java/org/spongepowered/api/entity/Player.java +++ b/src/main/java/org/spongepowered/api/entity/Player.java @@ -39,5 +39,4 @@ public interface Player extends HumanEntity { * @return The player's display name */ String getDisplayName(); - } diff --git a/src/main/java/org/spongepowered/api/event/Event.java b/src/main/java/org/spongepowered/api/event/Event.java index 86afdc9be99..247af2da141 100644 --- a/src/main/java/org/spongepowered/api/event/Event.java +++ b/src/main/java/org/spongepowered/api/event/Event.java @@ -25,6 +25,9 @@ import org.spongepowered.api.Game; +/** + * A game event. A game event can be any sort of event from anywhere, and can be anything. + */ public interface Event { /** @@ -44,14 +47,14 @@ public interface Event { /** * Gets if the {@link Event} can be cancelled * - * @return + * @return Can this event be cancelled */ boolean isCancellable(); /** * Gets if the {@link Event} has been cancelled * - * @return + * @return Is this event cancelled */ boolean isCancelled(); @@ -59,7 +62,6 @@ public interface Event { * Sets the cancelled state of the {@link Event} * * @param cancel the new cancelled state - * @return */ void setCancelled(boolean cancel); @@ -67,14 +69,13 @@ public interface Event { * Sets the {@link Result} of the {@link Event} * * @param result the result - * @return */ void setResult(Result result); /** * Gets the {@link Result} of the {@link Event} * - * @return + * @return The result of this event */ Result getResult(); diff --git a/src/main/java/org/spongepowered/api/event/Order.java b/src/main/java/org/spongepowered/api/event/Order.java index 16646ec563a..1c4b4255c0e 100644 --- a/src/main/java/org/spongepowered/api/event/Order.java +++ b/src/main/java/org/spongepowered/api/event/Order.java @@ -42,13 +42,49 @@ * */ public enum Order { + /** + * The order point of PRE handles setting up things that need to be done before other things are handled + * PRE is read only and cannot cancel the events + */ PRE, + /** + * The order point of AFTER_PRE handles things that need to be done after PRE + * AFTER_PRE is read only and cannot cancel the events + */ AFTER_PRE, + /** + * The order point of FIRST handles cancellation by protection plugins for informational responses + * FIRST is read only but can cancel events + */ FIRST, + /** + * The order point of EARLY handles standard actions that need to be done before other plugins + * EARLY is not read only and can cancel events + */ EARLY, + /** + * The order point of DEFAULT handles just standard event handlings, you should use this unless you know you need otherwise + * DEFAULT is not read only and can cancel events + */ DEFAULT, + /** + * The order point of LATE handles standard actions that need to be done after other plugins + * LATE is not read only and can cancel the event + */ LATE, + /** + * The order point of LAST handles last minute cancellations by protection plugins + * LAST is read only but can cancel events + */ LAST, + /** + * The order point of BEFORE_POST handles preparation for things needing to be done in post + * BEFORE_POST is read only but can cancel events + */ BEFORE_POST, + /** + * The order point of POST handles last minute things and monitoring of events for rollback or logging + * POST is read only but can cancel events + */ POST } \ No newline at end of file diff --git a/src/main/java/org/spongepowered/api/event/Result.java b/src/main/java/org/spongepowered/api/event/Result.java index 79a86e2456c..d476a320b87 100644 --- a/src/main/java/org/spongepowered/api/event/Result.java +++ b/src/main/java/org/spongepowered/api/event/Result.java @@ -23,6 +23,24 @@ */ package org.spongepowered.api.event; +/** + * The result of an action such as an event + */ public enum Result { - DENY, DEFAULT, ALLOW, NO_RESULT + /** + * The result of a request such as an event has been denied continuation + */ + DENY, + /** + * The result of a request such as an event has not been modified, and will progress based on the default expectation + */ + DEFAULT, + /** + * The result of a request such as an event has been allowed continuation + */ + ALLOW, + /** + * There is no result from a request such as an event, or a result is not applicable + */ + NO_RESULT } diff --git a/src/main/java/org/spongepowered/api/event/world/WorldEvent.java b/src/main/java/org/spongepowered/api/event/world/WorldEvent.java index 3ed8849b97c..6a51ce47c32 100644 --- a/src/main/java/org/spongepowered/api/event/world/WorldEvent.java +++ b/src/main/java/org/spongepowered/api/event/world/WorldEvent.java @@ -33,7 +33,7 @@ public interface WorldEvent { /** * Gets the {@link World} involved in the event * - * @return + * @return The world that this event is involved in */ World getWorld(); } diff --git a/src/main/java/org/spongepowered/api/inventory/ItemStack.java b/src/main/java/org/spongepowered/api/inventory/ItemStack.java index 2de2f2b8bd7..de5b3315f29 100644 --- a/src/main/java/org/spongepowered/api/inventory/ItemStack.java +++ b/src/main/java/org/spongepowered/api/inventory/ItemStack.java @@ -26,7 +26,6 @@ import org.spongepowered.api.item.Item; import java.io.Serializable; -import java.util.List; /** * Represents a stack of a specific {@link Item}. Allows comparison to another @@ -44,7 +43,7 @@ public interface ItemStack extends Comparable, Serializable { /** * Set the damage/durability * - * @param damage + * @param damage The value that the damage should be set to */ void setDamage(short damage); @@ -81,7 +80,7 @@ public interface ItemStack extends Comparable, Serializable { int getMaxStackQuantity(); /** - * Set the max quantity per stack. This overrides, and is entirely separate from {@link org.spongepowered.api.item.Item#getMaxStackQuantity() + * Set the max quantity per stack. This overrides, and is entirely separate from {@link org.spongepowered.api.item.Item#getMaxStackQuantity()} * * @param quantity Max stack quantity */ diff --git a/src/main/java/org/spongepowered/api/item/Item.java b/src/main/java/org/spongepowered/api/item/Item.java index f4b803bab89..c338025bba7 100644 --- a/src/main/java/org/spongepowered/api/item/Item.java +++ b/src/main/java/org/spongepowered/api/item/Item.java @@ -40,5 +40,4 @@ public interface Item { * @return Max stack quantity */ int getMaxStackQuantity(); - } diff --git a/src/main/java/org/spongepowered/api/math/Vector2d.java b/src/main/java/org/spongepowered/api/math/Vector2d.java index 076cfbfa949..36be4d071d3 100644 --- a/src/main/java/org/spongepowered/api/math/Vector2d.java +++ b/src/main/java/org/spongepowered/api/math/Vector2d.java @@ -165,7 +165,7 @@ public interface Vector2d extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param power The value to raise by * @return The results of the operation as a new vector */ Vector2d pow(double power); @@ -321,6 +321,8 @@ public interface Vector2d extends Comparable, Serializable, Cloneable /** * Returns this vector as a Vector3d, using the provided value for component z. + * + * @param z The z component value to be used * * @return This vector as a Vector3d */ @@ -347,10 +349,13 @@ public interface Vector2d extends Comparable, Serializable, Cloneable */ Vector2f toFloat(); + @Override int compareTo(Vector2d v); + @Override boolean equals(Object o); + @Override int hashCode(); /** @@ -365,5 +370,6 @@ public interface Vector2d extends Comparable, Serializable, Cloneable * * @return This vector as a string */ + @Override String toString(); } diff --git a/src/main/java/org/spongepowered/api/math/Vector2f.java b/src/main/java/org/spongepowered/api/math/Vector2f.java index bf0577637c4..031e6fcf60b 100644 --- a/src/main/java/org/spongepowered/api/math/Vector2f.java +++ b/src/main/java/org/spongepowered/api/math/Vector2f.java @@ -225,7 +225,7 @@ public interface Vector2f extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param pow The value to raise by * @return The results of the operation as a new vector */ Vector2f pow(double pow); @@ -233,7 +233,7 @@ public interface Vector2f extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param power The value to raise by * @return The results of the operation as a new vector */ Vector2f pow(float power); @@ -407,14 +407,14 @@ public interface Vector2f extends Comparable, Serializable, Cloneable /** * Return the axis with the minimal value. * - * @return {@link int} axis with minimal value + * @return The axis with minimal value */ int getMinAxis(); /** * Return the axis with the maximum value. * - * @return {@link int} axis with maximum value + * @return The axis with maximum value */ int getMaxAxis(); @@ -427,6 +427,8 @@ public interface Vector2f extends Comparable, Serializable, Cloneable /** * Returns this vector as a Vector3f, using the provided value for component z. + * + * @param z The z component value to be used * * @return This vector as a Vector3f */ @@ -434,6 +436,8 @@ public interface Vector2f extends Comparable, Serializable, Cloneable /** * Returns this vector as a Vector3f, using the provided value for component z. + * + * @param z The z component value to be used * * @return This vector as a Vector3f */ @@ -460,10 +464,13 @@ public interface Vector2f extends Comparable, Serializable, Cloneable */ Vector2d toDouble(); + @Override int compareTo(Vector2f v); + @Override boolean equals(Object o); + @Override int hashCode(); /** @@ -478,5 +485,6 @@ public interface Vector2f extends Comparable, Serializable, Cloneable * * @return This vector as a string */ + @Override String toString(); } diff --git a/src/main/java/org/spongepowered/api/math/Vector2i.java b/src/main/java/org/spongepowered/api/math/Vector2i.java index 025579f9ca7..71b4904ae69 100644 --- a/src/main/java/org/spongepowered/api/math/Vector2i.java +++ b/src/main/java/org/spongepowered/api/math/Vector2i.java @@ -212,7 +212,7 @@ public interface Vector2i extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param pow The value to raise by * @return The results of the operation as a new vector */ Vector2i pow(double pow); @@ -220,7 +220,7 @@ public interface Vector2i extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param power The value to raise by * @return The results of the operation as a new vector */ Vector2i pow(int power); @@ -366,14 +366,14 @@ public interface Vector2i extends Comparable, Serializable, Cloneable /** * Return the axis with the minimal value. * - * @return {@link int} axis with minimal value + * @return The axis with minimal value */ int getMinAxis(); /** * Return the axis with the maximum value. * - * @return {@link int} axis with maximum value + * @return The axis with maximum value */ int getMaxAxis(); @@ -386,6 +386,8 @@ public interface Vector2i extends Comparable, Serializable, Cloneable /** * Returns this vector as a Vector3i, using the provided value for component z. + * + * @param z The z component value to be used * * @return This vector as a Vector3i */ @@ -393,6 +395,8 @@ public interface Vector2i extends Comparable, Serializable, Cloneable /** * Returns this vector as a Vector3i, using the provided value for component z. + * + * @param z The z component value to be used * * @return This vector as a Vector3i */ @@ -419,10 +423,13 @@ public interface Vector2i extends Comparable, Serializable, Cloneable */ Vector2d toDouble(); + @Override int compareTo(Vector2i v); + @Override boolean equals(Object o); + @Override int hashCode(); /** @@ -437,5 +444,6 @@ public interface Vector2i extends Comparable, Serializable, Cloneable * * @return This vector as a string */ + @Override String toString(); } diff --git a/src/main/java/org/spongepowered/api/math/Vector3d.java b/src/main/java/org/spongepowered/api/math/Vector3d.java index 22c984ad37e..617bddf9527 100644 --- a/src/main/java/org/spongepowered/api/math/Vector3d.java +++ b/src/main/java/org/spongepowered/api/math/Vector3d.java @@ -201,7 +201,7 @@ public interface Vector3d extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param power The value to raise by * @return The results of the operation as a new vector */ Vector3d pow(double power); @@ -341,14 +341,14 @@ public interface Vector3d extends Comparable, Serializable, Cloneable /** * Returns the axis with the minimal value. * - * @return {@link int} axis with minimal value + * @return The axis with minimal value */ int getMinAxis(); /** * Returns the axis with the maximum value. * - * @return {@link int} axis with maximum value + * @return The axis with maximum value */ int getMaxAxis(); @@ -388,10 +388,13 @@ public interface Vector3d extends Comparable, Serializable, Cloneable */ Vector3f toFloat(); + @Override int compareTo(Vector3d v); + @Override boolean equals(Object o); + @Override int hashCode(); /** @@ -406,5 +409,6 @@ public interface Vector3d extends Comparable, Serializable, Cloneable * * @return This vector as a string */ + @Override String toString(); } diff --git a/src/main/java/org/spongepowered/api/math/Vector3f.java b/src/main/java/org/spongepowered/api/math/Vector3f.java index 6ee120e30e4..5d6c1952a07 100644 --- a/src/main/java/org/spongepowered/api/math/Vector3f.java +++ b/src/main/java/org/spongepowered/api/math/Vector3f.java @@ -277,7 +277,7 @@ public interface Vector3f extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param pow The value to raise by * @return The results of the operation as a new vector */ Vector3f pow(double pow); @@ -285,7 +285,7 @@ public interface Vector3f extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param power The value to raise by * @return The results of the operation as a new vector */ Vector3f pow(float power); @@ -467,14 +467,14 @@ public interface Vector3f extends Comparable, Serializable, Cloneable /** * Returns the axis with the minimal value. * - * @return {@link int} axis with minimal value + * @return The axis with minimal value */ int getMinAxis(); /** * Returns the axis with the maximum value. * - * @return {@link int} axis with maximum value + * @return The axis with maximum value */ int getMaxAxis(); @@ -514,10 +514,13 @@ public interface Vector3f extends Comparable, Serializable, Cloneable */ Vector3d toDouble(); + @Override int compareTo(Vector3f v); + @Override boolean equals(Object o); + @Override int hashCode(); /** @@ -532,5 +535,6 @@ public interface Vector3f extends Comparable, Serializable, Cloneable * * @return This vector as a string */ + @Override String toString(); } diff --git a/src/main/java/org/spongepowered/api/math/Vector3i.java b/src/main/java/org/spongepowered/api/math/Vector3i.java index 69d9fa3bcf2..25f8132aba0 100644 --- a/src/main/java/org/spongepowered/api/math/Vector3i.java +++ b/src/main/java/org/spongepowered/api/math/Vector3i.java @@ -257,7 +257,7 @@ public interface Vector3i extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param pow The value to raise by * @return The results of the operation as a new vector */ Vector3i pow(double pow); @@ -265,7 +265,7 @@ public interface Vector3i extends Comparable, Serializable, Cloneable /** * Raises each component of this vector by the value, returning the results as new vector. * - * @param a The value to raise by + * @param power The value to raise by * @return The results of the operation as a new vector */ Vector3i pow(int power); @@ -419,14 +419,14 @@ public interface Vector3i extends Comparable, Serializable, Cloneable /** * Returns the axis with the minimal value. * - * @return {@link int} axis with minimal value + * @return The axis with minimal value */ int getMinAxis(); /** * Returns the axis with the maximum value. * - * @return {@link int} axis with maximum value + * @return The axis with maximum value */ int getMaxAxis(); @@ -459,12 +459,20 @@ public interface Vector3i extends Comparable, Serializable, Cloneable */ Vector3f toFloat(); + /** + * Returns this vector as a Vector3d. + * + * @return This vector as a Vector3d + */ Vector3d toDouble(); + @Override int compareTo(Vector3i v); + @Override boolean equals(Object o); + @Override int hashCode(); /** @@ -479,5 +487,6 @@ public interface Vector3i extends Comparable, Serializable, Cloneable * * @return This vector as a string */ + @Override String toString(); } diff --git a/src/main/java/org/spongepowered/api/plugin/Plugin.java b/src/main/java/org/spongepowered/api/plugin/Plugin.java index 1ada6d8cbd0..bb4fb16cf74 100644 --- a/src/main/java/org/spongepowered/api/plugin/Plugin.java +++ b/src/main/java/org/spongepowered/api/plugin/Plugin.java @@ -29,12 +29,27 @@ import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; +/** + * An annotation used to describe and mark a Sponge plugin + */ @Target(TYPE) @Retention(RUNTIME) public @interface Plugin { + /** + * An ID for the plugin to be used internally + * The ID should be unique as to not conflict with other plugins + */ String id(); + /** + * The human readable name of the plugin as to be used in descriptions and similar things + * @return The human readable name of the plugin + */ String name(); + /** + * The version of the plugin + * @return The version of the plugin + */ String version() default "unknown"; } diff --git a/src/main/java/org/spongepowered/api/plugin/PluginContainer.java b/src/main/java/org/spongepowered/api/plugin/PluginContainer.java index 203a479dcac..cf2cf24dabb 100644 --- a/src/main/java/org/spongepowered/api/plugin/PluginContainer.java +++ b/src/main/java/org/spongepowered/api/plugin/PluginContainer.java @@ -23,6 +23,9 @@ */ package org.spongepowered.api.plugin; +/** + * A wrapper around a class marked with an {@link org.spongepowered.api.plugin.Plugin} annotation to retrieve information from the annotation for easier use + */ public interface PluginContainer { /** * Gets the id of the {@link org.spongepowered.api.plugin.Plugin} within this container.