geforkt von Mirrors/Paper
Generic cleaning
By: Erik Broes <erikbroes@grum.nl>
Dieser Commit ist enthalten in:
Ursprung
8377ee22f8
Commit
4c80a49933
@ -37,7 +37,7 @@ public enum Achievement {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the ID for this achievement.
|
* Gets the ID for this achievement.
|
||||||
*
|
* <p />
|
||||||
* Note that this is offset using {@link #STATISTIC_OFFSET}
|
* Note that this is offset using {@link #STATISTIC_OFFSET}
|
||||||
*
|
*
|
||||||
* @return ID of this achievement
|
* @return ID of this achievement
|
||||||
@ -48,7 +48,7 @@ public enum Achievement {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the achievement associated with the given ID.
|
* Gets the achievement associated with the given ID.
|
||||||
*
|
* <p />
|
||||||
* Note that the ID must already be offset using {@link #STATISTIC_OFFSET}
|
* Note that the ID must already be offset using {@link #STATISTIC_OFFSET}
|
||||||
*
|
*
|
||||||
* @param id ID of the achievement to return
|
* @param id ID of the achievement to return
|
||||||
|
@ -42,7 +42,7 @@ public final class Bukkit {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to set the {@link Server} singleton.
|
* Attempts to set the {@link Server} singleton.
|
||||||
*
|
* <p />
|
||||||
* This cannot be done if the Server is already set.
|
* This cannot be done if the Server is already set.
|
||||||
*
|
*
|
||||||
* @param server Server instance
|
* @param server Server instance
|
||||||
|
@ -4,51 +4,50 @@ package org.bukkit;
|
|||||||
* A list of all Effects that can happen to entities.
|
* A list of all Effects that can happen to entities.
|
||||||
*/
|
*/
|
||||||
public enum EntityEffect {
|
public enum EntityEffect {
|
||||||
|
|
||||||
/**
|
|
||||||
* When mobs get hurt.
|
|
||||||
*/
|
|
||||||
HURT((byte) 2),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When a mob dies.
|
|
||||||
* <p>
|
|
||||||
* <b>This will cause client-glitches!
|
|
||||||
*/
|
|
||||||
DEATH((byte) 3),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The smoke when taming a wolf fails.
|
|
||||||
* <p>
|
|
||||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
|
||||||
*/
|
|
||||||
WOLF_SMOKE((byte) 6),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The hearts when taming a wolf succeeds.
|
|
||||||
* <p>
|
|
||||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
|
||||||
*/
|
|
||||||
WOLF_HEARTS((byte) 7),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When a wolf shakes (after being wet).
|
|
||||||
* <p>
|
|
||||||
* Without client-mods this will be ignored if the entity is not a wolf.
|
|
||||||
*/
|
|
||||||
WOLF_SHAKE((byte) 8);
|
|
||||||
|
|
||||||
private final byte data;
|
/**
|
||||||
|
* When mobs get hurt.
|
||||||
|
*/
|
||||||
|
HURT((byte) 2),
|
||||||
|
|
||||||
EntityEffect(byte data)
|
/**
|
||||||
{
|
* When a mob dies.
|
||||||
this.data = data;
|
* <p>
|
||||||
}
|
* <b>This will cause client-glitches!
|
||||||
|
*/
|
||||||
|
DEATH((byte) 3),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The data-value that is sent to the client to play this effect.
|
* The smoke when taming a wolf fails.
|
||||||
*/
|
* <p>
|
||||||
public byte getData() {
|
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||||
return data;
|
*/
|
||||||
}
|
WOLF_SMOKE((byte) 6),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The hearts when taming a wolf succeeds.
|
||||||
|
* <p>
|
||||||
|
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||||
|
*/
|
||||||
|
WOLF_HEARTS((byte) 7),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When a wolf shakes (after being wet).
|
||||||
|
* <p>
|
||||||
|
* Without client-mods this will be ignored if the entity is not a wolf.
|
||||||
|
*/
|
||||||
|
WOLF_SHAKE((byte) 8);
|
||||||
|
|
||||||
|
private final byte data;
|
||||||
|
|
||||||
|
EntityEffect(byte data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The data-value that is sent to the client to play this effect.
|
||||||
|
*/
|
||||||
|
public byte getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package org.bukkit;
|
|||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -30,14 +30,14 @@ import org.bukkit.scheduler.BukkitScheduler;
|
|||||||
public interface Server extends PluginMessageRecipient {
|
public interface Server extends PluginMessageRecipient {
|
||||||
/**
|
/**
|
||||||
* Used for all administrative messages, such as an operator using a command.
|
* Used for all administrative messages, such as an operator using a command.
|
||||||
*
|
* <p />
|
||||||
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
|
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
|
||||||
*/
|
*/
|
||||||
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
|
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for all announcement messages, such as informing users that a player has joined.
|
* Used for all announcement messages, such as informing users that a player has joined.
|
||||||
*
|
* <p />
|
||||||
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
|
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
|
||||||
*/
|
*/
|
||||||
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
|
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
|
||||||
@ -155,7 +155,7 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcast a message to all players.
|
* Broadcast a message to all players.
|
||||||
*
|
* <p />
|
||||||
* This is the same as calling {@link #broadcast(java.lang.String, java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
|
* This is the same as calling {@link #broadcast(java.lang.String, java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
|
||||||
*
|
*
|
||||||
* @param message the message
|
* @param message the message
|
||||||
@ -166,7 +166,7 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
/**
|
/**
|
||||||
* Gets the name of the update folder. The update folder is used to safely update
|
* Gets the name of the update folder. The update folder is used to safely update
|
||||||
* plugins at the right moment on a plugin load.
|
* plugins at the right moment on a plugin load.
|
||||||
*
|
* <p />
|
||||||
* The update folder name is relative to the plugins folder.
|
* The update folder name is relative to the plugins folder.
|
||||||
*
|
*
|
||||||
* @return The name of the update folder
|
* @return The name of the update folder
|
||||||
@ -183,7 +183,7 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a player object by the given username
|
* Gets a player object by the given username
|
||||||
*
|
* <p />
|
||||||
* This method may not return objects for offline players
|
* This method may not return objects for offline players
|
||||||
*
|
*
|
||||||
* @param name Name to look up
|
* @param name Name to look up
|
||||||
@ -202,7 +202,7 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
/**
|
/**
|
||||||
* Attempts to match any players with the given name, and returns a list
|
* Attempts to match any players with the given name, and returns a list
|
||||||
* of all possibly matches
|
* of all possibly matches
|
||||||
*
|
* <p />
|
||||||
* This list is not sorted in any particular order. If an exact match is found,
|
* This list is not sorted in any particular order. If an exact match is found,
|
||||||
* the returned list will only contain a single result.
|
* the returned list will only contain a single result.
|
||||||
*
|
*
|
||||||
@ -457,7 +457,7 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the player by the given name, regardless if they are offline or online.
|
* Gets the player by the given name, regardless if they are offline or online.
|
||||||
*
|
* <p />
|
||||||
* This will return an object even if the player does not exist. To this method, all players will exist.
|
* This will return an object even if the player does not exist. To this method, all players will exist.
|
||||||
*
|
*
|
||||||
* @param name Name of the player to retrieve
|
* @param name Name of the player to retrieve
|
||||||
|
@ -47,7 +47,7 @@ public enum Statistic {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this is a substatistic.
|
* Checks if this is a substatistic.
|
||||||
*
|
* <p />
|
||||||
* A substatistic exists in mass for each block or item, depending on {@link #isBlock()}
|
* A substatistic exists in mass for each block or item, depending on {@link #isBlock()}
|
||||||
*
|
*
|
||||||
* @return true if this is a substatistic
|
* @return true if this is a substatistic
|
||||||
|
@ -82,7 +82,6 @@ public interface World extends PluginMessageRecipient {
|
|||||||
*
|
*
|
||||||
* @param x X-coordinate of the block
|
* @param x X-coordinate of the block
|
||||||
* @param z Z-coordinate of the block
|
* @param z Z-coordinate of the block
|
||||||
*
|
|
||||||
* @return Highest non-empty block
|
* @return Highest non-empty block
|
||||||
*/
|
*/
|
||||||
public Block getHighestBlockAt(int x, int z);
|
public Block getHighestBlockAt(int x, int z);
|
||||||
@ -91,7 +90,6 @@ public interface World extends PluginMessageRecipient {
|
|||||||
* Gets the highest non-empty block at the given coordinates
|
* Gets the highest non-empty block at the given coordinates
|
||||||
*
|
*
|
||||||
* @param location Coordinates to get the highest block
|
* @param location Coordinates to get the highest block
|
||||||
*
|
|
||||||
* @return Highest non-empty block
|
* @return Highest non-empty block
|
||||||
*/
|
*/
|
||||||
public Block getHighestBlockAt(Location location);
|
public Block getHighestBlockAt(Location location);
|
||||||
@ -154,7 +152,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the {@link Chunk} at the specified coordinates
|
* Loads the {@link Chunk} at the specified coordinates
|
||||||
*
|
* <p />
|
||||||
* If the chunk does not exist, it will be generated.
|
* If the chunk does not exist, it will be generated.
|
||||||
* This method is analogous to {@link #loadChunk(int, int, boolean)} where generate is true.
|
* This method is analogous to {@link #loadChunk(int, int, boolean)} where generate is true.
|
||||||
*
|
*
|
||||||
@ -175,7 +173,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Safely unloads and saves the {@link Chunk} at the specified coordinates
|
* Safely unloads and saves the {@link Chunk} at the specified coordinates
|
||||||
*
|
* <p />
|
||||||
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where safe and saveis true
|
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where safe and saveis true
|
||||||
*
|
*
|
||||||
* @param chunk the chunk to unload
|
* @param chunk the chunk to unload
|
||||||
@ -185,7 +183,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Safely unloads and saves the {@link Chunk} at the specified coordinates
|
* Safely unloads and saves the {@link Chunk} at the specified coordinates
|
||||||
*
|
* <p />
|
||||||
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where safe and saveis true
|
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where safe and saveis true
|
||||||
*
|
*
|
||||||
* @param x X-coordinate of the chunk
|
* @param x X-coordinate of the chunk
|
||||||
@ -196,7 +194,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Safely unloads and optionally saves the {@link Chunk} at the specified coordinates
|
* Safely unloads and optionally saves the {@link Chunk} at the specified coordinates
|
||||||
*
|
* <p />
|
||||||
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where save is true
|
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where save is true
|
||||||
*
|
*
|
||||||
* @param x X-coordinate of the chunk
|
* @param x X-coordinate of the chunk
|
||||||
@ -219,7 +217,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Safely queues the {@link Chunk} at the specified coordinates for unloading
|
* Safely queues the {@link Chunk} at the specified coordinates for unloading
|
||||||
*
|
* <p />
|
||||||
* This method is analogous to {@link #unloadChunkRequest(int, int, boolean)} where safe is true
|
* This method is analogous to {@link #unloadChunkRequest(int, int, boolean)} where safe is true
|
||||||
*
|
*
|
||||||
* @param x X-coordinate of the chunk
|
* @param x X-coordinate of the chunk
|
||||||
@ -366,7 +364,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a semi-unique identifier for this world.
|
* Gets a semi-unique identifier for this world.
|
||||||
*
|
* <p />
|
||||||
* While it is highly unlikely that this may be shared with another World,
|
* While it is highly unlikely that this may be shared with another World,
|
||||||
* it is not guaranteed to be unique
|
* it is not guaranteed to be unique
|
||||||
*
|
*
|
||||||
@ -395,7 +393,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the relative in-game time of this world.
|
* Gets the relative in-game time of this world.
|
||||||
*
|
* <p />
|
||||||
* The relative time is analogous to hours * 1000
|
* The relative time is analogous to hours * 1000
|
||||||
*
|
*
|
||||||
* @return The current relative time
|
* @return The current relative time
|
||||||
@ -405,7 +403,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the relative in-game time on the server.
|
* Sets the relative in-game time on the server.
|
||||||
*
|
* <p />
|
||||||
* The relative time is analogous to hours * 1000
|
* The relative time is analogous to hours * 1000
|
||||||
* <br /><br />
|
* <br /><br />
|
||||||
* Note that setting the relative time below the current relative time will
|
* Note that setting the relative time below the current relative time will
|
||||||
@ -650,43 +648,40 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the biome for the given block coordinates.
|
* Gets the biome for the given block coordinates.
|
||||||
*
|
* <p />
|
||||||
* It is safe to run this method when the block does not exist, it will not create the block.
|
* It is safe to run this method when the block does not exist, it will not create the block.
|
||||||
*
|
*
|
||||||
* @param x X coordinate of the block
|
* @param x X coordinate of the block
|
||||||
* @param z Z coordinate of the block
|
* @param z Z coordinate of the block
|
||||||
*
|
|
||||||
* @return Biome of the requested block
|
* @return Biome of the requested block
|
||||||
*/
|
*/
|
||||||
public Biome getBiome(int x, int z);
|
public Biome getBiome(int x, int z);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the temperature for the given block coordinates.
|
* Gets the temperature for the given block coordinates.
|
||||||
*
|
* <p />
|
||||||
* It is safe to run this method when the block does not exist, it will not create the block.
|
* It is safe to run this method when the block does not exist, it will not create the block.
|
||||||
*
|
*
|
||||||
* @param x X coordinate of the block
|
* @param x X coordinate of the block
|
||||||
* @param z Z coordinate of the block
|
* @param z Z coordinate of the block
|
||||||
*
|
|
||||||
* @return Temperature of the requested block
|
* @return Temperature of the requested block
|
||||||
*/
|
*/
|
||||||
public double getTemperature(int x, int z);
|
public double getTemperature(int x, int z);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the humidity for the given block coordinates.
|
* Gets the humidity for the given block coordinates.
|
||||||
*
|
* <p />
|
||||||
* It is safe to run this method when the block does not exist, it will not create the block.
|
* It is safe to run this method when the block does not exist, it will not create the block.
|
||||||
*
|
*
|
||||||
* @param x X coordinate of the block
|
* @param x X coordinate of the block
|
||||||
* @param z Z coordinate of the block
|
* @param z Z coordinate of the block
|
||||||
*
|
|
||||||
* @return Humidity of the requested block
|
* @return Humidity of the requested block
|
||||||
*/
|
*/
|
||||||
public double getHumidity(int x, int z);
|
public double getHumidity(int x, int z);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the maximum height of this world.
|
* Gets the maximum height of this world.
|
||||||
*
|
* <p />
|
||||||
* If the max height is 100, there are only blocks from y=0 to y=99.
|
* If the max height is 100, there are only blocks from y=0 to y=99.
|
||||||
*
|
*
|
||||||
* @return Maximum height of the world
|
* @return Maximum height of the world
|
||||||
@ -695,7 +690,7 @@ public interface World extends PluginMessageRecipient {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sea level for this world.
|
* Gets the sea level for this world.
|
||||||
*
|
* <p />
|
||||||
* This is often half of {@link #getMaxHeight()}
|
* This is often half of {@link #getMaxHeight()}
|
||||||
*
|
*
|
||||||
* @return Sea level
|
* @return Sea level
|
||||||
|
@ -186,7 +186,7 @@ public interface Block {
|
|||||||
/**
|
/**
|
||||||
* Captures the current state of this block. You may then cast that state
|
* Captures the current state of this block. You may then cast that state
|
||||||
* into any accepted type, such as Furnace or Sign.
|
* into any accepted type, such as Furnace or Sign.
|
||||||
*
|
* <p />
|
||||||
* The returned object will never be updated, and you are not guaranteed that
|
* The returned object will never be updated, and you are not guaranteed that
|
||||||
* (for example) a sign is still a sign after you capture its state.
|
* (for example) a sign is still a sign after you capture its state.
|
||||||
*
|
*
|
||||||
@ -248,7 +248,7 @@ public interface Block {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this block is empty.
|
* Checks if this block is empty.
|
||||||
*
|
* <p />
|
||||||
* A block is considered empty when {@link #getType()} returns {@link Material#AIR}.
|
* A block is considered empty when {@link #getType()} returns {@link Material#AIR}.
|
||||||
*
|
*
|
||||||
* @return true if this block is empty
|
* @return true if this block is empty
|
||||||
@ -257,7 +257,7 @@ public interface Block {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this block is liquid.
|
* Checks if this block is liquid.
|
||||||
*
|
* <p />
|
||||||
* A block is considered liquid when {@link #getType()} returns {@link Material#WATER}, {@link Material#STATIONARY_WATER}, {@link Material#LAVA} or {@link Material#STATIONARY_LAVA}.
|
* A block is considered liquid when {@link #getType()} returns {@link Material#WATER}, {@link Material#STATIONARY_WATER}, {@link Material#LAVA} or {@link Material#STATIONARY_LAVA}.
|
||||||
*
|
*
|
||||||
* @return true if this block is liquid
|
* @return true if this block is liquid
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.material.MaterialData;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a captured state of a block, which will not change automatically.
|
* Represents a captured state of a block, which will not change automatically.
|
||||||
*
|
* <p />
|
||||||
* Unlike Block, which only one object can exist per coordinate, BlockState can
|
* Unlike Block, which only one object can exist per coordinate, BlockState can
|
||||||
* exist multiple times for any given Block. Note that another plugin may change
|
* exist multiple times for any given Block. Note that another plugin may change
|
||||||
* the state of the block and you will not know, or they may change the block to
|
* the state of the block and you will not know, or they may change the block to
|
||||||
|
@ -14,7 +14,7 @@ public interface Sign extends BlockState {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the line of text at the specified index.
|
* Gets the line of text at the specified index.
|
||||||
*
|
* <p />
|
||||||
* For example, getLine(0) will return the first line of text.
|
* For example, getLine(0) will return the first line of text.
|
||||||
*
|
*
|
||||||
* @param index Line number to get the text from, starting at 0
|
* @param index Line number to get the text from, starting at 0
|
||||||
@ -25,7 +25,7 @@ public interface Sign extends BlockState {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the line of text at the specified index.
|
* Sets the line of text at the specified index.
|
||||||
*
|
* <p />
|
||||||
* For example, setLine(0, "Line One") will set the first line of text to
|
* For example, setLine(0, "Line One") will set the first line of text to
|
||||||
* "Line One".
|
* "Line One".
|
||||||
*
|
*
|
||||||
|
@ -75,7 +75,7 @@ public abstract class Command {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the given {@link CommandSender} to see if they can perform this command.
|
* Tests the given {@link CommandSender} to see if they can perform this command.
|
||||||
*
|
* <p />
|
||||||
* If they do not have permission, they will be informed that they cannot do this.
|
* If they do not have permission, they will be informed that they cannot do this.
|
||||||
*
|
*
|
||||||
* @param target User to test
|
* @param target User to test
|
||||||
|
@ -20,7 +20,7 @@ public class BanListCommand extends VanillaCommand {
|
|||||||
StringBuilder message = new StringBuilder().append(ChatColor.GRAY).append("Ban list:");
|
StringBuilder message = new StringBuilder().append(ChatColor.GRAY).append("Ban list:");
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (OfflinePlayer p : Bukkit.getServer().getBannedPlayers()){
|
for (OfflinePlayer p : Bukkit.getServer().getBannedPlayers()) {
|
||||||
if (count++ > 0) {
|
if (count++ > 0) {
|
||||||
message.append(", ");
|
message.append(", ");
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,7 @@ public class TimingsCommand extends Command {
|
|||||||
plugin.resetTimings();
|
plugin.resetTimings();
|
||||||
}
|
}
|
||||||
sender.sendMessage("Timings reset");
|
sender.sendMessage("Timings reset");
|
||||||
}
|
} else if ("merged".equals(args[0]) || seperate) {
|
||||||
else if("merged".equals(args[0]) || seperate) {
|
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
int pluginIdx = 0;
|
int pluginIdx = 0;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package org.bukkit.configuration;
|
package org.bukkit.configuration;
|
||||||
|
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
|
@ -56,7 +56,6 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
|||||||
* but you may include one if you wish for extra spacing.
|
* 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.
|
* Null is a valid value which will indicate that no header is to be applied.
|
||||||
*
|
|
||||||
*
|
*
|
||||||
* @param value New header
|
* @param value New header
|
||||||
* @return This object, for chaining
|
* @return This object, for chaining
|
||||||
|
@ -12,11 +12,8 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.configuration.Configuration;
|
import org.bukkit.configuration.Configuration;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
|
||||||
import org.yaml.snakeyaml.DumperOptions;
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
|
||||||
import org.yaml.snakeyaml.error.YAMLException;
|
import org.yaml.snakeyaml.error.YAMLException;
|
||||||
import org.yaml.snakeyaml.representer.Representer;
|
import org.yaml.snakeyaml.representer.Representer;
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ public class YamlConstructor extends SafeConstructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class ConstructCustomObject extends ConstructYamlMap {
|
private class ConstructCustomObject extends ConstructYamlMap {
|
||||||
|
@Override
|
||||||
public Object construct(Node node) {
|
public Object construct(Node node) {
|
||||||
if (node.isTwoStepsConstruction()) {
|
if (node.isTwoStepsConstruction()) {
|
||||||
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
||||||
@ -40,6 +41,7 @@ public class YamlConstructor extends SafeConstructor {
|
|||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void construct2ndStep(Node node, Object object) {
|
public void construct2ndStep(Node node, Object object) {
|
||||||
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.configuration.file;
|
package org.bukkit.configuration.file;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@ -9,7 +8,6 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
|||||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
||||||
|
|
||||||
import org.yaml.snakeyaml.nodes.Node;
|
import org.yaml.snakeyaml.nodes.Node;
|
||||||
import org.yaml.snakeyaml.representer.Represent;
|
|
||||||
import org.yaml.snakeyaml.representer.Representer;
|
import org.yaml.snakeyaml.representer.Representer;
|
||||||
|
|
||||||
public class YamlRepresenter extends Representer {
|
public class YamlRepresenter extends Representer {
|
||||||
@ -20,6 +18,7 @@ public class YamlRepresenter extends Representer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class RepresentConfigurationSection extends RepresentMap {
|
private class RepresentConfigurationSection extends RepresentMap {
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Node representData(Object data) {
|
public Node representData(Object data) {
|
||||||
return super.representData(((ConfigurationSection) data).getValues(false));
|
return super.representData(((ConfigurationSection) data).getValues(false));
|
||||||
@ -27,6 +26,7 @@ public class YamlRepresenter extends Representer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class RepresentConfigurationSerializable extends RepresentMap {
|
private class RepresentConfigurationSerializable extends RepresentMap {
|
||||||
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Node representData(Object data) {
|
public Node representData(Object data) {
|
||||||
ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
||||||
|
@ -2,7 +2,6 @@ package org.bukkit.entity;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an Animal.
|
* Represents an Animal.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface Animals extends Creature {
|
public interface Animals extends Creature {
|
||||||
/**
|
/**
|
||||||
|
@ -67,7 +67,7 @@ public interface Minecart extends Vehicle {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails.
|
* Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails.
|
||||||
*
|
* <p />
|
||||||
* A derailed minecart's velocity is multiplied by this factor each tick.
|
* A derailed minecart's velocity is multiplied by this factor each tick.
|
||||||
*
|
*
|
||||||
* @return derailed visible speed
|
* @return derailed visible speed
|
||||||
|
@ -16,12 +16,11 @@ import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a player, connected or not
|
* Represents a player, connected or not
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface Player extends HumanEntity, CommandSender, OfflinePlayer, PluginMessageRecipient {
|
public interface Player extends HumanEntity, CommandSender, OfflinePlayer, PluginMessageRecipient {
|
||||||
/**
|
/**
|
||||||
* Gets the "friendly" name to display of this player. This may include color.
|
* Gets the "friendly" name to display of this player. This may include color.
|
||||||
*
|
* <p />
|
||||||
* Note that this name will not be displayed in game, only in chat and places
|
* Note that this name will not be displayed in game, only in chat and places
|
||||||
* defined by plugins
|
* defined by plugins
|
||||||
*
|
*
|
||||||
@ -31,7 +30,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the "friendly" name to display of this player. This may include color.
|
* Sets the "friendly" name to display of this player. This may include color.
|
||||||
*
|
* <p />
|
||||||
* Note that this name will not be displayed in game, only in chat and places
|
* Note that this name will not be displayed in game, only in chat and places
|
||||||
* defined by plugins
|
* defined by plugins
|
||||||
*
|
*
|
||||||
@ -153,7 +152,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the players current location, health, inventory, motion, and other information from the username.dat file, in the world/player folder
|
* Loads the players current location, health, inventory, motion, and other information from the username.dat file, in the world/player folder
|
||||||
*
|
* <p />
|
||||||
* Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file.
|
* Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file.
|
||||||
*/
|
*/
|
||||||
public void loadData();
|
public void loadData();
|
||||||
@ -220,7 +219,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
|
|||||||
* Send a chunk change. This fakes a chunk change packet for a user at
|
* Send a chunk change. This fakes a chunk change packet for a user at
|
||||||
* a certain location. The updated cuboid must be entirely within a single
|
* a certain location. The updated cuboid must be entirely within a single
|
||||||
* chunk. This will not actually change the world in any way.
|
* chunk. This will not actually change the world in any way.
|
||||||
*
|
* <p />
|
||||||
* At least one of the dimensions of the cuboid must be even. The size of the
|
* At least one of the dimensions of the cuboid must be even. The size of the
|
||||||
* data buffer must be 2.5*sx*sy*sz and formatted in accordance with the Packet51
|
* data buffer must be 2.5*sx*sy*sz and formatted in accordance with the Packet51
|
||||||
* format.
|
* format.
|
||||||
@ -230,7 +229,6 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
|
|||||||
* @param sy The y size of the cuboid
|
* @param sy The y size of the cuboid
|
||||||
* @param sz The z size of the cuboid
|
* @param sz The z size of the cuboid
|
||||||
* @param data The data to be sent
|
* @param data The data to be sent
|
||||||
*
|
|
||||||
* @return true if the chunk change packet was sent
|
* @return true if the chunk change packet was sent
|
||||||
*/
|
*/
|
||||||
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data);
|
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data);
|
||||||
@ -303,7 +301,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
|
|||||||
/**
|
/**
|
||||||
* Sets the current time on the player's client. When relative is true the player's time
|
* Sets the current time on the player's client. When relative is true the player's time
|
||||||
* will be kept synchronized to its world time with the specified offset.
|
* will be kept synchronized to its world time with the specified offset.
|
||||||
*
|
* <p />
|
||||||
* When using non relative time the player's time will stay fixed at the specified time parameter. It's up to
|
* When using non relative time the player's time will stay fixed at the specified time parameter. It's up to
|
||||||
* the caller to continue updating the player's time. To restore player time to normal use resetPlayerTime().
|
* the caller to continue updating the player's time. To restore player time to normal use resetPlayerTime().
|
||||||
*
|
*
|
||||||
@ -471,19 +469,19 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
|
|||||||
* @return Bed Spawn Location if bed exists, otherwise null.
|
* @return Bed Spawn Location if bed exists, otherwise null.
|
||||||
*/
|
*/
|
||||||
public Location getBedSpawnLocation();
|
public Location getBedSpawnLocation();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if the Player is allowed to fly via jump key double-tap like in creative mode.
|
* Determines if the Player is allowed to fly via jump key double-tap like in creative mode.
|
||||||
*
|
*
|
||||||
* @return True if the player is allowed to fly.
|
* @return True if the player is allowed to fly.
|
||||||
*/
|
*/
|
||||||
public boolean getAllowFlight();
|
public boolean getAllowFlight();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if the Player is allowed to fly via jump key double-tap like in creative mode.
|
* Sets if the Player is allowed to fly via jump key double-tap like in creative mode.
|
||||||
*
|
*
|
||||||
* @param flight If flight should be allowed.
|
* @param flight If flight should be allowed.
|
||||||
*/
|
*/
|
||||||
public void setAllowFlight(boolean flight);
|
public void setAllowFlight(boolean flight);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public interface Projectile extends Entity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if this projectile should bounce or not when it hits.
|
* Determine if this projectile should bounce or not when it hits.
|
||||||
*
|
* <p />
|
||||||
* If a small fireball does not bounce it will set the target on fire.
|
* If a small fireball does not bounce it will set the target on fire.
|
||||||
*
|
*
|
||||||
* @return true if it should bounce.
|
* @return true if it should bounce.
|
||||||
|
@ -4,7 +4,7 @@ public interface Tameable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if this is tamed
|
* Check if this is tamed
|
||||||
*
|
* <p />
|
||||||
* If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.
|
* If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.
|
||||||
*
|
*
|
||||||
* @return true if this has been tamed
|
* @return true if this has been tamed
|
||||||
@ -13,7 +13,7 @@ public interface Tameable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if this has been tamed. Not necessary if the method setOwner has been used, as it tames automatically.
|
* Sets if this has been tamed. Not necessary if the method setOwner has been used, as it tames automatically.
|
||||||
*
|
* <p />
|
||||||
* If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.
|
* If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.
|
||||||
*
|
*
|
||||||
* @param tame true if tame
|
* @param tame true if tame
|
||||||
|
@ -78,7 +78,7 @@ public abstract class Event implements Serializable {
|
|||||||
Highest,
|
Highest,
|
||||||
/**
|
/**
|
||||||
* Event is listened to purely for monitoring the outcome of an event.
|
* Event is listened to purely for monitoring the outcome of an event.
|
||||||
*
|
* <p />
|
||||||
* No modifications to the event should be made under this priority
|
* No modifications to the event should be made under this priority
|
||||||
*/
|
*/
|
||||||
Monitor
|
Monitor
|
||||||
@ -333,7 +333,7 @@ public abstract class Event implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* Called when a block is undergoing a universe physics
|
* Called when a block is undergoing a universe physics
|
||||||
* check on whether it can be built
|
* check on whether it can be built
|
||||||
*
|
* <p />
|
||||||
* For example, cacti cannot be built on grass unless overridden here
|
* For example, cacti cannot be built on grass unless overridden here
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.block.BlockCanBuildEvent
|
* @see org.bukkit.event.block.BlockCanBuildEvent
|
||||||
@ -355,7 +355,7 @@ public abstract class Event implements Serializable {
|
|||||||
BLOCK_IGNITE(Category.BLOCK),
|
BLOCK_IGNITE(Category.BLOCK),
|
||||||
/**
|
/**
|
||||||
* Called when a block undergoes a physics check
|
* Called when a block undergoes a physics check
|
||||||
*
|
* <p />
|
||||||
* A physics check is commonly called when an adjacent block changes
|
* A physics check is commonly called when an adjacent block changes
|
||||||
* type
|
* type
|
||||||
*
|
*
|
||||||
@ -531,7 +531,7 @@ public abstract class Event implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a chunk is loaded
|
* Called when a chunk is loaded
|
||||||
*
|
* <p />
|
||||||
* If a new chunk is being generated for loading, it will call
|
* If a new chunk is being generated for loading, it will call
|
||||||
* Type.CHUNK_GENERATION and then Type.CHUNK_LOADED upon completion
|
* Type.CHUNK_GENERATION and then Type.CHUNK_LOADED upon completion
|
||||||
*
|
*
|
||||||
@ -546,7 +546,7 @@ public abstract class Event implements Serializable {
|
|||||||
CHUNK_UNLOAD(Category.WORLD),
|
CHUNK_UNLOAD(Category.WORLD),
|
||||||
/**
|
/**
|
||||||
* Called when a newly created chunk has been populated.
|
* Called when a newly created chunk has been populated.
|
||||||
*
|
* <p />
|
||||||
* If your intent is to populate the chunk using this event, please see {@link org.bukkit.generator.BlockPopulator}
|
* If your intent is to populate the chunk using this event, please see {@link org.bukkit.generator.BlockPopulator}
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.world.ChunkPopulateEvent
|
* @see org.bukkit.event.world.ChunkPopulateEvent
|
||||||
@ -605,7 +605,7 @@ public abstract class Event implements Serializable {
|
|||||||
*
|
*
|
||||||
* @see org.bukkit.event.entity.ItemDespawnEvent
|
* @see org.bukkit.event.entity.ItemDespawnEvent
|
||||||
*/
|
*/
|
||||||
ITEM_DESPAWN (Category.WORLD),
|
ITEM_DESPAWN(Category.WORLD),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ENTITY EVENTS
|
* ENTITY EVENTS
|
||||||
@ -667,10 +667,10 @@ public abstract class Event implements Serializable {
|
|||||||
ENTITY_EXPLODE(Category.LIVING_ENTITY),
|
ENTITY_EXPLODE(Category.LIVING_ENTITY),
|
||||||
/**
|
/**
|
||||||
* Called when an entity has made a decision to explode.
|
* Called when an entity has made a decision to explode.
|
||||||
*
|
* <p />
|
||||||
* Provides an opportunity to act on the entity, change the explosion radius,
|
* Provides an opportunity to act on the entity, change the explosion radius,
|
||||||
* or to change the fire-spread flag.
|
* or to change the fire-spread flag.
|
||||||
*
|
* <p />
|
||||||
* Canceling the event negates the entity's decision to explode.
|
* Canceling the event negates the entity's decision to explode.
|
||||||
* For EntityCreeper, this resets the fuse but does not kill the Entity.
|
* For EntityCreeper, this resets the fuse but does not kill the Entity.
|
||||||
* For EntityFireball and EntityTNTPrimed....?
|
* For EntityFireball and EntityTNTPrimed....?
|
||||||
|
@ -6,10 +6,10 @@ import org.bukkit.entity.Entity;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a block is formed by entities.
|
* Called when a block is formed by entities.
|
||||||
*<p />
|
* <p />
|
||||||
* Examples:
|
* Examples:
|
||||||
*<ul>
|
* <ul>
|
||||||
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
|
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class EntityBlockFormEvent extends BlockFormEvent {
|
public class EntityBlockFormEvent extends BlockFormEvent {
|
||||||
|
@ -15,7 +15,7 @@ public class EntityCombustByBlockEvent extends EntityCombustEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The combuster can be lava or a block that is on fire.
|
* The combuster can be lava or a block that is on fire.
|
||||||
*
|
* <p />
|
||||||
* WARNING: block may be null.
|
* WARNING: block may be null.
|
||||||
*
|
*
|
||||||
* @return the Block that set the combustee alight.
|
* @return the Block that set the combustee alight.
|
||||||
|
@ -36,7 +36,7 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of seconds the combustee should be alight for.
|
* The number of seconds the combustee should be alight for.
|
||||||
*
|
* <p />
|
||||||
* This value will only ever increase the combustion time, not decrease existing combustion times.
|
* This value will only ever increase the combustion time, not decrease existing combustion times.
|
||||||
*
|
*
|
||||||
* @param duration the time in seconds to be alight for.
|
* @param duration the time in seconds to be alight for.
|
||||||
|
@ -68,97 +68,97 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Damage caused when an entity contacts a block such as a Cactus.
|
* Damage caused when an entity contacts a block such as a Cactus.
|
||||||
*
|
* <p />
|
||||||
* Damage: 1 (Cactus)
|
* Damage: 1 (Cactus)
|
||||||
*/
|
*/
|
||||||
CONTACT,
|
CONTACT,
|
||||||
/**
|
/**
|
||||||
* Damage caused when an entity attacks another entity.
|
* Damage caused when an entity attacks another entity.
|
||||||
*
|
* <p />
|
||||||
* Damage: variable
|
* Damage: variable
|
||||||
*/
|
*/
|
||||||
ENTITY_ATTACK,
|
ENTITY_ATTACK,
|
||||||
/**
|
/**
|
||||||
* Damage caused when attacked by a projectile.
|
* Damage caused when attacked by a projectile.
|
||||||
*
|
* <p />
|
||||||
* Damage: variable
|
* Damage: variable
|
||||||
*/
|
*/
|
||||||
PROJECTILE,
|
PROJECTILE,
|
||||||
/**
|
/**
|
||||||
* Damage caused by being put in a block
|
* Damage caused by being put in a block
|
||||||
*
|
* <p />
|
||||||
* Damage: 1
|
* Damage: 1
|
||||||
*/
|
*/
|
||||||
SUFFOCATION,
|
SUFFOCATION,
|
||||||
/**
|
/**
|
||||||
* Damage caused when an entity falls a distance greater than 3 blocks
|
* Damage caused when an entity falls a distance greater than 3 blocks
|
||||||
*
|
* <p />
|
||||||
* Damage: fall height - 3.0
|
* Damage: fall height - 3.0
|
||||||
*/
|
*/
|
||||||
FALL,
|
FALL,
|
||||||
/**
|
/**
|
||||||
* Damage caused by direct exposure to fire
|
* Damage caused by direct exposure to fire
|
||||||
*
|
* <p />
|
||||||
* Damage: 1
|
* Damage: 1
|
||||||
*/
|
*/
|
||||||
FIRE,
|
FIRE,
|
||||||
/**
|
/**
|
||||||
* Damage caused due to burns caused by fire
|
* Damage caused due to burns caused by fire
|
||||||
*
|
* <p />
|
||||||
* Damage: 1
|
* Damage: 1
|
||||||
*/
|
*/
|
||||||
FIRE_TICK,
|
FIRE_TICK,
|
||||||
/**
|
/**
|
||||||
* Damage caused by direct exposure to lava
|
* Damage caused by direct exposure to lava
|
||||||
*
|
* <p />
|
||||||
* Damage: 4
|
* Damage: 4
|
||||||
*/
|
*/
|
||||||
LAVA,
|
LAVA,
|
||||||
/**
|
/**
|
||||||
* Damage caused by running out of air while in water
|
* Damage caused by running out of air while in water
|
||||||
*
|
* <p />
|
||||||
* Damage: 2
|
* Damage: 2
|
||||||
*/
|
*/
|
||||||
DROWNING,
|
DROWNING,
|
||||||
/**
|
/**
|
||||||
* Damage caused by being in the area when a block explodes.
|
* Damage caused by being in the area when a block explodes.
|
||||||
*
|
* <p />
|
||||||
* Damage: variable
|
* Damage: variable
|
||||||
*/
|
*/
|
||||||
BLOCK_EXPLOSION,
|
BLOCK_EXPLOSION,
|
||||||
/**
|
/**
|
||||||
* Damage caused by being in the area when an entity, such as a Creeper, explodes.
|
* Damage caused by being in the area when an entity, such as a Creeper, explodes.
|
||||||
*
|
* <p />
|
||||||
* Damage: variable
|
* Damage: variable
|
||||||
*/
|
*/
|
||||||
ENTITY_EXPLOSION,
|
ENTITY_EXPLOSION,
|
||||||
/**
|
/**
|
||||||
* Damage caused by falling into the void
|
* Damage caused by falling into the void
|
||||||
*
|
* <p />
|
||||||
* Damage: 4 for players
|
* Damage: 4 for players
|
||||||
*/
|
*/
|
||||||
VOID,
|
VOID,
|
||||||
/**
|
/**
|
||||||
* Damage caused by being struck by lightning
|
* Damage caused by being struck by lightning
|
||||||
*
|
* <p />
|
||||||
* Damage: 5
|
* Damage: 5
|
||||||
*/
|
*/
|
||||||
LIGHTNING,
|
LIGHTNING,
|
||||||
/**
|
/**
|
||||||
* Damage caused by committing suicide using the command "/kill"
|
* Damage caused by committing suicide using the command "/kill"
|
||||||
*
|
* <p />
|
||||||
* Damage: 1000
|
* Damage: 1000
|
||||||
*/
|
*/
|
||||||
SUICIDE,
|
SUICIDE,
|
||||||
/**
|
/**
|
||||||
* Damage caused by starving due to having an empty hunger bar
|
* Damage caused by starving due to having an empty hunger bar
|
||||||
*
|
* <p />
|
||||||
* Damage: 1
|
* Damage: 1
|
||||||
*/
|
*/
|
||||||
STARVATION,
|
STARVATION,
|
||||||
/**
|
/**
|
||||||
* Custom damage.
|
* Custom damage.
|
||||||
*
|
* <p />
|
||||||
* Damage: variable
|
* Damage: variable
|
||||||
*/
|
*/
|
||||||
CUSTOM
|
CUSTOM
|
||||||
|
@ -172,7 +172,7 @@ public class EntityListener implements Listener {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an entity creates a portal.
|
* Called when an entity creates a portal.
|
||||||
*
|
*
|
||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
*/
|
*/
|
||||||
public void onEntityCreatePortalEvent(EntityCreatePortalEvent event) {}
|
public void onEntityCreatePortalEvent(EntityCreatePortalEvent event) {}
|
||||||
|
@ -51,7 +51,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
|||||||
* Set the entity that you want the mob to target instead.
|
* Set the entity that you want the mob to target instead.
|
||||||
* It is possible to be null, null will cause the entity to be
|
* It is possible to be null, null will cause the entity to be
|
||||||
* target-less.
|
* target-less.
|
||||||
*
|
* <p />
|
||||||
* This is different from cancelling the event. Cancelling the event
|
* This is different from cancelling the event. Cancelling the event
|
||||||
* will cause the entity to keep an original target, while setting to be
|
* will cause the entity to keep an original target, while setting to be
|
||||||
* null will cause the entity to be reset
|
* null will cause the entity to be reset
|
||||||
|
@ -19,11 +19,11 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
|||||||
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, String deathMessage) {
|
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, String deathMessage) {
|
||||||
this(player, drops, droppedExp, 0, deathMessage);
|
this(player, drops, droppedExp, 0, deathMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, String deathMessage) {
|
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, String deathMessage) {
|
||||||
this(player, drops, droppedExp, newExp, 0, 0, deathMessage);
|
this(player, drops, droppedExp, newExp, 0, 0, deathMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, String deathMessage) {
|
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, String deathMessage) {
|
||||||
super(player, drops, droppedExp);
|
super(player, drops, droppedExp);
|
||||||
this.newExp = newExp;
|
this.newExp = newExp;
|
||||||
@ -73,59 +73,59 @@ public class PlayerDeathEvent extends EntityDeathEvent {
|
|||||||
public void setNewExp(int exp) {
|
public void setNewExp(int exp) {
|
||||||
newExp = exp;
|
newExp = exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Level the Player should have at respawn.
|
* Gets the Level the Player should have at respawn.
|
||||||
*
|
*
|
||||||
* @return New Level of the respawned player
|
* @return New Level of the respawned player
|
||||||
*/
|
*/
|
||||||
public int getNewLevel() {
|
public int getNewLevel() {
|
||||||
return newLevel;
|
return newLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Level the Player should have at respawn.
|
* Sets the Level the Player should have at respawn.
|
||||||
*
|
*
|
||||||
* @get level New Level of the respawned player
|
* @get level New Level of the respawned player
|
||||||
*/
|
*/
|
||||||
public void setNewLevel(int level) {
|
public void setNewLevel(int level) {
|
||||||
newLevel = level;
|
newLevel = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Total EXP the Player should have at respawn.
|
* Gets the Total EXP the Player should have at respawn.
|
||||||
*
|
*
|
||||||
* @return New Total EXP of the respawned player
|
* @return New Total EXP of the respawned player
|
||||||
*/
|
*/
|
||||||
public int getNewTotalExp() {
|
public int getNewTotalExp() {
|
||||||
return newTotalExp;
|
return newTotalExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Total EXP the Player should have at respawn.
|
* Sets the Total EXP the Player should have at respawn.
|
||||||
*
|
*
|
||||||
* @get totalExp New Total EXP of the respawned player
|
* @get totalExp New Total EXP of the respawned player
|
||||||
*/
|
*/
|
||||||
public void setNewTotalExp(int totalExp) {
|
public void setNewTotalExp(int totalExp) {
|
||||||
newTotalExp = totalExp;
|
newTotalExp = totalExp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets if the Player should keep all EXP at respawn.
|
* Gets if the Player should keep all EXP at respawn.
|
||||||
* <p>
|
* <p>
|
||||||
* This flag overrides other EXP settings
|
* This flag overrides other EXP settings
|
||||||
*
|
*
|
||||||
* @return True if Player should keep all pre-death exp
|
* @return True if Player should keep all pre-death exp
|
||||||
*/
|
*/
|
||||||
public boolean getKeepLevel() {
|
public boolean getKeepLevel() {
|
||||||
return keepLevel;
|
return keepLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets if the Player should keep all EXP at respawn.
|
* Sets if the Player should keep all EXP at respawn.
|
||||||
* <p>
|
* <p>
|
||||||
* This overrides all other EXP settings
|
* This overrides all other EXP settings
|
||||||
*
|
*
|
||||||
* @param keepLevel True to keep all current value levels
|
* @param keepLevel True to keep all current value levels
|
||||||
*/
|
*/
|
||||||
public void setKeepLevel(boolean keepLevel) {
|
public void setKeepLevel(boolean keepLevel) {
|
||||||
|
@ -72,7 +72,7 @@ public class PlayerEggThrowEvent extends PlayerEvent {
|
|||||||
/**
|
/**
|
||||||
* Get the number of mob hatches from the egg. By default the number
|
* Get the number of mob hatches from the egg. By default the number
|
||||||
* will be he number the server would've done
|
* will be he number the server would've done
|
||||||
*
|
* <p />
|
||||||
* 7/8 chance of being 0
|
* 7/8 chance of being 0
|
||||||
* 31/256 ~= 1/8 chance to be 1
|
* 31/256 ~= 1/8 chance to be 1
|
||||||
* 1/256 chance to be 4
|
* 1/256 chance to be 4
|
||||||
@ -85,7 +85,7 @@ public class PlayerEggThrowEvent extends PlayerEvent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the number of mobs coming out of the hatched egg
|
* Change the number of mobs coming out of the hatched egg
|
||||||
*
|
* <p />
|
||||||
* The boolean hatching will override this number.
|
* The boolean hatching will override this number.
|
||||||
* Ie. If hatching = false, this number will not matter
|
* Ie. If hatching = false, this number will not matter
|
||||||
*
|
*
|
||||||
|
@ -54,7 +54,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
|||||||
/**
|
/**
|
||||||
* Sets the cancellation state of this event. A canceled event will not
|
* Sets the cancellation state of this event. A canceled event will not
|
||||||
* be executed in the server, but will still pass to other plugins
|
* be executed in the server, but will still pass to other plugins
|
||||||
*
|
* <p />
|
||||||
* Canceling this event will prevent use of food (player won't lose the
|
* Canceling this event will prevent use of food (player won't lose the
|
||||||
* food item), prevent bows/snowballs/eggs from firing, etc. (player won't
|
* food item), prevent bows/snowballs/eggs from firing, etc. (player won't
|
||||||
* lose the ammo)
|
* lose the ammo)
|
||||||
|
@ -29,7 +29,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
|||||||
/**
|
/**
|
||||||
* Gets the cancellation state of this event. A cancelled event will not
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
* be executed in the server, but will still pass to other plugins
|
* be executed in the server, but will still pass to other plugins
|
||||||
*
|
* <p />
|
||||||
* If a move or teleport event is cancelled, the player will be moved or
|
* If a move or teleport event is cancelled, the player will be moved or
|
||||||
* teleported back to the Location as defined by getFrom(). This will not
|
* teleported back to the Location as defined by getFrom(). This will not
|
||||||
* fire an event
|
* fire an event
|
||||||
@ -43,7 +43,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
|||||||
/**
|
/**
|
||||||
* Sets the cancellation state of this event. A cancelled event will not
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
* be executed in the server, but will still pass to other plugins
|
* be executed in the server, but will still pass to other plugins
|
||||||
*
|
* <p />
|
||||||
* If a move or teleport event is cancelled, the player will be moved or
|
* If a move or teleport event is cancelled, the player will be moved or
|
||||||
* teleported back to the Location as defined by getFrom(). This will not
|
* teleported back to the Location as defined by getFrom(). This will not
|
||||||
* fire an event
|
* fire an event
|
||||||
|
@ -5,7 +5,7 @@ import org.bukkit.generator.BlockPopulator;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when a new chunk has finished being populated.
|
* Thrown when a new chunk has finished being populated.
|
||||||
*
|
* <p />
|
||||||
* If your intent is to populate the chunk using this event, please see {@link BlockPopulator}
|
* If your intent is to populate the chunk using this event, please see {@link BlockPopulator}
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
|
@ -16,7 +16,7 @@ public class WorldListener implements Listener {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a newly created chunk has been populated.
|
* Called when a newly created chunk has been populated.
|
||||||
*
|
* <p />
|
||||||
* If your intent is to populate the chunk using this event, please see {@link org.bukkit.generator.BlockPopulator}
|
* If your intent is to populate the chunk using this event, please see {@link org.bukkit.generator.BlockPopulator}
|
||||||
*
|
*
|
||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
@ -70,7 +70,8 @@ public class WorldListener implements Listener {
|
|||||||
*
|
*
|
||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
*/
|
*/
|
||||||
public void onWorldUnload(WorldUnloadEvent event) { }
|
public void onWorldUnload(WorldUnloadEvent event) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that is called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal.
|
* Event that is called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal.
|
||||||
*
|
*
|
||||||
|
@ -11,7 +11,7 @@ import org.bukkit.World;
|
|||||||
public abstract class BlockPopulator {
|
public abstract class BlockPopulator {
|
||||||
/**
|
/**
|
||||||
* Populates an area of blocks at or around the given chunk.
|
* Populates an area of blocks at or around the given chunk.
|
||||||
*
|
* <p />
|
||||||
* The chunks on each side of the specified chunk must already exist; that is,
|
* The chunks on each side of the specified chunk must already exist; that is,
|
||||||
* there must be one north, east, south and west of the specified chunk.
|
* there must be one north, east, south and west of the specified chunk.
|
||||||
* The "corner" chunks may not exist, in which scenario the populator should
|
* The "corner" chunks may not exist, in which scenario the populator should
|
||||||
|
@ -73,7 +73,7 @@ public abstract class ChunkGenerator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a fixed spawn location to use for a given world.
|
* Gets a fixed spawn location to use for a given world.
|
||||||
*
|
* <p />
|
||||||
* A null value is returned if a world should not use a fixed spawn point,
|
* A null value is returned if a world should not use a fixed spawn point,
|
||||||
* and will instead attempt to find one randomly.
|
* and will instead attempt to find one randomly.
|
||||||
*
|
*
|
||||||
|
@ -40,7 +40,6 @@ public interface Inventory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the given ItemStacks in the inventory.
|
* Stores the given ItemStacks in the inventory.
|
||||||
*
|
|
||||||
* This will try to fill existing stacks and empty slots as good as it can.
|
* This will try to fill existing stacks and empty slots as good as it can.
|
||||||
* It will return a HashMap of what it couldn't fit.
|
* It will return a HashMap of what it couldn't fit.
|
||||||
*
|
*
|
||||||
@ -51,7 +50,7 @@ public interface Inventory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the given ItemStacks from the inventory.
|
* Removes the given ItemStacks from the inventory.
|
||||||
*
|
* <p />
|
||||||
* It will try to remove 'as much as possible' from the types and amounts you
|
* It will try to remove 'as much as possible' from the types and amounts you
|
||||||
* give as arguments. It will return a HashMap of what it couldn't remove.
|
* give as arguments. It will return a HashMap of what it couldn't remove.
|
||||||
*
|
*
|
||||||
|
@ -40,7 +40,7 @@ public abstract class MapRenderer {
|
|||||||
*
|
*
|
||||||
* @param map The MapView being initialized.
|
* @param map The MapView being initialized.
|
||||||
*/
|
*/
|
||||||
public void initialize(MapView map) { }
|
public void initialize(MapView map) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render to the given map.
|
* Render to the given map.
|
||||||
|
@ -4,7 +4,6 @@ import org.bukkit.DyeColor;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* An object that can be colored.
|
* An object that can be colored.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface Colorable {
|
public interface Colorable {
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public interface Permissible extends ServerOperator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the specified permission, if set.
|
* Gets the value of the specified permission, if set.
|
||||||
*
|
* <p />
|
||||||
* If a permission override is not set on this object, the default value of the permission will be returned.
|
* If a permission override is not set on this object, the default value of the permission will be returned.
|
||||||
*
|
*
|
||||||
* @param name Name of the permission
|
* @param name Name of the permission
|
||||||
@ -35,7 +35,7 @@ public interface Permissible extends ServerOperator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the value of the specified permission, if set.
|
* Gets the value of the specified permission, if set.
|
||||||
*
|
* <p />
|
||||||
* If a permission override is not set on this object, the default value of the permission will be returned
|
* If a permission override is not set on this object, the default value of the permission will be returned
|
||||||
*
|
*
|
||||||
* @param perm Permission to get
|
* @param perm Permission to get
|
||||||
@ -91,7 +91,7 @@ public interface Permissible extends ServerOperator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculates the permissions for this object, if the attachments have changed values.
|
* Recalculates the permissions for this object, if the attachments have changed values.
|
||||||
*
|
* <p />
|
||||||
* This should very rarely need to be called from a plugin.
|
* This should very rarely need to be called from a plugin.
|
||||||
*/
|
*/
|
||||||
public void recalculatePermissions();
|
public void recalculatePermissions();
|
||||||
|
@ -91,7 +91,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the default value of this permission.
|
* Sets the default value of this permission.
|
||||||
*
|
* <p />
|
||||||
* This will not be saved to disk, and is a temporary operation until the server reloads permissions.
|
* This will not be saved to disk, and is a temporary operation until the server reloads permissions.
|
||||||
* Changing this default will cause all {@link Permissible}s that contain this permission to recalculate their permissions
|
* Changing this default will cause all {@link Permissible}s that contain this permission to recalculate their permissions
|
||||||
*
|
*
|
||||||
@ -117,7 +117,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the description of this permission.
|
* Sets the description of this permission.
|
||||||
*
|
* <p />
|
||||||
* This will not be saved to disk, and is a temporary operation until the server reloads permissions.
|
* This will not be saved to disk, and is a temporary operation until the server reloads permissions.
|
||||||
*
|
*
|
||||||
* @param value The new description to set
|
* @param value The new description to set
|
||||||
@ -132,7 +132,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a set containing every {@link Permissible} that has this permission.
|
* Gets a set containing every {@link Permissible} that has this permission.
|
||||||
*
|
* <p />
|
||||||
* This set cannot be modified.
|
* This set cannot be modified.
|
||||||
*
|
*
|
||||||
* @return Set containing permissibles with this permission
|
* @return Set containing permissibles with this permission
|
||||||
@ -143,7 +143,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculates all {@link Permissible}s that contain this permission.
|
* Recalculates all {@link Permissible}s that contain this permission.
|
||||||
*
|
* <p />
|
||||||
* This should be called after modifying the children, and is automatically called after modifying the default value
|
* This should be called after modifying the children, and is automatically called after modifying the default value
|
||||||
*/
|
*/
|
||||||
public void recalculatePermissibles() {
|
public void recalculatePermissibles() {
|
||||||
@ -158,7 +158,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds this permission to the specified parent permission.
|
* Adds this permission to the specified parent permission.
|
||||||
*
|
* <p />
|
||||||
* If the parent permission does not exist, it will be created and registered.
|
* If the parent permission does not exist, it will be created and registered.
|
||||||
*
|
*
|
||||||
* @param name Name of the parent permission
|
* @param name Name of the parent permission
|
||||||
@ -194,7 +194,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.
|
* Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.
|
||||||
*
|
* <p />
|
||||||
* The data may contain a list of name:data, where the data contains the following keys:
|
* The data may contain a list of name:data, where the data contains the following keys:
|
||||||
* default: Boolean true or false. If not specified, false.
|
* default: Boolean true or false. If not specified, false.
|
||||||
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
|
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
|
||||||
@ -220,7 +220,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a Permission from a map of data, usually used from retrieval from a yaml file.
|
* Loads a Permission from a map of data, usually used from retrieval from a yaml file.
|
||||||
*
|
* <p />
|
||||||
* The data may contain the following keys:
|
* The data may contain the following keys:
|
||||||
* default: Boolean true or false. If not specified, false.
|
* default: Boolean true or false. If not specified, false.
|
||||||
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
|
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
|
||||||
@ -236,7 +236,7 @@ public class Permission {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads a Permission from a map of data, usually used from retrieval from a yaml file.
|
* Loads a Permission from a map of data, usually used from retrieval from a yaml file.
|
||||||
*
|
* <p />
|
||||||
* The data may contain the following keys:
|
* The data may contain the following keys:
|
||||||
* default: Boolean true or false. If not specified, false.
|
* default: Boolean true or false. If not specified, false.
|
||||||
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
|
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
|
||||||
|
@ -62,7 +62,7 @@ public class PermissionAttachment {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a copy of all set permissions and values contained within this attachment.
|
* Gets a copy of all set permissions and values contained within this attachment.
|
||||||
*
|
* <p />
|
||||||
* This map may be modified but will not affect the attachment, as it is a copy.
|
* This map may be modified but will not affect the attachment, as it is a copy.
|
||||||
*
|
*
|
||||||
* @return Copy of all permissions and values expressed by this attachment
|
* @return Copy of all permissions and values expressed by this attachment
|
||||||
@ -95,7 +95,7 @@ public class PermissionAttachment {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the specified permission from this attachment.
|
* Removes the specified permission from this attachment.
|
||||||
*
|
* <p />
|
||||||
* If the permission does not exist in this attachment, nothing will happen.
|
* If the permission does not exist in this attachment, nothing will happen.
|
||||||
*
|
*
|
||||||
* @param name Name of the permission to remove
|
* @param name Name of the permission to remove
|
||||||
@ -107,7 +107,7 @@ public class PermissionAttachment {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the specified permission from this attachment.
|
* Removes the specified permission from this attachment.
|
||||||
*
|
* <p />
|
||||||
* If the permission does not exist in this attachment, nothing will happen.
|
* If the permission does not exist in this attachment, nothing will happen.
|
||||||
*
|
*
|
||||||
* @param perm Permission to remove
|
* @param perm Permission to remove
|
||||||
|
@ -55,7 +55,7 @@ public interface PluginLoader {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables the specified plugin
|
* Enables the specified plugin
|
||||||
*
|
* <p />
|
||||||
* Attempting to enable a plugin that is already enabled will have no effect
|
* Attempting to enable a plugin that is already enabled will have no effect
|
||||||
*
|
*
|
||||||
* @param plugin Plugin to enable
|
* @param plugin Plugin to enable
|
||||||
@ -64,7 +64,7 @@ public interface PluginLoader {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables the specified plugin
|
* Disables the specified plugin
|
||||||
*
|
* <p />
|
||||||
* Attempting to disable a plugin that is not enabled will have no effect
|
* Attempting to disable a plugin that is not enabled will have no effect
|
||||||
*
|
*
|
||||||
* @param plugin Plugin to disable
|
* @param plugin Plugin to disable
|
||||||
|
@ -8,7 +8,6 @@ import org.bukkit.event.Event.Priority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.permissions.Permissible;
|
import org.bukkit.permissions.Permissible;
|
||||||
import org.bukkit.permissions.Permission;
|
import org.bukkit.permissions.Permission;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles all plugin management from the Server
|
* Handles all plugin management from the Server
|
||||||
@ -25,7 +24,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given plugin is loaded and returns it when applicable
|
* Checks if the given plugin is loaded and returns it when applicable
|
||||||
*
|
* <p />
|
||||||
* Please note that the name of the plugin is case-sensitive
|
* Please note that the name of the plugin is case-sensitive
|
||||||
*
|
*
|
||||||
* @param name Name of the plugin to check
|
* @param name Name of the plugin to check
|
||||||
@ -42,7 +41,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given plugin is enabled or not
|
* Checks if the given plugin is enabled or not
|
||||||
*
|
* <p />
|
||||||
* Please note that the name of the plugin is case-sensitive.
|
* Please note that the name of the plugin is case-sensitive.
|
||||||
*
|
*
|
||||||
* @param name Name of the plugin to check
|
* @param name Name of the plugin to check
|
||||||
@ -60,7 +59,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the plugin in the specified file
|
* Loads the plugin in the specified file
|
||||||
*
|
* <p />
|
||||||
* File must be valid according to the current enabled Plugin interfaces
|
* File must be valid according to the current enabled Plugin interfaces
|
||||||
*
|
*
|
||||||
* @param file File containing the plugin to load
|
* @param file File containing the plugin to load
|
||||||
@ -119,7 +118,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables the specified plugin
|
* Enables the specified plugin
|
||||||
*
|
* <p />
|
||||||
* Attempting to enable a plugin that is already enabled will have no effect
|
* Attempting to enable a plugin that is already enabled will have no effect
|
||||||
*
|
*
|
||||||
* @param plugin Plugin to enable
|
* @param plugin Plugin to enable
|
||||||
@ -128,7 +127,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables the specified plugin
|
* Disables the specified plugin
|
||||||
*
|
* <p />
|
||||||
* Attempting to disable a plugin that is not enabled will have no effect
|
* Attempting to disable a plugin that is not enabled will have no effect
|
||||||
*
|
*
|
||||||
* @param plugin Plugin to disable
|
* @param plugin Plugin to disable
|
||||||
@ -145,7 +144,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a {@link Permission} to this plugin manager.
|
* Adds a {@link Permission} to this plugin manager.
|
||||||
*
|
* <p />
|
||||||
* If a permission is already defined with the given name of the new permission,
|
* If a permission is already defined with the given name of the new permission,
|
||||||
* an exception will be thrown.
|
* an exception will be thrown.
|
||||||
*
|
*
|
||||||
@ -156,9 +155,9 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a {@link Permission} registration from this plugin manager.
|
* Removes a {@link Permission} registration from this plugin manager.
|
||||||
*
|
* <p />
|
||||||
* If the specified permission does not exist in this plugin manager, nothing will happen.
|
* If the specified permission does not exist in this plugin manager, nothing will happen.
|
||||||
*
|
* <p />
|
||||||
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
|
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
|
||||||
*
|
*
|
||||||
* @param perm Permission to remove
|
* @param perm Permission to remove
|
||||||
@ -167,9 +166,9 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes a {@link Permission} registration from this plugin manager.
|
* Removes a {@link Permission} registration from this plugin manager.
|
||||||
*
|
* <p />
|
||||||
* If the specified permission does not exist in this plugin manager, nothing will happen.
|
* If the specified permission does not exist in this plugin manager, nothing will happen.
|
||||||
*
|
* <p />
|
||||||
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
|
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
|
||||||
*
|
*
|
||||||
* @param name Permission to remove
|
* @param name Permission to remove
|
||||||
@ -186,7 +185,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculates the defaults for the given {@link Permission}.
|
* Recalculates the defaults for the given {@link Permission}.
|
||||||
*
|
* <p />
|
||||||
* This will have no effect if the specified permission is not registered here.
|
* This will have no effect if the specified permission is not registered here.
|
||||||
*
|
*
|
||||||
* @param perm Permission to recalculate
|
* @param perm Permission to recalculate
|
||||||
@ -195,7 +194,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribes the given Permissible for information about the requested Permission, by name.
|
* Subscribes the given Permissible for information about the requested Permission, by name.
|
||||||
*
|
* <p />
|
||||||
* If the specified Permission changes in any form, the Permissible will be asked to recalculate.
|
* If the specified Permission changes in any form, the Permissible will be asked to recalculate.
|
||||||
*
|
*
|
||||||
* @param permission Permission to subscribe to
|
* @param permission Permission to subscribe to
|
||||||
@ -221,7 +220,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribes to the given Default permissions by operator status
|
* Subscribes to the given Default permissions by operator status
|
||||||
*
|
* <p />
|
||||||
* If the specified defaults change in any form, the Permissible will be asked to recalculate.
|
* If the specified defaults change in any form, the Permissible will be asked to recalculate.
|
||||||
*
|
*
|
||||||
* @param op Default list to subscribe to
|
* @param op Default list to subscribe to
|
||||||
@ -247,7 +246,7 @@ public interface PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a set of all registered permissions.
|
* Gets a set of all registered permissions.
|
||||||
*
|
* <p />
|
||||||
* This set is a copy and will not be modified live.
|
* This set is a copy and will not be modified live.
|
||||||
*
|
*
|
||||||
* @return Set containing all current registered permissions
|
* @return Set containing all current registered permissions
|
||||||
|
@ -168,7 +168,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the plugin in the specified file
|
* Loads the plugin in the specified file
|
||||||
*
|
* <p />
|
||||||
* File must be valid according to the current enabled Plugin interfaces
|
* File must be valid according to the current enabled Plugin interfaces
|
||||||
*
|
*
|
||||||
* @param file File containing the plugin to load
|
* @param file File containing the plugin to load
|
||||||
@ -183,7 +183,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the plugin in the specified file
|
* Loads the plugin in the specified file
|
||||||
*
|
* <p />
|
||||||
* File must be valid according to the current enabled Plugin interfaces
|
* File must be valid according to the current enabled Plugin interfaces
|
||||||
*
|
*
|
||||||
* @param file File containing the plugin to load
|
* @param file File containing the plugin to load
|
||||||
@ -226,7 +226,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given plugin is loaded and returns it when applicable
|
* Checks if the given plugin is loaded and returns it when applicable
|
||||||
*
|
* <p />
|
||||||
* Please note that the name of the plugin is case-sensitive
|
* Please note that the name of the plugin is case-sensitive
|
||||||
*
|
*
|
||||||
* @param name Name of the plugin to check
|
* @param name Name of the plugin to check
|
||||||
@ -242,7 +242,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given plugin is enabled or not
|
* Checks if the given plugin is enabled or not
|
||||||
*
|
* <p />
|
||||||
* Please note that the name of the plugin is case-sensitive.
|
* Please note that the name of the plugin is case-sensitive.
|
||||||
*
|
*
|
||||||
* @param name Name of the plugin to check
|
* @param name Name of the plugin to check
|
||||||
@ -332,7 +332,7 @@ public final class SimplePluginManager implements PluginManager {
|
|||||||
*/
|
*/
|
||||||
public synchronized void callEvent(Event event) {
|
public synchronized void callEvent(Event event) {
|
||||||
for (RegisteredListener registration : getEventListeners(event.getType())) {
|
for (RegisteredListener registration : getEventListeners(event.getType())) {
|
||||||
if(!registration.getPlugin().isEnabled()) {
|
if (!registration.getPlugin().isEnabled()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ public abstract class JavaPlugin implements Plugin {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes this plugin with the given variables.
|
* Initializes this plugin with the given variables.
|
||||||
*
|
* <p />
|
||||||
* This method should never be called manually.
|
* This method should never be called manually.
|
||||||
*
|
*
|
||||||
* @param loader PluginLoader that is responsible for this plugin
|
* @param loader PluginLoader that is responsible for this plugin
|
||||||
|
@ -37,9 +37,7 @@ import org.yaml.snakeyaml.error.YAMLException;
|
|||||||
*/
|
*/
|
||||||
public class JavaPluginLoader implements PluginLoader {
|
public class JavaPluginLoader implements PluginLoader {
|
||||||
private final Server server;
|
private final Server server;
|
||||||
protected final Pattern[] fileFilters = new Pattern[] {
|
protected final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
|
||||||
Pattern.compile("\\.jar$"),
|
|
||||||
};
|
|
||||||
protected final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
|
protected final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
|
||||||
protected final Map<String, PluginClassLoader> loaders = new HashMap<String, PluginClassLoader>();
|
protected final Map<String, PluginClassLoader> loaders = new HashMap<String, PluginClassLoader>();
|
||||||
|
|
||||||
@ -1006,7 +1004,7 @@ public class JavaPluginLoader implements PluginLoader {
|
|||||||
|
|
||||||
if (plugin.isEnabled()) {
|
if (plugin.isEnabled()) {
|
||||||
server.getPluginManager().callEvent(new PluginDisableEvent(plugin));
|
server.getPluginManager().callEvent(new PluginDisableEvent(plugin));
|
||||||
|
|
||||||
JavaPlugin jPlugin = (JavaPlugin) plugin;
|
JavaPlugin jPlugin = (JavaPlugin) plugin;
|
||||||
ClassLoader cloader = jPlugin.getClassLoader();
|
ClassLoader cloader = jPlugin.getClassLoader();
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public final class PluginMessageListenerRegistration {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the plugin channel that this registration is about.
|
* Gets the plugin channel that this registration is about.
|
||||||
*
|
*
|
||||||
* @return Plugin channel.
|
* @return Plugin channel.
|
||||||
*/
|
*/
|
||||||
public String getChannel() {
|
public String getChannel() {
|
||||||
|
@ -362,7 +362,7 @@ public class StandardMessenger implements Messenger {
|
|||||||
|
|
||||||
synchronized (incomingLock) {
|
synchronized (incomingLock) {
|
||||||
Set<PluginMessageListenerRegistration> registrations = incomingByPlugin.get(registration.getPlugin());
|
Set<PluginMessageListenerRegistration> registrations = incomingByPlugin.get(registration.getPlugin());
|
||||||
|
|
||||||
if (registrations != null) {
|
if (registrations != null) {
|
||||||
return registrations.contains(registration);
|
return registrations.contains(registration);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public interface BukkitScheduler {
|
|||||||
/**
|
/**
|
||||||
* Calls a method on the main thread and returns a Future object
|
* Calls a method on the main thread and returns a Future object
|
||||||
* This task will be executed by the main server thread
|
* This task will be executed by the main server thread
|
||||||
*
|
* <p />
|
||||||
* Note: The Future.get() methods must NOT be called from the main thread
|
* Note: The Future.get() methods must NOT be called from the main thread
|
||||||
* Note2: There is at least an average of 10ms latency until the isDone() method returns true
|
* Note2: There is at least an average of 10ms latency until the isDone() method returns true
|
||||||
*
|
*
|
||||||
@ -108,33 +108,33 @@ public interface BukkitScheduler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the task currently running.
|
* Check if the task currently running.
|
||||||
*
|
* <p />
|
||||||
* A repeating task might not be running currently, but will be running in the future.
|
* A repeating task might not be running currently, but will be running in the future.
|
||||||
* A task that has finished, and does not repeat, will not be running ever again.
|
* A task that has finished, and does not repeat, will not be running ever again.
|
||||||
*
|
* <p />
|
||||||
* Explicitly, a task is running if there exists a thread for it, and that thread is alive.
|
* Explicitly, a task is running if there exists a thread for it, and that thread is alive.
|
||||||
*
|
*
|
||||||
* @param taskId The task to check.
|
* @param taskId The task to check.
|
||||||
*
|
* <p />
|
||||||
* @return If the task is currently running.
|
* @return If the task is currently running.
|
||||||
*/
|
*/
|
||||||
public boolean isCurrentlyRunning(int taskId);
|
public boolean isCurrentlyRunning(int taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the task queued to be run later.
|
* Check if the task queued to be run later.
|
||||||
*
|
* <p />
|
||||||
* If a repeating task is currently running, it might not be queued now but could be in the future.
|
* If a repeating task is currently running, it might not be queued now but could be in the future.
|
||||||
* A task that is not queued, and not running, will not be queued again.
|
* A task that is not queued, and not running, will not be queued again.
|
||||||
*
|
*
|
||||||
* @param taskId The task to check.
|
* @param taskId The task to check.
|
||||||
*
|
* <p />
|
||||||
* @return If the task is queued to be run.
|
* @return If the task is queued to be run.
|
||||||
*/
|
*/
|
||||||
public boolean isQueued(int taskId);
|
public boolean isQueued(int taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of all active workers.
|
* Returns a list of all active workers.
|
||||||
*
|
* <p />
|
||||||
* This list contains asynch tasks that are being executed by separate threads.
|
* This list contains asynch tasks that are being executed by separate threads.
|
||||||
*
|
*
|
||||||
* @return Active workers
|
* @return Active workers
|
||||||
|
@ -5,7 +5,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
/**
|
/**
|
||||||
* Represents a worker thread for the scheduler. This gives information about
|
* Represents a worker thread for the scheduler. This gives information about
|
||||||
* the Thread object for the task, owner of the task and the taskId.
|
* the Thread object for the task, owner of the task and the taskId.
|
||||||
*
|
* </p>
|
||||||
* Workers are used to execute async tasks.
|
* Workers are used to execute async tasks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -259,7 +259,6 @@ public class BlockIterator implements Iterator<Block> {
|
|||||||
*
|
*
|
||||||
* @param loc The location for the start of the ray trace
|
* @param loc The location for the start of the ray trace
|
||||||
* @param yOffset The trace begins vertically offset from the start vector by this value
|
* @param yOffset The trace begins vertically offset from the start vector by this value
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public BlockIterator(Location loc, double yOffset) {
|
public BlockIterator(Location loc, double yOffset) {
|
||||||
@ -270,7 +269,6 @@ public class BlockIterator implements Iterator<Block> {
|
|||||||
* Constructs the BlockIterator.
|
* Constructs the BlockIterator.
|
||||||
*
|
*
|
||||||
* @param loc The location for the start of the ray trace
|
* @param loc The location for the start of the ray trace
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public BlockIterator(Location loc) {
|
public BlockIterator(Location loc) {
|
||||||
@ -293,7 +291,6 @@ public class BlockIterator implements Iterator<Block> {
|
|||||||
* Constructs the BlockIterator.
|
* Constructs the BlockIterator.
|
||||||
*
|
*
|
||||||
* @param entity Information from the entity is used to set up the trace
|
* @param entity Information from the entity is used to set up the trace
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public BlockIterator(LivingEntity entity) {
|
public BlockIterator(LivingEntity entity) {
|
||||||
@ -302,7 +299,6 @@ public class BlockIterator implements Iterator<Block> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the iteration has more elements
|
* Returns true if the iteration has more elements
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
|
@ -279,7 +279,7 @@ public class Vector implements Cloneable, ConfigurationSerializable {
|
|||||||
/**
|
/**
|
||||||
* Calculates the cross product of this vector with another. The cross
|
* Calculates the cross product of this vector with another. The cross
|
||||||
* product is defined as:
|
* product is defined as:
|
||||||
*
|
* <p />
|
||||||
* x = y1 * z2 - y2 * z1<br/>
|
* x = y1 * z2 - y2 * z1<br/>
|
||||||
* y = z1 * x2 - z2 * x1<br/>
|
* y = z1 * x2 - z2 * x1<br/>
|
||||||
* z = x1 * y2 - x2 * y1
|
* z = x1 * y2 - x2 * y1
|
||||||
@ -507,7 +507,7 @@ public class Vector implements Cloneable, ConfigurationSerializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks to see if two objects are equal.
|
* Checks to see if two objects are equal.
|
||||||
*
|
* <p />
|
||||||
* Only two Vectors can ever return true. This method uses a fuzzy match
|
* Only two Vectors can ever return true. This method uses a fuzzy match
|
||||||
* to account for floating point errors. The epsilon can be retrieved
|
* to account for floating point errors. The epsilon can be retrieved
|
||||||
* with epsilon.
|
* with epsilon.
|
||||||
@ -560,7 +560,6 @@ public class Vector implements Cloneable, ConfigurationSerializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns this vector's components as x,y,z.
|
* Returns this vector's components as x,y,z.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -27,7 +27,6 @@ import org.yaml.snakeyaml.representer.Representer;
|
|||||||
* a file and call its load() method. For specifying node paths in the
|
* a file and call its load() method. For specifying node paths in the
|
||||||
* various get*() methods, they support SK's path notation, allowing you to
|
* various get*() methods, they support SK's path notation, allowing you to
|
||||||
* select child nodes by delimiting node names with periods.
|
* select child nodes by delimiting node names with periods.
|
||||||
*
|
|
||||||
* <p>
|
* <p>
|
||||||
* For example, given the following configuration file:
|
* For example, given the following configuration file:
|
||||||
* </p>
|
* </p>
|
||||||
@ -48,7 +47,6 @@ import org.yaml.snakeyaml.representer.Representer;
|
|||||||
* eats:
|
* eats:
|
||||||
* babies: true
|
* babies: true
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
* <p>
|
* <p>
|
||||||
* Calling code could access sturmeh's baby eating state by using <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are methods such as <code>getStringList</code> that will return a type safe list.
|
* Calling code could access sturmeh's baby eating state by using <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are methods such as <code>getStringList</code> that will return a type safe list.
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,7 @@ public abstract class OctaveGenerator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the scale used for all coordinates passed to this generator.
|
* Sets the scale used for all coordinates passed to this generator.
|
||||||
*
|
* <p />
|
||||||
* This is the equivalent to setting each coordinate to the specified value.
|
* This is the equivalent to setting each coordinate to the specified value.
|
||||||
*
|
*
|
||||||
* @param scale New value to scale each coordinate by
|
* @param scale New value to scale each coordinate by
|
||||||
@ -176,8 +176,8 @@ public abstract class OctaveGenerator {
|
|||||||
y *= yScale;
|
y *= yScale;
|
||||||
z *= zScale;
|
z *= zScale;
|
||||||
|
|
||||||
for (int i = 0; i < octaves.length; i++) {
|
for (NoiseGenerator octave : octaves) {
|
||||||
result += octaves[i].noise(x * freq, y * freq, z * freq) * amp;
|
result += octave.noise(x * freq, y * freq, z * freq) * amp;
|
||||||
max += amp;
|
max += amp;
|
||||||
freq *= frequency;
|
freq *= frequency;
|
||||||
amp *= amplitude;
|
amp *= amplitude;
|
||||||
|
@ -5,7 +5,7 @@ import org.bukkit.World;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates simplex-based noise.
|
* Generates simplex-based noise.
|
||||||
*
|
* <p />
|
||||||
* This is a modified version of the freely published version in the paper by
|
* This is a modified version of the freely published version in the paper by
|
||||||
* Stefan Gustavson at http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
|
* Stefan Gustavson at http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
|
||||||
*/
|
*/
|
||||||
|
@ -16,24 +16,24 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract FileConfiguration getConfig();
|
public abstract FileConfiguration getConfig();
|
||||||
|
|
||||||
public abstract String getTestValuesString();
|
public abstract String getTestValuesString();
|
||||||
|
|
||||||
public abstract String getTestHeaderInput();
|
public abstract String getTestHeaderInput();
|
||||||
|
|
||||||
public abstract String getTestHeaderResult();
|
public abstract String getTestHeaderResult();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSave_File() throws Exception {
|
public void testSave_File() throws Exception {
|
||||||
FileConfiguration config = getConfig();
|
FileConfiguration config = getConfig();
|
||||||
File file = testFolder.newFile("test.config");
|
File file = testFolder.newFile("test.config");
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
||||||
config.set(entry.getKey(), entry.getValue());
|
config.set(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
config.save(file);
|
config.save(file);
|
||||||
|
|
||||||
assertTrue(file.isFile());
|
assertTrue(file.isFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,27 +41,27 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
public void testSave_String() throws Exception {
|
public void testSave_String() throws Exception {
|
||||||
FileConfiguration config = getConfig();
|
FileConfiguration config = getConfig();
|
||||||
File file = testFolder.newFile("test.config");
|
File file = testFolder.newFile("test.config");
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
||||||
config.set(entry.getKey(), entry.getValue());
|
config.set(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
config.save(file.getAbsolutePath());
|
config.save(file.getAbsolutePath());
|
||||||
|
|
||||||
assertTrue(file.isFile());
|
assertTrue(file.isFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSaveToString() {
|
public void testSaveToString() {
|
||||||
FileConfiguration config = getConfig();
|
FileConfiguration config = getConfig();
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
||||||
config.set(entry.getKey(), entry.getValue());
|
config.set(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
String result = config.saveToString();
|
String result = config.saveToString();
|
||||||
String expected = getTestValuesString();
|
String expected = getTestValuesString();
|
||||||
|
|
||||||
assertEquals(expected, result);
|
assertEquals(expected, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,19 +72,19 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
||||||
String saved = getTestValuesString();
|
String saved = getTestValuesString();
|
||||||
Map<String, Object> values = getTestValues();
|
Map<String, Object> values = getTestValues();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
writer.write(saved);
|
writer.write(saved);
|
||||||
} finally {
|
} finally {
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
config.load(file);
|
config.load(file);
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
||||||
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(values.keySet(), config.getKeys(true));
|
assertEquals(values.keySet(), config.getKeys(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,19 +95,19 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
||||||
String saved = getTestValuesString();
|
String saved = getTestValuesString();
|
||||||
Map<String, Object> values = getTestValues();
|
Map<String, Object> values = getTestValues();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
writer.write(saved);
|
writer.write(saved);
|
||||||
} finally {
|
} finally {
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
config.load(file.getAbsolutePath());
|
config.load(file.getAbsolutePath());
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
||||||
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(values.keySet(), config.getKeys(true));
|
assertEquals(values.keySet(), config.getKeys(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,13 +116,13 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
FileConfiguration config = getConfig();
|
FileConfiguration config = getConfig();
|
||||||
Map<String, Object> values = getTestValues();
|
Map<String, Object> values = getTestValues();
|
||||||
String saved = getTestValuesString();
|
String saved = getTestValuesString();
|
||||||
|
|
||||||
config.loadFromString(saved);
|
config.loadFromString(saved);
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
||||||
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(values.keySet(), config.getKeys(true));
|
assertEquals(values.keySet(), config.getKeys(true));
|
||||||
assertEquals(saved, config.saveToString());
|
assertEquals(saved, config.saveToString());
|
||||||
}
|
}
|
||||||
@ -131,14 +131,14 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
public void testSaveToStringWithHeader() {
|
public void testSaveToStringWithHeader() {
|
||||||
FileConfiguration config = getConfig();
|
FileConfiguration config = getConfig();
|
||||||
config.options().header(getTestHeaderInput());
|
config.options().header(getTestHeaderInput());
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
|
||||||
config.set(entry.getKey(), entry.getValue());
|
config.set(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
String result = config.saveToString();
|
String result = config.saveToString();
|
||||||
String expected = getTestHeaderResult() + "\n" + getTestValuesString();
|
String expected = getTestHeaderResult() + "\n" + getTestValuesString();
|
||||||
|
|
||||||
assertEquals(expected, result);
|
assertEquals(expected, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,15 +149,15 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
|
|||||||
String saved = getTestValuesString();
|
String saved = getTestValuesString();
|
||||||
String header = getTestHeaderResult();
|
String header = getTestHeaderResult();
|
||||||
String expected = getTestHeaderInput();
|
String expected = getTestHeaderInput();
|
||||||
|
|
||||||
config.loadFromString(header + "\n" + saved);
|
config.loadFromString(header + "\n" + saved);
|
||||||
|
|
||||||
assertEquals(expected, config.options().header());
|
assertEquals(expected, config.options().header());
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
for (Map.Entry<String, Object> entry : values.entrySet()) {
|
||||||
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
assertEquals(entry.getValue(), config.get(entry.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(values.keySet(), config.getKeys(true));
|
assertEquals(values.keySet(), config.getKeys(true));
|
||||||
assertEquals(header + "\n" + saved, config.saveToString());
|
assertEquals(header + "\n" + saved, config.saveToString());
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,12 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class YamlConfigurationTest extends FileConfigurationTest {
|
public class YamlConfigurationTest extends FileConfigurationTest {
|
||||||
@Override
|
@Override
|
||||||
public YamlConfiguration getConfig() {
|
public YamlConfiguration getConfig() {
|
||||||
return new YamlConfiguration();
|
return new YamlConfiguration();
|
||||||
@ -25,7 +24,7 @@ public class YamlConfigurationTest extends FileConfigurationTest {
|
|||||||
public String getTestHeaderResult() {
|
public String getTestHeaderResult() {
|
||||||
return "# This is a sample\n# header.\n# \n# Newline above should be commented.\n\n";
|
return "# This is a sample\n# header.\n# \n# Newline above should be commented.\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTestValuesString() {
|
public String getTestValuesString() {
|
||||||
return "integer: -2147483648\n" +
|
return "integer: -2147483648\n" +
|
||||||
@ -51,12 +50,12 @@ public class YamlConfigurationTest extends FileConfigurationTest {
|
|||||||
public void testSaveToStringWithIndent() {
|
public void testSaveToStringWithIndent() {
|
||||||
YamlConfiguration config = getConfig();
|
YamlConfiguration config = getConfig();
|
||||||
config.options().indent(9);
|
config.options().indent(9);
|
||||||
|
|
||||||
config.set("section.key", 1);
|
config.set("section.key", 1);
|
||||||
|
|
||||||
String result = config.saveToString();
|
String result = config.saveToString();
|
||||||
String expected = "section:\n key: 1\n";
|
String expected = "section:\n key: 1\n";
|
||||||
|
|
||||||
assertEquals(expected, result);
|
assertEquals(expected, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ public class StandardMessengerTest {
|
|||||||
assertFalse(messenger.isOutgoingChannelRegistered(plugin, "foo"));
|
assertFalse(messenger.isOutgoingChannelRegistered(plugin, "foo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=ReservedChannelException.class)
|
@Test(expected = ReservedChannelException.class)
|
||||||
public void testReservedOutgoingRegistration() {
|
public void testReservedOutgoingRegistration() {
|
||||||
Messenger messenger = getMessenger();
|
Messenger messenger = getMessenger();
|
||||||
TestPlugin plugin = getPlugin();
|
TestPlugin plugin = getPlugin();
|
||||||
@ -86,7 +86,7 @@ public class StandardMessengerTest {
|
|||||||
assertFalse(listener.hasReceived());
|
assertFalse(listener.hasReceived());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=ReservedChannelException.class)
|
@Test(expected = ReservedChannelException.class)
|
||||||
public void testReservedIncomingRegistration() {
|
public void testReservedIncomingRegistration() {
|
||||||
Messenger messenger = getMessenger();
|
Messenger messenger = getMessenger();
|
||||||
TestPlugin plugin = getPlugin();
|
TestPlugin plugin = getPlugin();
|
||||||
@ -94,7 +94,7 @@ public class StandardMessengerTest {
|
|||||||
messenger.registerIncomingPluginChannel(plugin, "REGISTER", new TestMessageListener("foo", "bar".getBytes()));
|
messenger.registerIncomingPluginChannel(plugin, "REGISTER", new TestMessageListener("foo", "bar".getBytes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected=IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
public void testDuplicateIncomingRegistration() {
|
public void testDuplicateIncomingRegistration() {
|
||||||
Messenger messenger = getMessenger();
|
Messenger messenger = getMessenger();
|
||||||
TestPlugin plugin = getPlugin();
|
TestPlugin plugin = getPlugin();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren