Generic cleanup of warnings, whitespace and style.

This commit is contained in:
Erik Broes 2011-12-25 16:02:30 +01:00
parent a345613cfa
commit b9fca3c04d
257 changed files with 1408 additions and 1152 deletions

View File

@ -32,6 +32,7 @@ public interface BlockChangeDelegate {
/** /**
* Get the block type at the location. * Get the block type at the location.
*
* @param x X coordinate * @param x X coordinate
* @param y Y coordinate * @param y Y coordinate
* @param z Z coordinate * @param z Z coordinate

View File

@ -42,12 +42,14 @@ public interface Chunk {
/** /**
* Capture thread-safe read-only snapshot of chunk data * Capture thread-safe read-only snapshot of chunk data
*
* @return ChunkSnapshot * @return ChunkSnapshot
*/ */
ChunkSnapshot getChunkSnapshot(); ChunkSnapshot getChunkSnapshot();
/** /**
* Capture thread-safe read-only snapshot of chunk data * Capture thread-safe read-only snapshot of chunk data
*
* @param includeMaxblocky - if true, snapshot includes per-coordinate maximum Y values * @param includeMaxblocky - if true, snapshot includes per-coordinate maximum Y values
* @param includeBiome - if true, snapshot includes per-coordinate biome type * @param includeBiome - if true, snapshot includes per-coordinate biome type
* @param includeBiomeTempRain - if true, snapshot includes per-coordinate raw biome temperature and rainfall * @param includeBiomeTempRain - if true, snapshot includes per-coordinate raw biome temperature and rainfall
@ -57,12 +59,14 @@ public interface Chunk {
/** /**
* Get a list of all entities in the chunk. * Get a list of all entities in the chunk.
*
* @return The entities. * @return The entities.
*/ */
Entity[] getEntities(); Entity[] getEntities();
/** /**
* Get a list of all tile entities in the chunk. * Get a list of all tile entities in the chunk.
*
* @return The tile entities. * @return The tile entities.
*/ */
BlockState[] getTileEntities(); BlockState[] getTileEntities();

View File

@ -1,6 +1,7 @@
package org.bukkit; package org.bukkit;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
/** /**
* Represents a static, thread-safe snapshot of chunk of blocks * Represents a static, thread-safe snapshot of chunk of blocks
* Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering) * Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)
@ -106,6 +107,7 @@ public interface ChunkSnapshot {
/** /**
* Get world full time when chunk snapshot was captured * Get world full time when chunk snapshot was captured
*
* @return time in ticks * @return time in ticks
*/ */
long getCaptureFullTime(); long getCaptureFullTime();

View File

@ -398,6 +398,7 @@ public interface Server {
/** /**
* Adds a recipe to the crafting manager. * Adds a recipe to the crafting manager.
*
* @param recipe The recipe to add. * @param recipe The recipe to add.
* @return True to indicate that the recipe was added. * @return True to indicate that the recipe was added.
*/ */

View File

@ -552,12 +552,14 @@ public interface World {
/** /**
* Gets the current PVP setting for this world. * Gets the current PVP setting for this world.
*
* @return True if PVP is enabled * @return True if PVP is enabled
*/ */
public boolean getPVP(); public boolean getPVP();
/** /**
* Sets the PVP setting for this world. * Sets the PVP setting for this world.
*
* @param pvp True/False whether PVP should be Enabled. * @param pvp True/False whether PVP should be Enabled.
*/ */
public void setPVP(boolean pvp); public void setPVP(boolean pvp);
@ -614,6 +616,7 @@ public interface World {
/** /**
* Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome * Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome
* data. Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk. * data. Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk.
*
* @param x - chunk x coordinate * @param x - chunk x coordinate
* @param z - chunk z coordinate * @param z - chunk z coordinate
* @param includeBiome - if true, snapshot includes per-coordinate biome type * @param includeBiome - if true, snapshot includes per-coordinate biome type

View File

@ -23,12 +23,14 @@ public interface Block {
/** /**
* @deprecated use {@link #getRelative(BlockFace face)} * @deprecated use {@link #getRelative(BlockFace face)}
*/ */
@Deprecated Block getFace(BlockFace face); @Deprecated
Block getFace(BlockFace face);
/** /**
* @deprecated use {@link #getRelative(BlockFace face, int distance)} * @deprecated use {@link #getRelative(BlockFace face, int distance)}
*/ */
@Deprecated Block getFace(BlockFace face, int distance); @Deprecated
Block getFace(BlockFace face, int distance);
/** /**
* Gets the block at the given offsets * Gets the block at the given offsets
@ -56,6 +58,7 @@ public interface Block {
* <br /> * <br />
* For example, the following method places water at 100,102,100; two blocks * For example, the following method places water at 100,102,100; two blocks
* above 100,100,100. * above 100,100,100.
*
* <pre> * <pre>
* Block block = world.getBlockAt(100, 100, 100); * Block block = world.getBlockAt(100, 100, 100);
* Block shower = block.getFace(BlockFace.UP, 2); * Block shower = block.getFace(BlockFace.UP, 2);
@ -164,12 +167,14 @@ public interface Block {
* Gets the face relation of this block compared to the given block<br /> * Gets the face relation of this block compared to the given block<br />
* <br /> * <br />
* For example: * For example:
*
* <pre> * <pre>
* Block current = world.getBlockAt(100, 100, 100); * Block current = world.getBlockAt(100, 100, 100);
* Block target = world.getBlockAt(100, 101, 100); * Block target = world.getBlockAt(100, 101, 100);
* *
* current.getFace(target) == BlockFace.Up; * current.getFace(target) == BlockFace.Up;
* </pre> * </pre>
*
* <br /> * <br />
* If the given block is not connected to this block, null may be returned * If the given block is not connected to this block, null may be returned
* *

View File

@ -42,6 +42,7 @@ public enum BlockFace {
/** /**
* Get the amount of X-coordinates to modify to get the represented block * Get the amount of X-coordinates to modify to get the represented block
*
* @return Amount of X-coordinates to modify * @return Amount of X-coordinates to modify
*/ */
public int getModX() { public int getModX() {
@ -50,6 +51,7 @@ public enum BlockFace {
/** /**
* Get the amount of Y-coordinates to modify to get the represented block * Get the amount of Y-coordinates to modify to get the represented block
*
* @return Amount of Y-coordinates to modify * @return Amount of Y-coordinates to modify
*/ */
public int getModY() { public int getModY() {
@ -58,6 +60,7 @@ public enum BlockFace {
/** /**
* Get the amount of Z-coordinates to modify to get the represented block * Get the amount of Z-coordinates to modify to get the represented block
*
* @return Amount of Z-coordinates to modify * @return Amount of Z-coordinates to modify
*/ */
public int getModZ() { public int getModZ() {

View File

@ -8,24 +8,28 @@ import org.bukkit.Material;
public interface Jukebox extends BlockState { public interface Jukebox extends BlockState {
/** /**
* Get the record currently playing * Get the record currently playing
*
* @return The record Material, or AIR if none is playing * @return The record Material, or AIR if none is playing
*/ */
public Material getPlaying(); public Material getPlaying();
/** /**
* Set the record currently playing * Set the record currently playing
*
* @param record The record Material, or null/AIR to stop playing * @param record The record Material, or null/AIR to stop playing
*/ */
public void setPlaying(Material record); public void setPlaying(Material record);
/** /**
* Check if the jukebox is currently playing a record * Check if the jukebox is currently playing a record
*
* @return True if there is a record playing * @return True if there is a record playing
*/ */
public boolean isPlaying(); public boolean isPlaying();
/** /**
* Stop the jukebox playing and eject the current record * Stop the jukebox playing and eject the current record
*
* @return True if a record was ejected; false if there was none playing * @return True if a record was ejected; false if there was none playing
*/ */
public boolean eject(); public boolean eject();

View File

@ -149,7 +149,6 @@ public abstract class Command {
return false; return false;
} }
private boolean allowChangesFrom(CommandMap commandMap) { private boolean allowChangesFrom(CommandMap commandMap) {
return (null == this.commandMap || this.commandMap == commandMap); return (null == this.commandMap || this.commandMap == commandMap);
} }

View File

@ -3,6 +3,7 @@ package org.bukkit.command;
/** /**
* Thrown when an unhandled exception occurs during the execution of a Command * Thrown when an unhandled exception occurs during the execution of a Command
*/ */
@SuppressWarnings("serial")
public class CommandException extends RuntimeException { public class CommandException extends RuntimeException {
/** /**
@ -12,6 +13,7 @@ public class CommandException extends RuntimeException {
/** /**
* Constructs an instance of <code>CommandException</code> with the specified detail message. * Constructs an instance of <code>CommandException</code> with the specified detail message.
*
* @param msg the detail message. * @param msg the detail message.
*/ */
public CommandException(String msg) { public CommandException(String msg) {

View File

@ -1,4 +1,3 @@
package org.bukkit.command; package org.bukkit.command;
/** /**

View File

@ -79,7 +79,7 @@ public class SimpleCommandMap implements CommandMap {
public boolean register(String label, String fallbackPrefix, Command command) { public boolean register(String label, String fallbackPrefix, Command command) {
boolean registeredPassedLabel = register(label, fallbackPrefix, command, false); boolean registeredPassedLabel = register(label, fallbackPrefix, command, false);
Iterator iterator = command.getAliases().iterator(); Iterator<String> iterator = command.getAliases().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
if (!register((String) iterator.next(), fallbackPrefix, command, true)) { if (!register((String) iterator.next(), fallbackPrefix, command, true)) {
iterator.remove(); iterator.remove();
@ -94,6 +94,7 @@ public class SimpleCommandMap implements CommandMap {
/** /**
* Registers a command with the given name is possible, otherwise uses fallbackPrefix to create a unique name if its not an alias * Registers a command with the given name is possible, otherwise uses fallbackPrefix to create a unique name if its not an alias
*
* @param name the name of the command, without the '/'-prefix. * @param name the name of the command, without the '/'-prefix.
* @param fallbackPrefix a prefix which is prepended to the command with a ':' one or more times to make the command unique * @param fallbackPrefix a prefix which is prepended to the command with a ':' one or more times to make the command unique
* @param command the command to register * @param command the command to register

View File

@ -23,9 +23,9 @@ public class MeCommand extends VanillaCommand {
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
message.append(sender.getName()); message.append(sender.getName());
if (args.length > 0) { if (args.length > 0) {
for (int i = 0; i < args.length; i++) { for (String arg : args) {
message.append(" "); message.append(" ");
message.append(args[i]); message.append(arg);
} }
} }

View File

@ -213,7 +213,6 @@ public interface ConfigurationSection {
*/ */
public boolean isString(String path); public boolean isString(String path);
/** /**
* Gets the requested int by path. * Gets the requested int by path.
* <p> * <p>
@ -250,7 +249,6 @@ public interface ConfigurationSection {
*/ */
public boolean isInt(String path); public boolean isInt(String path);
/** /**
* Gets the requested boolean by path. * Gets the requested boolean by path.
* <p> * <p>
@ -287,7 +285,6 @@ public interface ConfigurationSection {
*/ */
public boolean isBoolean(String path); public boolean isBoolean(String path);
/** /**
* Gets the requested double by path. * Gets the requested double by path.
* <p> * <p>
@ -324,7 +321,6 @@ public interface ConfigurationSection {
*/ */
public boolean isDouble(String path); public boolean isDouble(String path);
/** /**
* Gets the requested long by path. * Gets the requested long by path.
* <p> * <p>
@ -361,8 +357,6 @@ public interface ConfigurationSection {
*/ */
public boolean isLong(String path); public boolean isLong(String path);
// Java // Java
/** /**
* Gets the requested List by path. * Gets the requested List by path.
@ -374,6 +368,7 @@ public interface ConfigurationSection {
* @param path Path of the List to get. * @param path Path of the List to get.
* @return Requested List. * @return Requested List.
*/ */
@SuppressWarnings("rawtypes")
public List getList(String path); public List getList(String path);
/** /**
@ -385,7 +380,8 @@ public interface ConfigurationSection {
* @param path Path of the List to get. * @param path Path of the List to get.
* @return Requested List. * @return Requested List.
*/ */
public List getList(String path, List def); @SuppressWarnings("rawtypes")
public List getList(String path, List<?> def);
/** /**
* Checks if the specified path is a List. * Checks if the specified path is a List.
@ -400,7 +396,6 @@ public interface ConfigurationSection {
*/ */
public boolean isList(String path); public boolean isList(String path);
/** /**
* Gets the requested List of String by path. * Gets the requested List of String by path.
* <p> * <p>
@ -551,7 +546,6 @@ public interface ConfigurationSection {
*/ */
public List<Map<String, Object>> getMapList(String path); public List<Map<String, Object>> getMapList(String path);
// Bukkit // Bukkit
/** /**
* Gets the requested Vector by path. * Gets the requested Vector by path.
@ -589,7 +583,6 @@ public interface ConfigurationSection {
*/ */
public boolean isVector(String path); public boolean isVector(String path);
/** /**
* Gets the requested OfflinePlayer by path. * Gets the requested OfflinePlayer by path.
* <p> * <p>
@ -626,7 +619,6 @@ public interface ConfigurationSection {
*/ */
public boolean isOfflinePlayer(String path); public boolean isOfflinePlayer(String path);
/** /**
* Gets the requested ItemStack by path. * Gets the requested ItemStack by path.
* <p> * <p>
@ -663,7 +655,6 @@ public interface ConfigurationSection {
*/ */
public boolean isItemStack(String path); public boolean isItemStack(String path);
/** /**
* Gets the requested ConfigurationSection by path. * Gets the requested ConfigurationSection by path.
* <p> * <p>

View File

@ -3,6 +3,7 @@ package org.bukkit.configuration;
/** /**
* Exception thrown when attempting to load an invalid {@link Configuration} * Exception thrown when attempting to load an invalid {@link Configuration}
*/ */
@SuppressWarnings("serial")
public class InvalidConfigurationException extends Exception { public class InvalidConfigurationException extends Exception {
/** /**
* Creates a new instance of InvalidConfigurationException without a message or cause. * Creates a new instance of InvalidConfigurationException without a message or cause.

View File

@ -169,9 +169,7 @@ public class MemorySection implements ConfigurationSection {
String[] split = path.split(Pattern.quote(Character.toString(getRoot().options().pathSeparator()))); String[] split = path.split(Pattern.quote(Character.toString(getRoot().options().pathSeparator())));
ConfigurationSection section = this; ConfigurationSection section = this;
if (path == null) { if (path.length() == 0) {
throw new IllegalArgumentException("Path cannot be null");
} else if (path.length() == 0) {
throw new IllegalArgumentException("Cannot set to an empty path"); throw new IllegalArgumentException("Cannot set to an empty path");
} }
@ -230,11 +228,8 @@ public class MemorySection implements ConfigurationSection {
if (section == this) { if (section == this) {
result = map.get(key); result = map.get(key);
return (result == null) ? def : result; return (result == null) ? def : result;
} else if (section != null) {
return section.get(key, def);
} else {
return def;
} }
return section.get(key, def);
} }
public ConfigurationSection createSection(String path) { public ConfigurationSection createSection(String path) {
@ -268,6 +263,7 @@ public class MemorySection implements ConfigurationSection {
} }
} }
@SuppressWarnings("unchecked")
public ConfigurationSection createSection(String path, Map<String, Object> map) { public ConfigurationSection createSection(String path, Map<String, Object> map) {
ConfigurationSection section = createSection(path); ConfigurationSection section = createSection(path);
@ -419,22 +415,24 @@ public class MemorySection implements ConfigurationSection {
} }
// Java // Java
public List getList(String path) { @SuppressWarnings("unchecked")
public List<Object> getList(String path) {
if (path == null) { if (path == null) {
throw new IllegalArgumentException("Path cannot be null"); throw new IllegalArgumentException("Path cannot be null");
} }
Object def = getDefault(path); Object def = getDefault(path);
return getList(path, (def instanceof List) ? (List)def : null); return getList(path, (def instanceof List) ? (List<Object>) def : null);
} }
public List getList(String path, List def) { @SuppressWarnings("unchecked")
public List<Object> getList(String path, List<?> def) {
if (path == null) { if (path == null) {
throw new IllegalArgumentException("Path cannot be null"); throw new IllegalArgumentException("Path cannot be null");
} }
Object val = get(path, def); Object val = get(path, def);
return (val instanceof List) ? (List)val : def; return (List<Object>) ((val instanceof List) ? val : def);
} }
public boolean isList(String path) { public boolean isList(String path) {
@ -457,7 +455,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<String> result = new ArrayList(); List<String> result = new ArrayList<String>();
for (Object object : list) { for (Object object : list) {
if ((object instanceof String) || (isPrimitiveWrapper(object))) { if ((object instanceof String) || (isPrimitiveWrapper(object))) {
@ -479,7 +477,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Integer> result = new ArrayList(); List<Integer> result = new ArrayList<Integer>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Integer) { if (object instanceof Integer) {
@ -487,7 +485,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) { } else if (object instanceof String) {
try { try {
result.add(Integer.valueOf((String) object)); result.add(Integer.valueOf((String) object));
} catch (Exception ex) {} } catch (Exception ex) {
}
} else if (object instanceof Byte) { } else if (object instanceof Byte) {
result.add((Integer) (int) (byte) (Byte) object); result.add((Integer) (int) (byte) (Byte) object);
} else if (object instanceof Character) { } else if (object instanceof Character) {
@ -519,7 +518,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Boolean> result = new ArrayList(); List<Boolean> result = new ArrayList<Boolean>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Boolean) { if (object instanceof Boolean) {
@ -547,7 +546,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Double> result = new ArrayList(); List<Double> result = new ArrayList<Double>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Double) { if (object instanceof Double) {
@ -555,7 +554,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) { } else if (object instanceof String) {
try { try {
result.add(Double.valueOf((String) object)); result.add(Double.valueOf((String) object));
} catch (Exception ex) {} } catch (Exception ex) {
}
} else if (object instanceof Byte) { } else if (object instanceof Byte) {
result.add((Double) (double) (byte) (Byte) object); result.add((Double) (double) (byte) (Byte) object);
} else if (object instanceof Character) { } else if (object instanceof Character) {
@ -587,7 +587,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Float> result = new ArrayList(); List<Float> result = new ArrayList<Float>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Float) { if (object instanceof Float) {
@ -595,7 +595,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) { } else if (object instanceof String) {
try { try {
result.add(Float.valueOf((String) object)); result.add(Float.valueOf((String) object));
} catch (Exception ex) {} } catch (Exception ex) {
}
} else if (object instanceof Byte) { } else if (object instanceof Byte) {
result.add((Float) (float) (byte) (Byte) object); result.add((Float) (float) (byte) (Byte) object);
} else if (object instanceof Character) { } else if (object instanceof Character) {
@ -627,7 +628,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Long> result = new ArrayList(); List<Long> result = new ArrayList<Long>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Long) { if (object instanceof Long) {
@ -635,7 +636,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) { } else if (object instanceof String) {
try { try {
result.add(Long.valueOf((String) object)); result.add(Long.valueOf((String) object));
} catch (Exception ex) {} } catch (Exception ex) {
}
} else if (object instanceof Byte) { } else if (object instanceof Byte) {
result.add((Long) (long) (byte) (Byte) object); result.add((Long) (long) (byte) (Byte) object);
} else if (object instanceof Character) { } else if (object instanceof Character) {
@ -667,7 +669,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Byte> result = new ArrayList(); List<Byte> result = new ArrayList<Byte>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Byte) { if (object instanceof Byte) {
@ -675,7 +677,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) { } else if (object instanceof String) {
try { try {
result.add(Byte.valueOf((String) object)); result.add(Byte.valueOf((String) object));
} catch (Exception ex) {} } catch (Exception ex) {
}
} else if (object instanceof Byte) { } else if (object instanceof Byte) {
result.add((Byte) (byte) (byte) (Byte) object); result.add((Byte) (byte) (byte) (Byte) object);
} else if (object instanceof Character) { } else if (object instanceof Character) {
@ -707,7 +710,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Character> result = new ArrayList(); List<Character> result = new ArrayList<Character>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Character) { if (object instanceof Character) {
@ -749,7 +752,7 @@ public class MemorySection implements ConfigurationSection {
return null; return null;
} }
List<Short> result = new ArrayList(); List<Short> result = new ArrayList<Short>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Short) { if (object instanceof Short) {
@ -757,7 +760,8 @@ public class MemorySection implements ConfigurationSection {
} else if (object instanceof String) { } else if (object instanceof String) {
try { try {
result.add(Short.valueOf((String) object)); result.add(Short.valueOf((String) object));
} catch (Exception ex) {} } catch (Exception ex) {
}
} else if (object instanceof Byte) { } else if (object instanceof Byte) {
result.add((Short) (short) (byte) (Byte) object); result.add((Short) (short) (byte) (Byte) object);
} else if (object instanceof Character) { } else if (object instanceof Character) {
@ -778,13 +782,14 @@ public class MemorySection implements ConfigurationSection {
return result; return result;
} }
@SuppressWarnings("unchecked")
public List<Map<String, Object>> getMapList(String path) { public List<Map<String, Object>> getMapList(String path) {
if (path == null) { if (path == null) {
throw new IllegalArgumentException("Path cannot be null"); throw new IllegalArgumentException("Path cannot be null");
} }
List<Object> list = getList(path); List<Object> list = getList(path);
List<Map<String, Object>> result = new ArrayList(); List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
for (Object object : list) { for (Object object : list) {
if (object instanceof Map) { if (object instanceof Map) {
@ -883,8 +888,9 @@ public class MemorySection implements ConfigurationSection {
} }
Object val = get(path, null); Object val = get(path, null);
if (val != null) if (val != null) {
return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null; return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null;
}
val = get(path, getDefault(path)); val = get(path, getDefault(path));
return (val instanceof ConfigurationSection) ? createSection(path) : null; return (val instanceof ConfigurationSection) ? createSection(path) : null;
@ -991,7 +997,6 @@ public class MemorySection implements ConfigurationSection {
return createPath(section, key, (section == null) ? null : section.getRoot()); return createPath(section, key, (section == null) ? null : section.getRoot());
} }
/** /**
* Creates a relative path to the given {@link ConfigurationSection} from the given relative section. * Creates a relative path to the given {@link ConfigurationSection} from the given relative section.
* <p> * <p>

View File

@ -56,7 +56,7 @@ 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.
* The default value is null. *
* *
* @param value New header * @param value New header
* @return This object, for chaining * @return This object, for chaining

View File

@ -4,14 +4,14 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
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.serialization.ConfigurationSerializable; import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization; import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.DumperOptions;
@ -56,6 +56,7 @@ public class YamlConfiguration extends FileConfiguration {
throw new IllegalArgumentException("Contents cannot be null"); throw new IllegalArgumentException("Contents cannot be null");
} }
@SuppressWarnings("unchecked")
Map<Object, Object> input = (Map<Object, Object>) yaml.load(contents); Map<Object, Object> input = (Map<Object, Object>) yaml.load(contents);
int size = (input == null) ? 0 : input.size(); int size = (input == null) ? 0 : input.size();
Map<String, Object> result = new LinkedHashMap<String, Object>(size); Map<String, Object> result = new LinkedHashMap<String, Object>(size);
@ -84,6 +85,7 @@ public class YamlConfiguration extends FileConfiguration {
Object value = entry.getValue(); Object value = entry.getValue();
if (value instanceof Map) { if (value instanceof Map) {
@SuppressWarnings("unchecked")
Map<Object, Object> subinput = (Map<Object, Object>) value; Map<Object, Object> subinput = (Map<Object, Object>) value;
int size = (subinput == null) ? 0 : subinput.size(); int size = (subinput == null) ? 0 : subinput.size();
Map<String, Object> subvalues = new LinkedHashMap<String, Object>(size); Map<String, Object> subvalues = new LinkedHashMap<String, Object>(size);
@ -168,6 +170,7 @@ public class YamlConfiguration extends FileConfiguration {
return result.toString(); return result.toString();
} }
@Override
protected String buildHeader() { protected String buildHeader() {
String header = options().header(); String header = options().header();

View File

@ -7,9 +7,11 @@ import java.util.Map;
* <p> * <p>
* These objects MUST implement one of the following, in addition to the methods * These objects MUST implement one of the following, in addition to the methods
* as defined by this interface: * as defined by this interface:
* - A static method "deserialize" that accepts a single {@link Map<String, Object>} and returns the class. * <ul>
* - A static method "valueOf" that accepts a single {@link Map<String, Object>} and returns the class. * <li>A static method "deserialize" that accepts a single {@link Map<String, Object>} and returns the class.</li>
* - A constructor that accepts a single {@link Map<String, Object>}. * <li>A static method "valueOf" that accepts a single {@link Map<String, Object>} and returns the class.</li>
* <li>A constructor that accepts a single {@link Map<String, Object>}.</li>
* </ul>
*/ */
public interface ConfigurationSerializable { public interface ConfigurationSerializable {
/** /**

View File

@ -208,7 +208,9 @@ public class ConfigurationSerialization {
* @param clazz Class to unregister * @param clazz Class to unregister
*/ */
public static void unregisterClass(Class<? extends ConfigurationSerializable> clazz) { public static void unregisterClass(Class<? extends ConfigurationSerializable> clazz) {
while (aliases.values().remove(clazz)); while (aliases.values().remove(clazz)) {
;
}
} }
/** /**

View File

@ -122,6 +122,7 @@ public interface Entity {
/** /**
* Returns true if this entity has been marked for removal. * Returns true if this entity has been marked for removal.
*
* @return True if it is dead. * @return True if it is dead.
*/ */
public boolean isDead(); public boolean isDead();
@ -165,30 +166,35 @@ public interface Entity {
/** /**
* Returns the distance this entity has fallen * Returns the distance this entity has fallen
*
* @return The distance. * @return The distance.
*/ */
public float getFallDistance(); public float getFallDistance();
/** /**
* Sets the fall distance for this entity * Sets the fall distance for this entity
*
* @param distance The new distance. * @param distance The new distance.
*/ */
public void setFallDistance(float distance); public void setFallDistance(float distance);
/** /**
* Record the last {@link EntityDamageEvent} inflicted on this entity * Record the last {@link EntityDamageEvent} inflicted on this entity
*
* @param event a {@link EntityDamageEvent} * @param event a {@link EntityDamageEvent}
*/ */
public void setLastDamageCause(EntityDamageEvent event); public void setLastDamageCause(EntityDamageEvent event);
/** /**
* Retrieve the last {@link EntityDamageEvent} inflicted on this entity. This event may have been cancelled. * Retrieve the last {@link EntityDamageEvent} inflicted on this entity. This event may have been cancelled.
*
* @return the last known {@link EntityDamageEvent} or null if hitherto unharmed * @return the last known {@link EntityDamageEvent} or null if hitherto unharmed
*/ */
public EntityDamageEvent getLastDamageCause(); public EntityDamageEvent getLastDamageCause();
/** /**
* Returns a unique and persistent id for this entity * Returns a unique and persistent id for this entity
*
* @return unique id * @return unique id
*/ */
public UUID getUniqueId(); public UUID getUniqueId();
@ -205,8 +211,7 @@ public interface Entity {
/** /**
* Sets the amount of ticks this entity has lived for. * Sets the amount of ticks this entity has lived for.
* <p> * <p>
* This is the equivalent to "age" in entities. May not be * This is the equivalent to "age" in entities. May not be less than one tick.
* less than one tick.
* *
* @param value Age of entity * @param value Age of entity
*/ */

View File

@ -6,24 +6,28 @@ package org.bukkit.entity;
public interface Explosive extends Entity { public interface Explosive extends Entity {
/** /**
* Set the radius affected by this explosive's explosion * Set the radius affected by this explosive's explosion
*
* @param yield The explosive yield * @param yield The explosive yield
*/ */
public void setYield(float yield); public void setYield(float yield);
/** /**
* Return the radius or yield of this explosive's explosion * Return the radius or yield of this explosive's explosion
*
* @return the radius of blocks affected * @return the radius of blocks affected
*/ */
public float getYield(); public float getYield();
/** /**
* Set whether or not this explosive's explosion causes fire * Set whether or not this explosive's explosion causes fire
*
* @param isIncendiary Whether it should cause fire * @param isIncendiary Whether it should cause fire
*/ */
public void setIsIncendiary(boolean isIncendiary); public void setIsIncendiary(boolean isIncendiary);
/** /**
* Return whether or not this explosive creates a fire when exploding * Return whether or not this explosive creates a fire when exploding
*
* @return true if the explosive creates fire, false otherwise * @return true if the explosive creates fire, false otherwise
*/ */
public boolean isIncendiary(); public boolean isIncendiary();

View File

@ -39,14 +39,6 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible {
*/ */
public void setItemInHand(ItemStack item); public void setItemInHand(ItemStack item);
/**
* Changes the item in hand to another of your 'action slots'.
*
* @param index The new index to use, only valid ones are 0-8.
*
public void selectItemInHand(int index);
*/
/** /**
* Returns whether this player is slumbering. * Returns whether this player is slumbering.
* *

View File

@ -86,12 +86,14 @@ public interface LivingEntity extends Entity {
/** /**
* Throws an egg from the entity. * Throws an egg from the entity.
*
* @return The egg thrown. * @return The egg thrown.
*/ */
public Egg throwEgg(); public Egg throwEgg();
/** /**
* Throws a snowball from the entity. * Throws a snowball from the entity.
*
* @return The snowball thrown. * @return The snowball thrown.
*/ */
public Snowball throwSnowball(); public Snowball throwSnowball();

View File

@ -69,6 +69,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.
* *
* 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
*/ */
public Vector getDerailedVelocityMod(); public Vector getDerailedVelocityMod();

View File

@ -10,12 +10,14 @@ import org.bukkit.material.Attachable;
public interface Painting extends Entity, Attachable { public interface Painting extends Entity, Attachable {
/** /**
* Get the art on this painting * Get the art on this painting
*
* @return The art * @return The art
*/ */
public Art getArt(); public Art getArt();
/** /**
* Set the art on this painting * Set the art on this painting
*
* @param art The new art * @param art The new art
* @return False if the new art won't fit at the painting's current location * @return False if the new art won't fit at the painting's current location
*/ */
@ -23,6 +25,7 @@ public interface Painting extends Entity, Attachable {
/** /**
* Set the art on this painting * Set the art on this painting
*
* @param art The new art * @param art The new art
* @param force If true, force the new art regardless of whether it fits at the current location * @param force If true, force the new art regardless of whether it fits at the current location
* Note that forcing it where it can't fit normally causes it to drop as an item unless you override * Note that forcing it where it can't fit normally causes it to drop as an item unless you override
@ -34,6 +37,7 @@ public interface Painting extends Entity, Attachable {
/** /**
* Sets the direction of the painting, potentially overriding rules of placement. Note that if the result * Sets the direction of the painting, potentially overriding rules of placement. Note that if the result
* is not valid the painting would normally drop as an item. * is not valid the painting would normally drop as an item.
*
* @param face The new direction. * @param face The new direction.
* @param force Whether to force it. * @param force Whether to force it.
* @return False if force was false and there was no block for it to attach to in order to face the given direction. * @return False if force was false and there was no block for it to attach to in order to face the given direction.

View File

@ -82,6 +82,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer {
/** /**
* Gets the socket address of this player * Gets the socket address of this player
*
* @return the player's address * @return the player's address
*/ */
public InetSocketAddress getAddress(); public InetSocketAddress getAddress();
@ -117,12 +118,14 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer {
/** /**
* Returns if the player is in sneak mode * Returns if the player is in sneak mode
*
* @return true if player is in sneak mode * @return true if player is in sneak mode
*/ */
public boolean isSneaking(); public boolean isSneaking();
/** /**
* Sets the sneak mode the player * Sets the sneak mode the player
*
* @param sneak true if player should appear sneaking * @param sneak true if player should appear sneaking
*/ */
public void setSneaking(boolean sneak); public void setSneaking(boolean sneak);

View File

@ -6,12 +6,14 @@ package org.bukkit.entity;
public interface TNTPrimed extends Explosive { public interface TNTPrimed extends Explosive {
/** /**
* Set the number of ticks until the TNT blows up after being primed. * Set the number of ticks until the TNT blows up after being primed.
*
* @param fuseTicks The fuse ticks * @param fuseTicks The fuse ticks
*/ */
public void setFuseTicks(int fuseTicks); public void setFuseTicks(int fuseTicks);
/** /**
* Retrieve the number of ticks until the explosion of this TNTPrimed entity * Retrieve the number of ticks until the explosion of this TNTPrimed entity
*
* @return the number of ticks until this TNTPrimed explodes * @return the number of ticks until this TNTPrimed explodes
*/ */
public int getFuseTicks(); public int getFuseTicks();

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Projectile;
/** /**
* Represents an event * Represents an event
*/ */
@SuppressWarnings("serial")
public abstract class Event implements Serializable { public abstract class Event implements Serializable {
private final Type type; private final Type type;
private final String name; private final String name;
@ -596,7 +597,7 @@ public abstract class Event implements Serializable {
/** /**
* Called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal. * Called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal.
* *
+ * @see org.bukkit.event.world.TreeGrowEvent * @see org.bukkit.event.world.TreeGrowEvent
*/ */
STRUCTURE_GROW(Category.WORLD), STRUCTURE_GROW(Category.WORLD),

View File

@ -22,6 +22,7 @@ public class EventException extends Exception {
/** /**
* Constructs a new EventException with the given message * Constructs a new EventException with the given message
*
* @param cause The exception that caused this * @param cause The exception that caused this
* @param message The message * @param message The message
*/ */
@ -32,6 +33,7 @@ public class EventException extends Exception {
/** /**
* Constructs a new EventException with the given message * Constructs a new EventException with the given message
*
* @param message The message * @param message The message
*/ */
public EventException(String message) { public EventException(String message) {

View File

@ -13,6 +13,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Block Break event is cancelled, the block will not break. * If a Block Break event is cancelled, the block will not break.
*/ */
@SuppressWarnings("serial")
public class BlockBreakEvent extends BlockEvent implements Cancellable { public class BlockBreakEvent extends BlockEvent implements Cancellable {
private Player player; private Player player;

View File

@ -8,6 +8,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire. * If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
*/ */
@SuppressWarnings("serial")
public class BlockBurnEvent extends BlockEvent implements Cancellable { public class BlockBurnEvent extends BlockEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;

View File

@ -12,6 +12,7 @@ import org.bukkit.Material;
* <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li> * <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li>
* </ul> * </ul>
*/ */
@SuppressWarnings("serial")
public class BlockCanBuildEvent extends BlockEvent { public class BlockCanBuildEvent extends BlockEvent {
protected boolean buildable; protected boolean buildable;
protected int material; protected int material;

View File

@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
* <p /> * <p />
* If a Block Damage event is cancelled, the block will not be damaged. * If a Block Damage event is cancelled, the block will not be damaged.
*/ */
@SuppressWarnings("serial")
public class BlockDamageEvent extends BlockEvent implements Cancellable { public class BlockDamageEvent extends BlockEvent implements Cancellable {
private Player player; private Player player;
private boolean instaBreak; private boolean instaBreak;

View File

@ -10,6 +10,7 @@ import org.bukkit.util.Vector;
* <p /> * <p />
* If a Block Dispense event is cancelled, the block will not dispense the item. * If a Block Dispense event is cancelled, the block will not dispense the item.
*/ */
@SuppressWarnings("serial")
public class BlockDispenseEvent extends BlockEvent implements Cancellable { public class BlockDispenseEvent extends BlockEvent implements Cancellable {
private boolean cancelled = false; private boolean cancelled = false;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/** /**
* Represents a block related event. * Represents a block related event.
*/ */
@SuppressWarnings("serial")
public class BlockEvent extends Event { public class BlockEvent extends Event {
protected Block block; protected Block block;

View File

@ -3,6 +3,7 @@ package org.bukkit.event.block;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
/** /**
* Called when a block fades, melts or disappears based on world conditions * Called when a block fades, melts or disappears based on world conditions
* <p /> * <p />
@ -14,6 +15,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Block Fade event is cancelled, the block will not fade, melt or disappear. * If a Block Fade event is cancelled, the block will not fade, melt or disappear.
*/ */
@SuppressWarnings("serial")
public class BlockFadeEvent extends BlockEvent implements Cancellable { public class BlockFadeEvent extends BlockEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;
private BlockState newState; private BlockState newState;

View File

@ -15,8 +15,10 @@ import org.bukkit.event.Cancellable;
* </ul> * </ul>
* <p /> * <p />
* If a Block Form event is cancelled, the block will not be formed. * If a Block Form event is cancelled, the block will not be formed.
*
* @see BlockSpreadEvent * @see BlockSpreadEvent
*/ */
@SuppressWarnings("serial")
public class BlockFormEvent extends BlockEvent implements Cancellable { public class BlockFormEvent extends BlockEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;
private BlockState newState; private BlockState newState;

View File

@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Block From To event is cancelled, the block will not move (the liquid will not flow). * If a Block From To event is cancelled, the block will not move (the liquid will not flow).
*/ */
@SuppressWarnings("serial")
public class BlockFromToEvent extends BlockEvent implements Cancellable { public class BlockFromToEvent extends BlockEvent implements Cancellable {
protected Block to; protected Block to;
protected BlockFace face; protected BlockFace face;

View File

@ -10,6 +10,7 @@ import org.bukkit.event.Event;
* <p /> * <p />
* If a Block Ignite event is cancelled, the block will not be ignited. * If a Block Ignite event is cancelled, the block will not be ignited.
*/ */
@SuppressWarnings("serial")
public class BlockIgniteEvent extends BlockEvent implements Cancellable { public class BlockIgniteEvent extends BlockEvent implements Cancellable {
private IgniteCause cause; private IgniteCause cause;
private boolean cancel; private boolean cancel;

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Thrown when a block physics check is called * Thrown when a block physics check is called
*/ */
@SuppressWarnings("serial")
public class BlockPhysicsEvent extends BlockEvent implements Cancellable { public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
private final int changed; private final int changed;
private boolean cancel = false; private boolean cancel = false;

View File

@ -4,8 +4,8 @@ import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.material.PistonBaseMaterial;
@SuppressWarnings("serial")
public abstract class BlockPistonEvent extends BlockEvent implements Cancellable { public abstract class BlockPistonEvent extends BlockEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;
private BlockFace direction; private BlockFace direction;

View File

@ -7,6 +7,7 @@ import java.util.List;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@SuppressWarnings("serial")
public class BlockPistonExtendEvent extends BlockPistonEvent { public class BlockPistonExtendEvent extends BlockPistonEvent {
private int length; private int length;
private List<Block> blocks; private List<Block> blocks;

View File

@ -4,6 +4,7 @@ import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@SuppressWarnings("serial")
public class BlockPistonRetractEvent extends BlockPistonEvent { public class BlockPistonRetractEvent extends BlockPistonEvent {
public BlockPistonRetractEvent(Block block, BlockFace direction) { public BlockPistonRetractEvent(Block block, BlockFace direction) {
super(Type.BLOCK_PISTON_RETRACT, block, direction); super(Type.BLOCK_PISTON_RETRACT, block, direction);

View File

@ -11,6 +11,7 @@ import org.bukkit.inventory.ItemStack;
* <p /> * <p />
* If a Block Place event is cancelled, the block will not be placed. * If a Block Place event is cancelled, the block will not be placed.
*/ */
@SuppressWarnings("serial")
public class BlockPlaceEvent extends BlockEvent implements Cancellable { public class BlockPlaceEvent extends BlockEvent implements Cancellable {
protected boolean cancel; protected boolean cancel;
protected boolean canBuild; protected boolean canBuild;

View File

@ -5,6 +5,7 @@ import org.bukkit.block.Block;
/** /**
* Called when a redstone current changes * Called when a redstone current changes
*/ */
@SuppressWarnings("serial")
public class BlockRedstoneEvent extends BlockEvent { public class BlockRedstoneEvent extends BlockEvent {
private int oldCurrent; private int oldCurrent;
private int newCurrent; private int newCurrent;

View File

@ -2,6 +2,7 @@ package org.bukkit.event.block;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
/** /**
* Called when a block spreads based on world conditions. * Called when a block spreads based on world conditions.
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread. * Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread.
@ -13,8 +14,10 @@ import org.bukkit.block.BlockState;
* </ul> * </ul>
* <p /> * <p />
* If a Block Spread event is cancelled, the block will not spread. * If a Block Spread event is cancelled, the block will not spread.
*
* @see BlockFormEvent * @see BlockFormEvent
*/ */
@SuppressWarnings("serial")
public class BlockSpreadEvent extends BlockFormEvent { public class BlockSpreadEvent extends BlockFormEvent {
private Block source; private Block source;

View File

@ -8,6 +8,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Leaves Decay event is cancelled, the leaves will not decay. * If a Leaves Decay event is cancelled, the leaves will not decay.
*/ */
@SuppressWarnings("serial")
public class LeavesDecayEvent extends BlockEvent implements Cancellable { public class LeavesDecayEvent extends BlockEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;

View File

@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Sign Change event is cancelled, the sign will not be changed. * If a Sign Change event is cancelled, the sign will not be changed.
*/ */
@SuppressWarnings("serial")
public class SignChangeEvent extends BlockEvent implements Cancellable { public class SignChangeEvent extends BlockEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;
private Player player; private Player player;

View File

@ -10,6 +10,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Creature Spawn event is cancelled, the creature will not spawn. * If a Creature Spawn event is cancelled, the creature will not spawn.
*/ */
@SuppressWarnings("serial")
public class CreatureSpawnEvent extends EntityEvent implements Cancellable { public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
private Location location; private Location location;

View File

@ -8,6 +8,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If a Creeper Power event is cancelled, the Creeper will not be powered. * If a Creeper Power event is cancelled, the Creeper will not be powered.
*/ */
@SuppressWarnings("serial")
public class CreeperPowerEvent extends EntityEvent implements Cancellable { public class CreeperPowerEvent extends EntityEvent implements Cancellable {
private boolean canceled; private boolean canceled;

View File

@ -4,6 +4,7 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
@SuppressWarnings("serial")
public class EndermanPickupEvent extends EntityEvent implements Cancellable { public class EndermanPickupEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;

View File

@ -4,6 +4,7 @@ import org.bukkit.Location;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
@SuppressWarnings("serial")
public class EndermanPlaceEvent extends EntityEvent implements Cancellable { public class EndermanPlaceEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;

View File

@ -3,6 +3,7 @@ package org.bukkit.event.entity;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@SuppressWarnings("serial")
public class EntityCombustByBlockEvent extends EntityCombustEvent { public class EntityCombustByBlockEvent extends EntityCombustEvent {
private Block combuster; private Block combuster;
@ -16,6 +17,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.
* *
* 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.
*/ */
public Block getCombuster() { public Block getCombuster() {

View File

@ -2,6 +2,7 @@ package org.bukkit.event.entity;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@SuppressWarnings("serial")
public class EntityCombustByEntityEvent extends EntityCombustEvent { public class EntityCombustByEntityEvent extends EntityCombustEvent {
private Entity combuster; private Entity combuster;
@ -13,6 +14,7 @@ public class EntityCombustByEntityEvent extends EntityCombustEvent {
/** /**
* The combuster can be a WeatherStorm a Blaze, or an Entity holding a FIRE_ASPECT enchanted item. * The combuster can be a WeatherStorm a Blaze, or an Entity holding a FIRE_ASPECT enchanted item.
*
* @return the Entity that set the combustee alight. * @return the Entity that set the combustee alight.
*/ */
public Entity getCombuster() { public Entity getCombuster() {

View File

@ -8,6 +8,7 @@ import org.bukkit.event.Cancellable;
* <p /> * <p />
* If an Entity Combust event is cancelled, the entity will not combust. * If an Entity Combust event is cancelled, the entity will not combust.
*/ */
@SuppressWarnings("serial")
public class EntityCombustEvent extends EntityEvent implements Cancellable { public class EntityCombustEvent extends EntityEvent implements Cancellable {
private int duration; private int duration;
private boolean cancel; private boolean cancel;
@ -37,6 +38,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.
* *
* 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.
*/ */
public void setDuration(int duration) { public void setDuration(int duration) {

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Entity;
/** /**
* Called when an entity is damaged by a block * Called when an entity is damaged by a block
*/ */
@SuppressWarnings("serial")
public class EntityDamageByBlockEvent extends EntityDamageEvent { public class EntityDamageByBlockEvent extends EntityDamageEvent {
private Block damager; private Block damager;

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Entity;
/** /**
* Called when an entity is damaged by an entity * Called when an entity is damaged by an entity
*/ */
@SuppressWarnings("serial")
public class EntityDamageByEntityEvent extends EntityDamageEvent { public class EntityDamageByEntityEvent extends EntityDamageEvent {
private Entity damager; private Entity damager;

View File

@ -8,6 +8,7 @@ import org.bukkit.entity.Projectile;
* *
* @deprecated use {@link EntityDamageByEntityEvent} instead, where {@link EntityDamageByEntityEvent#getDamager()} will return the {@link Projectile} * @deprecated use {@link EntityDamageByEntityEvent} instead, where {@link EntityDamageByEntityEvent#getDamager()} will return the {@link Projectile}
*/ */
@SuppressWarnings("serial")
@Deprecated @Deprecated
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent { public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Event;
/** /**
* Stores data for damage events * Stores data for damage events
*/ */
@SuppressWarnings("serial")
public class EntityDamageEvent extends EntityEvent implements Cancellable { public class EntityDamageEvent extends EntityEvent implements Cancellable {
private int damage; private int damage;

View File

@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack;
/** /**
* Thrown whenever a LivingEntity dies * Thrown whenever a LivingEntity dies
*/ */
@SuppressWarnings("serial")
public class EntityDeathEvent extends EntityEvent { public class EntityDeathEvent extends EntityEvent {
private List<ItemStack> drops; private List<ItemStack> drops;
private int dropExp = 0; private int dropExp = 0;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/** /**
* Represents an Entity-related event * Represents an Entity-related event
*/ */
@SuppressWarnings("serial")
public class EntityEvent extends Event { public class EntityEvent extends Event {
protected Entity entity; protected Entity entity;

View File

@ -10,6 +10,7 @@ import java.util.List;
/** /**
* Called when an entity explodes * Called when an entity explodes
*/ */
@SuppressWarnings("serial")
public class EntityExplodeEvent extends EntityEvent implements Cancellable { public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;
private Location location; private Location location;
@ -40,6 +41,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
/** /**
* Returns the list of blocks that would have been removed or were * Returns the list of blocks that would have been removed or were
* removed from the explosion event. * removed from the explosion event.
*
* @return All blown-up blocks * @return All blown-up blocks
*/ */
public List<Block> blockList() { public List<Block> blockList() {
@ -50,6 +52,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
* Returns the location where the explosion happened. * Returns the location where the explosion happened.
* It is not possible to get this value from the Entity as * It is not possible to get this value from the Entity as
* the Entity no longer exists in the world. * the Entity no longer exists in the world.
*
* @return The location of the explosion * @return The location of the explosion
*/ */
public Location getLocation() { public Location getLocation() {
@ -67,6 +70,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
/** /**
* Sets the percentage of blocks to drop from this explosion * Sets the percentage of blocks to drop from this explosion
*
* @param yield The new yield percentage * @param yield The new yield percentage
*/ */
public void setYield(float yield) { public void setYield(float yield) {

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when an entity interacts with an object * Called when an entity interacts with an object
*/ */
@SuppressWarnings("serial")
public class EntityInteractEvent extends EntityEvent implements Cancellable { public class EntityInteractEvent extends EntityEvent implements Cancellable {
protected Block block; protected Block block;

View File

@ -1,12 +1,12 @@
package org.bukkit.event.entity; package org.bukkit.event.entity;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.Location; import org.bukkit.Location;
/** /**
* Stores data for entities standing inside a portal block * Stores data for entities standing inside a portal block
*/ */
@SuppressWarnings("serial")
public class EntityPortalEnterEvent extends EntityEvent { public class EntityPortalEnterEvent extends EntityEvent {
private Location location; private Location location;

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Event;
/** /**
* Stores data for health-regain events * Stores data for health-regain events
*/ */
@SuppressWarnings("serial")
public class EntityRegainHealthEvent extends EntityEvent implements Cancellable { public class EntityRegainHealthEvent extends EntityEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Thrown when a LivingEntity is tamed * Thrown when a LivingEntity is tamed
*/ */
@SuppressWarnings("serial")
public class EntityTameEvent extends EntityEvent implements Cancellable { public class EntityTameEvent extends EntityEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;
private AnimalTamer owner; private AnimalTamer owner;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when a creature targets or untargets another entity * Called when a creature targets or untargets another entity
*/ */
@SuppressWarnings("serial")
public class EntityTargetEvent extends EntityEvent implements Cancellable { public class EntityTargetEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;
private Entity target; private Entity target;
@ -28,6 +29,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
/** /**
* Returns the reason for the targeting * Returns the reason for the targeting
*
* @return The reason * @return The reason
*/ */
public TargetReason getReason() { public TargetReason getReason() {
@ -38,6 +40,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
* Get the entity that this is targeting. * Get the entity that this is targeting.
* This will be null in the case that the event is called when * This will be null in the case that the event is called when
* the mob forgets its target. * the mob forgets its target.
*
* @return The entity * @return The entity
*/ */
public Entity getTarget() { public Entity getTarget() {

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when an entity has made a decision to explode. * Called when an entity has made a decision to explode.
*/ */
@SuppressWarnings("serial")
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;
private float radius; private float radius;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when a human entity's food level changes * Called when a human entity's food level changes
*/ */
@SuppressWarnings("serial")
public class FoodLevelChangeEvent extends EntityEvent implements Cancellable { public class FoodLevelChangeEvent extends EntityEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;
private int level; private int level;

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when an item is spawned into a world * Called when an item is spawned into a world
*/ */
@SuppressWarnings("serial")
public class ItemSpawnEvent extends EntityEvent implements Cancellable { public class ItemSpawnEvent extends EntityEvent implements Cancellable {
private Location location; private Location location;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Stores data for pigs being zapped * Stores data for pigs being zapped
*/ */
@SuppressWarnings("serial")
public class PigZapEvent extends EntityEvent implements Cancellable { public class PigZapEvent extends EntityEvent implements Cancellable {
private boolean canceled; private boolean canceled;

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
/** /**
* Thrown whenever a {@link Player} dies * Thrown whenever a {@link Player} dies
*/ */
@SuppressWarnings("serial")
public class PlayerDeathEvent extends EntityDeathEvent { public class PlayerDeathEvent extends EntityDeathEvent {
private int newExp = 0; private int newExp = 0;
private String deathMessage = ""; private String deathMessage = "";

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Projectile;
/** /**
* Called when a projectile hits an object * Called when a projectile hits an object
*/ */
@SuppressWarnings("serial")
public class ProjectileHitEvent extends EntityEvent { public class ProjectileHitEvent extends EntityEvent {
public ProjectileHitEvent(Projectile projectile) { public ProjectileHitEvent(Projectile projectile) {

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Called when a Slime splits into smaller Slimes upon death * Called when a Slime splits into smaller Slimes upon death
*/ */
@SuppressWarnings("serial")
public class SlimeSplitEvent extends EntityEvent implements Cancellable { public class SlimeSplitEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;
private int count; private int count;

View File

@ -4,9 +4,11 @@ import org.bukkit.block.Block;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
/** /**
* Called when an ItemStack is successfully burned as fuel in a furnace. * Called when an ItemStack is successfully burned as fuel in a furnace.
*/ */
@SuppressWarnings("serial")
public class FurnaceBurnEvent extends Event implements Cancellable { public class FurnaceBurnEvent extends Event implements Cancellable {
private Block furnace; private Block furnace;
private ItemStack fuel; private ItemStack fuel;

View File

@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
/** /**
* Called when an ItemStack is successfully smelted in a furnace. * Called when an ItemStack is successfully smelted in a furnace.
*/ */
@SuppressWarnings("serial")
public class FurnaceSmeltEvent extends Event implements Cancellable { public class FurnaceSmeltEvent extends Event implements Cancellable {
private Block furnace; private Block furnace;
private ItemStack source; private ItemStack source;

View File

@ -1,6 +1,7 @@
package org.bukkit.event.inventory; package org.bukkit.event.inventory;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
/** /**
* Handles all events thrown in relation to Blocks * Handles all events thrown in relation to Blocks
*/ */

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Painting;
/** /**
* Triggered when a painting is removed by an entity * Triggered when a painting is removed by an entity
*/ */
@SuppressWarnings("serial")
public class PaintingBreakByEntityEvent extends PaintingBreakEvent { public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
private Entity remover; private Entity remover;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Triggered when a painting is removed * Triggered when a painting is removed
*/ */
@SuppressWarnings("serial")
public class PaintingBreakEvent extends PaintingEvent implements Cancellable { public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/** /**
* Represents a painting-related event. * Represents a painting-related event.
*/ */
@SuppressWarnings("serial")
public class PaintingEvent extends Event { public class PaintingEvent extends Event {
protected Painting painting; protected Painting painting;

View File

@ -10,6 +10,7 @@ import org.bukkit.event.Event;
/** /**
* Triggered when a painting is created in the world * Triggered when a painting is created in the world
*/ */
@SuppressWarnings("serial")
public class PaintingPlaceEvent extends PaintingEvent implements Cancellable { public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Represents a player animation event * Represents a player animation event
*/ */
@SuppressWarnings("serial")
public class PlayerAnimationEvent extends PlayerEvent implements Cancellable { public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
private PlayerAnimationType animationType; private PlayerAnimationType animationType;

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* This event is fired when the player is almost about to enter the bed. * This event is fired when the player is almost about to enter the bed.
*/ */
@SuppressWarnings("serial")
public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable { public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
/** /**
* This event is fired when the player is leaving a bed. * This event is fired when the player is leaving a bed.
*/ */
@SuppressWarnings("serial")
public class PlayerBedLeaveEvent extends PlayerEvent { public class PlayerBedLeaveEvent extends PlayerEvent {
private Block bed; private Block bed;

View File

@ -9,6 +9,7 @@ import org.bukkit.inventory.ItemStack;
/** /**
* Called when a player empties a bucket * Called when a player empties a bucket
*/ */
@SuppressWarnings("serial")
public class PlayerBucketEmptyEvent extends PlayerBucketEvent { public class PlayerBucketEmptyEvent extends PlayerBucketEvent {
public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) { public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
super(Type.PLAYER_BUCKET_EMPTY, who, blockClicked, blockFace, bucket, itemInHand); super(Type.PLAYER_BUCKET_EMPTY, who, blockClicked, blockFace, bucket, itemInHand);

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@SuppressWarnings("serial")
public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable { public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable {
private ItemStack itemStack; private ItemStack itemStack;
@ -50,7 +51,6 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab
this.itemStack = itemStack; this.itemStack = itemStack;
} }
/** /**
* Return the block clicked * Return the block clicked
* *

View File

@ -9,6 +9,7 @@ import org.bukkit.inventory.ItemStack;
/** /**
* Called when a player fills a bucket * Called when a player fills a bucket
*/ */
@SuppressWarnings("serial")
public class PlayerBucketFillEvent extends PlayerBucketEvent { public class PlayerBucketFillEvent extends PlayerBucketEvent {
public PlayerBucketFillEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) { public PlayerBucketFillEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
super(Type.PLAYER_BUCKET_FILL, who, blockClicked, blockFace, bucket, itemInHand); super(Type.PLAYER_BUCKET_FILL, who, blockClicked, blockFace, bucket, itemInHand);

View File

@ -3,6 +3,7 @@ package org.bukkit.event.player;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@SuppressWarnings("serial")
public class PlayerChangedWorldEvent extends PlayerEvent { public class PlayerChangedWorldEvent extends PlayerEvent {
private final World from; private final World from;

View File

@ -10,6 +10,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Holds information for player chat and commands * Holds information for player chat and commands
*/ */
@SuppressWarnings("serial")
public class PlayerChatEvent extends PlayerEvent implements Cancellable { public class PlayerChatEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;
private String message; private String message;

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
* Called early in the command handling process. This event is only * Called early in the command handling process. This event is only
* for very exceptional cases and you should not normally use it. * for very exceptional cases and you should not normally use it.
*/ */
@SuppressWarnings("serial")
public class PlayerCommandPreprocessEvent extends PlayerChatEvent { public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
public PlayerCommandPreprocessEvent(final Player player, final String message) { public PlayerCommandPreprocessEvent(final Player player, final String message) {
super(Type.PLAYER_COMMAND_PREPROCESS, player, message); super(Type.PLAYER_COMMAND_PREPROCESS, player, message);

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Thrown when a player drops an item from their inventory * Thrown when a player drops an item from their inventory
*/ */
@SuppressWarnings("serial")
public class PlayerDropItemEvent extends PlayerEvent implements Cancellable { public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
private final Item drop; private final Item drop;
private boolean cancel = false; private boolean cancel = false;

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
/** /**
* Called when a player throws an egg and it might hatch * Called when a player throws an egg and it might hatch
*/ */
@SuppressWarnings("serial")
public class PlayerEggThrowEvent extends PlayerEvent { public class PlayerEggThrowEvent extends PlayerEvent {
private Egg egg; private Egg egg;
private boolean hatching; private boolean hatching;

View File

@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/** /**
* Represents a player related event * Represents a player related event
*/ */
@SuppressWarnings("serial")
public class PlayerEvent extends Event { public class PlayerEvent extends Event {
protected Player player; protected Player player;

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Entity;
/** /**
* Thrown when a player is fishing * Thrown when a player is fishing
*/ */
@SuppressWarnings("serial")
public class PlayerFishEvent extends PlayerEvent implements Cancellable { public class PlayerFishEvent extends PlayerEvent implements Cancellable {
private final Entity entity; private final Entity entity;
private boolean cancel = false; private boolean cancel = false;

View File

@ -4,6 +4,7 @@ import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
@SuppressWarnings("serial")
public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellable { public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;

View File

@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/** /**
* Represents an event that is called when a player right clicks an entity. * Represents an event that is called when a player right clicks an entity.
*/ */
@SuppressWarnings("serial")
public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellable { public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellable {
protected Entity clickedEntity; protected Entity clickedEntity;
boolean cancelled = false; boolean cancelled = false;

View File

@ -11,6 +11,7 @@ import org.bukkit.event.block.Action;
/** /**
* Called when a player interacts with an object or air. * Called when a player interacts with an object or air.
*/ */
@SuppressWarnings("serial")
public class PlayerInteractEvent extends PlayerEvent implements Cancellable { public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
protected ItemStack item; protected ItemStack item;
protected Action action; protected Action action;
@ -141,6 +142,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
/** /**
* This controls the action to take with the block (if any) that was clicked on * This controls the action to take with the block (if any) that was clicked on
* This event gets processed for all blocks, but most don't have a default action * This event gets processed for all blocks, but most don't have a default action
*
* @return the action to take with the interacted block * @return the action to take with the interacted block
*/ */
public Result useInteractedBlock() { public Result useInteractedBlock() {
@ -158,6 +160,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
* This controls the action to take with the item the player is holding * This controls the action to take with the item the player is holding
* This includes both blocks and items (such as flint and steel or records) * This includes both blocks and items (such as flint and steel or records)
* When this is set to default, it will be allowed if no action is taken on the interacted block * When this is set to default, it will be allowed if no action is taken on the interacted block
*
* @return the action to take with the item in hand * @return the action to take with the item in hand
*/ */
public Result useItemInHand() { public Result useItemInHand() {

View File

@ -6,6 +6,7 @@ import org.bukkit.inventory.Inventory;
/** /**
* Represents a player related inventory event * Represents a player related inventory event
*/ */
@SuppressWarnings("serial")
public class PlayerInventoryEvent extends PlayerEvent { public class PlayerInventoryEvent extends PlayerEvent {
protected Inventory inventory; protected Inventory inventory;

View File

@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
/** /**
* Fired when a player changes their currently held item * Fired when a player changes their currently held item
*/ */
@SuppressWarnings("serial")
public class PlayerItemHeldEvent extends PlayerEvent { public class PlayerItemHeldEvent extends PlayerEvent {
private int previous; private int previous;
private int current; private int current;

Some files were not shown because too many files have changed in this diff Show More