geforkt von Mirrors/Paper
Javadoc updates
Fixes BUKKIT-1653, Fixes BUKKIT-1383 and Fixes BUKKIT-1644 By: feildmaster <admin@feildmaster.com>
Dieser Commit ist enthalten in:
Ursprung
3b35e0472d
Commit
03af91781c
@ -64,7 +64,7 @@ public enum Effect {
|
||||
*/
|
||||
SMOKE(2000, Type.VISUAL, BlockFace.class),
|
||||
/**
|
||||
* Visual effect of a block breaking. Needs block ID as additional info.
|
||||
* Sound of a block breaking. Needs block ID as additional info.
|
||||
*/
|
||||
STEP_SOUND(2001, Type.SOUND, Material.class),
|
||||
/**
|
||||
|
@ -16,28 +16,28 @@ public enum EntityEffect {
|
||||
|
||||
/**
|
||||
* When a mob dies.
|
||||
* <p>
|
||||
* <p />
|
||||
* <b>This will cause client-glitches!
|
||||
*/
|
||||
DEATH(3),
|
||||
|
||||
/**
|
||||
* The smoke when taming a wolf fails.
|
||||
* <p>
|
||||
* <p />
|
||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||
*/
|
||||
WOLF_SMOKE(6),
|
||||
|
||||
/**
|
||||
* The hearts when taming a wolf succeeds.
|
||||
* <p>
|
||||
* <p />
|
||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||
*/
|
||||
WOLF_HEARTS(7),
|
||||
|
||||
/**
|
||||
* When a wolf shakes (after being wet).
|
||||
* <p>
|
||||
* <p />
|
||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||
*/
|
||||
WOLF_SHAKE(8),
|
||||
|
@ -50,7 +50,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
|
||||
/**
|
||||
* Gets a {@link Player} object that this represents, if there is one
|
||||
* <p>
|
||||
* <p />
|
||||
* If the player is online, this will return that player. Otherwise,
|
||||
* it will return null.
|
||||
*
|
||||
@ -60,7 +60,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
|
||||
/**
|
||||
* Gets the first date and time that this player was witnessed on this server.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the player has never played before, this will return 0. Otherwise, it will be
|
||||
* the amount of milliseconds since midnight, January 1, 1970 UTC.
|
||||
*
|
||||
@ -70,7 +70,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
|
||||
/**
|
||||
* Gets the last date and time that this player was witnessed on this server.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the player has never played before, this will return 0. Otherwise, it will be
|
||||
* the amount of milliseconds since midnight, January 1, 1970 UTC.
|
||||
*
|
||||
|
@ -304,7 +304,7 @@ public interface Server extends PluginMessageRecipient {
|
||||
|
||||
/**
|
||||
* Creates or loads a world with the given name using the specified options.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the world is already loaded, it will just return the equivalent of
|
||||
* getWorld(creator.name()).
|
||||
*
|
||||
|
@ -430,7 +430,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
* Sets the relative in-game time on the server.
|
||||
* <p />
|
||||
* The relative time is analogous to hours * 1000
|
||||
* <br /><br />
|
||||
* <p />
|
||||
* Note that setting the relative time below the current relative time will
|
||||
* actually move the clock forward a day. If you require to rewind time, please
|
||||
* see setFullTime
|
||||
@ -450,7 +450,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
||||
|
||||
/**
|
||||
* Sets the in-game time on the server
|
||||
* <br /><br />
|
||||
* <p />
|
||||
* Note that this sets the full time of the world, which may cause adverse
|
||||
* effects such as breaking redstone clocks and any scheduled events
|
||||
*
|
||||
|
@ -140,7 +140,7 @@ public class WorldCreator {
|
||||
|
||||
/**
|
||||
* Gets the generator that will be used to create or load the world.
|
||||
* <p>
|
||||
* <p />
|
||||
* This may be null, in which case the "natural" generator for this environment
|
||||
* will be used.
|
||||
*
|
||||
@ -152,7 +152,7 @@ public class WorldCreator {
|
||||
|
||||
/**
|
||||
* Sets the generator that will be used to create or load the world.
|
||||
* <p>
|
||||
* <p />
|
||||
* This may be null, in which case the "natural" generator for this environment
|
||||
* will be used.
|
||||
*
|
||||
@ -167,10 +167,10 @@ public class WorldCreator {
|
||||
|
||||
/**
|
||||
* Sets the generator that will be used to create or load the world.
|
||||
* <p>
|
||||
* <p />
|
||||
* This may be null, in which case the "natural" generator for this environment
|
||||
* will be used.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the generator cannot be found for the given name, the natural environment generator
|
||||
* will be used instead and a warning will be printed to the console.
|
||||
*
|
||||
@ -185,10 +185,10 @@ public class WorldCreator {
|
||||
|
||||
/**
|
||||
* Sets the generator that will be used to create or load the world.
|
||||
* <p>
|
||||
* <p />
|
||||
* This may be null, in which case the "natural" generator for this environment
|
||||
* will be used.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the generator cannot be found for the given name, the natural environment generator
|
||||
* will be used instead and a warning will be printed to the specified output
|
||||
*
|
||||
@ -225,7 +225,7 @@ public class WorldCreator {
|
||||
|
||||
/**
|
||||
* Creates a world with the specified options.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the world already exists, it will be loaded from disk and some options
|
||||
* may be ignored.
|
||||
*
|
||||
@ -247,10 +247,10 @@ public class WorldCreator {
|
||||
|
||||
/**
|
||||
* Attempts to get the {@link ChunkGenerator} with the given name.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the generator is not found, null will be returned and a message will be
|
||||
* printed to the specified {@link CommandSender} explaining why.
|
||||
* <p>
|
||||
* <p />
|
||||
* The name must be in the "plugin:id" notation, or optionally just "plugin",
|
||||
* where "plugin" is the safe-name of a plugin and "id" is an optional unique
|
||||
* identifier for the generator you wish to request from the plugin.
|
||||
|
@ -35,8 +35,8 @@ public interface Block extends Metadatable {
|
||||
Block getRelative(int modX, int modY, int modZ);
|
||||
|
||||
/**
|
||||
* Gets the block at the given face<br />
|
||||
* <br />
|
||||
* Gets the block at the given face
|
||||
* <p />
|
||||
* This method is equal to getRelative(face, 1)
|
||||
*
|
||||
* @param face Face of this block to return
|
||||
@ -46,14 +46,14 @@ public interface Block extends Metadatable {
|
||||
Block getRelative(BlockFace face);
|
||||
|
||||
/**
|
||||
* Gets the block at the given distance of the given face<br />
|
||||
* <br />
|
||||
* Gets the block at the given distance of the given face
|
||||
* <p />
|
||||
* For example, the following method places water at 100,102,100; two blocks
|
||||
* above 100,100,100.
|
||||
*
|
||||
* <pre>
|
||||
* Block block = world.getBlockAt(100, 100, 100);
|
||||
* Block shower = block.getFace(BlockFace.UP, 2);
|
||||
* Block shower = block.getRelative(BlockFace.UP, 2);
|
||||
* shower.setType(Material.WATER);
|
||||
* </pre>
|
||||
*
|
||||
@ -86,7 +86,7 @@ public interface Block extends Metadatable {
|
||||
|
||||
/**
|
||||
* Get the amount of light at this block from the sky.
|
||||
* <p>
|
||||
* <p />
|
||||
* Any light given from other sources (such as blocks like torches) will be ignored.
|
||||
*
|
||||
* @return Sky light level
|
||||
@ -95,7 +95,7 @@ public interface Block extends Metadatable {
|
||||
|
||||
/**
|
||||
* Get the amount of light at this block from nearby blocks.
|
||||
* <p>
|
||||
* <p />
|
||||
* Any light given from other sources (such as the sun) will be ignored.
|
||||
*
|
||||
* @return Block light level
|
||||
@ -194,17 +194,15 @@ public interface Block extends Metadatable {
|
||||
boolean setTypeIdAndData(int type, byte data, boolean applyPhysics);
|
||||
|
||||
/**
|
||||
* Gets the face relation of this block compared to the given block<br />
|
||||
* <br />
|
||||
* Gets the face relation of this block compared to the given block
|
||||
* <p />
|
||||
* For example:
|
||||
*
|
||||
* <pre>
|
||||
* Block current = world.getBlockAt(100, 100, 100);
|
||||
* Block target = world.getBlockAt(100, 101, 100);
|
||||
*
|
||||
* current.getFace(target) == BlockFace.Up;
|
||||
* </pre>
|
||||
*
|
||||
* <br />
|
||||
* If the given block is not connected to this block, null may be returned
|
||||
*
|
||||
|
@ -6,8 +6,8 @@ package org.bukkit.block;
|
||||
public interface Dispenser extends BlockState, ContainerBlock {
|
||||
|
||||
/**
|
||||
* Attempts to dispense the contents of this block<br />
|
||||
* <br />
|
||||
* Attempts to dispense the contents of this block
|
||||
* <p />
|
||||
* If the block is no longer a dispenser, this will return false
|
||||
*
|
||||
* @return true if successful, otherwise false
|
||||
|
@ -37,8 +37,8 @@ public interface NoteBlock extends BlockState {
|
||||
public void setRawNote(byte note);
|
||||
|
||||
/**
|
||||
* Attempts to play the note at block<br />
|
||||
* <br />
|
||||
* Attempts to play the note at block
|
||||
* <p />
|
||||
* If the block is no longer a note block, this will return false
|
||||
*
|
||||
* @return true if successful, otherwise false
|
||||
|
@ -8,11 +8,11 @@ import java.util.Map;
|
||||
public interface Configuration extends ConfigurationSection {
|
||||
/**
|
||||
* Sets the default value of the given path as provided.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no source {@link Configuration} was provided as a default collection,
|
||||
* then a new {@link MemoryConfiguration} will be created to hold the new default
|
||||
* value.
|
||||
* <p>
|
||||
* <p />
|
||||
* If value is null, the value will be removed from the default Configuration source.
|
||||
*
|
||||
* @param path Path of the value to set.
|
||||
@ -23,7 +23,7 @@ public interface Configuration extends ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Sets the default values of the given paths as provided.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no source {@link Configuration} was provided as a default collection,
|
||||
* then a new {@link MemoryConfiguration} will be created to hold the new default
|
||||
* values.
|
||||
@ -35,11 +35,11 @@ public interface Configuration extends ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Sets the default values of the given paths as provided.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no source {@link Configuration} was provided as a default collection,
|
||||
* then a new {@link MemoryConfiguration} will be created to hold the new default
|
||||
* value.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will not hold a reference to the specified Configuration, nor will it
|
||||
* automatically update if that Configuration ever changes. If you require this,
|
||||
* you should set the default source with {@link #setDefaults(org.bukkit.configuration.Configuration)}.
|
||||
@ -51,7 +51,7 @@ public interface Configuration extends ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Sets the source of all default values for this {@link Configuration}.
|
||||
* <p>
|
||||
* <p />
|
||||
* If a previous source was set, or previous default values were defined, then they will
|
||||
* not be copied to the new source.
|
||||
*
|
||||
@ -62,7 +62,7 @@ public interface Configuration extends ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the source {@link Configuration} for this configuration.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no configuration source was set, but default values were added, then a
|
||||
* {@link MemoryConfiguration} will be returned. If no source was set and no
|
||||
* defaults were set, then this method will return null.
|
||||
@ -73,7 +73,7 @@ public interface Configuration extends ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the {@link ConfigurationOptions} for this {@link Configuration}.
|
||||
* <p>
|
||||
* <p />
|
||||
* All setters through this method are chainable.
|
||||
*
|
||||
* @return Options for this configuration
|
||||
|
@ -23,7 +23,7 @@ public class ConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Gets the char that will be used to separate {@link ConfigurationSection}s
|
||||
* <p>
|
||||
* <p />
|
||||
* This value does not affect how the {@link Configuration} is stored, only in
|
||||
* how you access the data. The default value is '.'.
|
||||
*
|
||||
@ -35,7 +35,7 @@ public class ConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Sets the char that will be used to separate {@link ConfigurationSection}s
|
||||
* <p>
|
||||
* <p />
|
||||
* This value does not affect how the {@link Configuration} is stored, only in
|
||||
* how you access the data. The default value is '.'.
|
||||
*
|
||||
@ -49,7 +49,7 @@ public class ConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Checks if the {@link Configuration} should copy values from its default {@link Configuration} directly.
|
||||
* <p>
|
||||
* <p />
|
||||
* If this is true, all values in the default Configuration will be directly copied,
|
||||
* making it impossible to distinguish between values that were set and values that
|
||||
* are provided by default. As a result, {@link ConfigurationSection#contains(java.lang.String)} will always
|
||||
@ -64,7 +64,7 @@ public class ConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Sets if the {@link Configuration} should copy values from its default {@link Configuration} directly.
|
||||
* <p>
|
||||
* <p />
|
||||
* If this is true, all values in the default Configuration will be directly copied,
|
||||
* making it impossible to distinguish between values that were set and values that
|
||||
* are provided by default. As a result, {@link ConfigurationSection#contains(java.lang.String)} will always
|
||||
|
@ -13,11 +13,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
public interface ConfigurationSection {
|
||||
/**
|
||||
* Gets a set containing all keys in this section.
|
||||
* <p>
|
||||
* <p />
|
||||
* If deep is set to true, then this will contain all the keys within any child
|
||||
* {@link ConfigurationSection}s (and their children, etc). These will be in a
|
||||
* valid path notation for you to use.
|
||||
* <p>
|
||||
* <p />
|
||||
* If deep is set to false, then this will contain only the keys of any direct children,
|
||||
* and not their own children.
|
||||
*
|
||||
@ -28,11 +28,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets a Map containing all keys and their values for this section.
|
||||
* <p>
|
||||
* <p />
|
||||
* If deep is set to true, then this will contain all the keys and values within
|
||||
* any child {@link ConfigurationSection}s (and their children, etc). These
|
||||
* keys will be in a valid path notation for you to use.
|
||||
* <p>
|
||||
* <p />
|
||||
* If deep is set to false, then this will contain only the keys and values of any
|
||||
* direct children, and not their own children.
|
||||
*
|
||||
@ -43,7 +43,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if this {@link ConfigurationSection} contains the given path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the value for the requested path does not exist but a default value has
|
||||
* been specified, this will return true.
|
||||
*
|
||||
@ -55,7 +55,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if this {@link ConfigurationSection} has a value set for the given path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the value for the requested path does not exist but a default value has
|
||||
* been specified, this will still return false.
|
||||
*
|
||||
@ -67,12 +67,12 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the path of this {@link ConfigurationSection} from its root {@link Configuration}
|
||||
* <p>
|
||||
* <p />
|
||||
* For any {@link Configuration} themselves, this will return an empty string.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the section is no longer contained within its root for any reason, such as
|
||||
* being replaced with a different value, this may return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* To retrieve the single name of this section, that is, the final part of the path
|
||||
* returned by this method, you may use {@link #getName()}.
|
||||
*
|
||||
@ -82,7 +82,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the name of this individual {@link ConfigurationSection}, in the path.
|
||||
* <p>
|
||||
* <p />
|
||||
* This will always be the final part of {@link #getCurrentPath()}, unless the
|
||||
* section is orphaned.
|
||||
*
|
||||
@ -92,9 +92,9 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the root {@link Configuration} that contains this {@link ConfigurationSection}
|
||||
* <p>
|
||||
* <p />
|
||||
* For any {@link Configuration} themselves, this will return its own object.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the section is no longer contained within its root for any reason, such as
|
||||
* being replaced with a different value, this may return null.
|
||||
*
|
||||
@ -105,9 +105,9 @@ public interface ConfigurationSection {
|
||||
/**
|
||||
* Gets the parent {@link ConfigurationSection} that directly contains this
|
||||
* {@link ConfigurationSection}.
|
||||
* <p>
|
||||
* <p />
|
||||
* For any {@link Configuration} themselves, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the section is no longer contained within its parent for any reason, such as
|
||||
* being replaced with a different value, this may return null.
|
||||
*
|
||||
@ -117,7 +117,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested Object by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the Object does not exist but a default value has been specified, this
|
||||
* will return the default value. If the Object does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -129,7 +129,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested Object by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the Object does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -141,10 +141,10 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Sets the specified path to the given value.
|
||||
* <p>
|
||||
* <p />
|
||||
* If value is null, the entry will be removed. Any existing entry will be
|
||||
* replaced, regardless of what the new value is.
|
||||
* <p>
|
||||
* <p />
|
||||
* Some implementations may have limitations on what you may store. See their
|
||||
* individual javadocs for details. No implementations should allow you to store
|
||||
* {@link Configuration}s or {@link ConfigurationSection}s, please use
|
||||
@ -157,7 +157,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Creates an empty {@link ConfigurationSection} at the specified path.
|
||||
* <p>
|
||||
* <p />
|
||||
* Any value that was previously set at this path will be overwritten. If the
|
||||
* previous value was itself a {@link ConfigurationSection}, it will be orphaned.
|
||||
*
|
||||
@ -168,7 +168,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Creates a {@link ConfigurationSection} at the specified path, with specified values.
|
||||
* <p>
|
||||
* <p />
|
||||
* Any value that was previously set at this path will be overwritten. If the
|
||||
* previous value was itself a {@link ConfigurationSection}, it will be orphaned.
|
||||
*
|
||||
@ -181,7 +181,7 @@ public interface ConfigurationSection {
|
||||
// Primitives
|
||||
/**
|
||||
* Gets the requested String by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the String does not exist but a default value has been specified, this
|
||||
* will return the default value. If the String does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -193,7 +193,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested String by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the String does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -205,7 +205,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a String.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a String, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a String and return
|
||||
@ -218,10 +218,10 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested int by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the int does not exist but a default value has been specified, this
|
||||
* will return the default value. If the int does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* value was specified, this will return 0.
|
||||
*
|
||||
* @param path Path of the int to get.
|
||||
* @return Requested int.
|
||||
@ -230,7 +230,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested int by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the int does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -242,7 +242,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is an int.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a int, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a int and return
|
||||
@ -255,7 +255,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested boolean by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the boolean does not exist but a default value has been specified, this
|
||||
* will return the default value. If the boolean does not exist and no default
|
||||
* value was specified, this will return false.
|
||||
@ -267,7 +267,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested boolean by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the boolean does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -279,7 +279,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a boolean.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a boolean, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a boolean and return
|
||||
@ -292,7 +292,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested double by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the double does not exist but a default value has been specified, this
|
||||
* will return the default value. If the double does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -304,7 +304,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested double by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the double does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -316,7 +316,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a double.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a double, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a double and return
|
||||
@ -329,7 +329,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested long by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the long does not exist but a default value has been specified, this
|
||||
* will return the default value. If the long does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -341,7 +341,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested long by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the long does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -353,7 +353,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a long.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a long, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a long and return
|
||||
@ -367,7 +367,7 @@ public interface ConfigurationSection {
|
||||
// Java
|
||||
/**
|
||||
* Gets the requested List by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -379,7 +379,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -391,7 +391,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a List.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a List, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a List and return
|
||||
@ -404,11 +404,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of String by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a String if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -419,11 +419,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Integer by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Integer if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -434,11 +434,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Boolean by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Boolean if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -449,11 +449,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Double by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Double if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -464,11 +464,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Float by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Float if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -479,11 +479,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Long by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Long if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -494,11 +494,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Byte by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Byte if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -509,11 +509,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Character by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Character if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -524,11 +524,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Short by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Short if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -539,11 +539,11 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested List of Maps by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the List does not exist but a default value has been specified, this
|
||||
* will return the default value. If the List does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method will attempt to cast any values into a Map if possible, but may
|
||||
* miss any values out if they are not compatible.
|
||||
*
|
||||
@ -555,7 +555,7 @@ public interface ConfigurationSection {
|
||||
// Bukkit
|
||||
/**
|
||||
* Gets the requested Vector by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the Vector does not exist but a default value has been specified, this
|
||||
* will return the default value. If the Vector does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -567,7 +567,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested {@link Vector} by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the Vector does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -579,7 +579,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a Vector.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a Vector, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a Vector and return
|
||||
@ -592,7 +592,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested OfflinePlayer by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the OfflinePlayer does not exist but a default value has been specified, this
|
||||
* will return the default value. If the OfflinePlayer does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -604,7 +604,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested {@link OfflinePlayer} by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the OfflinePlayer does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -616,7 +616,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is an OfflinePlayer.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a OfflinePlayer, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a OfflinePlayer and return
|
||||
@ -629,7 +629,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested ItemStack by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the ItemStack does not exist but a default value has been specified, this
|
||||
* will return the default value. If the ItemStack does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -641,7 +641,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested {@link ItemStack} by path, returning a default value if not found.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the ItemStack does not exist then the specified default value will returned
|
||||
* regardless of if a default has been identified in the root {@link Configuration}.
|
||||
*
|
||||
@ -653,7 +653,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is an ItemStack.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a ItemStack, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a ItemStack and return
|
||||
@ -666,7 +666,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the requested ConfigurationSection by path.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the ConfigurationSection does not exist but a default value has been specified, this
|
||||
* will return the default value. If the ConfigurationSection does not exist and no default
|
||||
* value was specified, this will return null.
|
||||
@ -678,7 +678,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Checks if the specified path is a ConfigurationSection.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the path exists but is not a ConfigurationSection, this will return false. If the path does not
|
||||
* exist, this will return false. If the path does not exist but a default value
|
||||
* has been specified, this will check if that default value is a ConfigurationSection and return
|
||||
@ -691,7 +691,7 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Gets the equivalent {@link ConfigurationSection} from the default {@link Configuration} defined in {@link #getRoot()}.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the root contains no defaults, or the defaults doesn't contain a value
|
||||
* for this path, or the value at this path is not a {@link ConfigurationSection} then
|
||||
* this will return null.
|
||||
@ -702,13 +702,13 @@ public interface ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Sets the default value in the root at the given path as provided.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no source {@link Configuration} was provided as a default collection,
|
||||
* then a new {@link MemoryConfiguration} will be created to hold the new default
|
||||
* value.
|
||||
* <p>
|
||||
* <p />
|
||||
* If value is null, the value will be removed from the default Configuration source.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the value as returned by {@link #getDefaultSection()} is null,
|
||||
* then this will create a new section at the path, replacing anything that
|
||||
* may have existed there previously.
|
||||
|
@ -24,7 +24,7 @@ public class MemorySection implements ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Creates an empty MemorySection for use as a root {@link Configuration} section.
|
||||
* <p>
|
||||
* <p />
|
||||
* Note that calling this without being yourself a {@link Configuration} will throw an
|
||||
* exception!
|
||||
*
|
||||
@ -728,7 +728,7 @@ public class MemorySection implements ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Creates a full path to the given {@link ConfigurationSection} from its root {@link Configuration}.
|
||||
* <p>
|
||||
* <p />
|
||||
* You may use this method for any given {@link ConfigurationSection}, not only {@link MemorySection}.
|
||||
*
|
||||
* @param section Section to create a path for.
|
||||
@ -741,7 +741,7 @@ public class MemorySection implements ConfigurationSection {
|
||||
|
||||
/**
|
||||
* Creates a relative path to the given {@link ConfigurationSection} from the given relative section.
|
||||
* <p>
|
||||
* <p />
|
||||
* You may use this method for any given {@link ConfigurationSection}, not only {@link MemorySection}.
|
||||
*
|
||||
* @param section Section to create a path for.
|
||||
|
@ -38,7 +38,7 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Saves this {@link FileConfiguration} to the specified location.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the file does not exist, it will be created. If already exists, it will
|
||||
* be overwritten. If it cannot be overwritten or created, an exception will be thrown.
|
||||
*
|
||||
@ -64,7 +64,7 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Saves this {@link FileConfiguration} to the specified location.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the file does not exist, it will be created. If already exists, it will
|
||||
* be overwritten. If it cannot be overwritten or created, an exception will be thrown.
|
||||
*
|
||||
@ -87,10 +87,10 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Loads this {@link FileConfiguration} from the specified location.
|
||||
* <p>
|
||||
* <p />
|
||||
* All the values contained within this configuration will be removed, leaving
|
||||
* only settings and defaults, and the new values will be loaded from the given file.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the file cannot be loaded for any reason, an exception will be thrown.
|
||||
*
|
||||
* @param file File to load from.
|
||||
@ -107,7 +107,7 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Loads this {@link FileConfiguration} from the specified stream.
|
||||
* <p>
|
||||
* <p />
|
||||
* All the values contained within this configuration will be removed, leaving
|
||||
* only settings and defaults, and the new values will be loaded from the given stream.
|
||||
*
|
||||
@ -140,10 +140,10 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Loads this {@link FileConfiguration} from the specified location.
|
||||
* <p>
|
||||
* <p />
|
||||
* All the values contained within this configuration will be removed, leaving
|
||||
* only settings and defaults, and the new values will be loaded from the given file.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the file cannot be loaded for any reason, an exception will be thrown.
|
||||
*
|
||||
* @param file File to load from.
|
||||
@ -160,10 +160,10 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Loads this {@link FileConfiguration} from the specified string, as opposed to from file.
|
||||
* <p>
|
||||
* <p />
|
||||
* All the values contained within this configuration will be removed, leaving
|
||||
* only settings and defaults, and the new values will be loaded from the given string.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the string is invalid in any way, an exception will be thrown.
|
||||
*
|
||||
* @param contents Contents of a Configuration to load.
|
||||
@ -174,7 +174,7 @@ public abstract class FileConfiguration extends MemoryConfiguration {
|
||||
|
||||
/**
|
||||
* Compiles the header for this {@link FileConfiguration} and returns the result.
|
||||
* <p>
|
||||
* <p />
|
||||
* This will use the header from {@link #options()} -> {@link FileConfigurationOptions#header()},
|
||||
* respecting the rules of {@link FileConfigurationOptions#copyHeader()} if set.
|
||||
*
|
||||
|
@ -32,12 +32,12 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Gets the header that will be applied to the top of the saved output.
|
||||
* <p>
|
||||
* <p />
|
||||
* This header will be commented out and applied directly at the top of the
|
||||
* generated output of the {@link FileConfiguration}. It is not required to
|
||||
* include a newline at the end of the header as it will automatically be applied,
|
||||
* but you may include one if you wish for extra spacing.
|
||||
* <p>
|
||||
* <p />
|
||||
* Null is a valid value which will indicate that no header is to be applied.
|
||||
* The default value is null.
|
||||
*
|
||||
@ -49,12 +49,12 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Sets the header that will be applied to the top of the saved output.
|
||||
* <p>
|
||||
* <p />
|
||||
* This header will be commented out and applied directly at the top of the
|
||||
* generated output of the {@link FileConfiguration}. It is not required to
|
||||
* include a newline at the end of the header as it will automatically be applied,
|
||||
* but you may include one if you wish for extra spacing.
|
||||
* <p>
|
||||
* <p />
|
||||
* Null is a valid value which will indicate that no header is to be applied.
|
||||
*
|
||||
* @param value New header
|
||||
@ -67,15 +67,15 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Gets whether or not the header should be copied from a default source.
|
||||
* <p>
|
||||
* <p />
|
||||
* If this is true, if a default {@link FileConfiguration} is passed to
|
||||
* {@link FileConfiguration#setDefaults(org.bukkit.configuration.Configuration)}
|
||||
* then upon saving it will use the header from that config, instead of the one provided here.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no default is set on the configuration, or the default is not of type FileConfiguration,
|
||||
* or that config has no header ({@link #header()} returns null) then the header
|
||||
* specified in this configuration will be used.
|
||||
* <p>
|
||||
* <p />
|
||||
* Defaults to true.
|
||||
*
|
||||
* @return Whether or not to copy the header
|
||||
@ -86,15 +86,15 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Sets whether or not the header should be copied from a default source.
|
||||
* <p>
|
||||
* <p />
|
||||
* If this is true, if a default {@link FileConfiguration} is passed to
|
||||
* {@link FileConfiguration#setDefaults(org.bukkit.configuration.Configuration)}
|
||||
* then upon saving it will use the header from that config, instead of the one provided here.
|
||||
* <p>
|
||||
* <p />
|
||||
* If no default is set on the configuration, or the default is not of type FileConfiguration,
|
||||
* or that config has no header ({@link #header()} returns null) then the header
|
||||
* specified in this configuration will be used.
|
||||
* <p>
|
||||
* <p />
|
||||
* Defaults to true.
|
||||
*
|
||||
* @param value Whether or not to copy the header
|
||||
|
@ -19,6 +19,7 @@ import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
/**
|
||||
* An implementation of {@link Configuration} which saves all files in Yaml.
|
||||
* Note that this implementation is not synchronized.
|
||||
*/
|
||||
public class YamlConfiguration extends FileConfiguration {
|
||||
protected static final String COMMENT_PREFIX = "# ";
|
||||
@ -157,13 +158,13 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
|
||||
/**
|
||||
* Creates a new {@link YamlConfiguration}, loading from the given file.
|
||||
* <p>
|
||||
* <p />
|
||||
* Any errors loading the Configuration will be logged and then ignored.
|
||||
* If the specified input is not a valid config, a blank config will be returned.
|
||||
*
|
||||
* @param file Input file
|
||||
* @return Resulting configuration
|
||||
* @throws IllegalArgumentException Thrown is file is null
|
||||
* @throws IllegalArgumentException Thrown if file is null
|
||||
*/
|
||||
public static YamlConfiguration loadConfiguration(File file) {
|
||||
Validate.notNull(file, "File cannot be null");
|
||||
@ -184,13 +185,13 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
|
||||
/**
|
||||
* Creates a new {@link YamlConfiguration}, loading from the given stream.
|
||||
* <p>
|
||||
* <p />
|
||||
* Any errors loading the Configuration will be logged and then ignored.
|
||||
* If the specified input is not a valid config, a blank config will be returned.
|
||||
*
|
||||
* @param stream Input stream
|
||||
* @return Resulting configuration
|
||||
* @throws IllegalArgumentException Thrown is stream is null
|
||||
* @throws IllegalArgumentException Thrown if stream is null
|
||||
*/
|
||||
public static YamlConfiguration loadConfiguration(InputStream stream) {
|
||||
Validate.notNull(stream, "Stream cannot be null");
|
||||
|
@ -43,7 +43,7 @@ public class YamlConfigurationOptions extends FileConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Gets how much spaces should be used to indent each line.
|
||||
* <p>
|
||||
* <p />
|
||||
* The minimum value this may be is 2, and the maximum is 9.
|
||||
*
|
||||
* @return How much to indent by
|
||||
@ -54,7 +54,7 @@ public class YamlConfigurationOptions extends FileConfigurationOptions {
|
||||
|
||||
/**
|
||||
* Sets how much spaces should be used to indent each line.
|
||||
* <p>
|
||||
* <p />
|
||||
* The minimum value this may be is 2, and the maximum is 9.
|
||||
*
|
||||
* @param value New indent
|
||||
|
@ -4,7 +4,7 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* Represents an object that may be serialized.
|
||||
* <p>
|
||||
* <p />
|
||||
* These objects MUST implement one of the following, in addition to the methods
|
||||
* as defined by this interface:
|
||||
* <ul>
|
||||
@ -22,7 +22,7 @@ import java.util.Map;
|
||||
public interface ConfigurationSerializable {
|
||||
/**
|
||||
* Creates a Map representation of this class.
|
||||
* <p>
|
||||
* <p />
|
||||
* This class must provide a method to restore this class, as defined in the
|
||||
* {@link ConfigurationSerializable} interface javadocs.
|
||||
*
|
||||
|
@ -129,10 +129,10 @@ public class ConfigurationSerialization {
|
||||
|
||||
/**
|
||||
* Attempts to deserialize the given arguments into a new instance of the given class.
|
||||
* <p>
|
||||
* <p />
|
||||
* The class must implement {@link ConfigurationSerializable}, including the extra methods
|
||||
* as specified in the javadoc of ConfigurationSerializable.
|
||||
* <p>
|
||||
* <p />
|
||||
* If a new instance could not be made, an example being the class not fully implementing
|
||||
* the interface, null will be returned.
|
||||
*
|
||||
@ -146,10 +146,10 @@ public class ConfigurationSerialization {
|
||||
|
||||
/**
|
||||
* Attempts to deserialize the given arguments into a new instance of the given class.
|
||||
* <p>
|
||||
* <p />
|
||||
* The class must implement {@link ConfigurationSerializable}, including the extra methods
|
||||
* as specified in the javadoc of ConfigurationSerializable.
|
||||
* <p>
|
||||
* <p />
|
||||
* If a new instance could not be made, an example being the class not fully implementing
|
||||
* the interface, null will be returned.
|
||||
*
|
||||
|
@ -9,10 +9,10 @@ import java.lang.annotation.Target;
|
||||
* Represents an "alias" that a {@link ConfigurationSerializable} may be stored as.
|
||||
* If this is not present on a {@link ConfigurationSerializable} class, it will use the
|
||||
* fully qualified name of the class.
|
||||
* <p>
|
||||
* <p />
|
||||
* This value will be stored in the configuration so that the configuration deserialization
|
||||
* can determine what type it is.
|
||||
* <p>
|
||||
* <p />
|
||||
* Using this annotation on any other class than a {@link ConfigurationSerializable} will
|
||||
* have no effect.
|
||||
* @see ConfigurationSerialization#registerClass(Class, String)
|
||||
@ -22,7 +22,7 @@ import java.lang.annotation.Target;
|
||||
public @interface SerializableAs {
|
||||
/**
|
||||
* This is the name your class will be stored and retrieved as.
|
||||
* <p>
|
||||
* <p />
|
||||
* This name MUST be unique. We recommend using names such as "MyPluginThing" instead of
|
||||
* "Thing".
|
||||
*
|
||||
|
@ -15,6 +15,7 @@ public class ConversationContext {
|
||||
private Plugin plugin;
|
||||
|
||||
/**
|
||||
* @param plugin The owning plugin.
|
||||
* @param forWhom The subject of the conversation.
|
||||
* @param initialSessionData Any initial values to put in the sessionData map.
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ public class ConversationFactory {
|
||||
|
||||
/**
|
||||
* Constructs a ConversationFactory.
|
||||
* @param plugin The plugin that owns the factory.
|
||||
*/
|
||||
public ConversationFactory(Plugin plugin)
|
||||
{
|
||||
@ -178,7 +179,7 @@ public class ConversationFactory {
|
||||
for (ConversationCanceller canceller : cancellers) {
|
||||
conversation.addConversationCanceller(canceller.clone());
|
||||
}
|
||||
|
||||
|
||||
//Add the ConversationAbandonedListeners
|
||||
for (ConversationAbandonedListener listener : abandonedListeners) {
|
||||
conversation.addConversationAbandonedListener(listener);
|
||||
|
@ -12,7 +12,7 @@ public abstract class MessagePrompt implements Prompt{
|
||||
/**
|
||||
* Message prompts never wait for user input before continuing.
|
||||
* @param context Context information about the conversation.
|
||||
* @return
|
||||
* @return Always false.
|
||||
*/
|
||||
public boolean blocksForInput(ConversationContext context) {
|
||||
return false;
|
||||
|
@ -203,7 +203,7 @@ public abstract class Enchantment {
|
||||
|
||||
/**
|
||||
* Registers an enchantment with the given ID and object.
|
||||
* <p>
|
||||
* <p />
|
||||
* Generally not to be used from within a plugin.
|
||||
*
|
||||
* @param enchantment Enchantment to register
|
||||
|
@ -203,7 +203,7 @@ public interface Entity extends Metadatable {
|
||||
|
||||
/**
|
||||
* Gets the amount of ticks this entity has lived for.
|
||||
* <p>
|
||||
* <p />
|
||||
* This is the equivalent to "age" in entities.
|
||||
*
|
||||
* @return Age of entity
|
||||
@ -212,7 +212,7 @@ public interface Entity extends Metadatable {
|
||||
|
||||
/**
|
||||
* Sets the amount of ticks this entity has lived for.
|
||||
* <p>
|
||||
* <p />
|
||||
* This is the equivalent to "age" in entities. May not be less than one tick.
|
||||
*
|
||||
* @param value Age of entity
|
||||
@ -221,7 +221,7 @@ public interface Entity extends Metadatable {
|
||||
|
||||
/**
|
||||
* Performs the specified {@link EntityEffect} for this entity.
|
||||
* <p>
|
||||
* <p />
|
||||
* This will be viewable to all players near the entity.
|
||||
*
|
||||
* @param type Effect to play.
|
||||
|
@ -213,7 +213,7 @@ public interface LivingEntity extends Entity {
|
||||
|
||||
/**
|
||||
* Gets the player identified as the killer of this entity.
|
||||
* <p>
|
||||
* <p />
|
||||
* May be null.
|
||||
*
|
||||
* @return Killer player, or null if none found.
|
||||
|
@ -49,11 +49,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
|
||||
/**
|
||||
* Sets the name that is shown on the in-game player list.
|
||||
* <p>
|
||||
* <p />
|
||||
* The name cannot be longer than 16 characters, but {@link ChatColor} is supported.
|
||||
* <p>
|
||||
* <p />
|
||||
* If the value is null, the name will be identical to {@link #getName()}.
|
||||
* <p>
|
||||
* <p />
|
||||
* This name is case sensitive and unique, two names with different casing will
|
||||
* appear as two different people. If a player joins afterwards with
|
||||
* a name that conflicts with a player's custom list name, the
|
||||
@ -358,7 +358,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
|
||||
/**
|
||||
* Gets the players current experience points towards the next level.
|
||||
* <p>
|
||||
* <p />
|
||||
* This is a percentage value. 0 is "no progress" and 1 is "next level".
|
||||
*
|
||||
* @return Current experience points
|
||||
@ -367,7 +367,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
|
||||
/**
|
||||
* Sets the players current experience points towards the next level
|
||||
* <p>
|
||||
* <p />
|
||||
* This is a percentage value. 0 is "no progress" and 1 is "next level".
|
||||
*
|
||||
* @param exp New experience points
|
||||
@ -404,7 +404,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
|
||||
/**
|
||||
* Gets the players current exhaustion level.
|
||||
* <p>
|
||||
* <p />
|
||||
* Exhaustion controls how fast the food level drops. While you have a certain
|
||||
* amount of exhaustion, your saturation will drop to zero, and then your food
|
||||
* will drop to zero.
|
||||
@ -422,7 +422,7 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||
|
||||
/**
|
||||
* Gets the players current saturation level.
|
||||
* <p>
|
||||
* <p />
|
||||
* Saturation is a buffer for food level. Your food level will not drop if you
|
||||
* are saturated > 0.
|
||||
*
|
||||
|
@ -54,7 +54,7 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
|
||||
* Gets the type of creature being spawned.
|
||||
*
|
||||
* @return A CreatureType value detailing the type of creature being spawned
|
||||
* @deprecated In favour of {@link #getSpawnedType()}.
|
||||
* @deprecated In favour of {@link #getEntityType()}.
|
||||
*/
|
||||
@Deprecated
|
||||
public CreatureType getCreatureType() {
|
||||
|
@ -30,7 +30,7 @@ public class EntityDeathEvent extends EntityEvent {
|
||||
|
||||
/**
|
||||
* Gets how much EXP should be dropped from this death.
|
||||
* <p>
|
||||
* <p />
|
||||
* This does not indicate how much EXP should be taken from the entity in question,
|
||||
* merely how much should be created after its death.
|
||||
*
|
||||
@ -42,7 +42,7 @@ public class EntityDeathEvent extends EntityEvent {
|
||||
|
||||
/**
|
||||
* Sets how much EXP should be dropped from this death.
|
||||
* <p>
|
||||
* <p />
|
||||
* This does not indicate how much EXP should be taken from the entity in question,
|
||||
* merely how much should be created after its death.
|
||||
*
|
||||
|
@ -56,7 +56,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
|
||||
/**
|
||||
* Gets how much EXP the Player should have at respawn.
|
||||
* <p>
|
||||
* <p />
|
||||
* This does not indicate how much EXP should be dropped, please see
|
||||
* {@link #getDroppedExp()} for that.
|
||||
*
|
||||
@ -68,7 +68,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
|
||||
/**
|
||||
* Sets how much EXP the Player should have at respawn.
|
||||
* <p>
|
||||
* <p />
|
||||
* This does not indicate how much EXP should be dropped, please see
|
||||
* {@link #setDroppedExp(int)} for that.
|
||||
*
|
||||
@ -116,7 +116,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
|
||||
/**
|
||||
* Gets if the Player should keep all EXP at respawn.
|
||||
* <p>
|
||||
* <p />
|
||||
* This flag overrides other EXP settings
|
||||
*
|
||||
* @return True if Player should keep all pre-death exp
|
||||
@ -127,7 +127,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
||||
|
||||
/**
|
||||
* Sets if the Player should keep all EXP at respawn.
|
||||
* <p>
|
||||
* <p />
|
||||
* This overrides all other EXP settings
|
||||
*
|
||||
* @param keepLevel True to keep all current value levels
|
||||
|
@ -38,8 +38,8 @@ public abstract class ChunkGenerator {
|
||||
}
|
||||
@Deprecated
|
||||
/**
|
||||
* Shapes the chunk for the given coordinates.<br />
|
||||
* <br />
|
||||
* Shapes the chunk for the given coordinates.
|
||||
* <p />
|
||||
* This method should return a byte[32768] in the following format:
|
||||
*
|
||||
* <pre>
|
||||
@ -51,10 +51,10 @@ public abstract class ChunkGenerator {
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* <p />
|
||||
* Note that this method should <b>never</b> attempt to get the Chunk at
|
||||
* the passed coordinates, as doing so may cause an infinite loop
|
||||
*
|
||||
* <p />
|
||||
* Note this deprecated method will only be called when both generateExtBlockSections()
|
||||
* and generateBlockSections() are unimplemented and return null.
|
||||
|
||||
@ -70,20 +70,40 @@ public abstract class ChunkGenerator {
|
||||
|
||||
/**
|
||||
* Shapes the chunk for the given coordinates, with extended block IDs supported (0-4095).
|
||||
* <p>
|
||||
* <p />
|
||||
* As of 1.2, chunks are represented by a vertical array of chunk sections, each of which is 16 x 16 x 16 blocks. If a section
|
||||
* is empty (all zero), the section does not need to be supplied, reducing memory usage.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method must return a short[][] array in the following format:
|
||||
* <pre>
|
||||
* short[][] result = new short[world-height / 16][];
|
||||
* </pre>
|
||||
* </pre>
|
||||
* Each section (sectionID = (Y>>4)) that has blocks needs to be allocated space for the 4096 blocks in that section:
|
||||
* <pre>
|
||||
* result[sectionID] = new short[4096];
|
||||
* </pre>
|
||||
* while sections that are not populated can be left null.
|
||||
* <p>
|
||||
* <p />
|
||||
* Setting a block at X, Y, Z within the chunk can be done with the following mapping function:
|
||||
* <pre>
|
||||
* void setBlock(short[][] result, int x, int y, int z, short blkid) {
|
||||
* if (result[y >> 4] == null) {
|
||||
* result[y >> 4] = new short[4096];
|
||||
* }
|
||||
* result[y >> 4][((y & 0xF) << 8) | (z << 4) | x] = blkid;
|
||||
* }
|
||||
* </pre>
|
||||
* while reading a block ID can be done with the following mapping function:
|
||||
* <pre>
|
||||
* short getBlock(short[][] result, int x, int y, int z) {
|
||||
* if (result[y >> 4] == null) {
|
||||
* return (short)0;
|
||||
* }
|
||||
* return result[y >> 4][((y & 0xF) << 8) | (z << 4) | x];
|
||||
* }
|
||||
* </pre>
|
||||
* while sections that are not populated can be left null.
|
||||
* <p />
|
||||
* Setting a block at X, Y, Z within the chunk can be done with the following mapping function:
|
||||
* <pre>
|
||||
* void setBlock(short[][] result, int x, int y, int z, short blkid) {
|
||||
@ -102,10 +122,10 @@ public abstract class ChunkGenerator {
|
||||
* return result[y >> 4][((y & 0xF) << 8) | (z << 4) | x];
|
||||
* }
|
||||
* </pre>
|
||||
* <p>
|
||||
* <p />
|
||||
* Note that this method should <b>never</b> attempt to get the Chunk at
|
||||
* the passed coordinates, as doing so may cause an infinite loop
|
||||
* <p>
|
||||
* <p />
|
||||
* Note generators that do not return block IDs above 255 should not implement
|
||||
* this method, or should have it return null (which will result in the
|
||||
* generateBlockSections() method being called).
|
||||
@ -123,20 +143,20 @@ public abstract class ChunkGenerator {
|
||||
|
||||
/**
|
||||
* Shapes the chunk for the given coordinates.
|
||||
* <p>
|
||||
* <p />
|
||||
* As of 1.2, chunks are represented by a vertical array of chunk sections, each of which is 16 x 16 x 16 blocks. If a section
|
||||
* is empty (all zero), the section does not need to be supplied, reducing memory usage.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method must return a byte[][] array in the following format:
|
||||
* <pre>
|
||||
* byte[][] result = new byte[world-height / 16][];
|
||||
* </pre>
|
||||
* </pre>
|
||||
* Each section (sectionID = (Y>>4)) that has blocks needs to be allocated space for the 4096 blocks in that section:
|
||||
* <pre>
|
||||
* result[sectionID] = new byte[4096];
|
||||
* </pre>
|
||||
* while sections that are not populated can be left null.
|
||||
* <p>
|
||||
* <p />
|
||||
* Setting a block at X, Y, Z within the chunk can be done with the following mapping function:
|
||||
* <pre>
|
||||
* void setBlock(byte[][] result, int x, int y, int z, byte blkid) {
|
||||
|
@ -27,7 +27,7 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
|
||||
/**
|
||||
* This method allows you to change the maximum stack size for an inventory.
|
||||
* <p><b>Caveats:</b>
|
||||
* <p /><b>Caveats:</b>
|
||||
* <ul>
|
||||
* <li>Not all inventories respect this value.
|
||||
* <li>Stacks larger than 127 may be clipped when the world is saved.
|
||||
@ -205,7 +205,7 @@ public interface Inventory extends Iterable<ItemStack> {
|
||||
/**
|
||||
* Find the first empty Slot.
|
||||
*
|
||||
* @return The first empty Slot found.
|
||||
* @return The first empty Slot found, or -1 if no empty slots.
|
||||
*/
|
||||
public int firstEmpty();
|
||||
|
||||
|
@ -88,7 +88,7 @@ public abstract class InventoryView {
|
||||
|
||||
/**
|
||||
* Sets one item in this inventory view by its raw slot ID.
|
||||
* <p>
|
||||
* <p />
|
||||
* Note: If slot ID -999 is chosen, it may be expected that the item is
|
||||
* dropped on the ground. This is not required behaviour, however.
|
||||
* @param slot The ID as returned by InventoryClickEvent.getRawSlot()
|
||||
|
@ -77,8 +77,8 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type of this item<br />
|
||||
* <br />
|
||||
* Sets the type of this item
|
||||
* <p />
|
||||
* Note that in doing so you will reset the MaterialData for this stack
|
||||
*
|
||||
* @param type New type to set the items in this stack to
|
||||
@ -97,8 +97,8 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type id of this item<br />
|
||||
* <br />
|
||||
* Sets the type id of this item
|
||||
* <p />
|
||||
* Note that in doing so you will reset the MaterialData for this stack
|
||||
*
|
||||
* @param type New type id to set the items in this stack to
|
||||
@ -274,7 +274,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
|
||||
/**
|
||||
* Adds the specified enchantments to this item stack.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method is the same as calling {@link #addEnchantment(org.bukkit.enchantments.Enchantment, int)}
|
||||
* for each element of the map.
|
||||
*
|
||||
@ -288,7 +288,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
|
||||
/**
|
||||
* Adds the specified {@link Enchantment} to this item stack.
|
||||
* <p>
|
||||
* <p />
|
||||
* If this item stack already contained the given enchantment (at any level), it will be replaced.
|
||||
*
|
||||
* @param ench Enchantment to add
|
||||
@ -306,7 +306,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
|
||||
/**
|
||||
* Adds the specified enchantments to this item stack in an unsafe manner.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method is the same as calling {@link #addUnsafeEnchantment(org.bukkit.enchantments.Enchantment, int)}
|
||||
* for each element of the map.
|
||||
*
|
||||
@ -320,9 +320,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
|
||||
/**
|
||||
* Adds the specified {@link Enchantment} to this item stack.
|
||||
* <p>
|
||||
* <p />
|
||||
* If this item stack already contained the given enchantment (at any level), it will be replaced.
|
||||
* <p>
|
||||
* <p />
|
||||
* This method is unsafe and will ignore level restrictions or item type. Use at your own
|
||||
* discretion.
|
||||
*
|
||||
|
@ -34,7 +34,7 @@ public interface Plugin extends CommandExecutor {
|
||||
|
||||
/**
|
||||
* Gets a {@link FileConfiguration} for this plugin, read through "config.yml"
|
||||
* <p>
|
||||
* <p />
|
||||
* If there is a default config.yml embedded in this plugin, it will be provided
|
||||
* as a default for this Configuration.
|
||||
*
|
||||
|
@ -161,7 +161,7 @@ public interface Messenger {
|
||||
|
||||
/**
|
||||
* Checks if the specified plugin message listener registration is valid.
|
||||
* <p>
|
||||
* <p />
|
||||
* A registration is considered valid if it has not be unregistered and that the plugin
|
||||
* is still enabled.
|
||||
*
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
|
||||
*/
|
||||
public interface PluginMessageListener {
|
||||
/**
|
||||
* A method that will be thrown when a {@link PluginMessageSource} sends a plugin
|
||||
* A method that will be thrown when a PluginMessageSource sends a plugin
|
||||
* message on a registered channel.
|
||||
*
|
||||
* @param channel Channel that the message was sent through.
|
||||
|
@ -9,7 +9,7 @@ import org.bukkit.plugin.Plugin;
|
||||
public interface PluginMessageRecipient {
|
||||
/**
|
||||
* Sends this recipient a Plugin Message on the specified outgoing channel.
|
||||
* <p>
|
||||
* <p />
|
||||
* The message may not be larger than {@link Messenger#MAX_MESSAGE_SIZE} bytes, and the plugin must be registered to send
|
||||
* messages on the specified channel.
|
||||
*
|
||||
|
@ -202,7 +202,7 @@ public abstract class PotionEffectType {
|
||||
|
||||
/**
|
||||
* Registers an effect type with the given object.
|
||||
* <p>
|
||||
* <p />
|
||||
* Generally not to be used from within a plugin.
|
||||
*
|
||||
* @param type PotionType to register
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren