Skip to content

Commit

Permalink
Merge pull request SpongePowered#97 from zeuslightning125/master
Browse files Browse the repository at this point in the history
Fixed existing javadoc, added missing @OVERRIDES
  • Loading branch information
DDoS committed Sep 11, 2014
2 parents 25447aa + 0de814c commit f9c0efe
Show file tree
Hide file tree
Showing 19 changed files with 164 additions and 37 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/spongepowered/api/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface Game {
*/
GameRegistry getRegistry();

/*
/**
* Gets the {@link Player}s currently online
*
* @return a {@link Collection} of online players
Expand All @@ -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
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/org/spongepowered/api/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
7 changes: 6 additions & 1 deletion src/main/java/org/spongepowered/api/entity/Damageable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
}
1 change: 0 additions & 1 deletion src/main/java/org/spongepowered/api/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ public interface Entity {
* @return The entity's {@link UUID}
*/
UUID getUniqueID();

}
1 change: 0 additions & 1 deletion src/main/java/org/spongepowered/api/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public interface Player extends HumanEntity {
* @return The player's display name
*/
String getDisplayName();

}
11 changes: 6 additions & 5 deletions src/main/java/org/spongepowered/api/event/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand All @@ -44,37 +47,35 @@ 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();

/**
* Sets the cancelled state of the {@link Event}
*
* @param cancel the new cancelled state
* @return
*/
void setCancelled(boolean cancel);

/**
* 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();

Expand Down
36 changes: 36 additions & 0 deletions src/main/java/org/spongepowered/api/event/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,49 @@
* </table>
*/
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
}
20 changes: 19 additions & 1 deletion src/main/java/org/spongepowered/api/event/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
5 changes: 2 additions & 3 deletions src/main/java/org/spongepowered/api/inventory/ItemStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,7 +43,7 @@ public interface ItemStack extends Comparable<ItemStack>, Serializable {
/**
* Set the damage/durability
*
* @param damage
* @param damage The value that the damage should be set to
*/
void setDamage(short damage);

Expand Down Expand Up @@ -81,7 +80,7 @@ public interface ItemStack extends Comparable<ItemStack>, 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
*/
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/spongepowered/api/item/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ public interface Item {
* @return Max stack quantity
*/
int getMaxStackQuantity();

}
8 changes: 7 additions & 1 deletion src/main/java/org/spongepowered/api/math/Vector2d.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public interface Vector2d extends Comparable<Vector2d>, 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);
Expand Down Expand Up @@ -321,6 +321,8 @@ public interface Vector2d extends Comparable<Vector2d>, 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
*/
Expand All @@ -347,10 +349,13 @@ public interface Vector2d extends Comparable<Vector2d>, Serializable, Cloneable
*/
Vector2f toFloat();

@Override
int compareTo(Vector2d v);

@Override
boolean equals(Object o);

@Override
int hashCode();

/**
Expand All @@ -365,5 +370,6 @@ public interface Vector2d extends Comparable<Vector2d>, Serializable, Cloneable
*
* @return This vector as a string
*/
@Override
String toString();
}
16 changes: 12 additions & 4 deletions src/main/java/org/spongepowered/api/math/Vector2f.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,15 @@ public interface Vector2f extends Comparable<Vector2f>, 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);

/**
* 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);
Expand Down Expand Up @@ -407,14 +407,14 @@ public interface Vector2f extends Comparable<Vector2f>, 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();

Expand All @@ -427,13 +427,17 @@ public interface Vector2f extends Comparable<Vector2f>, 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
*/
Vector3f toVector3(double z);

/**
* 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
*/
Expand All @@ -460,10 +464,13 @@ public interface Vector2f extends Comparable<Vector2f>, Serializable, Cloneable
*/
Vector2d toDouble();

@Override
int compareTo(Vector2f v);

@Override
boolean equals(Object o);

@Override
int hashCode();

/**
Expand All @@ -478,5 +485,6 @@ public interface Vector2f extends Comparable<Vector2f>, Serializable, Cloneable
*
* @return This vector as a string
*/
@Override
String toString();
}
Loading

0 comments on commit f9c0efe

Please sign in to comment.