Added and Fixed lots of JavaDocs

This commit is contained in:
Sn0wStorm
2019-11-25 22:16:16 +01:00
parent c287b6350f
commit 16c03f9da1
32 changed files with 513 additions and 308 deletions
@@ -7,17 +7,15 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* The Brewery Config was reloaded
* The Brewery Config was reloaded.
*/
public class ConfigLoadEvent extends Event {
private static final HandlerList handlers = new HandlerList();
/**
* One of the things one might need to do after reloading
* Removes a Recipe, can also remove config recipes
* Removes a Recipe, can also remove config recipes.
* One of the things one might need to do after reloading.
*
* @param name Name of the Recipe to remove
* @return The Recipe that was removed, null if none was removed
@@ -27,8 +25,8 @@ public class ConfigLoadEvent extends Event {
}
/**
* One of the things one might need to do after reloading
* Removes a Cauldron Recipe, can also remove config recipes
* Removes a Cauldron Recipe, can also remove config recipes.
* One of the things one might need to do after reloading.
*
* @param name Name of the Cauldron Recipe to remove
* @return The Cauldron Recipe that was removed, null if none was removed
@@ -15,9 +15,9 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Player adding an ingredient to a cauldron
* Always one item added at a time
* If needed use the caudrons add method to manually add more Items
* Player adding an ingredient to a cauldron.
* <p>Always one item added at a time.
* <p>If needed use the caudrons add method to manually add more Items
*/
public class IngedientAddEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -46,17 +46,17 @@ public class IngedientAddEvent extends PlayerEvent implements Cancellable {
/**
* The Recipe item that matches the ingredient.
* This might not be the only recipe item that will match the ingredient
* Will be recalculated if the Ingredient is changed with the setIngredient Method
* <p>This might not be the only recipe item that will match the ingredient
* <p>Will be recalculated if the Ingredient is changed with the setIngredient Method
*/
public RecipeItem getRecipeItem() {
return rItem;
}
/**
* Get the item currently being added to the cauldron by the player
* Can be changed directly (mutable) or with the setter Method
* The amount is ignored and always one added
* Get the item currently being added to the cauldron by the player.
* <p>Can be changed directly (mutable) or with the setter Method
* <p>The amount is ignored and always one added
*
* @return The item being added
*/
@@ -65,10 +65,10 @@ public class IngedientAddEvent extends PlayerEvent implements Cancellable {
}
/**
* Set the ingredient added to the cauldron to something else
* Will always be accepted, even when not in a recipe or the cooked lis
* The amount is ignored and always one added
* This also recalculates the recipeItem!
* Set the ingredient added to the cauldron to something else.
* <p>Will always be accepted, even when not in a recipe or the cooked lis
* <p>The amount is ignored and always one added
* <p>This also recalculates the recipeItem!
*
* @param ingredient The item to add instead
*/
@@ -79,15 +79,15 @@ public class IngedientAddEvent extends PlayerEvent implements Cancellable {
}
/**
* If the amount of the item in the players hand should be decreased
* Default true
* If the amount of the item in the players hand should be decreased.
* (Default true)
*/
public boolean willTakeItem() {
return takeItem;
}
/**
* Set if the amount of the item in the players hand should be decreased
* Set if the amount of the item in the players hand should be decreased.
*
* @param takeItem if the item amount in the hand should be decreased
*/
@@ -96,8 +96,8 @@ public class IngedientAddEvent extends PlayerEvent implements Cancellable {
}
/**
* Get the BlockData of the Cauldron
* May be null if the Cauldron does not exist anymore
* Get the BlockData of the Cauldron.
* <p>May be null if the Cauldron does not exist anymore
*
* @return The BlockData of the cauldron
*/
@@ -111,9 +111,9 @@ public class IngedientAddEvent extends PlayerEvent implements Cancellable {
}
/**
* Get the water fill level of the Cauldron
* 0 = empty, 1 = something in, 2 = full
* Can use BCauldron.EMPTY, BCauldron.SOME, BCauldron.FULL
* Get the water fill level of the Cauldron.
* <p>0 = empty, 1 = something in, 2 = full
* <p>Can use BCauldron.EMPTY, BCauldron.SOME, BCauldron.FULL
*
* @return The fill level as a byte 0-2
*/
@@ -127,7 +127,7 @@ public class IngedientAddEvent extends PlayerEvent implements Cancellable {
}
/**
* If the event is cancelled, no item will be added or taken from the player
* If the event is cancelled, no item will be added or taken from the player.
*/
@Override
public void setCancelled(boolean cancelled) {
@@ -13,7 +13,7 @@ import java.util.Objects;
/**
* The Player writes something in Chat or on a Sign and his words are distorted.
*
* This Event may be Async if the Chat Event is Async!
* <p>This Event may be Async if the Chat Event is Async!
*/
public class PlayerChatDistortEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -11,8 +11,9 @@ import java.util.List;
/**
* A List of effects is applied to the player.
* This happens for various reasons like Alcohol level, Brew quality, Brew effects, etc.
* Can be changed or cancelled
* <p>This happens for various reasons like Alcohol level, Brew quality, Brew effects, etc.
*
* <p>Can be changed or cancelled
*/
public class PlayerEffectEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -38,7 +39,7 @@ public class PlayerEffectEvent extends PlayerEvent implements Cancellable {
}
/**
* @return What type of effects are applied, sie EffectType
* @return What type of effects are applied, see EffectType
*/
public EffectType getEffectType() {
return effectType;
@@ -66,27 +67,30 @@ public class PlayerEffectEvent extends PlayerEvent implements Cancellable {
}
/**
* The Type of Effect, or why an effect is being added to the player.
*/
public enum EffectType {
/**
* The Alcohol level demands its toll.
* Regularly applied depending on the players alcohol level
* By default it is just one Confusion effect
* <p>Regularly applied depending on the players alcohol level
* <p>By default it is just one Confusion effect
*/
ALCOHOL,
/**
* Effects of a Brew are applied to the player (drinking the Brew)
* These depend on alcohol and quality of the brew
* Effects of a Brew are applied to the player (drinking the Brew).
* <p>These depend on alcohol and quality of the brew
*/
DRINK,
/**
* When drinking a Brew with low Quality, these effects are applied
* When drinking a Brew with low Quality, these effects are applied.
*/
QUALITY,
/**
* When logging in after drinking, Hangover Effects are applied
* When logging in after drinking, Hangover Effects are applied.
*/
HANGOVER
@@ -8,9 +8,9 @@ import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.NotNull;
/**
* The player pukes (throws puke items to the ground)
* Those items can never be picked up and despawn after the time set in the config
* Number of items to drop can be changed with count
* The player pukes (throws puke items to the ground).
* <p>Those items can never be picked up and despawn after the time set in the config
* <p>Number of items to drop can be changed with count
*/
public class PlayerPukeEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -25,14 +25,14 @@ public class PlayerPukeEvent extends PlayerEvent implements Cancellable {
}
/**
* @return The Amount of items being dropped this time
* Get the Amount of items being dropped this time
*/
public int getCount() {
return count;
}
/**
* @param count Set the amount of items being dropped this time
* Set the amount of items being dropped this time
*/
public void setCount(int count) {
this.count = count;
@@ -9,9 +9,9 @@ import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
/**
* The Players movement is hindered because of drunkeness
* Called each time before pushing the Player with the Vector push 10 times
* The Push Vector can be changed or multiplied
* The Players movement is hindered because of drunkeness.
* <p>Called each time before pushing the Player with the Vector push 10 times
* <p>The Push Vector can be changed or multiplied
*/
public class PlayerPushEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -29,12 +29,9 @@ public class PlayerPushEvent extends PlayerEvent implements Cancellable {
return bPlayer;
}
// The Vector in which direction and magnitude the player is Pushed
// Can be changed directly or through setPush
/**
* Get the Vector in which direction and magnitude the player is pushed
* Can be changed directly or through setPush
* Get the Vector in which direction and magnitude the player is pushed.
* <p>Can be changed directly or through setPush
*
* @return The current push vector
*/
@@ -43,7 +40,7 @@ public class PlayerPushEvent extends PlayerEvent implements Cancellable {
}
/**
* Set the Push vector
* Set the Push vector.
*
* @param push The new push vector, not null
*/
@@ -8,9 +8,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A Player opens a Barrel by rightclicking it
* The PlayerInteractEvent on the Barrel may be cancelled. In that case this never gets called
* Can be cancelled to silently deny opening the Barrel
* A Player opens a Barrel by rightclicking it.
* <p>The PlayerInteractEvent on the Barrel may be cancelled. In that case this never gets called
* <p>Can be cancelled to silently deny opening the Barrel
*/
public class BarrelAccessEvent extends BarrelEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -26,7 +26,7 @@ public class BarrelAccessEvent extends BarrelEvent implements Cancellable {
/**
* Gets the Block that was actually clicked.
* For access Permissions getSpigot() should be used
* <p>For access Permissions getSpigot() should be used
*/
public Block getClickedBlock() {
return clickedBlock;
@@ -7,8 +7,8 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* Called when a Barrel is created by a Player by placing a Sign
* Cancelling this will silently fail the Barrel creation
* Called when a Barrel is created by a Player by placing a Sign.
* <p>Cancelling this will silently fail the Barrel creation
*/
public class BarrelCreateEvent extends BarrelEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -9,10 +9,10 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* A Barrel is being destroyed by something, may not be by a Player
* A BarrelRemoveEvent will be called after this, if this is not cancelled
* Use the BarrelRemoveEvent to monitor any and all barrels being removed in a non cancellable way
* Cancelling the Event will stop the barrel from being destroyed
* A Barrel is being destroyed by something, may not be by a Player.
* <p>A BarrelRemoveEvent will be called after this, if this is not cancelled
* <p>Use the BarrelRemoveEvent to monitor any and all barrels being removed in a non cancellable way
* <p>Cancelling the Event will stop the barrel from being destroyed
*/
public class BarrelDestroyEvent extends BarrelEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -82,6 +82,9 @@ public class BarrelDestroyEvent extends BarrelEvent implements Cancellable {
return handlers;
}
/**
* The Reason why the Barrel is being destroyed.
*/
public enum Reason {
/**
* A Player Broke the Barrel
@@ -5,7 +5,8 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
* A Barrel is being removed. There may have been a BarrelDestroyEvent before this
* A Barrel is being removed.
* <p>There may have been a BarrelDestroyEvent before this.
* If not, Worldedit, other Plugins etc may be the cause for unexpected removal
*/
public class BarrelRemoveEvent extends BarrelEvent {
@@ -9,9 +9,9 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
/**
* A Player Drinks a Brew
* The amount of alcohol and quality that will be added to the player can be get/set here
* If cancelled the drinking will fail silently
* A Player Drinks a Brew.
* <p>The amount of alcohol and quality that will be added to the player can be get/set here
* <p>If cancelled the drinking will fail silently
*/
public class BrewDrinkEvent extends BrewEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -19,6 +19,9 @@ public abstract class BrewEvent extends Event {
return brew;
}
/**
* Gets the Meta of the Item this Brew is attached to
*/
@NotNull
public ItemMeta getItemMeta() {
return meta;
@@ -9,10 +9,10 @@ import org.bukkit.inventory.meta.PotionMeta;
import org.jetbrains.annotations.NotNull;
/**
* A Brew has been created or modified
* Usually happens on Filling from cauldron, distilling and aging.
* Modifications to the Brew or the PotionMeta can be done now
* Cancelling reverts the Brew to the state it was before the modification
* A Brew has been created or modified.
* <p>Usually happens on filling from cauldron, distilling and aging.
* <p>Modifications to the Brew or the PotionMeta can be done now
* <p>Cancelling reverts the Brew to the state it was before the modification
*/
public class BrewModifyEvent extends BrewEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -25,11 +25,17 @@ public class BrewModifyEvent extends BrewEvent implements Cancellable {
this.type = type;
}
/**
* Get the Type of modification being applied to the Brew.
*/
@NotNull
public Type getType() {
return type;
}
/**
* Get the BrewLore to modify lore on the Brew
*/
@NotNull
public BrewLore getLore() {
return new BrewLore(getBrew(), (PotionMeta) getItemMeta());
@@ -42,7 +48,7 @@ public class BrewModifyEvent extends BrewEvent implements Cancellable {
/**
* Setting the Event cancelled cancels all modificatons to the brew.
* Modifications to the Brew or ItemMeta will not be applied
* <p>Modifications to the Brew or ItemMeta will not be applied
*/
@Override
public void setCancelled(boolean cancelled) {
@@ -60,13 +66,44 @@ public class BrewModifyEvent extends BrewEvent implements Cancellable {
return handlers;
}
/**
* The Type of Modification being applied to the Brew.
*/
public enum Type {
CREATE, // A new Brew is created with arbitrary ways, like the create command
FILL, // Filled from a Cauldron into a new Brew
DISTILL, // Distilled in the Brewing stand
AGE, // Aged in a Barrel
UNLABEL, // Unlabeling Brew with command
STATIC, // Making Brew static with command
UNKNOWN // Unknown modification, unused
/**
* A new Brew is created with arbitrary ways, like the create command.
* <p>Cancelling this will disallow the creation
*/
CREATE,
/**
* Filled from a Cauldron into a new Brew.
*/
FILL,
/**
* Distilled in the Brewing stand.
*/
DISTILL,
/**
* Aged in a Barrel.
*/
AGE,
/**
* Unlabeling Brew with command.
*/
UNLABEL,
/**
* Making Brew static with command.
*/
STATIC,
/**
* Unknown modification, unused.
*/
UNKNOWN
}
}